cfca: pkcs7 test, avoid random failure

This commit is contained in:
Sun Yimin 2024-12-13 18:14:06 +08:00 committed by GitHub
parent 8e02380f47
commit ab670f8ced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,13 +26,12 @@ func TestSignMessageAttach(t *testing.T) {
if err != nil {
t.Fatal(err)
}
lastByte := p7[len(p7)-1]
p7[len(p7)-1] = 0
p7[0] = 0x20
err = VerifyMessageAttach(p7)
if err == nil {
t.Fatalf("VerifyMessageAttach() error = %v, wantErr %v", err, true)
}
p7[len(p7)-1] = lastByte
p7[0] = 0x30
err = VerifyMessageAttach(p7)
if err != nil {
t.Fatal(err)