6872048: bad private keys are generated for 2 specific ECC curves
authorvinnie
Mon, 24 Aug 2009 18:37:37 +0100
changeset 3636 b80fdcc0b0d5
parent 3635 dfc746e20834
child 3637 84b603d2b088
child 3704 bd98409d8c32
6872048: bad private keys are generated for 2 specific ECC curves Reviewed-by: wetmore
jdk/src/share/native/sun/security/ec/ec.c
jdk/test/sun/security/ec/TestEC.java
--- a/jdk/src/share/native/sun/security/ec/ec.c	Mon Aug 24 09:57:30 2009 -0700
+++ b/jdk/src/share/native/sun/security/ec/ec.c	Mon Aug 24 18:37:37 2009 +0100
@@ -422,7 +422,7 @@
      */
     if ((privKeyBytes = PORT_Alloc(2*len, kmflag)) == NULL) goto cleanup;
     if (randomlen != 2 * len) {
-        goto cleanup;
+        randomlen = 2 * len;
     }
     /* No need to generate - random bytes are now supplied */
     /* CHECK_SEC_OK( RNG_GenerateGlobalRandomBytes(privKeyBytes, 2*len) );*/
--- a/jdk/test/sun/security/ec/TestEC.java	Mon Aug 24 09:57:30 2009 -0700
+++ b/jdk/test/sun/security/ec/TestEC.java	Mon Aug 24 18:37:37 2009 +0100
@@ -53,7 +53,7 @@
         long start = System.currentTimeMillis();
         new TestECDH().main(p);
         new TestECDSA().main(p);
-        //new TestCurves().main(p);
+        new TestCurves().main(p);
         new TestKeyFactory().main(p);
         new TestECGenSpec().main(p);
         new ReadPKCS12().main(p);