mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-08 04:52:20 +00:00
collection of fixes based on comments/small aesthetic stuff // FREEBIE
This commit is contained in:
@@ -103,11 +103,11 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||
try {
|
||||
int flourish = cipher.doFinal(buffer, offset);
|
||||
// mac.update(buffer, offset, flourish);
|
||||
|
||||
|
||||
byte[] ourMac = mac.doFinal();
|
||||
byte[] theirMac = new byte[mac.getMacLength()];
|
||||
readFully(theirMac);
|
||||
|
||||
|
||||
if (!Arrays.equals(ourMac, theirMac))
|
||||
throw new IOException("MAC doesn't match! Potential tampering?");
|
||||
|
||||
@@ -175,7 +175,7 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||
return readLength;
|
||||
} catch (ShortBufferException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Mac initializeMac(SecretKeySpec key) throws NoSuchAlgorithmException, InvalidKeyException {
|
||||
@@ -214,6 +214,4 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||
else return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user