diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-10-19 08:26:27 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-10-19 08:26:27 -0400 |
commit | 7a40209a64c800be1b964a0eded2ab1f40accf50 (patch) | |
tree | 4d8c1fbf39eb98d5c67e63ffb202187a24057e52 /tests/hazmat/primitives | |
parent | aaf4e8bccd9cac827b5f740371feaa7faeebcb93 (diff) | |
download | cryptography-7a40209a64c800be1b964a0eded2ab1f40accf50.tar.gz cryptography-7a40209a64c800be1b964a0eded2ab1f40accf50.tar.bz2 cryptography-7a40209a64c800be1b964a0eded2ab1f40accf50.zip |
better place for this test
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_ec.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 6c184522..4c4d5b90 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -828,3 +828,19 @@ class TestECDHVectors(object): assert z != vector['Z'] else: assert z == vector['Z'] + + def test_exchange_unsupported_algorithm(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 + ) + ) + + with raises_unsupported_algorithm( + exceptions._Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM + ): + key.exchange(None, key.public_key()) |