]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: remove unused member Raw from certificate
authorAlexander Scheel <alex.scheel@hashicorp.com>
Wed, 2 Nov 2022 11:44:41 +0000 (11:44 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 14 Nov 2022 21:26:39 +0000 (21:26 +0000)
As noticed in the review of the CRL RawIssuer updates (https://go-review.googlesource.com/c/go/+/418834), the Raw field on the internal type certificate of crypto/x509 is unused and could be removed.

From looking at encoding/asn1's implementation, it appears this field would be set on unmarshal but not during marshaling. However, we unmarshal into the x509.Certificate class directly, avoiding this internal class entirely.

Change-Id: I1ab592eb939b6fe701206ba77b6727763deaeaf0
GitHub-Last-Rev: 5272e0d369ae1b9fee350c2731a6084f41011724
GitHub-Pull-Request: golang/go#56524
Reviewed-on: https://go-review.googlesource.com/c/go/+/447215
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>

src/crypto/x509/x509.go

index 9fbb97c5d664ed7ada323e793f4af9ccb43a73b4..b8c4b720cc2fe18362cff4e654616da1db4758fe 100644 (file)
@@ -156,7 +156,6 @@ func MarshalPKIXPublicKey(pub any) ([]byte, error) {
 // These structures reflect the ASN.1 structure of X.509 certificates.:
 
 type certificate struct {
-       Raw                asn1.RawContent
        TBSCertificate     tbsCertificate
        SignatureAlgorithm pkix.AlgorithmIdentifier
        SignatureValue     asn1.BitString
@@ -1603,7 +1602,6 @@ func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv
        }
 
        signedCert, err := asn1.Marshal(certificate{
-               nil,
                c,
                signatureAlgorithm,
                asn1.BitString{Bytes: signature, BitLength: len(signature) * 8},