From a2173583d928cc95977f8dbbb7dd48cc732b24f5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 17 Jul 2017 13:10:14 +0200 Subject: add AESGCM AEAD support (#3785) * add AESGCM AEAD support * remove stray newline * move AESGCM docs above CCM --- src/cryptography/hazmat/backends/openssl/aead.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/cryptography/hazmat/backends/openssl/aead.py') diff --git a/src/cryptography/hazmat/backends/openssl/aead.py b/src/cryptography/hazmat/backends/openssl/aead.py index 5402acb3..9cec3e23 100644 --- a/src/cryptography/hazmat/backends/openssl/aead.py +++ b/src/cryptography/hazmat/backends/openssl/aead.py @@ -13,13 +13,15 @@ _DECRYPT = 0 def _aead_cipher_name(cipher): from cryptography.hazmat.primitives.ciphers.aead import ( - AESCCM, ChaCha20Poly1305 + AESCCM, AESGCM, ChaCha20Poly1305 ) if isinstance(cipher, ChaCha20Poly1305): return b"chacha20-poly1305" - else: - assert isinstance(cipher, AESCCM) + elif isinstance(cipher, AESCCM): return "aes-{0}-ccm".format(len(cipher._key) * 8).encode("ascii") + else: + assert isinstance(cipher, AESGCM) + return "aes-{0}-gcm".format(len(cipher._key) * 8).encode("ascii") def _aead_setup(backend, cipher_name, key, nonce, tag, tag_len, operation): -- cgit v1.2.3