]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: handle CRLDistributionPoints without FullNames
authorRuss Cox <rsc@golang.org>
Tue, 8 Dec 2015 15:04:10 +0000 (10:04 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2015 07:17:28 +0000 (07:17 +0000)
Fixes #12910.

Change-Id: If446e5dce236483bbb898cc5959baf8371f05142
Reviewed-on: https://go-review.googlesource.com/17550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/x509/x509.go

index 948565ce3ef8dad5dd12767e9800a5b3fcc44dbd..d9288bb30e880f92e0385c155d0796ab22b7b6f1 100644 (file)
@@ -1048,7 +1048,7 @@ func parseCertificate(in *certificate) (*Certificate, error) {
                                }
 
                        case 31:
-                               // RFC 5280, 4.2.1.14
+                               // RFC 5280, 4.2.1.13
 
                                // CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
                                //
@@ -1069,6 +1069,11 @@ func parseCertificate(in *certificate) (*Certificate, error) {
                                }
 
                                for _, dp := range cdp {
+                                       // Per RFC 5280, 4.2.1.13, one of distributionPoint or cRLIssuer may be empty.
+                                       if len(dp.DistributionPoint.FullName.Bytes) == 0 {
+                                               continue
+                                       }
+
                                        var n asn1.RawValue
                                        if _, err := asn1.Unmarshal(dp.DistributionPoint.FullName.Bytes, &n); err != nil {
                                                return nil, err