From 8726fcfa3a3e1a7d00c37b0a691bd1f7e53b490b Mon Sep 17 00:00:00 2001 From: Gibheer Date: Mon, 15 Aug 2022 22:36:04 +0200 Subject: make the test succeed --- certificate_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'certificate_test.go') diff --git a/certificate_test.go b/certificate_test.go index 8616641..9951d7a 100644 --- a/certificate_test.go +++ b/certificate_test.go @@ -29,6 +29,7 @@ func TestCertificateCreation(t *testing.T) { cert_opts := CertificateOptions{ // KeyUsage: x509.KeyUsageEncipherOnly | x509.KeyUsageKeyEncipherment | x509.KeyUsageCertSign, SerialNumber: big.NewInt(1), + CALength: -1, } cert, err := csr.ToCertificate(pk, cert_opts, nil) @@ -42,6 +43,9 @@ func TestCertificateCreation(t *testing.T) { } func fieldsAreSame(data CertificateData, cert *Certificate) bool { + if cert == nil { + return false + } if data.Subject.CommonName != cert.Subject.CommonName { return false } -- cgit v1.2.3-70-g09d2