diff options
author | Xin Li <delphij@google.com> | 2023-08-31 11:52:55 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2023-08-31 12:31:09 -0700 |
commit | f68171667d88c976ca4cb6f33b9025218b043da4 (patch) | |
tree | e3eda8a27c15d50826634228f7a53ca776e6d82c | |
parent | 637a5269f49f02668bd2bb6d9a02483224527abf (diff) | |
parent | 9f05b44a151a2bb2836354906833fc014d201509 (diff) | |
download | wycheproof-f68171667d88c976ca4cb6f33b9025218b043da4.tar.gz |
Merge UP1A.230905.019
Merged-In: I40fdfb14c244be83c19287289603644605e20e94
Change-Id: I655768d67a8791cfee7a14df492e2a0cf98f7757
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 0271d44..9c2cbf5 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java @@ -368,6 +368,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); } @@ -426,6 +428,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); } @@ -446,6 +450,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 |