aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 23:14:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 23:14:34 +0000
commit2b3ba4ddc7ac4235c88a7c7d0fa3e429cb1353fb (patch)
tree1eab338c526fc234b72b65edbd094620df194e8e
parent3fc1784035bef851556f564b3d54048f884076aa (diff)
parent8e86983139138d0da3238a9d08d8615fdc957cfa (diff)
downloadwycheproof-2b3ba4ddc7ac4235c88a7c7d0fa3e429cb1353fb.tar.gz
Snap for 10929834 from 8e86983139138d0da3238a9d08d8615fdc957cfa to sdk-release
Change-Id: I2c29749265b9e298a71472d9fb7af15c9cbc6145
-rw-r--r--keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java6
-rw-r--r--keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java11
-rw-r--r--keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java6
-rw-r--r--keystore-cts/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java2
4 files changed, 25 insertions, 0 deletions
diff --git a/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java b/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java
index b08a3c1..001ab89 100644
--- a/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java
+++ b/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java
@@ -13,6 +13,7 @@
*/
package android.keystore.cts.util;
+import static org.junit.Assume.assumeTrue;
import android.content.Context;
import android.security.keystore.KeyProtection;
import android.keystore.cts.util.TestUtils;
@@ -179,4 +180,9 @@ public class KeyStoreUtil {
new ByteArrayInputStream(x509holder.getEncoded()));
return x509c;
}
+
+ public static void assumeKeyMintV1OrNewer(boolean isStrongBox) {
+ assumeTrue("Test can only run on KeyMint v1 and above",
+ KeyStoreUtil.getFeatureVersionKeystore(isStrongBox) >= KM_VERSION_KEYMINT_1);
+ }
}
diff --git a/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java b/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java
index 00959fe..5e02de9 100644
--- a/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java
+++ b/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java
@@ -350,6 +350,9 @@ public class MacTest {
// performance requirements can be defined. See http://b/288588810#comment27
@Ignore
public void testLongMacSha1() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
+
testLongMac(
"HMACSHA1",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
@@ -369,6 +372,8 @@ public class MacTest {
// performance requirements can be defined. See http://b/288588810#comment27
@Ignore
public void testLongMacSha256() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testLongMacSha256(false);
}
@Test
@@ -399,6 +404,9 @@ public class MacTest {
// performance requirements can be defined. See http://b/288588810#comment27
@Ignore
public void testLongMacSha384() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
+
testLongMac(
"HMACSHA384",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
@@ -422,6 +430,9 @@ public class MacTest {
// performance requirements can be defined. See http://b/288588810#comment27
@Ignore
public void testLongMacSha512() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
+
testLongMac(
"HMACSHA512",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
diff --git a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java
index 8aba13f..dbcc5ab 100644
--- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java
+++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java
@@ -365,6 +365,8 @@ public class RsaOaepTest {
@Test
public void testRsaOaep2048Sha1Mgf1Sha1() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testOaep("rsa_oaep_2048_sha1_mgf1sha1_test.json", false);
}
@@ -423,6 +425,8 @@ public class RsaOaepTest {
@Test
public void testRsaOaep3072Sha256Mgf1Sha1() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testOaep("rsa_oaep_3072_sha256_mgf1sha1_test.json", false);
}
@@ -443,6 +447,8 @@ public class RsaOaepTest {
@Test
public void testRsaOaep4096Sha256Mgf1Sha1() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testOaep("rsa_oaep_4096_sha256_mgf1sha1_test.json", false);
}
diff --git a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java
index d41bb98..de86dc5 100644
--- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java
+++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaSignatureTest.java
@@ -1265,6 +1265,8 @@ public class RsaSignatureTest {
*/
@Test
public void testFaultySigner() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testFaultySigner(false);
}
@Test