Skip to content

Commit d4cba76

Browse files
committed
chore: upgrade cryptography minimum version 46.0.5
Bump cryptography minimum constraint from `41.0.0` to `46.0.5`. Related-Task: INTER-1897
1 parent 681f9d5 commit d4cba76

6 files changed

Lines changed: 7 additions & 12 deletions

File tree

fingerprint_server_sdk/sealed.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import zlib
33

4-
from cryptography.hazmat.backends import default_backend
54
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
65

76
from fingerprint_server_sdk.models.event import Event
@@ -92,9 +91,7 @@ def __unseal_aes256gcm(sealed_data: bytes, decryption_key: bytes) -> str:
9291

9392
ciphertext = sealed_data[len(SEALED_HEADER) + nonce_length : -auth_tag_length]
9493

95-
decipher = Cipher(
96-
algorithms.AES(decryption_key), modes.GCM(nonce, auth_tag), backend=default_backend()
97-
).decryptor()
94+
decipher = Cipher(algorithms.AES(decryption_key), modes.GCM(nonce, auth_tag)).decryptor()
9895

9996
compressed = decipher.update(ciphertext) + decipher.finalize()
10097

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
"python-dateutil (>=2.8.2)",
1616
"pydantic (>=2)",
1717
"typing-extensions (>=4.7.1)",
18-
"cryptography"
18+
"cryptography (>=46.0.5)"
1919
]
2020

2121
[project.optional-dependencies]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ urllib3 >= 2.1.0, < 3.0.0
22
python_dateutil >= 2.8.2
33
pydantic >= 2
44
typing-extensions >= 4.7.1
5-
cryptography >= 41.0.0
5+
cryptography >= 46.0.5
66
setuptools >= 82.0.1

template/pyproject.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typing-extensions = ">= 4.7.1"
5656
{{#lazyImports}}
5757
lazy-imports = ">= 1, < 2"
5858
{{/lazyImports}}
59-
cryptography = ">= 41.0.0"
59+
cryptography = ">= 46.0.5"
6060
python-dotenv = ">= 1.0.0"
6161
{{/poetry1}}
6262
{{^poetry1}}
@@ -86,7 +86,7 @@ dependencies = [
8686
{{#lazyImports}}
8787
"lazy-imports (>=1,<2)"
8888
{{/lazyImports}}
89-
"cryptography"
89+
"cryptography (>=46.0.5)"
9090
]
9191

9292
[project.optional-dependencies]

template/requirements.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ typing-extensions >= 4.7.1
2121
{{#lazyImports}}
2222
lazy-imports >= 1, < 2
2323
{{/lazyImports}}
24-
cryptography >= 41.0.0
24+
cryptography >= 46.0.5
2525
setuptools >= 82.0.1

template/sealed.py.mustache

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import zlib
33

4-
from cryptography.hazmat.backends import default_backend
54
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
65

76
from {{packageName}}.models.event import Event
@@ -91,8 +90,7 @@ def __unseal_aes256gcm(sealed_data: bytes, decryption_key: bytes) -> str:
9190

9291
decipher = Cipher(
9392
algorithms.AES(decryption_key),
94-
modes.GCM(nonce, auth_tag),
95-
backend=default_backend()
93+
modes.GCM(nonce, auth_tag)
9694
).decryptor()
9795

9896
compressed = decipher.update(ciphertext) + decipher.finalize()

0 commit comments

Comments
 (0)