From 1b51d53a301179d538b0818508cf23a986bf57c8 Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 08:37:48 +0200 Subject: [PATCH 1/7] fix(cmputils): Fix and simplify confirm wait time preparation. --- resources/cmputils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/cmputils.py b/resources/cmputils.py index 2aa29307..61d264dd 100644 --- a/resources/cmputils.py +++ b/resources/cmputils.py @@ -4134,9 +4134,9 @@ def _prepare_generalinfo( new_time = datetime.now(timezone.utc) new_time = new_time + timedelta(seconds=int(confirm_wait_time)) if negative_value: - new_time = useful.UTCTime().fromDateTime(new_time) + new_time = prepareutils.prepare_utc_time(new_time) else: - new_time = useful.GeneralizedTime().fromDateTime(new_time) + new_time = prepareutils.prepare_generalized_time(new_time) confirm_wait_time_obj["infoValue"] = new_time general_info_wrapper.append(confirm_wait_time_obj) From 336f3bf5b7c0f2e475382121e02eb6e026d572a5 Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 08:42:32 +0200 Subject: [PATCH 2/7] fix(general_msg_utils): Update datetime handling to use UTC and remove microseconds --- resources/general_msg_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/general_msg_utils.py b/resources/general_msg_utils.py index a51a6a33..429bda9f 100644 --- a/resources/general_msg_utils.py +++ b/resources/general_msg_utils.py @@ -555,7 +555,7 @@ def _prepare_time_for_crl_update_retrieval(negative: bool, crl_filepath: Union[s :return: A `rfc9480.Time` object populated with the calculated `thisUpdate` time. """ if crl_filepath is None: - dt_object = datetime.datetime.now() + dt_object = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0) else: crl_object = utils.load_crl_from_file(crl_filepath) last_update = crl_object["tbsCertList"]["thisUpdate"] From 6baf06e63facd452e7842d54ef6081e592e220da Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 08:43:03 +0200 Subject: [PATCH 3/7] fix(dependencies): update pyasn1 to version 0.6.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 697f9c7d..9e1b18e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ description = "CMP Protocol Compliance Test Suite" requires-python = ">=3.13" dependencies = [ "cryptography==46.0.7", - "pyasn1==0.6.2", + "pyasn1==0.6.3", "pyasn1-alt-modules==0.4.9", "robotframework==7.4.2", "pkilint==0.13.2", From 1830f643ad507208da4e4edcf8fb54edde54c52f Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 08:52:50 +0200 Subject: [PATCH 4/7] fix(cmputils): update message time preparation to use prepareutils function --- resources/cmputils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/cmputils.py b/resources/cmputils.py index 61d264dd..f2b2aa2e 100644 --- a/resources/cmputils.py +++ b/resources/cmputils.py @@ -235,7 +235,7 @@ def prepare_pki_message( # the date is not correctly converted, so that it could happen for test cases, # that the messageTime is in the future. So a slightly older time is used date_time = datetime.now(timezone.utc) - timedelta(seconds=3) - message_time = useful.GeneralizedTime().fromDateTime(date_time) + message_time = prepareutils.prepare_generalized_time(date_time) msg_time_obj = prepareutils.convert_to_generalized_time( message_time, From 6700437242c1059fb5a4df7e7d8a4c4bf8ec6070 Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 08:56:29 +0200 Subject: [PATCH 5/7] fix(cmputils): simplify message time preparation by directly using datetime --- resources/cmputils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/cmputils.py b/resources/cmputils.py index f2b2aa2e..d81aadc2 100644 --- a/resources/cmputils.py +++ b/resources/cmputils.py @@ -234,8 +234,7 @@ def prepare_pki_message( if message_time is None: # the date is not correctly converted, so that it could happen for test cases, # that the messageTime is in the future. So a slightly older time is used - date_time = datetime.now(timezone.utc) - timedelta(seconds=3) - message_time = prepareutils.prepare_generalized_time(date_time) + message_time = datetime.now(timezone.utc) - timedelta(seconds=3) msg_time_obj = prepareutils.convert_to_generalized_time( message_time, From e75c7c4c853415c21cb3cb1b214d7e87eaed92e1 Mon Sep 17 00:00:00 2001 From: Z0050KEW Date: Mon, 13 Apr 2026 09:01:10 +0200 Subject: [PATCH 6/7] fix(cmputils): allow message_time to accept datetime in addition to GeneralizedTime --- resources/cmputils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/cmputils.py b/resources/cmputils.py index d81aadc2..33f07c86 100644 --- a/resources/cmputils.py +++ b/resources/cmputils.py @@ -183,7 +183,7 @@ def prepare_pki_message( implicit_confirm: bool = False, recip_kid: Optional[bytes] = None, sender_kid: Optional[bytes] = None, - message_time: Optional[useful.GeneralizedTime] = None, + message_time: Optional[Union[useful.GeneralizedTime, datetime]] = None, pki_free_text: Optional[Union[List[str], str]] = None, pvno: Optional[Strint] = 2, **kwargs, From aabe8ab965ef9bbf367aa844afe0a70b38b4be6e Mon Sep 17 00:00:00 2001 From: Guiliano99 Date: Mon, 13 Apr 2026 09:33:45 +0200 Subject: [PATCH 7/7] fix(cert_binding): update datetime handling to use UTC and remove microseconds --- pq_logic/hybrid_sig/cert_binding_for_multi_auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pq_logic/hybrid_sig/cert_binding_for_multi_auth.py b/pq_logic/hybrid_sig/cert_binding_for_multi_auth.py index 5afead33..835b6e96 100644 --- a/pq_logic/hybrid_sig/cert_binding_for_multi_auth.py +++ b/pq_logic/hybrid_sig/cert_binding_for_multi_auth.py @@ -15,7 +15,7 @@ import email import logging import time -from datetime import datetime +from datetime import datetime, timezone from typing import List, Optional from cryptography import x509 @@ -612,7 +612,7 @@ def server_side_validate_cert_binding_for_multi_auth(ee_cert, related_cert) -> N # SHOULD determine that all certificates are valid at the time of issuance. # The usable overlap of validity periods is a Subscriber concern. - now = datetime.now() + now = datetime.now(timezone.utc).replace(microsecond=0) val_cert_a = related_cert["tbsCertificate"]["validity"] cert_b = ee_cert["tbsCertificate"]["validity"]