mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 00:17:34 +02:00
cryptutil: use bytes for hmac (#2067)
This commit is contained in:
parent
a935c1ba30
commit
a51c7140ea
12 changed files with 28 additions and 28 deletions
|
@ -34,11 +34,11 @@ func TestHMAC(t *testing.T) {
|
|||
keyBytes := &[32]byte{}
|
||||
copy(keyBytes[:], keySlice)
|
||||
|
||||
macDigest := GenerateHMAC(dataBytes, string(keyBytes[:]))
|
||||
macDigest := GenerateHMAC(dataBytes, keyBytes[:])
|
||||
if !bytes.Equal(macDigest, expectedDigest) {
|
||||
t.Errorf("test %d generated unexpected mac", idx)
|
||||
}
|
||||
if !CheckHMAC(dataBytes, macDigest, string(keyBytes[:])) {
|
||||
if !CheckHMAC(dataBytes, macDigest, keyBytes[:]) {
|
||||
t.Errorf("test %d generated unexpected mac", idx)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue