aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ecdh/ech_lib.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-11-02 17:35:19 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-11-02 17:35:19 +0000
commitb6a9311a3edd056eaacbcbae2fcb723df5d99057 (patch)
tree720225dbdc898757e7df9a925ec85ade660013c1 /crypto/ecdh/ech_lib.c
parent12df5ad9af4981f5d3c31a9819d31618c0f1af51 (diff)
downloadsrc-b6a9311a3edd056eaacbcbae2fcb723df5d99057.tar.gz
src-b6a9311a3edd056eaacbcbae2fcb723df5d99057.zip
Import OpenSSL 1.0.2m.vendor/openssl/1.0.2m
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=325326 svn path=/vendor-crypto/openssl/1.0.2m/; revision=325327; tag=vendor/openssl/1.0.2m
Diffstat (limited to 'crypto/ecdh/ech_lib.c')
-rw-r--r--crypto/ecdh/ech_lib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c
index cbc21d1a276e..9cc22582e4ad 100644
--- a/crypto/ecdh/ech_lib.c
+++ b/crypto/ecdh/ech_lib.c
@@ -225,9 +225,16 @@ ECDH_DATA *ecdh_check(EC_KEY *key)
*/
ecdh_data_free(ecdh_data);
ecdh_data = (ECDH_DATA *)data;
+ } else if (EC_KEY_get_key_method_data(key, ecdh_data_dup,
+ ecdh_data_free,
+ ecdh_data_free) != ecdh_data) {
+ /* Or an out of memory error in EC_KEY_insert_key_method_data. */
+ ecdh_data_free(ecdh_data);
+ return NULL;
}
- } else
+ } else {
ecdh_data = (ECDH_DATA *)data;
+ }
#ifdef OPENSSL_FIPS
if (FIPS_mode() && !(ecdh_data->flags & ECDH_FLAG_FIPS_METHOD)
&& !(EC_KEY_get_flags(key) & EC_FLAG_NON_FIPS_ALLOW)) {