]> jfr.im git - irc/atheme/atheme.git/commitdiff
modules/crypto/pbkdf2v2: reuse previous idiom for length of salt array
authorAaron Jones <redacted>
Sat, 7 Oct 2017 22:55:21 +0000 (22:55 +0000)
committerAaron Jones <redacted>
Sat, 7 Oct 2017 22:56:47 +0000 (22:56 +0000)
This is equivalent but more robust.

modules/crypto/pbkdf2v2.c

index cf2e4b317c3145cee1b7b1c4877e04efdcf2febc..9158ed230c075c01d3dbf5d84b4fb18be207fe2f 100644 (file)
@@ -59,7 +59,7 @@ pbkdf2v2_salt(void)
                salt[i] = salt_chars[rawsalt[i] % sizeof salt_chars];
 
        /* NULL-terminate the string */
-       salt[PBKDF2_SALTLEN] = 0x00;
+       salt[sizeof rawsalt] = 0x00;
 
        /* Format and return the result */
        static char res[PASSLEN];