Skip to content

Commit a965819

Browse files
committed
Raise BadConfig exception if OpenSSL PQC support is not enabled during certificate chain verification.
1 parent 7ef17f7 commit a965819

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

resources/certutils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
BadSigAlgID,
6060
CertRevoked,
6161
SignerNotTrusted,
62-
UnknownOID,
62+
UnknownOID, BadConfig,
6363
)
6464
from resources.oid_mapping import get_hash_from_oid, may_return_oid_to_name
6565
from resources.oidutils import (
@@ -1065,14 +1065,14 @@ def _validate_cert_chain_algs_for_verification(
10651065
10661066
:param cert_chain: A list of `rfc9480.CMPCertificate` objects representing the certificate chain.
10671067
:raises ValueError: If the certificate chain contains unsupported algorithms for OpenSSL verification.
1068+
:raises BadConfig: If OpenSSL PQC support is not enabled.
10681069
:return: `True` if the certificate chain can be verified with OpenSSL, `False` otherwise.
10691070
"""
10701071
if not _is_pqc_or_hybrid_cert_chain(cert_chain):
10711072
return True
10721073

1073-
if not check_openssl_pqc_support() and not pqc_algs_cannot_be_validated_with_openssl(certs=cert_chain):
1074-
logging.warning("OpenSSL PQC support is not enabled.")
1075-
return False
1074+
if not check_openssl_pqc_support():
1075+
raise BadConfig("OpenSSL PQC support is not enabled. The test-suite requires OpenSSL 3.5 or later.")
10761076

10771077
if pqc_algs_cannot_be_validated_with_openssl(certs=cert_chain):
10781078
raise ValueError(

0 commit comments

Comments
 (0)