aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-04-05 23:35:38 +0200
committerlookshe <github@lookshe.org>2016-04-05 23:35:38 +0200
commit0beb3ca30b31f07e374b870e6a659256f6960170 (patch)
tree82a389561691afa508433d338e3f87aa6c8a5c7b /src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java
parent6899b9b01e416da95b9006d9f23bf1e1214f607d (diff)
parentd6a076e11281d4c3fb6b9504fe99d799b04ebbbb (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java
index 424d0301..101475c3 100644
--- a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java
+++ b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java
@@ -52,20 +52,16 @@ public class DownloadableFile extends File {
public void setKeyAndIv(byte[] keyIvCombo) {
if (keyIvCombo.length == 48) {
- byte[] secretKey = new byte[32];
- byte[] iv = new byte[16];
- System.arraycopy(keyIvCombo, 0, iv, 0, 16);
- System.arraycopy(keyIvCombo, 16, secretKey, 0, 32);
- this.aeskey = secretKey;
- this.iv = iv;
+ this.aeskey = new byte[32];
+ this.iv = new byte[16];
+ System.arraycopy(keyIvCombo, 0, this.iv, 0, 16);
+ System.arraycopy(keyIvCombo, 16, this.aeskey, 0, 32);
} else if (keyIvCombo.length >= 32) {
- byte[] secretKey = new byte[32];
- System.arraycopy(keyIvCombo, 0, secretKey, 0, 32);
- this.aeskey = secretKey;
+ this.aeskey = new byte[32];
+ System.arraycopy(keyIvCombo, 0, aeskey, 0, 32);
} else if (keyIvCombo.length >= 16) {
- byte[] secretKey = new byte[16];
- System.arraycopy(keyIvCombo, 0, secretKey, 0, 16);
- this.aeskey = secretKey;
+ this.aeskey = new byte[16];
+ System.arraycopy(keyIvCombo, 0, this.aeskey, 0, 16);
}
}