]> 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:48:23 +0000 (14:48 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Fri, 17 Jul 2026 18:42:47 +0000 (20:42 +0200)
27 corresponds to the minimum MD5 hash length.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/chkhash.c

index 454a2a69cf0fef296c26f7d54eac39baa4d0f599..de17d2db165888243bcdc62a698e4e7912e0bbb4 100644 (file)
@@ -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