openssl_link.c revision 431e5c81dbd81cf411b9a187fa5f611f23c0e16f
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Portions Copyright (C) 2004-2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Portions Copyright (C) 1999-2003 Internet Software Consortium.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Permission to use, copy, modify, and/or distribute this software for any
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * purpose with or without fee is hereby granted, provided that the above
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * copyright notice and this permission notice appear in all copies.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Portions Copyright (C) 1995-2000 by Network Associates, Inc.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Permission to use, copy, modify, and/or distribute this software for any
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * purpose with or without fee is hereby granted, provided that the above
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * copyright notice and this permission notice appear in all copies.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Principal Author: Brian Wellington
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt return (-1);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt result = dst__entropy_getdata(buf, (unsigned int) num, ISC_FALSE);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt return (-1);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt result = dst__entropy_getdata(buf, (unsigned int) num, ISC_TRUE);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntentropy_add(const void *buf, int num, double entropy) {
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Do nothing. The only call to this provides no useful data anyway.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntentropy_add(const void *buf, int num, double entropy) {
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt * Do nothing. The only call to this provides no useful data anyway.
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Huntlock_callback(int mode, int type, const char *file, int line) {
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Huntstatic unsigned long
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Hunt return ((unsigned long)isc_thread_self());
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Huntstatic void *
#ifdef OPENSSL_LEAKS
void *rptr;
return (rptr);
#ifdef USE_ENGINE
#ifdef DNS_CRYPTO_LEAKS
return (ISC_R_NOMEMORY);
goto cleanup_mutexalloc;
goto cleanup_mutexinit;
#ifdef USE_ENGINE
if (e == NULL) {
goto cleanup_rm;
goto cleanup_rm;
goto cleanup_rm;
return (ISC_R_SUCCESS);
#ifdef USE_ENGINE
if (e != NULL)
ENGINE_free(e);
e = NULL;
return (result);
dst__openssl_destroy(void) {
RAND_cleanup();
OBJ_cleanup();
EVP_cleanup();
#if defined(USE_ENGINE)
if (e != NULL)
ENGINE_free(e);
e = NULL;
ERR_remove_state(0);
#ifdef DNS_CRYPTO_LEAKS
static isc_result_t
#ifdef HAVE_OPENSSL_ECDSA
switch (reason) {
case ERR_R_MALLOC_FAILURE:
#ifdef HAVE_OPENSSL_ECDSA
return (result);
return (result);
unsigned long err;
goto done;
if (err == 0U)
goto done;
done:
return (result);
#if defined(USE_ENGINE)
ENGINE *
return (NULL);
if (e == NULL)
return (NULL);
return (NULL);