summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-05-12 10:03:53 -0700
committerKenny Root <kroot@google.com>2015-06-04 10:39:18 -0700
commit438f476f72a90637b085db2bf8a9209ef6e903fe (patch)
treee8d247ebdf3afbbd3ae07526f842aa0fe49b3b9f
parent9970b63a991cbfbe1f6deb10ad1336029cbbdea0 (diff)
downloadlibcore-438f476f72a90637b085db2bf8a9209ef6e903fe.zip
libcore-438f476f72a90637b085db2bf8a9209ef6e903fe.tar.gz
libcore-438f476f72a90637b085db2bf8a9209ef6e903fe.tar.bz2
No need to test EC keys of 192 bits
EC keys of 192 bits have a security level of 96 bits which is well below accepted minimum levels according to NIST SP800 131A. No need to be able to generate these anymore. Instead test 521-bit EC keys. (cherry picked from commit 9b8f9a1bb00f70f79f175282969d428d2aade062) Bug: 20563457 Change-Id: I674c255c55c910bb8f9ccdf1e5ad7f69a2bdac69
-rw-r--r--luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java b/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
index 7e08b5f..1320a8a 100644
--- a/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
+++ b/luni/src/test/java/libcore/java/security/KeyPairGeneratorTest.java
@@ -45,6 +45,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.crypto.interfaces.DHPrivateKey;
@@ -198,7 +199,6 @@ public class KeyPairGeneratorTest extends TestCase {
putKeySize("DiffieHellman", 512);
putKeySize("DiffieHellman", 512+64);
putKeySize("DiffieHellman", 1024);
- putKeySize("EC", 192);
putKeySize("EC", 224);
putKeySize("EC", 256);
putKeySize("EC", 384);
@@ -207,10 +207,10 @@ public class KeyPairGeneratorTest extends TestCase {
/** Elliptic Curve Crypto named curves that should be supported. */
private static final String[] EC_NAMED_CURVES = {
- // NIST P-192 aka SECG secp192r1 aka ANSI X9.62 prime192v1
- "secp192r1", "prime192v1",
// NIST P-256 aka SECG secp256r1 aka ANSI X9.62 prime256v1
"secp256r1", "prime256v1",
+ // NIST P-521 aka SECG secp521r1
+ "secp521r1",
};
private void test_KeyPairGenerator(KeyPairGenerator kpg) throws Exception {
@@ -267,7 +267,7 @@ public class KeyPairGeneratorTest extends TestCase {
}
private void test_Key(KeyPairGenerator kpg, Key k) throws Exception {
- String expectedAlgorithm = kpg.getAlgorithm().toUpperCase();
+ String expectedAlgorithm = kpg.getAlgorithm().toUpperCase(Locale.ROOT);
if (StandardNames.IS_RI && expectedAlgorithm.equals("DIFFIEHELLMAN")) {
expectedAlgorithm = "DH";
}