]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/chkhash.c: fix yescrypt hash length comment
authorIker Pedrosa <ipedrosa@redhat.com>
Fri, 6 Feb 2026 15:31:56 +0000 (16:31 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Tue, 17 Feb 2026 23:30:57 +0000 (00:30 +0100)
Fix misleading comment that stated "43-char (minimum) hash" when
the actual regex pattern requires exactly 43 characters. Update
comment to accurately reflect the implementation behavior.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
lib/chkhash.c

index 9123038adef069a87753b9cd764867896c61ee57..6ecdbac79ee360f4217e09598cdfd08508a8fd74 100644 (file)
@@ -53,7 +53,7 @@ is_valid_hash(const char *hash)
        if (strlen(hash) < 13)
                return false;
 
-       // Yescrypt: $y$ + algorithm parameters + $ + salt + $ + 43-char (minimum) hash
+       // Yescrypt: $y$ + algorithm parameters + $ + salt + $ + 43-char hash
        if (match_regex("^\\$y\\$[./A-Za-z0-9]+\\$[./A-Za-z0-9]{1,86}\\$[./A-Za-z0-9]{43}$", hash))
                return true;