From 33b634803b55d3a27798c8e42f547558efec0711 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Thu, 23 Mar 2023 10:57:26 +0000 Subject: [PATCH] crypto/x509: remove letters from the end of basic constraints parsing errors 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 Reviewed-by: Roland Shoemaker Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/crypto/x509/parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/x509/parser.go b/src/crypto/x509/parser.go index 735a27607e..5a1819841d 100644 --- a/src/crypto/x509/parser.go +++ b/src/crypto/x509/parser.go @@ -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") } } -- 2.48.1