diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-11-27 10:40:12 -1000 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-11-27 10:43:49 -1000 |
commit | aa7dacaf53e150d9d6e58224c46b88214f2957df (patch) | |
tree | 90b716eda89e7f94d65add0bceeb4e38011da3ee /tests/hazmat/primitives/test_dsa.py | |
parent | 65d054d1a9b8b122096d7994fc2fe675c06f423f (diff) | |
download | cryptography-aa7dacaf53e150d9d6e58224c46b88214f2957df.tar.gz cryptography-aa7dacaf53e150d9d6e58224c46b88214f2957df.tar.bz2 cryptography-aa7dacaf53e150d9d6e58224c46b88214f2957df.zip |
add encode_rfc6979_signature and refactor tests to use it
Diffstat (limited to 'tests/hazmat/primitives/test_dsa.py')
-rw-r--r-- | tests/hazmat/primitives/test_dsa.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py index 6411b7f9..f818f73b 100644 --- a/tests/hazmat/primitives/test_dsa.py +++ b/tests/hazmat/primitives/test_dsa.py @@ -12,14 +12,17 @@ from cryptography.exceptions import AlreadyFinalized, InvalidSignature from cryptography.hazmat.backends.interfaces import DSABackend from cryptography.hazmat.primitives import hashes, interfaces from cryptography.hazmat.primitives.asymmetric import dsa +from cryptography.hazmat.primitives.asymmetric.utils import ( + encode_rfc6979_signature +) from cryptography.utils import bit_length from .fixtures_dsa import ( DSA_KEY_1024, DSA_KEY_2048, DSA_KEY_3072 ) from ...utils import ( - der_encode_dsa_signature, load_fips_dsa_key_pair_vectors, - load_fips_dsa_sig_vectors, load_vectors_from_file, + load_fips_dsa_key_pair_vectors, load_fips_dsa_sig_vectors, + load_vectors_from_file, ) @@ -557,7 +560,7 @@ class TestDSAVerification(object): ), y=vector['y'] ).public_key(backend) - sig = der_encode_dsa_signature(vector['r'], vector['s']) + sig = encode_rfc6979_signature(vector['r'], vector['s']) verifier = public_key.verifier(sig, algorithm()) verifier.update(vector['msg']) if vector['result'] == "F": |