From d35a314b7a087f86b6fee72fc7e13cb08919f182 Mon Sep 17 00:00:00 2001 From: Emman Date: Mon, 11 Apr 2022 13:35:04 +0800 Subject: [PATCH] crypto/x509: properly handle issuerUniqueID and subjectUniqueID --- smx509/parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smx509/parser.go b/smx509/parser.go index 0894c3f..73e5c36 100644 --- a/smx509/parser.go +++ b/smx509/parser.go @@ -939,10 +939,10 @@ func parseCertificate(der []byte) (*Certificate, error) { } if cert.Version > 1 { - if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(1).Constructed().ContextSpecific()) { + if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(1).ContextSpecific()) { return nil, errors.New("x509: malformed issuerUniqueID") } - if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(2).Constructed().ContextSpecific()) { + if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(2).ContextSpecific()) { return nil, errors.New("x509: malformed subjectUniqueID") } if cert.Version == 3 {