1
0
mirror of https://github.com/golang/go synced 2024-11-17 15:34:42 -07:00

crypto/x509: remove unnecessary !Empty() check

This check is already done by PeekASN1Tag.

Change-Id: Ieba0e35548f7f99bce689d29adaea6b8e471cc70
GitHub-Last-Rev: b4ef3dcc23
GitHub-Pull-Request: golang/go#59197
Reviewed-on: https://go-review.googlesource.com/c/go/+/478835
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Mateusz Poliwczak 2023-03-23 10:57:36 +00:00 committed by Gopher Robot
parent 33b634803b
commit 7ec2e84424

View File

@ -342,7 +342,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")
}