aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_dsa.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-11-27 10:40:12 -1000
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-11-27 10:43:49 -1000
commitaa7dacaf53e150d9d6e58224c46b88214f2957df (patch)
tree90b716eda89e7f94d65add0bceeb4e38011da3ee /tests/hazmat/primitives/test_dsa.py
parent65d054d1a9b8b122096d7994fc2fe675c06f423f (diff)
downloadcryptography-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.py9
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":