]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[ocsp] Accept SHA1 certID responses even if SHA1 is not enabled
authorMichael Brown <mcb30@ipxe.org>
Thu, 25 Jun 2020 12:04:02 +0000 (13:04 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 25 Jun 2020 12:04:54 +0000 (13:04 +0100)
commit3f637d7462e7688638b4084717297db8638bdffb
treebb75718cc7ebb13c2fd3cbbc8a1071b8d51f0f43
parenta61b27b97f572a83ede765a0e779694865950cf2
[ocsp] Accept SHA1 certID responses even if SHA1 is not enabled

Various implementation quirks in OCSP servers make it impractical to
use anything other than SHA1 to construct the issuerNameHash and
issuerKeyHash identifiers in the request certID.  For example: both
the OpenCA OCSP responder used by ipxe.org and the Boulder OCSP
responder used by LetsEncrypt will fail if SHA256 is used in the
request certID.

As of commit 6ffe28a ("[ocsp] Accept response certID with missing
hashAlgorithm parameters") we rely on asn1_digest_algorithm() to parse
the algorithm identifier in the response certID.  This will fail if
SHA1 is disabled via config/crypto.h.

Fix by using a direct ASN.1 object comparison on the OID within the
algorithm identifier.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/ocsp.c