Skip to content

Commit 8572088

Browse files
authored
Merge pull request #199 from dreid/patch-1
Denylist ecdsa 0.15 in setup.py to allow for 0.16 to be installed.
2 parents a2a4c31 + d59ad6d commit 8572088

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

jose/backends/ecdsa_backend.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,22 @@ def _process_jwk(self, jwk_dict):
9191
return ecdsa.keys.VerifyingKey.from_public_point(point, self.curve)
9292

9393
def sign(self, msg):
94-
return self.prepared_key.sign(msg, hashfunc=self.hash_alg, sigencode=ecdsa.util.sigencode_string)
94+
return self.prepared_key.sign(
95+
msg,
96+
hashfunc=self.hash_alg,
97+
sigencode=ecdsa.util.sigencode_string,
98+
allow_truncate=False
99+
)
95100

96101
def verify(self, msg, sig):
97102
try:
98-
return self.prepared_key.verify(sig, msg, hashfunc=self.hash_alg, sigdecode=ecdsa.util.sigdecode_string)
103+
return self.prepared_key.verify(
104+
sig,
105+
msg,
106+
hashfunc=self.hash_alg,
107+
sigdecode=ecdsa.util.sigdecode_string,
108+
allow_truncate=False
109+
)
99110
except Exception:
100111
return False
101112

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _cryptography_version():
3838
'pycrypto': ['pycrypto >=2.6.0, <2.7.0'] + pyasn1,
3939
'pycryptodome': ['pycryptodome >=3.3.1, <4.0.0'] + pyasn1,
4040
}
41-
legacy_backend_requires = ['ecdsa <0.15', 'rsa'] + pyasn1
41+
legacy_backend_requires = ['ecdsa != 0.15', 'rsa'] + pyasn1
4242
install_requires = ['six <2.0']
4343

4444
# TODO: work this into the extras selection instead.
@@ -78,7 +78,7 @@ def _cryptography_version():
7878
],
7979
tests_require=[
8080
'six',
81-
'ecdsa<0.15',
81+
'ecdsa != 0.15',
8282
'pytest',
8383
'pytest-cov',
8484
'pytest-runner',

0 commit comments

Comments
 (0)