We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fe6c443 + b95a4b7 commit ab73d5eCopy full SHA for ab73d5e
lib/std/crypto/bcrypt.zig
@@ -742,7 +742,10 @@ const CryptFormatHasher = struct {
742
.rounds_log = rounds_log,
743
.silently_truncate_password = silently_truncate_password,
744
});
745
- if (!mem.eql(u8, wanted_s[0..], str[0..])) return HasherError.PasswordVerificationFailed;
+
746
+ // From [3..] to skip comparing version prefix. The input can have any version,
747
+ // and `strHashInternal` always prefixes with the current version $2b.
748
+ if (!mem.eql(u8, wanted_s[3..], str[3..])) return HasherError.PasswordVerificationFailed;
749
}
750
};
751
0 commit comments