mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
parent
b7badec752
commit
0b62cf372b
@ -100,7 +100,7 @@ public class DecryptingPartInputStream extends FileInputStream {
|
|||||||
private int readFinal(byte[] buffer, int offset, int length) throws IOException {
|
private int readFinal(byte[] buffer, int offset, int length) throws IOException {
|
||||||
try {
|
try {
|
||||||
int flourish = cipher.doFinal(buffer, offset);
|
int flourish = cipher.doFinal(buffer, offset);
|
||||||
// mac.update(buffer, offset, flourish);
|
//mac.update(buffer, offset, flourish);
|
||||||
|
|
||||||
byte[] ourMac = mac.doFinal();
|
byte[] ourMac = mac.doFinal();
|
||||||
byte[] theirMac = new byte[mac.getMacLength()];
|
byte[] theirMac = new byte[mac.getMacLength()];
|
||||||
@ -185,7 +185,7 @@ public class DecryptingPartInputStream extends FileInputStream {
|
|||||||
|
|
||||||
private Cipher initializeCipher(SecretKeySpec key)
|
private Cipher initializeCipher(SecretKeySpec key)
|
||||||
throws InvalidKeyException, InvalidAlgorithmParameterException,
|
throws InvalidKeyException, InvalidAlgorithmParameterException,
|
||||||
NoSuchAlgorithmException, NoSuchPaddingException, IOException
|
NoSuchAlgorithmException, NoSuchPaddingException, IOException
|
||||||
{
|
{
|
||||||
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
||||||
IvParameterSpec iv = readIv(cipher.getBlockSize());
|
IvParameterSpec iv = readIv(cipher.getBlockSize());
|
||||||
@ -209,7 +209,7 @@ public class DecryptingPartInputStream extends FileInputStream {
|
|||||||
int read = super.read(buffer, offset, buffer.length-offset);
|
int read = super.read(buffer, offset, buffer.length-offset);
|
||||||
|
|
||||||
if (read + offset < buffer.length) offset += read;
|
if (read + offset < buffer.length) offset += read;
|
||||||
else return;
|
else return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user