aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/jingle/jet_omemo.vala
diff options
context:
space:
mode:
authorhrxi <hrrrxi@gmail.com>2023-11-24 20:53:50 +0100
committerMarvin W <git@larma.de>2026-10-23 16:58:30 +0200
commit76a91fca2fc7dd5975e8ff0e6695f27c98539dba (patch)
tree7829340be71fe60ef847247e578c4589571fecc5 /plugins/omemo/src/jingle/jet_omemo.vala
parentb013d28182ce582f229185c23b6011f566f1f8cc (diff)
Add support for OpenSSL
Uses work by @hrxi in https://github.com/dino/dino/pull/1515 Co-Authored-By: hrxi <hrrrxi@gmail.com>
Diffstat (limited to 'plugins/omemo/src/jingle/jet_omemo.vala')
-rw-r--r--plugins/omemo/src/jingle/jet_omemo.vala8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/omemo/src/jingle/jet_omemo.vala b/plugins/omemo/src/jingle/jet_omemo.vala
index 2c364625..b1a27e15 100644
--- a/plugins/omemo/src/jingle/jet_omemo.vala
+++ b/plugins/omemo/src/jingle/jet_omemo.vala
@@ -93,19 +93,19 @@ public class AesGcmCipher : Jet.Cipher, Object {
}
public Jet.TransportSecret generate_random_secret() {
uint8[] iv = new uint8[default_iv_size];
- Omemo.Plugin.get_context().randomize(iv);
+ Crypto.randomize(iv);
uint8[] key = new uint8[key_size];
- Omemo.Plugin.get_context().randomize(key);
+ Crypto.randomize(key);
return new Jet.TransportSecret(key, iv);
}
public InputStream wrap_input_stream(InputStream input, Jet.TransportSecret secret) requires (secret.transport_key.length == key_size) {
- SymmetricCipher cipher = new SymmetricCipher("AES-GCM");
+ SymmetricCipherDecryption cipher = create_symmetric_cipher_decryption("AES-GCM");
cipher.set_key(secret.transport_key);
cipher.set_iv(secret.initialization_vector);
return new ConverterInputStream(input, new SymmetricCipherDecrypter((owned) cipher, 16));
}
public OutputStream wrap_output_stream(OutputStream output, Jet.TransportSecret secret) requires (secret.transport_key.length == key_size) {
- Crypto.SymmetricCipher cipher = new SymmetricCipher("AES-GCM");
+ SymmetricCipherEncryption cipher = create_symmetric_cipher_encryption("AES-GCM");
cipher.set_key(secret.transport_key);
cipher.set_iv(secret.initialization_vector);
return new ConverterOutputStream(output, new SymmetricCipherEncrypter((owned) cipher, 16));