From: Alejandro Colomar Date: Sat, 27 Dec 2025 13:48:23 +0000 (+0100) Subject: lib/chkhash.c: is_valid_hash(): Update minimum hash length X-Git-Tag: 4.20.0-rc3~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e334169aea3fb1d7e9ab49221334f4cd4bea9dc8;p=thirdparty%2Fshadow.git lib/chkhash.c: is_valid_hash(): Update minimum hash length 27 corresponds to the minimum MD5 hash length. Reviewed-by: Serge Hallyn Signed-off-by: Alejandro Colomar --- diff --git a/lib/chkhash.c b/lib/chkhash.c index 454a2a69c..de17d2db1 100644 --- a/lib/chkhash.c +++ b/lib/chkhash.c @@ -50,7 +50,7 @@ is_valid_hash(const char *hash) return true; // Minimum hash length - if (strlen(hash) < 13) + if (strlen(hash) < 27) return false; // Yescrypt: $y$ + algorithm parameters + $ + salt + $ + 43-char hash