From 0fc52cbd13bf9cd4edeebe641f493c5ba2fc1e37 Mon Sep 17 00:00:00 2001 From: igerasim Date: Wed, 22 Apr 2015 23:29:47 +0300 Subject: [PATCH] 8075833: Straighter Elliptic Curves Reviewed-by: mullan --- src/share/native/sun/security/ec/impl/ec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/share/native/sun/security/ec/impl/ec.c b/src/share/native/sun/security/ec/impl/ec.c index 2f665a9e0..cb5226d80 100644 --- a/src/share/native/sun/security/ec/impl/ec.c +++ b/src/share/native/sun/security/ec/impl/ec.c @@ -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 @@ ECDH_Derive(SECItem *publicValue, 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; -- GitLab