From 98c57be751fe18fec6d05152965f53ed9ade0872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 31 Mar 2020 16:14:50 +0200 Subject: Remove asserts (#904) --- src/OpenSSL/SSL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/OpenSSL/SSL.py') diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index ca39930..03f1455 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -2131,7 +2131,7 @@ class Connection(object): if session == _ffi.NULL: return None length = _lib.SSL_get_server_random(self._ssl, _ffi.NULL, 0) - assert length > 0 + _openssl_assert(length > 0) outp = _no_zero_allocator("unsigned char[]", length) _lib.SSL_get_server_random(self._ssl, outp, length) return _ffi.buffer(outp, length)[:] @@ -2147,7 +2147,7 @@ class Connection(object): return None length = _lib.SSL_get_client_random(self._ssl, _ffi.NULL, 0) - assert length > 0 + _openssl_assert(length > 0) outp = _no_zero_allocator("unsigned char[]", length) _lib.SSL_get_client_random(self._ssl, outp, length) return _ffi.buffer(outp, length)[:] @@ -2163,7 +2163,7 @@ class Connection(object): return None length = _lib.SSL_SESSION_get_master_key(session, _ffi.NULL, 0) - assert length > 0 + _openssl_assert(length > 0) outp = _no_zero_allocator("unsigned char[]", length) _lib.SSL_SESSION_get_master_key(session, outp, length) return _ffi.buffer(outp, length)[:] -- cgit v1.2.1