aboutsummaryrefslogtreecommitdiff
path: root/certificate_test.go
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2022-08-15 22:36:04 +0200
committerGibheer <gibheer+git@zero-knowledge.org>2022-08-15 22:36:04 +0200
commit8726fcfa3a3e1a7d00c37b0a691bd1f7e53b490b (patch)
treefde476e9ecf2eb90176d733fb2af743e1e835754 /certificate_test.go
parent9fcfb1009c2088e0506e8fc5239a5a5d15379378 (diff)
make the test succeed
Diffstat (limited to 'certificate_test.go')
-rw-r--r--certificate_test.go4
1 files changed, 4 insertions, 0 deletions
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
}