提交 fd4cfd65 编写于 作者: V vinnie

6872048: bad private keys are generated for 2 specific ECC curves

Reviewed-by: wetmore
上级 0e559cd8
...@@ -422,7 +422,7 @@ ec_GenerateRandomPrivateKey(const unsigned char *order, int len, ...@@ -422,7 +422,7 @@ ec_GenerateRandomPrivateKey(const unsigned char *order, int len,
*/ */
if ((privKeyBytes = PORT_Alloc(2*len, kmflag)) == NULL) goto cleanup; if ((privKeyBytes = PORT_Alloc(2*len, kmflag)) == NULL) goto cleanup;
if (randomlen != 2 * len) { if (randomlen != 2 * len) {
goto cleanup; randomlen = 2 * len;
} }
/* No need to generate - random bytes are now supplied */ /* No need to generate - random bytes are now supplied */
/* CHECK_SEC_OK( RNG_GenerateGlobalRandomBytes(privKeyBytes, 2*len) );*/ /* CHECK_SEC_OK( RNG_GenerateGlobalRandomBytes(privKeyBytes, 2*len) );*/
......
...@@ -53,7 +53,7 @@ public class TestEC { ...@@ -53,7 +53,7 @@ public class TestEC {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
new TestECDH().main(p); new TestECDH().main(p);
new TestECDSA().main(p); new TestECDSA().main(p);
//new TestCurves().main(p); new TestCurves().main(p);
new TestKeyFactory().main(p); new TestKeyFactory().main(p);
new TestECGenSpec().main(p); new TestECGenSpec().main(p);
new ReadPKCS12().main(p); new ReadPKCS12().main(p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册