diff options
author | Prashant Patil <patilprashant@google.com> | 2023-01-03 14:59:03 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-01-03 14:59:03 +0000 |
commit | 374e2aef22c3ecaf4a9d9b0f289c0f3ff6a56065 (patch) | |
tree | bb05579e206ede48da3adefa9f64b6e5f90fc97b | |
parent | dea239ad0ae7fa57c5e148fe71c36a454b21bec5 (diff) | |
parent | 9cbb4bb889dc7ad5d4b4dc0f11ee81db8ef4982d (diff) | |
download | wycheproof-374e2aef22c3ecaf4a9d9b0f289c0f3ff6a56065.tar.gz |
Keystore: StrongBox assumption added in EcdsaTest am: 0cbbf85345 am: 9cbb4bb889
Original change: https://android-review.googlesource.com/c/platform/external/wycheproof/+/2361485
Change-Id: Iff02d9c04097fcc9f80cf99e8163ffabdad127ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java b/keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java index b454b84..3a758f3 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java @@ -195,6 +195,9 @@ public class EcdsaTest { return testParameters(algorithm, curve, false); } boolean testParameters(String algorithm, String curve, boolean isStrongBox) throws Exception { + if (isStrongBox) { + KeyStoreUtil.assumeStrongBox(); + } String message = "123400"; KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); @@ -245,7 +248,6 @@ public class EcdsaTest { } @Test public void testBasic_StrongBox() throws Exception { - KeyStoreUtil.assumeStrongBox(); String algorithm = "SHA256WithECDSA"; String curve = "secp256r1"; assertTrue(testParameters(algorithm, curve, true)); @@ -257,6 +259,9 @@ public class EcdsaTest { } public void testBias(String algorithm, String curve, boolean isStrongBox) throws Exception { + if (isStrongBox) { + KeyStoreUtil.assumeStrongBox(); + } Signature signer = Signature.getInstance(algorithm, EXPECTED_PROVIDER_NAME); KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); keyGen.initialize(new ECGenParameterSpec(curve)); @@ -364,7 +369,6 @@ public class EcdsaTest { @Test public void testBiasSecp521r1_StrongBox() throws Exception { - KeyStoreUtil.assumeStrongBox(); testBias("SHA256WithECDSA", "secp256r1", true); } @@ -398,7 +402,11 @@ public class EcdsaTest { public void testNullRandom(String algorithm, String curve) throws Exception { testNullRandom(algorithm, curve, false); } - public void testNullRandom(String algorithm, String curve, boolean isStrongBox) throws Exception { + public void testNullRandom(String algorithm, String curve, boolean isStrongBox) + throws Exception { + if (isStrongBox) { + KeyStoreUtil.assumeStrongBox(); + } int samples = 8; Signature signer = Signature.getInstance(algorithm); KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC"); |