Skip to content

Commit acec356

Browse files
Ignat Korchaginignatk
authored andcommitted
ci: test that decrypted seed is not an all-zero slice
1 parent 46c5153 commit acec356

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

csprng_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ func TestEncryptedSeed(t *testing.T) {
140140
t.Fatal("no auth tag in unwrapped seed")
141141
}
142142

143+
if bytes.Equal(uSeed[12:len(uSeed)-16], make([]byte, len(uSeed[12:len(uSeed)-16]))) {
144+
t.Fatal("decrypted seed is all zeroes")
145+
}
146+
143147
// rest should have been encrypted
144148
if bytes.Equal(uSeed[12:len(uSeed)-16], seed[12:len(seed)-16]) {
145149
t.Fatal("seed was not properly encrypted")

0 commit comments

Comments
 (0)