aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat/primitives/hmac.py
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-03-26 20:26:49 +0000
committerAlex Stapleton <alexs@prol.etari.at>2014-03-27 12:53:55 +0000
commit4c1401a3745af97fcd398ff5b7f0dcb94f5292a0 (patch)
tree5e9a953a04398bea99b95e07044eb917c28f56b3 /cryptography/hazmat/primitives/hmac.py
parentf33ccfcc8e611359a65235d72423fc9c62b438da (diff)
downloadcryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.gz
cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.bz2
cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.zip
Update tests and raise sites
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r--cryptography/hazmat/primitives/hmac.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py
index 3dfabef3..afbb2f75 100644
--- a/cryptography/hazmat/primitives/hmac.py
+++ b/cryptography/hazmat/primitives/hmac.py
@@ -17,7 +17,7 @@ import six
from cryptography import utils
from cryptography.exceptions import (
- AlreadyFinalized, InvalidSignature, UnsupportedAlgorithm
+ AlreadyFinalized, InvalidSignature, UnsupportedAlgorithm, _Reasons
)
from cryptography.hazmat.backends.interfaces import HMACBackend
from cryptography.hazmat.primitives import constant_time, interfaces
@@ -28,7 +28,9 @@ class HMAC(object):
def __init__(self, key, algorithm, backend, ctx=None):
if not isinstance(backend, HMACBackend):
raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend")
+ "Backend object does not implement HMACBackend",
+ _Reasons.BACKEND_MISSING_INTERFACE
+ )
if not isinstance(algorithm, interfaces.HashAlgorithm):
raise TypeError("Expected instance of interfaces.HashAlgorithm.")