Skip to content

Commit

Permalink
Merge pull request #2112 from slingamn/testvector
Browse files Browse the repository at this point in the history
include a fixed test vector in password tests
  • Loading branch information
slingamn authored Dec 21, 2023
2 parents b1a0e7c + 8d80cb5 commit cc1c491
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions irc/passwd/bcrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ func TestBasic(t *testing.T) {
}
}

func TestVector(t *testing.T) {
// sanity check for persisted hashes
if CompareHashAndPassword(
[]byte("$2a$12$sJokyLJ5px3Nb51DEDhsQ.wh8nfwEYuMbVYrpqO5v9Ylyj0YyVWj."),
[]byte("this is my passphrase"),
) != nil {
t.Errorf("hash comparison failed unexpectedly")
}
}

func TestLongPassphrases(t *testing.T) {
longPassphrase := make([]byte, 168)
for i := range longPassphrase {
Expand Down

0 comments on commit cc1c491

Please sign in to comment.