From 5cfaa5b79d446e1c63de3948e7558cd00561ea1f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 21 Feb 2019 09:52:10 +0800 Subject: encode the package version in the shared object (#4756) * encode the package version in the shared object * review feedback * move into build_ffi so the symbol is in all shared objects * review feedback --- tests/hazmat/bindings/test_openssl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py index fb1e62fa..29a1c459 100644 --- a/tests/hazmat/bindings/test_openssl.py +++ b/tests/hazmat/bindings/test_openssl.py @@ -8,7 +8,7 @@ import pytest from cryptography.exceptions import InternalError from cryptography.hazmat.bindings.openssl.binding import ( - Binding, _consume_errors, _openssl_assert + Binding, _consume_errors, _openssl_assert, _verify_package_version ) @@ -118,3 +118,7 @@ class TestOpenSSL(object): ) b._register_osrandom_engine() assert _consume_errors(b.lib) == [] + + def test_version_mismatch(self): + with pytest.raises(ImportError): + _verify_package_version("nottherightversion") -- cgit v1.2.3