mkpasswd: support setting the rounds number for *scrypt

It is not practical to support for these functions passing straight to
crypt(3) an user-provided salt string because the salt field in the
hashed password also contains the rounds number encoded as base64.
See yescrypt_encode_params_r in the libxcrypt source for details.
This commit is contained in:
Marco d'Itri 2019-12-31 01:56:56 +01:00
parent 467f8e9935
commit 38cab73d18

View File

@ -97,11 +97,11 @@ static const struct crypt_method methods[] = {
{ "des", "", 2, 2, 0, NULL },
{ "md5", "$1$", 8, 8, 0, NULL },
#if defined XCRYPT_VERSION_NUM
{ "yescrypt", "$y$", 0, 0, 0, "Yescrypt" },
{ "yescrypt", "$y$", 0, 0, 1, "Yescrypt" },
#if XCRYPT_VERSION_NUM >= ((4 << 16) | 4)
{ "gost-yescrypt", "$gy$", 0, 0, 0, "GOST Yescrypt" },
{ "gost-yescrypt", "$gy$", 0, 0, 1, "GOST Yescrypt" },
#endif
{ "scrypt", "$7$", 0, 0, 0, "scrypt" },
{ "scrypt", "$7$", 0, 0, 1, "scrypt" },
#endif
#ifdef HAVE_BCRYPT_OBSOLETE
/* http://marc.info/?l=openbsd-misc&m=139320023202696 */