summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-07-03 09:54:09 -0400
committerCory Benfield <lukasaoz@gmail.com>2016-07-03 14:54:09 +0100
commit09f19f5ab29d7545b962c921d350b9d4320b448e (patch)
treeb19c4954208a9f31b901d6dea52735e8549e5767 /src
parent09a386e7e0d9737006906d453de2948a25f4021c (diff)
downloadpyopenssl-git-09f19f5ab29d7545b962c921d350b9d4320b448e.tar.gz
Port the easy cases of SSL.py to _openssl_assert (#499)
Diffstat (limited to 'src')
-rw-r--r--src/OpenSSL/SSL.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py
index 8dfa0ed..5eea271 100644
--- a/src/OpenSSL/SSL.py
+++ b/src/OpenSSL/SSL.py
@@ -561,9 +561,7 @@ class Context(object):
:return: None
"""
set_result = _lib.SSL_CTX_set_default_verify_paths(self._context)
- if not set_result:
- # TODO: This is untested.
- _raise_current_error()
+ _openssl_assert(set_result == 1)
def use_certificate_chain_file(self, certfile):
"""
@@ -890,9 +888,7 @@ class Context(object):
add_result = _lib.SSL_CTX_add_client_CA(
self._context, certificate_authority._x509)
- if not add_result:
- # TODO: This is untested.
- _raise_current_error()
+ _openssl_assert(add_result == 1)
def set_timeout(self, timeout):
"""
@@ -1129,9 +1125,7 @@ class Connection(object):
self._socket = socket
set_result = _lib.SSL_set_fd(
self._ssl, _asFileDescriptor(self._socket))
- if not set_result:
- # TODO: This is untested.
- _raise_current_error()
+ _openssl_assert(set_result == 1)
def __getattr__(self, name):
"""