From: Alejandro Colomar Date: Sat, 27 Dec 2025 13:43:14 +0000 (+0100) Subject: lib/chkhash.c: is_valid_hash(): Update minimum hash length X-Git-Tag: 4.20.0-rc3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9215c642bb9e4490a76f7c357a4aa912a7bdae20;p=thirdparty%2Fshadow.git lib/chkhash.c: is_valid_hash(): Update minimum hash length 48 corresponds to the minimum SHA256 hash length. Signed-off-by: Alejandro Colomar --- diff --git a/lib/chkhash.c b/lib/chkhash.c index 28d73854d..3a0f246d2 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) < 27) + if (strlen(hash) < 48) return false; // Yescrypt: $y$ + algorithm parameters + $ + salt + $ + 43-char hash