hash-pin #235

Merged
lash merged 15 commits from hash-pin into master 2025-01-03 09:25:26 +01:00
Showing only changes of commit 91dc9ce82f - Show all commits

View File

@ -99,6 +99,27 @@ func TestHashPIN(t *testing.T) {
}
}
func TestVerifyMigratedHashPin(t *testing.T) {
kamikazechaser marked this conversation as resolved Outdated
Outdated
Review

We are going to need a test using data from the legacy system aswell. Please @kamikazechaser can you provide an existing plain/cipher pair?

We are going to need a test using data from the legacy system aswell. Please @kamikazechaser can you provide an existing plain/cipher pair?
tests := []struct {
pin string
hash string
}{
{
pin: "1234",
hash: "$2b$08$dTvIGxCCysJtdvrSnaLStuylPoOS/ZLYYkxvTeR5QmTFY3TSvPQC6",
},
}
for _, tt := range tests {
t.Run(tt.pin, func(t *testing.T) {
ok := VerifyPIN(tt.hash, tt.pin)
if !ok {
t.Errorf("VerifyPIN could not verify migrated PIN: %v", tt.pin, ok)
}
})
}
}
func TestVerifyPIN(t *testing.T) {
tests := []struct {
name string