diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 18:10:47 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 18:10:47 +0000 |
commit | e1585f14c6fa44d93917a4df4799b4ece8a226cc (patch) | |
tree | 729b1c52baccd5745896d501044868814f2248e1 | |
parent | 345e6e873f09f159c6cd589c438b39bf5881cc76 (diff) | |
parent | 77da4e61de9d6f1f6a5683338a646bd8ada54978 (diff) | |
download | wycheproof-e1585f14c6fa44d93917a4df4799b4ece8a226cc.tar.gz |
Snap for 10498811 from 77da4e61de9d6f1f6a5683338a646bd8ada54978 to mainline-adservices-releaseaml_ads_340915050
Change-Id: I3062a6dc5bbd324fecc522a87e076a1b3ad1d139
-rw-r--r-- | keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java | 6 | ||||
-rw-r--r-- | keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java b/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java index ea5d91b..14020e0 100644 --- a/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java +++ b/keystore-cts/java/android/keystore/cts/util/KeyStoreUtil.java @@ -91,7 +91,11 @@ public class KeyStoreUtil { } } - public static int getFeatureVersionKeystore() { + public static int getFeatureVersionKeystore(boolean isStrongBox) { + if (isStrongBox) { + return TestUtils.getFeatureVersionKeystoreStrongBox( + ApplicationProvider.getApplicationContext()); + } return TestUtils.getFeatureVersionKeystore(ApplicationProvider.getApplicationContext()); } 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 5eb47e5..29f8905 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java @@ -192,14 +192,14 @@ public class RsaOaepTest { } protected static OAEPParameterSpec getOaepParameters(JsonObject group, - JsonObject test) throws Exception { + JsonObject test, boolean isStrongBox) throws Exception { String sha = getString(group, "sha"); String mgf = getString(group, "mgf"); String mgfSha = getString(group, "mgfSha"); // mgfDigest other than SHA-1 are supported from KeyMint V1 and above. if (!mgfSha.equalsIgnoreCase("SHA-1")) { assumeTrue("This test is valid for KeyMint version 1 and above.", - KeyStoreUtil.getFeatureVersionKeystore() >= KeyStoreUtil.KM_VERSION_KEYMINT_1); + KeyStoreUtil.getFeatureVersionKeystore(isStrongBox) >= KeyStoreUtil.KM_VERSION_KEYMINT_1); } PSource p = PSource.PSpecified.DEFAULT; if (test.has("label") && !TextUtils.isEmpty(getString(test, "label"))) { @@ -305,7 +305,7 @@ public class RsaOaepTest { String messageHex = TestUtil.bytesToHex(getBytes(testcase, "msg")); OAEPParameterSpec params; try { - params = getOaepParameters(group, testcase); + params = getOaepParameters(group, testcase, isStrongBox); } catch (UnsupportedKeyParametersException e) { // TODO This try catch block should be removed once issue b/229183581 is fixed. continue; |