smx509: remove unnecessary !Empty() check

This commit is contained in:
Sun Yimin 2023-03-31 08:56:24 +08:00 committed by GitHub
parent e8c96eff71
commit 7484123c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,7 +362,7 @@ func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) {
}
}
maxPathLen := -1
if !der.Empty() && der.PeekASN1Tag(cryptobyte_asn1.INTEGER) {
if der.PeekASN1Tag(cryptobyte_asn1.INTEGER) {
if !der.ReadASN1Integer(&maxPathLen) {
return false, 0, errors.New("x509: invalid basic constraints c")
}