diff options
author | Alex Chan <alex@alexwlchan.net> | 2017-04-20 11:50:47 +0100 |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2017-04-20 12:50:47 +0200 |
commit | 84902a28c657c7f2b0de10192948f8f5c5410c10 (patch) | |
tree | 7f18aa8d37c252578b45ade63b03a6f92df41f8b | |
parent | f6c96af9b8ae4634ebdfebf7972379297c5e5604 (diff) | |
download | pyopenssl-84902a28c657c7f2b0de10192948f8f5c5410c10.tar.gz |
Remove code for checking if EC support is present (#616)
-rw-r--r-- | src/OpenSSL/crypto.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py index b90f0e4..98a7c78 100644 --- a/src/OpenSSL/crypto.py +++ b/src/OpenSSL/crypto.py @@ -357,17 +357,15 @@ class _EllipticCurve(object): :return: A :py:type:`set` of ``cls`` instances giving the names of the elliptic curves the underlying library supports. """ - if lib.Cryptography_HAS_EC: - num_curves = lib.EC_get_builtin_curves(_ffi.NULL, 0) - builtin_curves = _ffi.new('EC_builtin_curve[]', num_curves) - # The return value on this call should be num_curves again. We - # could check it to make sure but if it *isn't* then.. what could - # we do? Abort the whole process, I suppose...? -exarkun - lib.EC_get_builtin_curves(builtin_curves, num_curves) - return set( - cls.from_nid(lib, c.nid) - for c in builtin_curves) - return set() + num_curves = lib.EC_get_builtin_curves(_ffi.NULL, 0) + builtin_curves = _ffi.new('EC_builtin_curve[]', num_curves) + # The return value on this call should be num_curves again. We + # could check it to make sure but if it *isn't* then.. what could + # we do? Abort the whole process, I suppose...? -exarkun + lib.EC_get_builtin_curves(builtin_curves, num_curves) + return set( + cls.from_nid(lib, c.nid) + for c in builtin_curves) @classmethod def _get_elliptic_curves(cls, lib): |