diff options
author | Prashant Patil <patilprashant@google.com> | 2023-06-13 15:35:59 +0000 |
---|---|---|
committer | Prashant Patil <patilprashant@google.com> | 2023-09-06 10:23:22 +0000 |
commit | 96b5c298251b62626cbf0a54fd5499b4a253f2cd (patch) | |
tree | 9ac19450494cf283bfcbec3c9ce22259edc4a3f1 | |
parent | 1924ded86d5a5d6c1cdc83f1facec9486086ee67 (diff) | |
download | wycheproof-96b5c298251b62626cbf0a54fd5499b4a253f2cd.tar.gz |
Used a MGF1 digest setter method
Using a MGF1 digest setter method while RSA key import.
This is required, so that specific MGF1 digest could be used for
encryption/decryption.
Bug: 284140060
Test: atest CtsKeystoreWycheproofTestCases:RsaOaepTest
Change-Id: I60cbcd22e11ebe2a56cea3a52c63e5bb2bdc6d00
-rw-r--r-- | keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java | 7 |
1 files changed, 2 insertions, 5 deletions
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..8aba13f 100644 --- a/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java +++ b/keystore-cts/java/com/google/security/wycheproof/testcases/RsaOaepTest.java @@ -66,12 +66,9 @@ public class RsaOaepTest { KeyProperties.PURPOSE_DECRYPT) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1, KeyProperties.ENCRYPTION_PADDING_RSA_OAEP) + .setDigests(digest) + .setMgf1Digests(mgfDigest) .setIsStrongBoxBacked(isStrongBox); - if (digest.equalsIgnoreCase(mgfDigest)) { - keyProtection.setDigests(digest); - } else { - keyProtection.setDigests(digest, mgfDigest); - } return (PrivateKey) KeyStoreUtil.saveKeysToKeystore(KEY_ALIAS_1, pubKey, privKey, keyProtection.build()).getKey(KEY_ALIAS_1, null); } |