open-vault/sdk/helper
Alexander Scheel ef7dd8c1bb
Add fix for Go x/crypto/ocsp failure case (#20181)
* Add fix for Go x/crypto/ocsp failure case

When calling ocsp.ParseRequest(req, issue) with a non-nil issuer on a
ocsp request which _unknowingly_ contains an entry in the
BasicOCSPResponse's certs field, Go incorrectly assumes that the issuer
is a direct parent of the _first_ certificate in the certs field,
discarding the rest.

As documented in the Go issue, this is not a valid assumption and thus
causes OCSP verification to fail in Vault with an error like:

> bad OCSP signature: crypto/rsa: verification error

which ultimately leads to a cert auth login error of:

> no chain matching all constraints could be found for this login certificate

We address this by using the unsafe issuer=nil argument, taking on the
task of validating the OCSP response's signature as best we can in the
absence of full chain information on either side (both the trusted
certificate whose OCSP response we're verifying and the lack of any
additional certs the OCSP responder may have sent).

See also: https://github.com/golang/go/issues/59641

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add test case with Vault PKI

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add changelog entry

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-17 11:48:19 -04:00
..
authmetadata adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
base62 adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
certutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
cidrutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
compressutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
consts adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
cryptoutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
custommetadata adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
dbtxn adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
errutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
hclutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
identitytpl adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
jsonutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
kdf adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
keysutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
ldaputil sdk/ldaputil: add connection_timeout configurable (#20144) 2023-04-13 12:43:28 -04:00
license adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
locksutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
logging adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
mlock adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
ocsp Add fix for Go x/crypto/ocsp failure case (#20181) 2023-04-17 11:48:19 -04:00
parseutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
password adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
pathmanager adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
pluginutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
pointerutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
policyutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
roottoken adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
salt adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
strutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
template adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
testhelpers/schema Fix response structure validation tests for non-2xx responses (#19726) 2023-03-23 16:33:44 -04:00
tlsutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
tokenutil adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
useragent adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
wrapping adding copyright header (#19555) 2023-03-15 09:00:52 -07:00
xor adding copyright header (#19555) 2023-03-15 09:00:52 -07:00