aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_serialization.py
diff options
context:
space:
mode:
authorMichael <mrh2@MRH2W7D.uk.cambridgeconsultants.com>2014-09-12 16:19:39 +0100
committerMichael <mrh2@MRH2W7D.uk.cambridgeconsultants.com>2014-09-12 16:19:39 +0100
commit909f8222a5ee23c558876a783741e38b3027f59d (patch)
tree7ae83a7df4877826547ff17126bb6869144f7a87 /tests/hazmat/primitives/test_serialization.py
parentf0ec609bd18c050b270d87d26e454b073b67a76e (diff)
downloadcryptography-909f8222a5ee23c558876a783741e38b3027f59d.tar.gz
cryptography-909f8222a5ee23c558876a783741e38b3027f59d.tar.bz2
cryptography-909f8222a5ee23c558876a783741e38b3027f59d.zip
Changed EC curve type and add test markers
Changed the Elliptic Curve curve type from secp256k1 to secp256r1, as this is supported, in an attempt to pass tests on CentOS 7; also added markers and methods to skip test functions for systems that do not support ECC.
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r--tests/hazmat/primitives/test_serialization.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index 77d748b3..cbcc772d 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -25,6 +25,10 @@ from cryptography.hazmat.primitives.serialization import (
load_pem_pkcs8_private_key, load_pem_private_key,
load_pem_traditional_openssl_private_key
)
+from tests.hazmat.primitives.test_ec import (
+ _skip_curve_unsupported
+)
+from cryptography.hazmat.primitives.asymmetric import ec
from .utils import _check_rsa_private_numbers, load_vectors_from_file
from ...utils import raises_unsupported_algorithm
@@ -46,7 +50,9 @@ class TestPEMSerialization(object):
if isinstance(key, interfaces.RSAPrivateKeyWithNumbers):
_check_rsa_private_numbers(key.private_numbers())
+ @pytest.mark.elliptic
def test_load_pem_ec_private_key_unencrypted(self, backend):
+ _skip_curve_unsupported(backend, ec.SECP256R1())
key = load_vectors_from_file(
os.path.join(
"asymmetric", "PEM_Serialization", "ec_private_key.pem"),
@@ -58,7 +64,9 @@ class TestPEMSerialization(object):
assert key
assert isinstance(key, interfaces.EllipticCurvePrivateKey)
+ @pytest.mark.elliptic
def test_load_pem_ec_private_key_encrypted(self, backend):
+ _skip_curve_unsupported(backend, ec.SECP256R1())
key = load_vectors_from_file(
os.path.join(
"asymmetric", "PEM_Serialization",