changeset 12391:5d084680f135

8075833: Straighter Elliptic Curves Reviewed-by: mullan
author vinnie
date Mon, 20 Apr 2015 16:26:12 +0100
parents 098db82c3351
children 7ccfb2bb3c4e
files src/jdk.crypto.ec/share/native/libsunec/impl/ec.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c	Fri Apr 17 15:36:32 2015 +0100
+++ b/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;