diff --git a/sat/plugins/plugin_sec_aesgcm.py b/sat/plugins/plugin_sec_aesgcm.py index e4171e07..0ea9c0e0 100644 --- a/sat/plugins/plugin_sec_aesgcm.py +++ b/sat/plugins/plugin_sec_aesgcm.py @@ -170,13 +170,7 @@ class AESGCM(object): if options.get('encryption') != C.ENC_AES_GCM: return True log.debug("encrypting file with AES-GCM") - # specification talks about 12 bytes IV, but in practice and for legacy reasons - # 16 bytes are used by most clients (and also in the specification example). - # It seems that some clients don't handle 12 bytes IV (apparently, - # that's the case for ChatSecure). - # So we have to follow the de-facto standard and use 16 bytes to be sure - # to be compatible with a maximum of clients. - iv = secrets.token_bytes(16) + iv = secrets.token_bytes(12) key = secrets.token_bytes(32) fragment = f'{iv.hex()}{key.hex()}' ori_url = parse.urlparse(slot.get)