aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-04 12:53:18 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-04 12:53:18 +0200
commit219d5f113bf809b2e5929256d4a9812a4aa21f8c (patch)
treeb168bab27e25fd934b56090e331f157665c2db65 /src/main/java/de
parenta1a0892d3586e2c1e67ff895f6c739282907c836 (diff)
use 12 byte IV for omemo and http upload
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java2
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java b/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java
index f9b2539c3..1f7df2bba 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/XmppAxolotlMessage.java
@@ -165,7 +165,7 @@ public class XmppAxolotlMessage {
private static byte[] generateIv() {
SecureRandom random = new SecureRandom();
- byte[] iv = new byte[16];
+ byte[] iv = new byte[12];
random.nextBytes(iv);
return iv;
}
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index eee8b3c01..16caecd08 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -5,7 +5,6 @@ import android.util.Log;
import android.util.Pair;
import java.io.FileNotFoundException;
-import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
@@ -110,7 +109,7 @@ public class HttpUploadConnection implements Transferable {
if (Config.ENCRYPT_ON_HTTP_UPLOADED
|| message.getEncryption() == Message.ENCRYPTION_AXOLOTL
|| message.getEncryption() == Message.ENCRYPTION_OTR) {
- this.key = new byte[48]; // todo: change this to 44 for 12-byte IV instead of 16-byte at some point in future
+ this.key = new byte[44];
mXmppConnectionService.getRNG().nextBytes(this.key);
this.file.setKeyAndIv(this.key);
}