Skip to content
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

RSA PKCS#1 v1.5 signature scheme verification incompatibility issue #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yahyazadeh
Copy link

Added support for implicit NULL parameter case in pkcs1 signature verification

@bdauvergne
Copy link
Owner

Seems great, could you add a test vector for this use case ? Do not try to add to the existing one extracted from PKCS#1 specification, just add it directly in the test files.

@yahyazadeh
Copy link
Author

I might not be able to do this at the moment but may try this later.

@bmurray7 bmurray7 mentioned this pull request Jan 22, 2022
except ValueError:
raise exceptions.RSAModulusTooShort
return primitives.constant_time_cmp(em, em_prime)
return primitives.constant_time_cmp(em, em_prime) or primitives.constant_time_cmp(em, em_prime_imp)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still constant time?

In an or statement, Python only evaluates the second condition if the first condition evaluates to True. See the Python specification for Boolean operations..

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. But don't expect this lib to give you real constant time even with this change. It's a toy implementation, if you need a really hardened implementation of RSA, there are a lot around written in C or ASM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants