]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix OCSP_basic_verify signer certificate validation
authorMatt Caswell <matt@openssl.org>
Wed, 13 Apr 2022 15:36:54 +0000 (16:36 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 3 May 2022 09:46:49 +0000 (10:46 +0100)
commit21f89f542d745adbf1131338929ae538e200d50d
treec28718b84cb2a2e64f6d3b0752e1318bc4eee315
parentb1b2146ded9ce5a84c62f30c6c4a922b449f6c90
Fix OCSP_basic_verify signer certificate validation

The function `OCSP_basic_verify` validates the signer certificate on an OCSP
response. The internal function, ocsp_verify_signer, is responsible for this
and is expected to return a 0 value in the event of a failure to verify.
Unfortunately, due to a bug, it actually returns with a postive success
response in this case. In the normal course of events OCSP_basic_verify
will then continue and will fail anyway in the ocsp_check_issuer function
because the supplied "chain" value will be empty in the case that
ocsp_verify_signer failed to verify the chain. This will cause
OCSP_basic_verify to return with a negative result (fatal error). Normally
in the event of a failure to verify it should return with 0.

However, in the case of the OCSP_NOCHECKS flag being used, OCSP_basic_verify
will return with a positvie result. This could lead to callers trusting an
OCSP Basic response when it should not be.

CVE-2022-1343

Fixes #18053

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/ocsp/ocsp_vfy.c