Skip to content

Bug in iqmp calculation #62

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

Closed
angelakis opened this issue Aug 28, 2020 · 1 comment · Fixed by #61
Closed

Bug in iqmp calculation #62

angelakis opened this issue Aug 28, 2020 · 1 comment · Fixed by #61
Assignees
Labels

Comments

@angelakis
Copy link
Contributor

There's a bug/typo in iqmp calculation. The parameters in the method below should be p, q instead of p, p:

cnum["iqmp"] = rsa.rsa_crt_iqmp(cnum["p"], cnum["p"])

(Also 2 lines below.)

AFAIK Cryptography < 3.1.0 and the underlying libraries/bindings were correcting this error but after version 3.1.0 the checks became stricter and the key is rejected:

'Invalid private key', [_OpenSSLErrorWithText(code=67764350, lib=4, func=160, reason=126, reason_text=b'error:040A007E:rsa routines:RSA_check_key_ex:iqmp not inv
erse of q')]
jschlyter added a commit that referenced this issue Aug 28, 2020
@jschlyter jschlyter self-assigned this Aug 28, 2020
@jschlyter
Copy link
Collaborator

Good catch! I've fixed this in #61, waiting for review by @rohe. I suggest we do a new release once this is fixed.

@jschlyter jschlyter added the bug label Aug 28, 2020
@jschlyter jschlyter linked a pull request Aug 28, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants