]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: disallow negative path length
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Tue, 20 May 2025 16:21:22 +0000 (16:21 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 19:07:24 +0000 (12:07 -0700)
commit3a7a856951c69e6c279b4305030c5da6ca8af913
treef71aed2fc183302ec5ccc1c3efec993cb3e600b3
parent94e3caeec18dfb55c0a8ab6067904ae76248ec3f
crypto/x509: disallow negative path length

pathLenConstraint is restricted to unsigned integers.
Also the -1 value of cert.MaxPathLength has a special
meaning, so we shouldn't allow unmarshaling -1.

BasicConstraints ::= SEQUENCE {
     cA                      BOOLEAN DEFAULT FALSE,
     pathLenConstraint       INTEGER (0..MAX) OPTIONAL }

Change-Id: I485a6aa7223127becc86c423e1ef9ed2fbd48209
GitHub-Last-Rev: 75a11b47b963ac383d1ad67dfc001648632a05f0
GitHub-Pull-Request: golang/go#60706
Reviewed-on: https://go-review.googlesource.com/c/go/+/502076
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/crypto/x509/parser.go
src/crypto/x509/parser_test.go
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go