File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
cryptography/hazmat/primitives/asymmetric Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ def recover_data_from_signature(
123123 self ,
124124 signature : bytes ,
125125 padding : AsymmetricPadding ,
126- algorithm : hashes .HashAlgorithm | None ,
126+ algorithm : hashes .HashAlgorithm | asym_utils . NoDigestInfo | None ,
127127 ) -> bytes :
128128 """
129129 Recovers the original data from the signature.
Original file line number Diff line number Diff line change @@ -497,6 +497,11 @@ impl RsaPublicKey {
497497 padding : & pyo3:: Bound < ' _ , pyo3:: PyAny > ,
498498 algorithm : & pyo3:: Bound < ' _ , pyo3:: PyAny > ,
499499 ) -> CryptographyResult < pyo3:: Bound < ' p , pyo3:: types:: PyBytes > > {
500+ let algorithm = if algorithm. is_instance ( & types:: NO_DIGEST_INFO . get ( py) ?) ? {
501+ & pyo3:: types:: PyNone :: get ( py) . to_owned ( ) . into_any ( )
502+ } else {
503+ algorithm
504+ } ;
500505 if algorithm. is_instance ( & types:: PREHASHED . get ( py) ?) ? {
501506 return Err ( CryptographyError :: from (
502507 pyo3:: exceptions:: PyTypeError :: new_err (
You can’t perform that action at this time.
0 commit comments