aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/bindings/test_openssl.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py
index 207fece9..73952561 100644
--- a/tests/hazmat/bindings/test_openssl.py
+++ b/tests/hazmat/bindings/test_openssl.py
@@ -95,13 +95,15 @@ class TestOpenSSL(object):
b._register_osrandom_engine()
def test_actual_osrandom_bytes(self, monkeypatch):
+ b = Binding()
+ if b'LibreSSL' in b.ffi.string(b.lib.OPENSSL_VERSION_TEXT):
+ pytest.skip("LibreSSL hard-codes RAND_bytes to use arc4random.")
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)
- b = Binding()
buf = b.ffi.new("char[]", length)
b.lib.RAND_bytes(buf, length)
assert b.ffi.buffer(buf)[0:length] == sample_data