1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Corrected wrong error requirement

This commit is contained in:
JanHoefelmeyer 2023-09-08 13:26:38 +02:00
parent 2e129b9dc8
commit daab24eb2f

View file

@ -17,8 +17,8 @@ func TestLoadCertificates(t *testing.T) {
if certificate, err := LoadCertificate(&TestCert, &missingTestkey, nil); certificate != nil || err == nil { if certificate, err := LoadCertificate(&TestCert, &missingTestkey, nil); certificate != nil || err == nil {
t.Errorf("Failure: No Failure while loading certificate using missing key.") t.Errorf("Failure: No Failure while loading certificate using missing key.")
} }
if certificate, err := LoadCertificate(&TestCert, &Testkey, &Passphrase); certificate == nil || err != nil { if certificate, err := LoadCertificate(&TestCert, &Testkey, &Passphrase); certificate != nil || err == nil {
t.Errorf("Failure: Couldn't load supposedly valid certificate with passphrase.") t.Errorf("Failure: Could load unprotected valid certificate with passphrase.")
} }
if certificate, err := LoadCertificate(&TestCert, &missingTestkey, &Passphrase); certificate != nil || err == nil { if certificate, err := LoadCertificate(&TestCert, &missingTestkey, &Passphrase); certificate != nil || err == nil {
t.Errorf("Failure: No Failure while loading certificate using missing key with passphrase.") t.Errorf("Failure: No Failure while loading certificate using missing key with passphrase.")