Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ee628f4 authored by Bo Zhu's avatar Bo Zhu Committed by Android (Google) Code Review
Browse files

Merge "Change packVaultParams to use the real vault_handle directly"

parents 0137f81f 31ccba1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ public class KeySyncUtils {
                .put(SecureBox.encodePublicKey(thmPublicKey))
                .putLong(counterId)
                .putInt(maxAttempts)
                .put(new byte[VAULT_HANDLE_LENGTH_BYTES]) // TODO: replace with real vaultHandle
                .put(vaultHandle)
                .array();
    }

+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ public class KeySyncTaskTest {
    private static final int TEST_RECOVERY_AGENT_UID = 10009;
    private static final int TEST_RECOVERY_AGENT_UID2 = 10010;
    private static final byte[] TEST_VAULT_HANDLE =
            new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17};
            new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
    private static final String TEST_APP_KEY_ALIAS = "rcleaver";
    private static final int TEST_GENERATION_ID = 2;
    private static final int TEST_CREDENTIAL_TYPE = CREDENTIAL_TYPE_PASSWORD;
+2 −3
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public class KeySyncUtilsTest {
    private static final int THM_KF_HASH_SIZE = 256;
    private static final int KEY_CLAIMANT_LENGTH_BYTES = 16;
    private static final byte[] TEST_VAULT_HANDLE =
            new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17};
            new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
    private static final String SHA_256_ALGORITHM = "SHA-256";
    private static final String APPLICATION_KEY_ALGORITHM = "AES";
    private static final byte[] LOCK_SCREEN_HASH_1 =
@@ -417,8 +417,7 @@ public class KeySyncUtilsTest {
        byteBuffer.position(PUBLIC_KEY_LENGTH_BYTES + Long.BYTES + Integer.BYTES);
        byte[] vaultHandle = new byte[VAULT_HANDLE_LENGTH_BYTES];
        byteBuffer.get(vaultHandle);
        // TODO: Fix this once we fix the code in the KeySyncUtils class
        assertArrayEquals(new byte[VAULT_HANDLE_LENGTH_BYTES], vaultHandle);
        assertArrayEquals(TEST_VAULT_HANDLE, vaultHandle);
    }

    private static byte[] randomBytes(int n) {