diff options
author | Xin Li <delphij@google.com> | 2023-10-05 15:39:57 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2023-10-05 15:39:57 -0700 |
commit | 8e86983139138d0da3238a9d08d8615fdc957cfa (patch) | |
tree | 1eab338c526fc234b72b65edbd094620df194e8e | |
parent | 27fe73361c98ff70f62621ca769b1530a22b8b5e (diff) | |
parent | 38c725e5392f5829d14912f266197b5da30e1655 (diff) | |
download | wycheproof-8e86983139138d0da3238a9d08d8615fdc957cfa.tar.gz |
Merge Android 14
Bug: 298295554
Merged-In: I3c37eb2e373c25ac4f97f410dec31afa550af3db
Change-Id: I7448c85cb66f7ecbe8d41777da7f783f6cc6a5c2
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 |