Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cryptography from 41.0.7 to 42.0.4 #638

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
cryptography==41.0.7
cryptography==42.0.4
# via -r docs-requirements.in
docutils==0.20.1
# via sphinx
Expand Down
2 changes: 1 addition & 1 deletion lint-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
cffi==1.16.0
# via cryptography
cryptography==41.0.7
cryptography==42.0.4
# via
# -r lint-requirements.in
# types-pyopenssl
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cffi==1.16.0
# via cryptography
coverage[toml]==7.4.1
# via -r test-requirements.in
cryptography==41.0.7
cryptography==42.0.4
# via
# -r test-requirements.in
# pyopenssl
Expand Down
10 changes: 5 additions & 5 deletions tests/test_trustme.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def assert_is_leaf(leaf_cert: x509.Certificate) -> None:
def test_basics(key_type: KeyType, expected_key_header: bytes) -> None:
ca = CA(key_type=key_type)

today = datetime.datetime.today()
today = datetime.datetime.now(datetime.timezone.utc)

assert (
b"BEGIN " + expected_key_header + b" PRIVATE KEY" in ca.private_key_pem.bytes()
Expand All @@ -79,7 +79,7 @@ def test_basics(key_type: KeyType, expected_key_header: bytes) -> None:
private_key = load_pem_private_key(ca.private_key_pem.bytes(), password=None)

ca_cert = x509.load_pem_x509_certificate(ca.cert_pem.bytes())
assert ca_cert.not_valid_before <= today <= ca_cert.not_valid_after
assert ca_cert.not_valid_before_utc <= today <= ca_cert.not_valid_after_utc

public_key1 = private_key.public_key().public_bytes(
Encoding.PEM, PublicFormat.SubjectPublicKeyInfo
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_basics(key_type: KeyType, expected_key_header: bytes) -> None:

server_cert = x509.load_pem_x509_certificate(server.cert_chain_pems[0].bytes())

assert server_cert.not_valid_before <= today <= server_cert.not_valid_after
assert server_cert.not_valid_before_utc <= today <= server_cert.not_valid_after_utc
assert server_cert.issuer == ca_cert.subject
assert_is_leaf(server_cert)

Expand Down Expand Up @@ -168,7 +168,7 @@ def test_issue_cert_custom_not_after() -> None:
cert = x509.load_pem_x509_certificate(leaf_cert.cert_chain_pems[0].bytes())

for t in ["year", "month", "day", "hour", "minute", "second"]:
assert getattr(cert.not_valid_after, t) == getattr(expires, t)
assert getattr(cert.not_valid_after_utc, t) == getattr(expires, t)


def test_issue_cert_custom_not_before() -> None:
Expand All @@ -185,7 +185,7 @@ def test_issue_cert_custom_not_before() -> None:
cert = x509.load_pem_x509_certificate(leaf_cert.cert_chain_pems[0].bytes())

for t in ["year", "month", "day", "hour", "minute", "second"]:
assert getattr(cert.not_valid_before, t) == getattr(not_before, t)
assert getattr(cert.not_valid_before_utc, t) == getattr(not_before, t)


def test_intermediate() -> None:
Expand Down