diff options
Diffstat (limited to 'src/cryptography')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/cmac.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/hmac.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/cmac.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/hmac.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/interfaces.py | 17 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/mac.py (renamed from src/cryptography/hazmat/primitives/interfaces/__init__.py) | 0 |
6 files changed, 25 insertions, 8 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/cmac.py b/src/cryptography/hazmat/backends/openssl/cmac.py index eaefc276..5919017a 100644 --- a/src/cryptography/hazmat/backends/openssl/cmac.py +++ b/src/cryptography/hazmat/backends/openssl/cmac.py @@ -9,11 +9,11 @@ from cryptography import utils from cryptography.exceptions import ( InvalidSignature, UnsupportedAlgorithm, _Reasons ) -from cryptography.hazmat.primitives import constant_time, interfaces +from cryptography.hazmat.primitives import constant_time, mac from cryptography.hazmat.primitives.ciphers.modes import CBC -@utils.register_interface(interfaces.MACContext) +@utils.register_interface(mac.MACContext) class _CMACContext(object): def __init__(self, backend, algorithm, ctx=None): if not backend.cmac_algorithm_supported(algorithm): diff --git a/src/cryptography/hazmat/backends/openssl/hmac.py b/src/cryptography/hazmat/backends/openssl/hmac.py index dff3742d..ea834204 100644 --- a/src/cryptography/hazmat/backends/openssl/hmac.py +++ b/src/cryptography/hazmat/backends/openssl/hmac.py @@ -9,10 +9,10 @@ from cryptography import utils from cryptography.exceptions import ( InvalidSignature, UnsupportedAlgorithm, _Reasons ) -from cryptography.hazmat.primitives import constant_time, hashes, interfaces +from cryptography.hazmat.primitives import constant_time, hashes, mac -@utils.register_interface(interfaces.MACContext) +@utils.register_interface(mac.MACContext) @utils.register_interface(hashes.HashContext) class _HMACContext(object): def __init__(self, backend, key, algorithm, ctx=None): diff --git a/src/cryptography/hazmat/primitives/cmac.py b/src/cryptography/hazmat/primitives/cmac.py index c2038a30..77537f04 100644 --- a/src/cryptography/hazmat/primitives/cmac.py +++ b/src/cryptography/hazmat/primitives/cmac.py @@ -9,10 +9,10 @@ from cryptography.exceptions import ( AlreadyFinalized, UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import CMACBackend -from cryptography.hazmat.primitives import ciphers, interfaces +from cryptography.hazmat.primitives import ciphers, mac -@utils.register_interface(interfaces.MACContext) +@utils.register_interface(mac.MACContext) class CMAC(object): def __init__(self, algorithm, backend, ctx=None): if not isinstance(backend, CMACBackend): diff --git a/src/cryptography/hazmat/primitives/hmac.py b/src/cryptography/hazmat/primitives/hmac.py index 15b9ee6e..2e9a4e2f 100644 --- a/src/cryptography/hazmat/primitives/hmac.py +++ b/src/cryptography/hazmat/primitives/hmac.py @@ -9,10 +9,10 @@ from cryptography.exceptions import ( AlreadyFinalized, UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives import hashes, interfaces +from cryptography.hazmat.primitives import hashes, mac -@utils.register_interface(interfaces.MACContext) +@utils.register_interface(mac.MACContext) @utils.register_interface(hashes.HashContext) class HMAC(object): def __init__(self, key, algorithm, backend, ctx=None): diff --git a/src/cryptography/hazmat/primitives/interfaces.py b/src/cryptography/hazmat/primitives/interfaces.py new file mode 100644 index 00000000..c9fdb3bf --- /dev/null +++ b/src/cryptography/hazmat/primitives/interfaces.py @@ -0,0 +1,17 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +from __future__ import absolute_import, division, print_function + +from cryptography import utils +from cryptography.hazmat.primitives.mac import MACContext as _MACContext + + +MACContext = utils.deprecated( + _MACContext, + __name__, + "MACContext was moved to cryptography.hazmat.primitives.mac.MACContext " + "in version 1.9.", + utils.DeprecatedIn19 +) diff --git a/src/cryptography/hazmat/primitives/interfaces/__init__.py b/src/cryptography/hazmat/primitives/mac.py index 4c95190b..4c95190b 100644 --- a/src/cryptography/hazmat/primitives/interfaces/__init__.py +++ b/src/cryptography/hazmat/primitives/mac.py |