mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Minor cleanup.
// FREEBIE
This commit is contained in:
parent
e16735bbbd
commit
485e8455bd
@ -45,6 +45,8 @@ import android.util.Log;
|
||||
|
||||
public class DecryptingPartInputStream extends FileInputStream {
|
||||
|
||||
private static final String TAG = DecryptingPartInputStream.class.getSimpleName();
|
||||
|
||||
private static final int IV_LENGTH = 16;
|
||||
private static final int MAC_LENGTH = 20;
|
||||
|
||||
@ -68,16 +70,12 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||
totalDataSize = file.length() - cipher.getBlockSize() - mac.getMacLength();
|
||||
totalRead = 0;
|
||||
} catch (InvalidKeyException ike) {
|
||||
Log.w("EncryptingPartInputStream", ike);
|
||||
Log.w(TAG, ike);
|
||||
throw new FileNotFoundException("Invalid key!");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new AssertionError(e);
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
throw new AssertionError(e);
|
||||
} catch (NoSuchPaddingException e) {
|
||||
} catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | NoSuchPaddingException e) {
|
||||
throw new AssertionError(e);
|
||||
} catch (IOException e) {
|
||||
Log.w("EncryptingPartInputStream", e);
|
||||
Log.w(TAG, e);
|
||||
throw new FileNotFoundException("IOException while reading IV!");
|
||||
}
|
||||
}
|
||||
@ -130,13 +128,13 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||
done = true;
|
||||
return flourish;
|
||||
} catch (IllegalBlockSizeException e) {
|
||||
Log.w("EncryptingPartInputStream", e);
|
||||
Log.w(TAG, e);
|
||||
throw new IOException("Illegal block size exception!");
|
||||
} catch (ShortBufferException e) {
|
||||
Log.w("EncryptingPartInputStream", e);
|
||||
Log.w(TAG, e);
|
||||
throw new IOException("Short buffer exception!");
|
||||
} catch (BadPaddingException e) {
|
||||
Log.w("EncryptingPartInputStream", e);
|
||||
Log.w(TAG, e);
|
||||
throw new IOException("Bad padding exception!");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user