summaryrefslogtreecommitdiffstats
path: root/keystore/tests
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-03-20 14:03:49 -0700
committerChad Brubaker <cbrubaker@google.com>2015-03-20 14:03:49 -0700
commit003a55a6713fd4c1fe63ae5cdb478a11016f46b4 (patch)
tree8ce34dac13a3efc9fe0480a34f887d14c0a14269 /keystore/tests
parenta4c4c575c793d3ba4847107b15ce3a9dd5395878 (diff)
downloadframeworks_base-003a55a6713fd4c1fe63ae5cdb478a11016f46b4.zip
frameworks_base-003a55a6713fd4c1fe63ae5cdb478a11016f46b4.tar.gz
frameworks_base-003a55a6713fd4c1fe63ae5cdb478a11016f46b4.tar.bz2
Specify public exponent for RSA
Keymaster no longer adds a default value, so these tests were failing. Change-Id: I9c5a8d2552534db1d7fa77965b0d675acc3ccc0a
Diffstat (limited to 'keystore/tests')
-rw-r--r--keystore/tests/src/android/security/KeyStoreTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/keystore/tests/src/android/security/KeyStoreTest.java b/keystore/tests/src/android/security/KeyStoreTest.java
index f935bb1..f0b07a6 100644
--- a/keystore/tests/src/android/security/KeyStoreTest.java
+++ b/keystore/tests/src/android/security/KeyStoreTest.java
@@ -36,6 +36,7 @@ import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
+import java.security.spec.RSAKeyGenParameterSpec;
import android.util.Log;
import android.util.Base64;
@@ -713,6 +714,8 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
args.addInt(KeymasterDefs.KM_TAG_KEY_SIZE, 2048);
args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, null);
args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
+ args.addBlob(KeymasterDefs.KM_TAG_RSA_PUBLIC_EXPONENT,
+ RSAKeyGenParameterSpec.F4.toByteArray());
KeyCharacteristics outCharacteristics = new KeyCharacteristics();
int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);
@@ -750,6 +753,8 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
args.addInt(KeymasterDefs.KM_TAG_BLOCK_MODE, KeymasterDefs.KM_MODE_ECB);
args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, new byte[] {0x01, 0x02, 0x03});
args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
+ args.addBlob(KeymasterDefs.KM_TAG_RSA_PUBLIC_EXPONENT,
+ RSAKeyGenParameterSpec.F4.toByteArray());
KeyCharacteristics outCharacteristics = new KeyCharacteristics();
int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);