diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-23 07:08:50 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-23 07:08:50 -0400 |
commit | d59996ba409e15364abf70e29e8c138ad39eea04 (patch) | |
tree | 3747182affec9eee4a43498af6ddc2c6923e803c /tests | |
parent | c952fb18053afc59104e05ea0e35c85460402d59 (diff) | |
parent | 370c4da9fe2662d07152a4b78bc09ae45f34decb (diff) | |
download | cryptography-d59996ba409e15364abf70e29e8c138ad39eea04.tar.gz cryptography-d59996ba409e15364abf70e29e8c138ad39eea04.tar.bz2 cryptography-d59996ba409e15364abf70e29e8c138ad39eea04.zip |
Merge pull request #2057 from reaperhulk/i-are-dumb
fix ec_cdata_to_evp_pkey bug
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_ec.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 82b5b3a1..cc185145 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -642,6 +642,24 @@ class TestECSerialization(object): DummyKeyEncryption() ) + def test_public_bytes_from_derived_public_key(self, backend): + _skip_curve_unsupported(backend, ec.SECP256R1()) + key = load_vectors_from_file( + os.path.join( + "asymmetric", "PKCS8", "ec_private_key.pem"), + lambda pemfile: serialization.load_pem_private_key( + pemfile.read().encode(), None, backend + ) + ) + _skip_if_no_serialization(key, backend) + public = key.public_key() + pem = public.public_bytes( + serialization.Encoding.PEM, + serialization.PublicFormat.SubjectPublicKeyInfo + ) + parsed_public = serialization.load_pem_public_key(pem, backend) + assert parsed_public + @pytest.mark.requires_backend_interface(interface=EllipticCurveBackend) @pytest.mark.requires_backend_interface(interface=PEMSerializationBackend) |