aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-24 11:51:22 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-29 17:19:46 -0600
commita8b35f4a882ddd02fefed69163e9f226eab99ce9 (patch)
tree4ca16a61fbc5e94b30abb59431733fc1190f98df
parent0092c205657789e15848c7848eec768720de468f (diff)
downloadcryptography-a8b35f4a882ddd02fefed69163e9f226eab99ce9.tar.gz
cryptography-a8b35f4a882ddd02fefed69163e9f226eab99ce9.tar.bz2
cryptography-a8b35f4a882ddd02fefed69163e9f226eab99ce9.zip
make _CipherContext in backend.py compliant with AEADCipherContext
* Might make more sense to split it into _CipherContext and _AEADCipherContext like we do in base.py, but there would be quite a bit of duplicate code.
-rw-r--r--cryptography/hazmat/bindings/openssl/backend.py5
-rw-r--r--cryptography/hazmat/primitives/ciphers/base.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index 1a534011..4d9a8ce5 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -237,6 +237,7 @@ class GetCipherByName(object):
@utils.register_interface(interfaces.CipherContext)
+@utils.register_interface(interfaces.AEADCipherContext)
class _CipherContext(object):
_ENCRYPT = 1
_DECRYPT = 0
@@ -343,6 +344,10 @@ class _CipherContext(object):
)
assert res != 0
+ @property
+ def tag(self):
+ return self._tag
+
@utils.register_interface(interfaces.HashContext)
class _HashContext(object):
diff --git a/cryptography/hazmat/primitives/ciphers/base.py b/cryptography/hazmat/primitives/ciphers/base.py
index 252a9feb..a6f06b82 100644
--- a/cryptography/hazmat/primitives/ciphers/base.py
+++ b/cryptography/hazmat/primitives/ciphers/base.py
@@ -85,7 +85,7 @@ class _AEADCipherContext(object):
if self._ctx is None:
raise AlreadyFinalized("Context was already finalized")
data = self._ctx.finalize()
- self._tag = self._ctx._tag
+ self._tag = self._ctx.tag
self._ctx = None
return data