Skip to content

Commit be7544b

Browse files
committed
crypto/x509: handle CRLDistributionPoints without FullNames
Fixes #12910. Change-Id: If446e5dce236483bbb898cc5959baf8371f05142 Reviewed-on: https://go-review.googlesource.com/17550 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Adam Langley <[email protected]>
1 parent 70cee78 commit be7544b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/crypto/x509/x509.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ func parseCertificate(in *certificate) (*Certificate, error) {
10481048
}
10491049

10501050
case 31:
1051-
// RFC 5280, 4.2.1.14
1051+
// RFC 5280, 4.2.1.13
10521052

10531053
// CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
10541054
//
@@ -1069,6 +1069,11 @@ func parseCertificate(in *certificate) (*Certificate, error) {
10691069
}
10701070

10711071
for _, dp := range cdp {
1072+
// Per RFC 5280, 4.2.1.13, one of distributionPoint or cRLIssuer may be empty.
1073+
if len(dp.DistributionPoint.FullName.Bytes) == 0 {
1074+
continue
1075+
}
1076+
10721077
var n asn1.RawValue
10731078
if _, err := asn1.Unmarshal(dp.DistributionPoint.FullName.Bytes, &n); err != nil {
10741079
return nil, err

0 commit comments

Comments
 (0)