8075833: Straighter Elliptic Curves
authorvinnie
Mon, 20 Apr 2015 16:26:12 +0100
changeset 31710 02dacd0f7b79
parent 31709 885627926ab1
child 31711 cca718f2fcf0
8075833: Straighter Elliptic Curves Reviewed-by: mullan
jdk/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c
--- a/jdk/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c	Fri Apr 17 15:36:32 2015 +0100
+++ b/jdk/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c	Mon Apr 20 16:26:12 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
  * This library is free software; you can redistribute it and/or
@@ -585,6 +585,10 @@
         return SECFailure;
     }
 
+    if (EC_ValidatePublicKey(ecParams, publicValue, kmflag) != SECSuccess) {
+        return SECFailure;
+    }
+
     memset(derivedSecret, 0, sizeof *derivedSecret);
     len = (ecParams->fieldID.size + 7) >> 3;
     pointQ.len = 2*len + 1;