clean up loader and make docs default to hmac sha256
diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst
index 993e317..47b8803 100644
--- a/docs/hazmat/primitives/hmac.rst
+++ b/docs/hazmat/primitives/hmac.rst
@@ -27,7 +27,7 @@
.. 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 25291d5..ad676c0 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -127,7 +127,9 @@
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 @@
# 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