- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.7k
 
Allow RSA signing with raw data (without a DigestInfo) #13740
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
base: main
Are you sure you want to change the base?
Conversation
| 
           I haven't reviewed in depth -- but I don't think we should use  @reaperhulk wdyt?  | 
    
| 
           @alex yeah that is a fair concern 👍  in some early attempt I did add a  I'll be happy to apply what you folks think is the best, if possible, please provide pointers where in the code-base a similar pattern is used so I can take inspiration from it.  | 
    
          
 I would like to highlight that the API already uses None for this purpose (for the RSA signature recover functionality, ref. issue #5495). So whatever you decide, you may want to use the same method in all the API functions to make them symmetric.  | 
    
| 
           Hmm, the inconsistency is a bit unfortunate. I'd be inclined to do a   | 
    
| 
           @alex @reaperhulk I did add a sentinel  Please have an other look and let me know what you think  | 
    
| algorithm: &pyo3::Bound<'_, pyo3::PyAny>, | ||
| ) -> CryptographyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> { | ||
| let algorithm = if algorithm.is_instance(&types::NO_DIGEST_INFO.get(py)?)? { | ||
| &pyo3::types::PyNone::get(py).to_owned().into_any() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch isn't covered so CI is failing, but should be an easy test to add.
This fixes #3713 and #10226.
Instead of using the script written by @misterzed88 in #10226 to generate modified tests vectors, I did directly implement the same logic in the test infrastructure, so we can reuse directly the NIST (or others...) vectors stored in the tests.