Skip to content

Commit

Permalink
(Wallet) Fix crash KeystoreHelper class (#27027)
Browse files Browse the repository at this point in the history
Fix crash KeystoreHelper class
  • Loading branch information
simoarpe authored Dec 16, 2024
1 parent 09cf2a7 commit 73be2eb
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ public static Cipher getCipherForDecryption() {
}
GCMParameterSpec spec =
new GCMParameterSpec(128, Base64.decode(ivBase64, Base64.DEFAULT));
SecretKey secretKey =
((KeyStore.SecretKeyEntry) keyStore.getEntry(BRAVE_WALLET_ALIAS, null))
.getSecretKey();

KeyStore.SecretKeyEntry secretKeyEntry =
(KeyStore.SecretKeyEntry) keyStore.getEntry(BRAVE_WALLET_ALIAS, null);
if (secretKeyEntry == null) {
return null;
}
SecretKey secretKey = secretKeyEntry.getSecretKey();
final Cipher cipher = Cipher.getInstance(TRANSFORMATION);
cipher.init(Cipher.DECRYPT_MODE, secretKey, spec);
return cipher;
Expand Down

0 comments on commit 73be2eb

Please sign in to comment.