-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix argon2 parsing and comparison (#1887)
Argon2 parsing and comparison is broken in multiple ways: 1. Incorrect comparison being done using `ConstantTimeCompare`. This Go API is awful as it returns 1 on _equality_ (unlike all other comparison APIs that return 0) so it was missed. 2. All Argon2 comparisons were producing incorrect derived keys due to the multiplication by 1024. The `argon2.Key` and `IDKey` accept *KiB* as arguments (not bytes!) which caused all hashes to always be incorrect. Tests didn't catch this as they only tested for the positive case (which passed with flying colors).
- Loading branch information
Showing
2 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters