aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-01-04 02:21:57 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-01-04 02:21:57 +0000
commit7fe933965ec0d0f640f371b62576d3ebeea0d574 (patch)
treebb05579e206ede48da3adefa9f64b6e5f90fc97b
parent23ee57bd8dfb56d2d52b3e671ec27ab8f66bd6c5 (diff)
parent5397bfcb4903e8ee6fbfa1011b75709df4a0107c (diff)
downloadwycheproof-7fe933965ec0d0f640f371b62576d3ebeea0d574.tar.gz
Snap for 9451931 from 5397bfcb4903e8ee6fbfa1011b75709df4a0107c to udc-release
Change-Id: I7cf406e3cb5ca8f6bea39718efa761964a2d34a5
-rw-r--r--keystore-cts/java/com/google/security/wycheproof/testcases/EcdsaTest.java14
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");