From 9e233139790599a3d779330bb351ba1da984ae60 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 21 May 2014 10:17:57 -0500 Subject: add some comments to explain the existence of AESCTRCipherContext --- cryptography/hazmat/backends/openssl/backend.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 7b0e50d3..d9165492 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -208,6 +208,9 @@ class Backend(object): def create_symmetric_encryption_ctx(self, cipher, mode): if (isinstance(mode, CTR) and isinstance(cipher, AES) and not self._cipher_supported(cipher, mode)): + # This is needed to provide support for AES CTR mode in OpenSSL + # 0.9.8. It can be removed when we drop 0.9.8 support (RHEL 5 + # extended life ends 2020). return _AESCTRCipherContext(self, cipher, mode) else: return _CipherContext(self, cipher, mode, _CipherContext._ENCRYPT) @@ -215,6 +218,9 @@ class Backend(object): def create_symmetric_decryption_ctx(self, cipher, mode): if (isinstance(mode, CTR) and isinstance(cipher, AES) and not self._cipher_supported(cipher, mode)): + # This is needed to provide support for AES CTR mode in OpenSSL + # 0.9.8. It can be removed when we drop 0.9.8 support (RHEL 5 + # extended life ends 2020). return _AESCTRCipherContext(self, cipher, mode) else: return _CipherContext(self, cipher, mode, _CipherContext._DECRYPT) @@ -850,6 +856,8 @@ class _CipherContext(object): return self._tag +# This is needed to provide support for AES CTR mode in OpenSSL 0.9.8. It can +# be removed when we drop 0.9.8 support (RHEL5 extended life ends 2020). @utils.register_interface(interfaces.CipherContext) class _AESCTRCipherContext(object): def __init__(self, backend, cipher, mode): -- cgit v1.2.3