Skip to content

Commit 5ea25a5

Browse files
committed
fix: add CTLPoisonByte to precertificates
References #85
1 parent 6aa339e commit 5ea25a5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

internal/certificatetransparency/ct-parser.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ func parseData(entry *ct.RawLogEntry, operatorName, logName, ctURL string) (mode
7272
data.LeafCert.Fingerprint = calculatedHash
7373
data.LeafCert.SHA1 = calculatedHash
7474
data.LeafCert.SHA256 = calculateSHA256(rawData)
75+
76+
// Since we use the TBSCertificate to parse the LeafCert, the PoisonByte indicator cannot be set by our parser.
77+
// According to RFC 6962 Section 3.2 the `"tbs_certificate" is the DER-encoded TBSCertificate (see [RFC5280])
78+
// component of the Precertificate -- that is, without the signature and the poison extension.`
79+
// Since the PoisonByte Extension `is to ensure that the Precertificate cannot be validated by a standard
80+
// X.509v3 client`, we can safely set it for each precertificate.
81+
data.LeafCert.Extensions.CTLPoisonByte = true
7582
}
7683

7784
certAsDER := base64.StdEncoding.EncodeToString(entry.Cert.Data)

0 commit comments

Comments
 (0)