Example #1
0
 def create_symmetric_decryption_ctx(self, cipher, mode):
     if (isinstance(mode, CTR) and isinstance(cipher, AES)
             and not self._evp_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)
Example #2
0
 def create_symmetric_decryption_ctx(self, cipher, mode):
     if (isinstance(mode, CTR) and isinstance(cipher, AES)
             and not self._evp_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)