Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pq_logic/hybrid_sig/cert_binding_for_multi_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions resources/cmputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = useful.GeneralizedTime().fromDateTime(date_time)
message_time = datetime.now(timezone.utc) - timedelta(seconds=3)

msg_time_obj = prepareutils.convert_to_generalized_time(
message_time,
Expand Down Expand Up @@ -4134,9 +4133,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)
Expand Down
2 changes: 1 addition & 1 deletion resources/general_msg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading