]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: remove letters from the end of basic constraints parsing errors
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Thu, 23 Mar 2023 10:57:26 +0000 (10:57 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 24 Mar 2023 02:45:11 +0000 (02:45 +0000)
Change-Id: I84533d2df1a20f6337c43b1ca00d8022909a0018
GitHub-Last-Rev: 7dcc4e7296054df7fcbaebfdbd2a9895750f56ea
GitHub-Pull-Request: golang/go#59195
Reviewed-on: https://go-review.googlesource.com/c/go/+/478816
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/crypto/x509/parser.go

index 735a27607ea71df43b733c6e032de04f7869e64d..5a1819841df47f7ad68ca948c864c45f4ac10c01 100644 (file)
@@ -334,17 +334,17 @@ func parseKeyUsageExtension(der cryptobyte.String) (KeyUsage, error) {
 func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) {
        var isCA bool
        if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) {
-               return false, 0, errors.New("x509: invalid basic constraints a")
+               return false, 0, errors.New("x509: invalid basic constraints")
        }
        if der.PeekASN1Tag(cryptobyte_asn1.BOOLEAN) {
                if !der.ReadASN1Boolean(&isCA) {
-                       return false, 0, errors.New("x509: invalid basic constraints b")
+                       return false, 0, errors.New("x509: invalid basic constraints")
                }
        }
        maxPathLen := -1
        if !der.Empty() && der.PeekASN1Tag(cryptobyte_asn1.INTEGER) {
                if !der.ReadASN1Integer(&maxPathLen) {
-                       return false, 0, errors.New("x509: invalid basic constraints c")
+                       return false, 0, errors.New("x509: invalid basic constraints")
                }
        }