mirror of https://github.com/golang/go.git
remove a,b,c from end of basic constraints errors messages
This commit is contained in:
parent
0aa14fca8c
commit
7dcc4e7296
|
|
@ -334,17 +334,17 @@ func parseKeyUsageExtension(der cryptobyte.String) (KeyUsage, error) {
|
||||||
func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) {
|
func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) {
|
||||||
var isCA bool
|
var isCA bool
|
||||||
if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) {
|
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.PeekASN1Tag(cryptobyte_asn1.BOOLEAN) {
|
||||||
if !der.ReadASN1Boolean(&isCA) {
|
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
|
maxPathLen := -1
|
||||||
if !der.Empty() && der.PeekASN1Tag(cryptobyte_asn1.INTEGER) {
|
if !der.Empty() && der.PeekASN1Tag(cryptobyte_asn1.INTEGER) {
|
||||||
if !der.ReadASN1Integer(&maxPathLen) {
|
if !der.ReadASN1Integer(&maxPathLen) {
|
||||||
return false, 0, errors.New("x509: invalid basic constraints c")
|
return false, 0, errors.New("x509: invalid basic constraints")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue