diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2014-04-17 13:37:51 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2014-04-17 13:37:51 +0000 |
commit | 798a6f0972ce4f8ea25aa987dc43e626dc6d4087 (patch) | |
tree | 557371c7b1514332c466ec6233d3e6af96c88520 /lib/libcrypto/ecdh/ech_ossl.c | |
parent | eea79ffdb77e3dd4cdbd3f98ed1b44d9522496fa (diff) |
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free
Diffstat (limited to 'lib/libcrypto/ecdh/ech_ossl.c')
-rw-r--r-- | lib/libcrypto/ecdh/ech_ossl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrypto/ecdh/ech_ossl.c b/lib/libcrypto/ecdh/ech_ossl.c index 2a40ff12dfa..a63eb4922db 100644 --- a/lib/libcrypto/ecdh/ech_ossl.c +++ b/lib/libcrypto/ecdh/ech_ossl.c @@ -157,6 +157,7 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, goto err; } } +#ifndef OPENSSL_NO_EC2M else { if (!EC_POINT_get_affine_coordinates_GF2m(group, tmp, x, y, ctx)) @@ -165,6 +166,7 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, goto err; } } +#endif buflen = (EC_GROUP_get_degree(group) + 7)/8; len = BN_num_bytes(x); @@ -173,7 +175,7 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, ECDHerr(ECDH_F_ECDH_COMPUTE_KEY,ERR_R_INTERNAL_ERROR); goto err; } - if ((buf = OPENSSL_malloc(buflen)) == NULL) + if ((buf = malloc(buflen)) == NULL) { ECDHerr(ECDH_F_ECDH_COMPUTE_KEY,ERR_R_MALLOC_FAILURE); goto err; @@ -208,6 +210,6 @@ err: if (tmp) EC_POINT_free(tmp); if (ctx) BN_CTX_end(ctx); if (ctx) BN_CTX_free(ctx); - if (buf) OPENSSL_free(buf); + if (buf) free(buf); return(ret); } |