proxmox/proxmox-sys
Stefan Sterz f82bb2fc2b sys: crypt: move to yescrypt for password hashing
previously we used `sha256scrypt` for password hashing. while this may
by safe if used with the correct parameters, we used the default
parameters which are considered unsafe. according to `man crypt(5)`:

> The default CPU time cost parameter is 5000, which is too low for
> modern hardware.

hence, we needed to adapt this code anyway. conveniently, verification
with crypt also works for older hashes as the parameters for the
hashing function are encoded in the output of crypt. so this is a drop
in replacement that will simply use yescrypt for new hashes while
old hashes will still verify properly.

this commit also adds a wrapper for `crypt_gensalt_rn` to more easily
generate correctly formatted salt strings. this is also useful for
switching the cpu time hardness parameter, as otherwise we'd need to
encode that ourselves.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2024-05-22 10:26:41 +02:00
..
debian sys: bump version to 0.5.4-2 2024-04-26 17:24:23 +02:00
src sys: crypt: move to yescrypt for password hashing 2024-05-22 10:26:41 +02:00
tests sys: rust fmt 2022-04-10 17:39:31 +02:00
Cargo.toml sys: bump version to 0.5.4-1 2024-04-26 16:52:46 +02:00