Skip to content

Commit 4e8a929

Browse files
committed
refactor: GenerateCertificate create self signed CA certs with themselves as parent
1 parent 7d7c831 commit 4e8a929

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/certinfo/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ func GenerateCertificate(tpl certificateTemplate) ([]byte, *x509.Certificate, er
261261
// use the CA cert key for signing
262262
// and do not reference any previous parent Certificate
263263
if tpl.isCA {
264-
certParent = &template
265264
signingKey = tpl.key
266265
template = x509.Certificate{
267266
SerialNumber: serialNumber,
@@ -278,6 +277,7 @@ func GenerateCertificate(tpl certificateTemplate) ([]byte, *x509.Certificate, er
278277
KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
279278
BasicConstraintsValid: true,
280279
}
280+
certParent = &template
281281
}
282282

283283
derBytes, err := x509.CreateCertificate(rand.Reader,

0 commit comments

Comments
 (0)