Loading keystore/java/android/security/KeyStoreCipherSpi.java +6 −12 Original line number Original line Diff line number Diff line Loading @@ -547,18 +547,12 @@ public abstract class KeyStoreCipherSpi extends CipherSpi implements KeyStoreCry if (mIvRequired) { if (mIvRequired) { // IV is needed // IV is needed if ((mIv == null) && (mEncrypting)) { if ((mIv == null) && (mEncrypting)) { // TODO: Switch to keymaster-generated IV code below once keymaster supports // IV was not provided by the caller and thus will be generated by keymaster. // that. // Mix in some additional entropy from the provided SecureRandom. // IV is needed but was not provided by the caller -- generate an IV. if (mRng != null) { mIv = new byte[mBlockSizeBytes]; mAdditionalEntropyForBegin = new byte[mBlockSizeBytes]; SecureRandom rng = (mRng != null) ? mRng : new SecureRandom(); mRng.nextBytes(mAdditionalEntropyForBegin); 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); // } } } } } } } Loading Loading
keystore/java/android/security/KeyStoreCipherSpi.java +6 −12 Original line number Original line Diff line number Diff line Loading @@ -547,18 +547,12 @@ public abstract class KeyStoreCipherSpi extends CipherSpi implements KeyStoreCry if (mIvRequired) { if (mIvRequired) { // IV is needed // IV is needed if ((mIv == null) && (mEncrypting)) { if ((mIv == null) && (mEncrypting)) { // TODO: Switch to keymaster-generated IV code below once keymaster supports // IV was not provided by the caller and thus will be generated by keymaster. // that. // Mix in some additional entropy from the provided SecureRandom. // IV is needed but was not provided by the caller -- generate an IV. if (mRng != null) { mIv = new byte[mBlockSizeBytes]; mAdditionalEntropyForBegin = new byte[mBlockSizeBytes]; SecureRandom rng = (mRng != null) ? mRng : new SecureRandom(); mRng.nextBytes(mAdditionalEntropyForBegin); 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); // } } } } } } } Loading