aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/x509/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/x509/parser.go')
-rw-r--r--src/crypto/x509/parser.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/crypto/x509/parser.go b/src/crypto/x509/parser.go
index 3d51ddd7f5..f085162a4e 100644
--- a/src/crypto/x509/parser.go
+++ b/src/crypto/x509/parser.go
@@ -734,10 +734,12 @@ func processExtensions(out *Certificate) error {
if !val.ReadASN1(&akid, cryptobyte_asn1.SEQUENCE) {
return errors.New("x509: invalid authority key identifier")
}
- if !akid.ReadASN1(&akid, cryptobyte_asn1.Tag(0).ContextSpecific()) {
- return errors.New("x509: invalid authority key identifier")
+ if akid.PeekASN1Tag(cryptobyte_asn1.Tag(0).ContextSpecific()) {
+ if !akid.ReadASN1(&akid, cryptobyte_asn1.Tag(0).ContextSpecific()) {
+ return errors.New("x509: invalid authority key identifier")
+ }
+ out.AuthorityKeyId = akid
}
- out.AuthorityKeyId = akid
case 37:
out.ExtKeyUsage, out.UnknownExtKeyUsage, err = parseExtKeyUsageExtension(e.Value)
if err != nil {