1
0
mirror of https://github.com/moepman/acertmgr.git synced 2024-12-29 11:31:49 +01:00

Instantiate HashAlgorithm in OCSPRequestBuilder

Installations of more recent cryptography require parameter hash
algorithm to be an instance of hashes.HashAlgorithm, not the bare object
itself.

Fixes #63
This commit is contained in:
Jan 2023-07-01 14:29:48 +02:00 committed by Markus Hauschild
parent 2d230e30d9
commit c15b6ec441

View File

@ -432,7 +432,7 @@ def is_ocsp_valid(cert, issuer, hash_algo):
# This is a bit of a hack due to validation problems within cryptography (TODO: Check if this is still true)
# Correct replacement: ocsprequest = ocsp.OCSPRequestBuilder().add_certificate(cert, issuer, algorithm).build()
ocsprequest = ocsp.OCSPRequestBuilder((cert, issuer, algorithm)).build()
ocsprequest = ocsp.OCSPRequestBuilder((cert, issuer, (algorithm)())).build()
ocsprequestdata = ocsprequest.public_bytes(serialization.Encoding.DER)
for ocsp_url in ocsp_urls:
response = get_url(ocsp_url,