Skip to content

Commit dbbe46d

Browse files
committed
Fix bad iqmp calculation
closes #62
1 parent 82ec404 commit dbbe46d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"Programming Language :: Python :: 3.7",
5353
"Programming Language :: Python :: 3.8",
5454
],
55-
install_requires=["cryptography<=3.0", "requests"],
55+
install_requires=["cryptography", "requests"],
5656
tests_require=["pytest"],
5757
zip_safe=False,
5858
extras_require={

src/cryptojwt/jwk/rsa.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ def rsa_construct_private(numbers):
172172
try:
173173
cnum["iqmp"] = numbers["di"]
174174
except KeyError:
175-
cnum["iqmp"] = rsa.rsa_crt_iqmp(cnum["p"], cnum["p"])
175+
cnum["iqmp"] = rsa.rsa_crt_iqmp(cnum["p"], cnum["q"])
176176
else:
177177
if not numbers["di"]:
178-
cnum["iqmp"] = rsa.rsa_crt_iqmp(cnum["p"], cnum["p"])
178+
cnum["iqmp"] = rsa.rsa_crt_iqmp(cnum["p"], cnum["q"])
179179

180180
rpubn = rsa.RSAPublicNumbers(e=numbers["e"], n=numbers["n"])
181181
rprivn = rsa.RSAPrivateNumbers(public_numbers=rpubn, **cnum)

0 commit comments

Comments
 (0)