From 38cab73d189caf5321de99ed992f843f800bb624 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Tue, 31 Dec 2019 01:56:56 +0100 Subject: [PATCH] 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. --- mkpasswd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkpasswd.c b/mkpasswd.c index 0a03be1..6b98a1f 100644 --- a/mkpasswd.c +++ b/mkpasswd.c @@ -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 */