From 511b45b531b0bf60a5e54e8dd99fbcab7bd39a45 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 20 Feb 2020 09:26:03 -0800 Subject: [PATCH] RebootEscrowKey: use bytes for equivalence Since RebootEscrowKey started wrapping SecretKey, it is necessary to check equivalence via a method that does not do object equivalence. Use the underlying byte array in the tests. equals() could be implemented, but then hashCode() would need to be implemented which would be based on the private key. Test: atest RebootEscrowDataTest Change-Id: Ia5b0bb822dcd3e59b5898f390fa8670db0b8d4c9 --- .../com/android/server/locksettings/RebootEscrowDataTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/tests/servicestests/src/com/android/server/locksettings/RebootEscrowDataTest.java b/services/tests/servicestests/src/com/android/server/locksettings/RebootEscrowDataTest.java index b5c6d0425bb1e..46f43e7af596a 100644 --- a/services/tests/servicestests/src/com/android/server/locksettings/RebootEscrowDataTest.java +++ b/services/tests/servicestests/src/com/android/server/locksettings/RebootEscrowDataTest.java @@ -75,7 +75,7 @@ public class RebootEscrowDataTest { assertThat(actual.getSpVersion(), is(expected.getSpVersion())); assertThat(actual.getIv(), is(expected.getIv())); - assertThat(actual.getKey(), is(expected.getKey())); + assertThat(actual.getKey().getKeyBytes(), is(expected.getKey().getKeyBytes())); assertThat(actual.getBlob(), is(expected.getBlob())); assertThat(actual.getSyntheticPassword(), is(expected.getSyntheticPassword())); }