From 008b209765cc22e9384fac6d12c363025bc02183 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Fri, 13 Dec 2024 18:16:08 +0800 Subject: [PATCH] cfca: pkcs7 test, avoid random failure --- cfca/pkcs7_sign_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cfca/pkcs7_sign_test.go b/cfca/pkcs7_sign_test.go index 4460d81..9d1fefb 100644 --- a/cfca/pkcs7_sign_test.go +++ b/cfca/pkcs7_sign_test.go @@ -61,13 +61,12 @@ func TestSignMessageDetach(t *testing.T) { if err != nil { t.Fatal(err) } - lastByte := p7[len(p7)-1] - p7[len(p7)-1] = 0 + p7[0] = 0x20 err = VerifyMessageDetach(p7, []byte("test")) if err == nil { t.Fatalf("VerifyMessageAttach() error = %v, wantErr %v", err, true) } - p7[len(p7)-1] = lastByte + p7[0] = 0x30 err = VerifyMessageDetach(p7, []byte("test")) if err != nil { t.Fatal(err)