aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Nyamagoud <nyamagoud@google.com>2023-07-27 01:55:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-28 01:49:54 +0000
commitebe0fe8038358f43f1744ce44ae64d88599d1756 (patch)
treed25b546390bbdcf473bb2fe66cee8257edb7ba7f
parentfc052bdef787dfaa73eef2eb89372c6ca8caee84 (diff)
downloadwycheproof-ebe0fe8038358f43f1744ce44ae64d88599d1756.tar.gz
Changes made to skip the tests on devices with keyMaster in backend.
Few of the failing tests are updated to skip running if device is having TEE with KeyMaster implementation (basically anything below KeyMint v1). Ignore-AOSP-First: b/244609904#comment63 Test: atest CtsKeystoreWycheproofTestCases Bug: 244609904 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5aaf3fd5210ebd3fc139662689f9cfc96f0b8cd3) Merged-In: I6fa0c6740e41bf24a5b9e737b611156f1a8d21c5 Change-Id: I6fa0c6740e41bf24a5b9e737b611156f1a8d21c5
-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 14020e0..91ab070 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;
@@ -177,4 +178,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 3a42761..81be1bd 100644
--- a/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java
+++ b/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java
@@ -332,6 +332,9 @@ public class MacTest {
@Test
public void testLongMacSha1() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
+
testLongMac(
"HMACSHA1",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
@@ -348,6 +351,8 @@ public class MacTest {
@Test
public void testLongMacSha256() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
testLongMacSha256(false);
}
@Test
@@ -375,6 +380,9 @@ public class MacTest {
@Test
public void testLongMacSha384() throws Exception {
+ // b/244609904#comment64
+ KeyStoreUtil.assumeKeyMintV1OrNewer(false);
+
testLongMac(
"HMACSHA384",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
@@ -395,6 +403,9 @@ public class MacTest {
@Test
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 29f8905..3782fc6 100644
--- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java
+++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java
@@ -362,6 +362,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);
}
@@ -420,6 +422,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);
}
@@ -440,6 +444,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