Merge "Remove the hard-coded counterId in VaultParams" into pi-dev

This commit is contained in:
Bo Zhu
2018-03-22 17:32:10 +00:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 6 deletions

View File

@@ -255,9 +255,6 @@ public class KeySyncTask implements Runnable {
}
}
// TODO: make sure the same counter id is used during recovery and remove temporary fix.
counterId = 1L;
byte[] vaultParams = KeySyncUtils.packVaultParams(
publicKey,
counterId,

View File

@@ -416,8 +416,8 @@ public class RecoverableKeyStoreManager {
* @param vaultChallenge Challenge issued by vault service.
* @param secrets Lock-screen hashes. For now only a single secret is supported.
* @return Encrypted bytes of recovery claim. This can then be issued to the vault service.
* @deprecated Use {@link #startRecoverySessionWithCertPath(String, RecoveryCertPath, byte[],
* byte[], List)} instead.
* @deprecated Use {@link #startRecoverySessionWithCertPath(String, String, RecoveryCertPath,
* byte[], byte[], List)} instead.
*
* @hide
*/
@@ -457,6 +457,7 @@ public class RecoverableKeyStoreManager {
uid,
new RecoverySessionStorage.Entry(sessionId, kfHash, keyClaimant, vaultParams));
Log.i(TAG, "Received VaultParams for recovery: " + HexDump.toHexString(vaultParams));
try {
byte[] thmKfHash = KeySyncUtils.calculateThmKfHash(kfHash);
return KeySyncUtils.encryptRecoveryClaim(

View File

@@ -296,7 +296,6 @@ public class KeySyncTaskTest {
keyDerivationParams.getSalt(),
TEST_CREDENTIAL);
Long counterId = mRecoverableKeyStoreDb.getCounterId(TEST_USER_ID, TEST_RECOVERY_AGENT_UID);
counterId = 1L; // TODO: use value from the database.
assertThat(counterId).isNotNull();
byte[] recoveryKey = decryptThmEncryptedKey(
lockScreenHash,