diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-28 20:17:04 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-28 20:17:04 +0000 |
commit | d60810634324c1476bfe121e3c97518b7ec8fa83 (patch) | |
tree | e3eda8a27c15d50826634228f7a53ca776e6d82c | |
parent | 0fc56d09a14ccdebbd8087f7a87436eee66715d0 (diff) | |
parent | 5eee5ef21fee5c8ae1b2ba4494ce63162ed3ad09 (diff) | |
download | wycheproof-android14-mainline-permission-release.tar.gz |
Snap for 10724605 from 5eee5ef21fee5c8ae1b2ba4494ce63162ed3ad09 to mainline-permission-releaseaml_per_341510010aml_per_341410020aml_per_341311000aml_per_341110020aml_per_341110010android14-mainline-permission-release
Change-Id: Ic4d718ff77d8e180df9b23bfe52e7e0fab6324d4
-rw-r--r-- | keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java | 27 | ||||
-rw-r--r-- | keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java | 23 |
2 files changed, 40 insertions, 10 deletions
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 81be1bd..5e02de9 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/MacTest.java @@ -209,16 +209,25 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/296367623 + @Ignore public void testHmacSha1() throws Exception { testMac("HMACSHA1", 20); } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/296367623 + @Ignore public void testHmacSha224() throws Exception { testMac("HMACSHA224", 28); } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/296367623 + @Ignore public void testHmacSha256() throws Exception { testMac("HMACSHA256", 32); } @@ -231,11 +240,17 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/296367623 + @Ignore public void testHmacSha384() throws Exception { testMac("HMACSHA384", 48); } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/296367623 + @Ignore public void testHmacSha512() throws Exception { testMac("HMACSHA512", 64); } @@ -331,6 +346,9 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/288588810#comment27 + @Ignore public void testLongMacSha1() throws Exception { // b/244609904#comment64 KeyStoreUtil.assumeKeyMintV1OrNewer(false); @@ -350,6 +368,9 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/288588810#comment27 + @Ignore public void testLongMacSha256() throws Exception { // b/244609904#comment64 KeyStoreUtil.assumeKeyMintV1OrNewer(false); @@ -379,6 +400,9 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/288588810#comment27 + @Ignore public void testLongMacSha384() throws Exception { // b/244609904#comment64 KeyStoreUtil.assumeKeyMintV1OrNewer(false); @@ -402,6 +426,9 @@ public class MacTest { } @Test + // Long-running MAC tests expose inefficiencies on some devices. Ignore the test until + // performance requirements can be defined. See http://b/288588810#comment27 + @Ignore public void testLongMacSha512() throws Exception { // b/244609904#comment64 KeyStoreUtil.assumeKeyMintV1OrNewer(false); 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 0a82423..9c2cbf5 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java @@ -60,17 +60,20 @@ public class RsaOaepTest { private static PrivateKey saveKeyPairToKeystoreAndReturnPrivateKey(PublicKey pubKey, PrivateKey privKey, String digest, String mgfDigest, boolean isStrongBox) throws Exception { + KeyProtection.Builder keyProtection = new KeyProtection.Builder(KeyProperties.PURPOSE_SIGN | + KeyProperties.PURPOSE_VERIFY | + KeyProperties.PURPOSE_ENCRYPT | + KeyProperties.PURPOSE_DECRYPT) + .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1, + KeyProperties.ENCRYPTION_PADDING_RSA_OAEP) + .setIsStrongBoxBacked(isStrongBox); + if (digest.equalsIgnoreCase(mgfDigest)) { + keyProtection.setDigests(digest); + } else { + keyProtection.setDigests(digest, mgfDigest); + } return (PrivateKey) KeyStoreUtil.saveKeysToKeystore(KEY_ALIAS_1, pubKey, privKey, - new KeyProtection.Builder(KeyProperties.PURPOSE_SIGN | - KeyProperties.PURPOSE_VERIFY | - KeyProperties.PURPOSE_ENCRYPT | - KeyProperties.PURPOSE_DECRYPT) - .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1, - KeyProperties.ENCRYPTION_PADDING_RSA_OAEP) - .setDigests(digest, mgfDigest) - .setIsStrongBoxBacked(isStrongBox) - .build()) - .getKey(KEY_ALIAS_1, null); + keyProtection.build()).getKey(KEY_ALIAS_1, null); } /** |