diff options
Diffstat (limited to 'pskc/mac.py')
-rw-r--r-- | pskc/mac.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/pskc/mac.py b/pskc/mac.py index c5ac1ec..b051eb8 100644 --- a/pskc/mac.py +++ b/pskc/mac.py @@ -55,8 +55,6 @@ def get_hmac(algorithm): def get_mac(algorithm, key, value): """Generate the MAC value over the specified value.""" from pskc.exceptions import DecryptionError - if key is None: - raise DecryptionError('No MAC key available') if algorithm is None: raise DecryptionError('No MAC algorithm set') hmacfn = get_hmac(algorithm) @@ -124,17 +122,6 @@ class MAC(object): """Generate the MAC over the specified value.""" return get_mac(self.algorithm, self.key, value) - def check_value(self, value, value_mac): - """Check if the provided value matches the MAC. - - This will return None if there is no MAC to be checked. It will - return True if the MAC matches and raise an exception if it fails. - """ - from pskc.exceptions import DecryptionError - if self.generate_mac(value) != value_mac: - raise DecryptionError('MAC value does not match') - return True - def setup(self, key=None, algorithm=None): """Configure an encrypted MAC key. |