From 76a91fca2fc7dd5975e8ff0e6695f27c98539dba Mon Sep 17 00:00:00 2001 From: hrxi Date: Fri, 24 Nov 2023 20:53:50 +0100 Subject: Add support for OpenSSL Uses work by @hrxi in https://github.com/dino/dino/pull/1515 Co-Authored-By: hrxi --- plugins/omemo/src/file_transfer/file_decryptor.vala | 2 +- plugins/omemo/src/file_transfer/file_encryptor.vala | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/omemo/src/file_transfer') diff --git a/plugins/omemo/src/file_transfer/file_decryptor.vala b/plugins/omemo/src/file_transfer/file_decryptor.vala index 80303789..ff96b4a3 100644 --- a/plugins/omemo/src/file_transfer/file_decryptor.vala +++ b/plugins/omemo/src/file_transfer/file_decryptor.vala @@ -59,7 +59,7 @@ public class OmemoFileDecryptor : FileDecryptor, Object { file_transfer.encryption = Encryption.OMEMO; debug("Decrypting file %s from %s", file_transfer.file_name, file_transfer.server_file_name); - SymmetricCipher cipher = new SymmetricCipher("AES-GCM"); + SymmetricCipherDecryption cipher = create_symmetric_cipher_decryption("AES-GCM"); cipher.set_key(key); cipher.set_iv(iv); return new ConverterInputStream(encrypted_stream, new SymmetricCipherDecrypter((owned) cipher, 16)); diff --git a/plugins/omemo/src/file_transfer/file_encryptor.vala b/plugins/omemo/src/file_transfer/file_encryptor.vala index 58be7ef1..1aed752f 100644 --- a/plugins/omemo/src/file_transfer/file_encryptor.vala +++ b/plugins/omemo/src/file_transfer/file_encryptor.vala @@ -27,11 +27,11 @@ public class OmemoFileEncryptor : Dino.FileEncryptor, Object { try { //Create a key and use it to encrypt the file uint8[] iv = new uint8[IV_SIZE]; - Plugin.get_context().randomize(iv); + Crypto.randomize(iv); uint8[] key = new uint8[KEY_SIZE]; - Plugin.get_context().randomize(key); + Crypto.randomize(key); - SymmetricCipher cipher = new SymmetricCipher("AES-GCM"); + SymmetricCipherEncryption cipher = create_symmetric_cipher_encryption("AES-GCM"); cipher.set_key(key); cipher.set_iv(iv); -- cgit v1.3