more cleanup

This commit is contained in:
Wade Simmons
2026-06-09 10:55:57 -04:00
parent d725e53072
commit f437c7d372
2 changed files with 20 additions and 8 deletions
+9 -6
View File
@@ -33,10 +33,13 @@ func TestNewAESGCM(t *testing.T) {
assert.Equal(t, expected, dst)
// We expect this to fail since we are re-encrypting with a repeat IV
// TODO: the error message has changed between fips module versions, best way to verify it?
// assert.PanicsWithValue(t, "crypto/cipher: counter decreased", func() {
// assert.PanicsWithValue(t, "crypto/cipher: counter decreased or remained the same", func() {
assert.Panics(t, func() {
dst = aead.Seal([]byte{}, iv, plaintext, aad)
})
if fips140.Version() == "v1.0.0" {
assert.PanicsWithValue(t, "crypto/cipher: counter decreased", func() {
dst = aead.Seal([]byte{}, iv, plaintext, aad)
})
} else {
assert.PanicsWithValue(t, "crypto/cipher: counter decreased or remained the same", func() {
dst = aead.Seal([]byte{}, iv, plaintext, aad)
})
}
}