diff options
author | Donald Stufft <donald@stufft.io> | 2014-05-17 15:59:16 -0400 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2014-05-17 15:59:16 -0400 |
commit | b6d8f7b95f4db772794a4f908a2156e34edd8332 (patch) | |
tree | f15f52d1403f158c26ff0951748e98f9c0781192 /cryptography/hazmat/primitives/hmac.py | |
parent | a741aad3bd7d6347b9816025cb4905558c2c71c6 (diff) | |
parent | 3b39ae4fc80020bba3d0c2888aa9c250b46e7071 (diff) | |
download | cryptography-b6d8f7b95f4db772794a4f908a2156e34edd8332.tar.gz cryptography-b6d8f7b95f4db772794a4f908a2156e34edd8332.tar.bz2 cryptography-b6d8f7b95f4db772794a4f908a2156e34edd8332.zip |
Merge pull request #1051 from alex/bytes-is-bytes
We don't need six.binary_type, it's always bytes
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r-- | cryptography/hazmat/primitives/hmac.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py index 5d7bad59..0f89df94 100644 --- a/cryptography/hazmat/primitives/hmac.py +++ b/cryptography/hazmat/primitives/hmac.py @@ -13,8 +13,6 @@ from __future__ import absolute_import, division, print_function -import six - from cryptography import utils from cryptography.exceptions import ( AlreadyFinalized, InvalidSignature, UnsupportedAlgorithm, _Reasons @@ -46,7 +44,7 @@ class HMAC(object): def update(self, msg): if self._ctx is None: raise AlreadyFinalized("Context was already finalized") - if not isinstance(msg, six.binary_type): + if not isinstance(msg, bytes): raise TypeError("msg must be bytes") self._ctx.update(msg) @@ -68,7 +66,7 @@ class HMAC(object): return digest def verify(self, signature): - if not isinstance(signature, six.binary_type): + if not isinstance(signature, bytes): raise TypeError("signature must be bytes") digest = self.finalize() if not constant_time.bytes_eq(digest, signature): |