mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-05 15:27:18 +00:00
Fix OMEMO file transfer GCM tag
This commit is contained in:
parent
0082d376af
commit
388cc56674
2 changed files with 2 additions and 2 deletions
|
@ -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