Skip to content

Commit

Permalink
(Wallet) Fix crash KeystoreHelper class (uplift to 1.74.x) (#27031)
Browse files Browse the repository at this point in the history
Uplift of #27027 (squashed) to beta
  • Loading branch information
brave-builds authored Dec 16, 2024
1 parent 0b37550 commit 52f181f
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 52f181f

Please sign in to comment.