mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Forgot to specify NoPadding for temporary storage cipher.
This commit is contained in:
@@ -43,7 +43,7 @@ import com.google.inject.Inject;
|
|||||||
|
|
||||||
class CryptoComponentImpl implements CryptoComponent {
|
class CryptoComponentImpl implements CryptoComponent {
|
||||||
|
|
||||||
private static final String PROVIDER = "SC";
|
private static final String PROVIDER = "SC"; // Spongy Castle
|
||||||
private static final String AGREEMENT_KEY_PAIR_ALGO = "ECDH";
|
private static final String AGREEMENT_KEY_PAIR_ALGO = "ECDH";
|
||||||
private static final int AGREEMENT_KEY_PAIR_BITS = 384;
|
private static final int AGREEMENT_KEY_PAIR_BITS = 384;
|
||||||
private static final String AGREEMENT_ALGO = "ECDHC";
|
private static final String AGREEMENT_ALGO = "ECDHC";
|
||||||
@@ -57,7 +57,7 @@ class CryptoComponentImpl implements CryptoComponent {
|
|||||||
private static final String SIGNATURE_ALGO = "ECDSA";
|
private static final String SIGNATURE_ALGO = "ECDSA";
|
||||||
private static final String TAG_CIPHER_ALGO = "AES/ECB/NoPadding";
|
private static final String TAG_CIPHER_ALGO = "AES/ECB/NoPadding";
|
||||||
private static final int GCM_MAC_LENGTH = 16; // 128 bits
|
private static final int GCM_MAC_LENGTH = 16; // 128 bits
|
||||||
private static final String STORAGE_CIPHER_ALGO = "AES/GCM";
|
private static final String STORAGE_CIPHER_ALGO = "AES/GCM/NoPadding";
|
||||||
private static final int STORAGE_IV_LENGTH = 32; // 256 bits
|
private static final int STORAGE_IV_LENGTH = 32; // 256 bits
|
||||||
|
|
||||||
// Labels for key derivation
|
// Labels for key derivation
|
||||||
@@ -397,12 +397,11 @@ class CryptoComponentImpl implements CryptoComponent {
|
|||||||
try {
|
try {
|
||||||
cipher = Cipher.getInstance(STORAGE_CIPHER_ALGO, PROVIDER);
|
cipher = Cipher.getInstance(STORAGE_CIPHER_ALGO, PROVIDER);
|
||||||
cipher.init(ENCRYPT_MODE, temporaryStorageKey, iv);
|
cipher.init(ENCRYPT_MODE, temporaryStorageKey, iv);
|
||||||
cipher.doFinal(input, 0, input.length, output,
|
cipher.doFinal(input, 0, input.length, output, STORAGE_IV_LENGTH);
|
||||||
STORAGE_IV_LENGTH);
|
return output;
|
||||||
} catch(GeneralSecurityException e) {
|
} catch(GeneralSecurityException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] decryptTemporaryStorage(byte[] input) {
|
public byte[] decryptTemporaryStorage(byte[] input) {
|
||||||
|
|||||||
Reference in New Issue
Block a user