plugin aesgcm: use 12 bytes Initialisation Vector:
SàT was using 16 bytes IV when sending files withr AES-GCM, due to ChatSecure being only compatible with that. Monal, an other iOS client is only compatible with 12 bytes IV, and ChatSecure has fixed its code to also handle 12 bytes IV, so there is not reason anymore to use 16 bytes, and SàT now uses 12 bytes.
This commit is contained in:
parent
3d8ef1d625
commit
74a60a2e5b
1 changed files with 1 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue