diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-08-01 12:28:59 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-08-01 12:28:59 +0200 |
commit | 8b6981c6ebf8286eb690764aaa8165a7a398c8da (patch) | |
tree | 312297eb7801da246f1b7494bdeec3198e0df63a | |
parent | 0f34c0ab3ed0ce3c98dc4d835c7897e8d533f7e6 (diff) |
fixed otr jingle file size reporting
3 files changed, 2 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java index 3ecf584cb..87e494af2 100644 --- a/src/main/java/de/pixart/messenger/Config.java +++ b/src/main/java/de/pixart/messenger/Config.java @@ -105,8 +105,6 @@ public final class Config { public static final boolean ENCRYPT_ON_HTTP_UPLOADED = false; - public static final boolean REPORT_WRONG_FILESIZE_IN_OTR_JINGLE = true; - public static final boolean X509_VERIFICATION = false; //use x509 certificates to verify OMEMO keys public static final boolean IGNORE_ID_REWRITE_IN_MUC = true; diff --git a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java index 9232b2d7e..8fd7dc814 100644 --- a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java +++ b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java @@ -99,8 +99,7 @@ public class AbstractConnectionManager { Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(file.getKey(), "AES"), ips); Log.d(Config.LOGTAG, "opening encrypted input stream"); - final int s = Config.REPORT_WRONG_FILESIZE_IN_OTR_JINGLE ? size : (size / 16 + 1) * 16; - return new Pair<InputStream, Integer>(new CipherInputStream(is, cipher), s); + return new Pair<InputStream, Integer>(new CipherInputStream(is, cipher), (size / 16 + 1) * 16); } } catch (InvalidKeyException e) { return null; diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java index bf92a2c30..2f8d66306 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java @@ -463,11 +463,7 @@ public class JingleConnection implements Transferable { } } this.mFileOutputStream = AbstractConnectionManager.createOutputStream(this.file, message.getEncryption() == Message.ENCRYPTION_AXOLOTL); - if (message.getEncryption() == Message.ENCRYPTION_OTR && Config.REPORT_WRONG_FILESIZE_IN_OTR_JINGLE) { - this.file.setExpectedSize((size / 16 + 1) * 16); - } else { - this.file.setExpectedSize(size); - } + this.file.setExpectedSize(size); Log.d(Config.LOGTAG, "receiving file: expecting size of " + this.file.getExpectedSize()); } else { this.sendCancel(); |