diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-03-16 19:54:33 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-03-16 19:54:33 +0100 |
commit | b2cc1724232de226eff3cb6cc4d0841ffc8ec501 (patch) | |
tree | b79f5c5899cfeb9f5002fe1268b11eb8bfc1add4 /src/main/java/de/pixart/messenger/http/HttpUploadConnection.java | |
parent | e64a7c7a450fae669d5d426668180632a2659c06 (diff) |
explicitly use BouncyCastle for file crypto
Diffstat (limited to 'src/main/java/de/pixart/messenger/http/HttpUploadConnection.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpUploadConnection.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java index 4eedfcf3f..2293cb7ea 100644 --- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java @@ -106,11 +106,12 @@ public class HttpUploadConnection implements Transferable { } else { this.mime = this.file.getMimeType(); } + final long originalFileSize = file.getSize(); this.delayed = delay; if (Config.ENCRYPT_ON_HTTP_UPLOADED || message.getEncryption() == Message.ENCRYPTION_AXOLOTL || message.getEncryption() == Message.ENCRYPTION_OTR) { - this.key = new byte[48]; + this.key = new byte[44]; mXmppConnectionService.getRNG().nextBytes(this.key); this.file.setKeyAndIv(this.key); } @@ -129,7 +130,7 @@ public class HttpUploadConnection implements Transferable { md5 = null; } - this.file.setExpectedSize(file.getSize() + (file.getKey() != null ? 16 : 0)); + this.file.setExpectedSize(originalFileSize + (file.getKey() != null ? 16 : 0)); message.resetFileParams(); this.mSlotRequester.request(method, account, file, mime, md5, new SlotRequester.OnSlotRequested() { @Override |