summaryrefslogtreecommitdiffstats
path: root/keystore/java/android
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-04-16 17:20:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-16 17:20:23 +0000
commit3abd2b757a2515de67993e2a94290b77ee6b352e (patch)
tree8e9d085b00ab0e5cdcf19ebd1a71330a94f714a4 /keystore/java/android
parent56d16568c0233dacec8f3c20cc987b2b68298e7a (diff)
parent22b5d9b969176a196b0b29ce9441ac3d1d35d208 (diff)
downloadframeworks_base-3abd2b757a2515de67993e2a94290b77ee6b352e.zip
frameworks_base-3abd2b757a2515de67993e2a94290b77ee6b352e.tar.gz
frameworks_base-3abd2b757a2515de67993e2a94290b77ee6b352e.tar.bz2
am 22b5d9b9: am 28a9089f: am 216d18b9: Merge "Remove IV auto-generation workaround."
* commit '22b5d9b969176a196b0b29ce9441ac3d1d35d208': Remove IV auto-generation workaround.
Diffstat (limited to 'keystore/java/android')
-rw-r--r--keystore/java/android/security/KeyStoreCipherSpi.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/keystore/java/android/security/KeyStoreCipherSpi.java b/keystore/java/android/security/KeyStoreCipherSpi.java
index 7bc6378..37e00b2 100644
--- a/keystore/java/android/security/KeyStoreCipherSpi.java
+++ b/keystore/java/android/security/KeyStoreCipherSpi.java
@@ -547,18 +547,12 @@ public abstract class KeyStoreCipherSpi extends CipherSpi implements KeyStoreCry
if (mIvRequired) {
// IV is needed
if ((mIv == null) && (mEncrypting)) {
- // TODO: Switch to keymaster-generated IV code below once keymaster supports
- // that.
- // IV is needed but was not provided by the caller -- generate an IV.
- mIv = new byte[mBlockSizeBytes];
- SecureRandom rng = (mRng != null) ? mRng : new SecureRandom();
- rng.nextBytes(mIv);
-// // IV was not provided by the caller and thus will be generated by keymaster.
-// // Mix in some additional entropy from the provided SecureRandom.
-// if (mRng != null) {
-// mAdditionalEntropyForBegin = new byte[mBlockSizeBytes];
-// mRng.nextBytes(mAdditionalEntropyForBegin);
-// }
+ // IV was not provided by the caller and thus will be generated by keymaster.
+ // Mix in some additional entropy from the provided SecureRandom.
+ if (mRng != null) {
+ mAdditionalEntropyForBegin = new byte[mBlockSizeBytes];
+ mRng.nextBytes(mAdditionalEntropyForBegin);
+ }
}
}
}