From dd6f4c2977ff03ba0e45e3528f49f126f587f123 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 8 Jul 2018 21:20:43 -0400 Subject: Convert a pair of asserts to use openssl_assert (#4318) We have an existence proof that the latter assertion can be triggered, and I bet the former can too. --- src/cryptography/hazmat/backends/openssl/rsa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/openssl/rsa.py b/src/cryptography/hazmat/backends/openssl/rsa.py index 1b6ebfd7..e7a77312 100644 --- a/src/cryptography/hazmat/backends/openssl/rsa.py +++ b/src/cryptography/hazmat/backends/openssl/rsa.py @@ -129,7 +129,7 @@ def _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding): def _handle_rsa_enc_dec_error(backend, key): errors = backend._consume_errors() - assert errors + backend.openssl_assert(errors) assert errors[0].lib == backend._lib.ERR_LIB_RSA if isinstance(key, _RSAPublicKey): assert (errors[0].reason == @@ -265,7 +265,7 @@ def _rsa_sig_verify(backend, padding, algorithm, public_key, signature, data): backend.openssl_assert(res >= 0) if res == 0: errors = backend._consume_errors() - assert errors + backend.openssl_assert(errors) raise InvalidSignature -- cgit v1.2.3