summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-03-31 09:10:50 -0700
committerAlex Klyubin <klyubin@google.com>2015-04-01 09:59:27 -0700
commit8cac87765c3cc1014e2d9ba2486d9d0d63541853 (patch)
treef0f856c7c72206b49a8f9c37d9b4d9e74a5e4fb4 /luni
parentfc62e635ef4dcdeda9f144c90dd77568be0176fc (diff)
downloadlibcore-8cac87765c3cc1014e2d9ba2486d9d0d63541853.zip
libcore-8cac87765c3cc1014e2d9ba2486d9d0d63541853.tar.gz
libcore-8cac87765c3cc1014e2d9ba2486d9d0d63541853.tar.bz2
Fix KeyGeneratorTest breakage due to AndroidKeyStore.
AndroidKeyStore provider's KeyPairGenerator and KeyGenerator instances require AndroidKeyStore-specific initialization parameters which are represnted by Android framework classes and are thus not accessible from libcore tests. This CL fixes KeyGeneratorTest to skip AndroidKeyStore provider to follow the behavior of KeyPairGeneratorTest. Change-Id: I61d176a7bc22a676d06d32f49aba37aebebe9c76
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java5
-rw-r--r--luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java9
2 files changed, 13 insertions, 1 deletions
diff --git a/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java b/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
index e7fdb1f..7e08b5f 100644
--- a/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
+++ b/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
@@ -121,7 +121,10 @@ public class KeyPairGeneratorTest extends TestCase {
}
String algorithm = service.getAlgorithm();
- // AndroidKeyStore is tested in CTS.
+ // Do not test AndroidKeyStore's KeyPairGenerator. It cannot be initialized without
+ // providing AndroidKeyStore-specific algorithm parameters.
+ // It's OKish not to test AndroidKeyStore's KeyPairGenerator here because it's tested
+ // by cts/tests/test/keystore.
if ("AndroidKeyStore".equals(provider.getName())) {
continue;
}
diff --git a/luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java b/luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java
index 8bbd548..5763562 100644
--- a/luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java
+++ b/luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java
@@ -44,6 +44,15 @@ public class KeyGeneratorTest extends TestCase {
if (!type.equals("KeyGenerator")) {
continue;
}
+
+ // Do not test AndroidKeyStore's KeyGenerator. It cannot be initialized without
+ // providing AndroidKeyStore-specific algorithm parameters.
+ // It's OKish not to test AndroidKeyStore's KeyGenerator here because it's tested
+ // by cts/tests/test/keystore.
+ if ("AndroidKeyStore".equals(provider.getName())) {
+ continue;
+ }
+
String algorithm = service.getAlgorithm();
try {
// KeyGenerator.getInstance(String)