diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-16 17:28:31 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-16 17:28:31 -0400 |
commit | 61013edb980fea359355a8d0bb8d948da1643aac (patch) | |
tree | 16286449660833289d6c2a65d4bc62c6720b170f | |
parent | 24b063da632f89a5ca9693921c59a9a598200d48 (diff) | |
download | cryptography-61013edb980fea359355a8d0bb8d948da1643aac.tar.gz cryptography-61013edb980fea359355a8d0bb8d948da1643aac.tar.bz2 cryptography-61013edb980fea359355a8d0bb8d948da1643aac.zip |
extract RSA struct from EVP_PKEY
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index a2e06946..44065b1c 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -879,9 +879,13 @@ class _RSAVerificationContext(object): assert errors raise InvalidSignature - def _verify_pss(self, rsa_cdata, evp_pkey, evp_md): + def _verify_pss(self, evp_pkey, evp_md): pkey_size = self._backend._lib.EVP_PKEY_size(evp_pkey) assert pkey_size > 0 + rsa_cdata = self._backend._lib.EVP_PKEY_get1_RSA(evp_pkey) + assert rsa_cdata != self._backend._ffi.NULL + rsa_cdata = self._backend._ffi.gc(rsa_cdata, + self._backend._lib.RSA_free) buf = self._backend._ffi.new("unsigned char[]", pkey_size) res = self._backend._lib.RSA_public_decrypt( len(self._signature), |