diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-27 17:00:14 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-28 17:34:37 -0500 |
commit | 1bb8b710d444012b7218a08f098a85c4a31ca1bc (patch) | |
tree | 91a5e8c1287b56d43ea3daa4f84af318f42994f8 | |
parent | 00dd509f180b6229cfd4b913274a94df3bc05a00 (diff) | |
download | cryptography-1bb8b710d444012b7218a08f098a85c4a31ca1bc.tar.gz cryptography-1bb8b710d444012b7218a08f098a85c4a31ca1bc.tar.bz2 cryptography-1bb8b710d444012b7218a08f098a85c4a31ca1bc.zip |
clean up loader and make docs default to hmac sha256
-rw-r--r-- | docs/hazmat/primitives/hmac.rst | 2 | ||||
-rw-r--r-- | tests/utils.py | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst index 993e3179..47b88030 100644 --- a/docs/hazmat/primitives/hmac.rst +++ b/docs/hazmat/primitives/hmac.rst @@ -27,7 +27,7 @@ message. .. doctest:: >>> from cryptography.primitives import hashes, hmac - >>> h = hmac.HMAC(key, hashes.SHA1) + >>> h = hmac.HMAC(key, hashes.SHA256) >>> h.update(b"message to hash") >>> h.hexdigest() '...' diff --git a/tests/utils.py b/tests/utils.py index 25291d55..ad676c04 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -127,7 +127,9 @@ def load_openssl_vectors(vector_data): def load_hash_vectors(vector_data): vectors = [] - key, msg, md = None, None, None + key = None + msg = None + md = None for line in vector_data: line = line.strip() @@ -154,8 +156,13 @@ def load_hash_vectors(vector_data): # after MD is found the Msg+MD (+ potential key) tuple is complete if key is not None: vectors.append((msg, md, key)) + key = None + msg = None + md = None else: vectors.append((msg, md)) + msg = None + md = None else: raise ValueError("Unknown line in hash vector") return vectors |