Fix OMEMO file transfer GCM tag
This commit is contained in:
parent
0082d376af
commit
388cc56674
|
@ -63,7 +63,7 @@ public class OmemoFileDecryptor : FileDecryptor, Object {
|
||||||
SymmetricCipher cipher = new SymmetricCipher("AES-GCM");
|
SymmetricCipher cipher = new SymmetricCipher("AES-GCM");
|
||||||
cipher.set_key(key);
|
cipher.set_key(key);
|
||||||
cipher.set_iv(iv);
|
cipher.set_iv(iv);
|
||||||
return new ConverterInputStream(encrypted_stream, new SymmetricCipherDecrypter((owned) cipher));
|
return new ConverterInputStream(encrypted_stream, new SymmetricCipherDecrypter((owned) cipher, 16));
|
||||||
|
|
||||||
} catch (Crypto.Error e) {
|
} catch (Crypto.Error e) {
|
||||||
throw new FileReceiveError.DECRYPTION_FAILED("OMEMO file decryption error: %s".printf(e.message));
|
throw new FileReceiveError.DECRYPTION_FAILED("OMEMO file decryption error: %s".printf(e.message));
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class OmemoFileEncryptor : Dino.FileEncryptor, Object {
|
||||||
omemo_http_file_meta.key = key;
|
omemo_http_file_meta.key = key;
|
||||||
omemo_http_file_meta.size = file_transfer.size + 16;
|
omemo_http_file_meta.size = file_transfer.size + 16;
|
||||||
omemo_http_file_meta.mime_type = "omemo";
|
omemo_http_file_meta.mime_type = "omemo";
|
||||||
file_transfer.input_stream = new ConverterInputStream(file_transfer.input_stream, new SymmetricCipherEncrypter((owned) cipher));
|
file_transfer.input_stream = new ConverterInputStream(file_transfer.input_stream, new SymmetricCipherEncrypter((owned) cipher, 16));
|
||||||
} catch (Crypto.Error error) {
|
} catch (Crypto.Error error) {
|
||||||
throw new FileSendError.ENCRYPTION_FAILED("OMEMO file encryption error: %s".printf(error.message));
|
throw new FileSendError.ENCRYPTION_FAILED("OMEMO file encryption error: %s".printf(error.message));
|
||||||
} catch (GLib.Error error) {
|
} catch (GLib.Error error) {
|
||||||
|
|
Loading…
Reference in a new issue