diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-05-17 13:19:15 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-06-07 19:04:27 +0100 |
commit | e47bafb9b620b557aeb48fce4734a568d6dc0b38 (patch) | |
tree | 6fe6155fca2d6943f7615ea391e43538d6394c38 /tests/hazmat/backends | |
parent | ddadf40234e97cd5b7e5f7b3a3a03d38900cb291 (diff) | |
download | cryptography-e47bafb9b620b557aeb48fce4734a568d6dc0b38.tar.gz cryptography-e47bafb9b620b557aeb48fce4734a568d6dc0b38.tar.bz2 cryptography-e47bafb9b620b557aeb48fce4734a568d6dc0b38.zip |
ECDSA backend
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index bfcdf14a..aa2122fb 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -19,7 +19,9 @@ import pytest from cryptography import utils from cryptography.exceptions import InternalError, _Reasons -from cryptography.hazmat.backends.openssl.backend import Backend, backend +from cryptography.hazmat.backends.openssl.backend import ( + Backend, backend +) from cryptography.hazmat.primitives import hashes, interfaces from cryptography.hazmat.primitives.asymmetric import dsa, padding, rsa from cryptography.hazmat.primitives.ciphers import Cipher @@ -445,3 +447,22 @@ class TestOpenSSLSerialisationWithOpenSSL(object): key = pretend.stub(type="unsupported") with raises_unsupported_algorithm(None): backend._evp_pkey_to_private_key(key) + + +class TestOpenSSLNoEllipticCurve(object): + def test_elliptic_curve_supported(self, monkeypatch): + monkeypatch.setattr(backend._lib, "Cryptography_HAS_EC", 0) + + assert backend.elliptic_curve_supported(None) is False + + def test_elliptic_curve_signature_algorithm_supported(self, monkeypatch): + monkeypatch.setattr(backend._lib, "Cryptography_HAS_EC", 0) + + assert backend.elliptic_curve_signature_algorithm_supported( + None, None + ) is False + + def test_supported_curves(self, monkeypatch): + monkeypatch.setattr(backend._lib, "Cryptography_HAS_EC", 0) + + assert backend._supported_curves() == [] |