]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/chkhash.c: is_valid_hash(): Update minimum hash length
authorAlejandro Colomar <alx@kernel.org>
Sat, 27 Dec 2025 13:43:14 +0000 (14:43 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 19 Jul 2026 14:35:56 +0000 (09:35 -0500)
48 corresponds to the minimum SHA256 hash length.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/chkhash.c

index 28d73854dbf00969d40306f66c5d0c62b984eda9..3a0f246d225c7d083960d59e9ca60f83208df835 100644 (file)
@@ -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