diff options
author | Ian Cordasco <graffatcolmingov@gmail.com> | 2015-08-03 08:26:42 -0500 |
---|---|---|
committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2015-08-03 08:26:42 -0500 |
commit | a0f00f47ea3aa53a31213843d60a4141e468f021 (patch) | |
tree | a663f2bb14b0ed45054c03971cb47005155cecb2 /tests/hazmat/bindings/test_openssl.py | |
parent | 36a1238703a1aa7aff44654e2e551f2a022c9c1a (diff) | |
parent | 93b5e3efab0337c51c84c27208d9034b607f09e2 (diff) | |
download | cryptography-a0f00f47ea3aa53a31213843d60a4141e468f021.tar.gz cryptography-a0f00f47ea3aa53a31213843d60a4141e468f021.tar.bz2 cryptography-a0f00f47ea3aa53a31213843d60a4141e468f021.zip |
Merge remote-tracking branch 'upstream/master' into cert-builder
Diffstat (limited to 'tests/hazmat/bindings/test_openssl.py')
-rw-r--r-- | tests/hazmat/bindings/test_openssl.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py index f3f2eaf4..75a8e3f1 100644 --- a/tests/hazmat/bindings/test_openssl.py +++ b/tests/hazmat/bindings/test_openssl.py @@ -4,27 +4,11 @@ from __future__ import absolute_import, division, print_function -import os - import pytest from cryptography.hazmat.bindings.openssl.binding import Binding -def skip_if_libre_ssl(openssl_version): - if b'LibreSSL' in openssl_version: - pytest.skip("LibreSSL hard-codes RAND_bytes to use arc4random.") - - -class TestLibreSkip(object): - def test_skip_no(self): - assert skip_if_libre_ssl(b"OpenSSL 0.9.8zf 19 Mar 2015") is None - - def test_skip_yes(self): - with pytest.raises(pytest.skip.Exception): - skip_if_libre_ssl(b"LibreSSL 2.1.6") - - class TestOpenSSL(object): def test_binding_loads(self): binding = Binding() @@ -108,20 +92,6 @@ class TestOpenSSL(object): with pytest.raises(RuntimeError): b._register_osrandom_engine() - def test_actual_osrandom_bytes(self, monkeypatch): - b = Binding() - skip_if_libre_ssl(b.ffi.string(b.lib.OPENSSL_VERSION_TEXT)) - sample_data = (b"\x01\x02\x03\x04" * 4) - length = len(sample_data) - - def notrandom(size): - assert size == length - return sample_data - monkeypatch.setattr(os, "urandom", notrandom) - buf = b.ffi.new("char[]", length) - b.lib.RAND_bytes(buf, length) - assert b.ffi.buffer(buf)[0:length] == sample_data - def test_ssl_ctx_options(self): # Test that we're properly handling 32-bit unsigned on all platforms. b = Binding() |