Skip to content

Commit 557d0cb

Browse files
author
Lars Scheibling
committed
Update to Python3.10 as default in pipfile
Bump cryptography to v42 Fixed incompatibility Needs more testing before release
1 parent 1ea19eb commit 557d0cb

File tree

4 files changed

+78
-65
lines changed

4 files changed

+78
-65
lines changed

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name = "pypi"
55

66
[packages]
77
click = "~=8.1"
8-
cryptography = "~=41.0"
8+
cryptography = "~=42.0"
99
bcrypt = "~=4.1"
1010
prettytable = "~=3.1"
1111
pytimeparse2 = "~=1.4"
@@ -21,4 +21,4 @@ cprint = "*"
2121
pylint = "*"
2222

2323
[requires]
24-
python_version = "3.9"
24+
python_version = "3.10"

Pipfile.lock

Lines changed: 70 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
click~=8.1
2-
cryptography~=41.0.0
2+
cryptography~=42.0.0
33
bcrypt~=4.1
44
PrettyTable~=3.9
55
pytimeparse2~=1.1

src/sshkey_tools/keys.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
from typing import Union
88

99
from cryptography.exceptions import InvalidSignature
10-
from cryptography.hazmat.backends.openssl.ec import (
11-
_EllipticCurvePrivateKey,
12-
_EllipticCurvePublicKey,
13-
)
1410
from cryptography.hazmat.bindings import _rust as _RustBinding
1511

16-
from cryptography.hazmat.backends.openssl.rsa import _RSAPrivateKey, _RSAPublicKey
1712
from cryptography.hazmat.primitives import hashes as _HASHES
1813
from cryptography.hazmat.primitives import serialization as _SERIALIZATION
1914
from cryptography.hazmat.primitives.asymmetric import dsa as _DSA
@@ -29,14 +24,14 @@
2924
from .utils import sha512_fingerprint as _FP_SHA512
3025

3126
PUBKEY_MAP = {
32-
_RSAPublicKey: "RsaPublicKey",
33-
_EllipticCurvePublicKey: "EcdsaPublicKey",
27+
_RustBinding.openssl.rsa.RSAPublicKey: "RsaPublicKey",
28+
_RustBinding.openssl.ec.ECPublicKey: "EcdsaPublicKey",
3429
_RustBinding.openssl.ed25519.Ed25519PublicKey: "Ed25519PublicKey",
3530
}
3631

3732
PRIVKEY_MAP = {
38-
_RSAPrivateKey: "RsaPrivateKey",
39-
_EllipticCurvePrivateKey: "EcdsaPrivateKey",
33+
_RustBinding.openssl.rsa.RSAPrivateKey: "RsaPrivateKey",
34+
_RustBinding.openssl.ec.ECPrivateKey: "EcdsaPrivateKey",
4035
# trunk-ignore(gitleaks/generic-api-key)
4136
_RustBinding.openssl.ed25519.Ed25519PrivateKey: "Ed25519PrivateKey",
4237
}
@@ -780,7 +775,7 @@ def generate(cls, curve: EcdsaCurves = EcdsaCurves.P521):
780775
Returns:
781776
EcdsaPrivateKey: An instance of EcdsaPrivateKey
782777
"""
783-
return cls.from_class(_ECDSA.generate_private_key(curve=curve.value))
778+
return cls.from_class(_ECDSA.generate_private_key(curve=curve.value()))
784779

785780
def sign(self, data: bytes):
786781
"""

0 commit comments

Comments
 (0)