From 033115dd5eb93295330eb151ff8557df5bffbec8 Mon Sep 17 00:00:00 2001 From: Alexander Scheel Date: Wed, 2 Nov 2022 12:14:41 -0400 Subject: [PATCH] Add comment on utility of tbsCertificateList.Raw Signed-off-by: Alexander Scheel --- src/crypto/x509/x509.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index fb4ba0591b..df86c65939 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -2162,7 +2162,7 @@ type certificateList struct { } type tbsCertificateList struct { - Raw asn1.RawContent + Raw asn1.RawContent Version int `asn1:"optional,default:0"` Signature pkix.AlgorithmIdentifier Issuer asn1.RawValue @@ -2264,6 +2264,9 @@ func CreateRevocationList(rand io.Reader, template *RevocationList, issuer *Cert if err != nil { return nil, err } + + // Optimization to only marshal this struct once, when signing and + // then embedding in certificateList below. tbsCertList.Raw = tbsCertListContents input := tbsCertListContents