aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat/primitives/hmac.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-25 17:46:32 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-25 17:46:32 -0700
commit4d05537fa5e6c3a3f38b9027deeaf8e799a3a415 (patch)
tree37df174a6eb72a3cb6078a35b65c6a0162b87791 /cryptography/hazmat/primitives/hmac.py
parentd1f0c6621036bfb801066b2c34fe5bff6f234388 (diff)
parentbf148d2e11e3fbf95ce6213eb3722a4911a3f4ff (diff)
downloadcryptography-4d05537fa5e6c3a3f38b9027deeaf8e799a3a415.tar.gz
cryptography-4d05537fa5e6c3a3f38b9027deeaf8e799a3a415.tar.bz2
cryptography-4d05537fa5e6c3a3f38b9027deeaf8e799a3a415.zip
Merge pull request #1444 from alex/attributes-as-properties
Expose all attributes via properties so they can be statically introspected
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r--cryptography/hazmat/primitives/hmac.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py
index b85fb2aa..22a31391 100644
--- a/cryptography/hazmat/primitives/hmac.py
+++ b/cryptography/hazmat/primitives/hmac.py
@@ -33,7 +33,7 @@ class HMAC(object):
if not isinstance(algorithm, interfaces.HashAlgorithm):
raise TypeError("Expected instance of interfaces.HashAlgorithm.")
- self.algorithm = algorithm
+ self._algorithm = algorithm
self._backend = backend
self._key = key
@@ -42,6 +42,8 @@ class HMAC(object):
else:
self._ctx = ctx
+ algorithm = utils.read_only_property("_algorithm")
+
def update(self, data):
if self._ctx is None:
raise AlreadyFinalized("Context was already finalized.")