diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-02-13 22:15:56 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-02-13 22:15:56 +0000 |
commit | f3b8b34a882a09ff73facc4c6ce7cdcad59b8656 (patch) | |
tree | 79d6c350c61cb2c6055ac3b21d94c152a09b44ff /crypto/ecdh | |
parent | 451758c6115bda75e299808f60c4403de86398a8 (diff) | |
download | src-f3b8b34a882a09ff73facc4c6ce7cdcad59b8656.tar.gz src-f3b8b34a882a09ff73facc4c6ce7cdcad59b8656.zip |
Import OpenSSL 1.0.1e.vendor/openssl/1.0.1e
Approved by: secteam (delphij, simon), benl (silence)
Notes
Notes:
svn path=/vendor-crypto/openssl/dist/; revision=246769
svn path=/vendor-crypto/openssl/1.0.1e/; revision=246770; tag=vendor/openssl/1.0.1e
Diffstat (limited to 'crypto/ecdh')
-rw-r--r-- | crypto/ecdh/Makefile | 17 | ||||
-rw-r--r-- | crypto/ecdh/ech_key.c | 3 | ||||
-rw-r--r-- | crypto/ecdh/ech_lib.c | 11 |
3 files changed, 15 insertions, 16 deletions
diff --git a/crypto/ecdh/Makefile b/crypto/ecdh/Makefile index 65d8904ee8a6..ba05fea05ca0 100644 --- a/crypto/ecdh/Makefile +++ b/crypto/ecdh/Makefile @@ -84,17 +84,12 @@ ech_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ech_err.o: ech_err.c ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -ech_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -ech_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -ech_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -ech_key.o: ../../include/openssl/engine.h ../../include/openssl/evp.h -ech_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h -ech_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -ech_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -ech_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h -ech_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -ech_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -ech_key.o: ../../include/openssl/x509_vfy.h ech_key.c ech_locl.h +ech_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +ech_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h +ech_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +ech_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h +ech_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +ech_key.o: ech_key.c ech_locl.h ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h diff --git a/crypto/ecdh/ech_key.c b/crypto/ecdh/ech_key.c index f44da9298b5e..2988899ea2ab 100644 --- a/crypto/ecdh/ech_key.c +++ b/crypto/ecdh/ech_key.c @@ -68,9 +68,6 @@ */ #include "ech_locl.h" -#ifndef OPENSSL_NO_ENGINE -#include <openssl/engine.h> -#endif int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *eckey, diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c index dadbfd3c49f5..0644431b756a 100644 --- a/crypto/ecdh/ech_lib.c +++ b/crypto/ecdh/ech_lib.c @@ -222,8 +222,15 @@ ECDH_DATA *ecdh_check(EC_KEY *key) ecdh_data = (ECDH_DATA *)ecdh_data_new(); if (ecdh_data == NULL) return NULL; - EC_KEY_insert_key_method_data(key, (void *)ecdh_data, - ecdh_data_dup, ecdh_data_free, ecdh_data_free); + data = EC_KEY_insert_key_method_data(key, (void *)ecdh_data, + ecdh_data_dup, ecdh_data_free, ecdh_data_free); + if (data != NULL) + { + /* Another thread raced us to install the key_method + * data and won. */ + ecdh_data_free(ecdh_data); + ecdh_data = (ECDH_DATA *)data; + } } else ecdh_data = (ECDH_DATA *)data; |