From d36bef0b744d79b209b13f87fb9c943e4091a2c5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 25 May 2017 23:05:00 -0500 Subject: fix libressl error/refactor some error handling (#3609) * add libre so I can see the error * add the libre error needed and refactor error handling a bit We were historically matching on lib + func + reason, but func is somewhat unstable so now we match on lib + reason only. Of course, in this case libressl changed both lib and reason so it wouldn't have mattered. All error handling from the error queue in openssl is an illusion * fix a typo, probably an unneeded branch * review feedback * refactor tests to support libressl insert additional rant about libre here, although admittedly these tests were assuming stability where openssl itself guarantees none * better assert, fix flake8 --- tests/hazmat/backends/test_openssl.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests/hazmat/backends') diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 20c073a4..e857ff61 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -127,10 +127,7 @@ class TestOpenSSL(object): def test_error_strings_loaded(self): # returns a value in a static buffer err = backend._lib.ERR_error_string(101183626, backend._ffi.NULL) - assert backend._ffi.string(err) == ( - b"error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:" - b"data not multiple of block length" - ) + assert b"data not multiple of block length" in backend._ffi.string(err) def test_unknown_error_in_cipher_finalize(self): cipher = Cipher(AES(b"\0" * 16), CBC(b"\0" * 16), backend=backend) -- cgit v1.2.3