openssl_link.c revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
/*
* Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
* FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
* FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Principal Author: Brian Wellington
* $Id: openssl_link.c,v 1.14 2007/06/19 23:47:16 tbox Exp $
*/
#ifdef OPENSSL
#include <config.h>
#include <isc/mutexblock.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#define USE_ENGINE 1
#endif
#ifdef USE_ENGINE
#endif
static int nlocks;
#ifdef USE_ENGINE
static ENGINE *e;
#endif
static int
if (num < 0)
return (-1);
}
static int
entropy_status(void) {
return (dst__entropy_status() > 32);
}
static int
if (num < 0)
return (-1);
}
static void
/*
* Do nothing. The only call to this provides no useful data anyway.
*/
}
static void
if ((mode & CRYPTO_LOCK) != 0)
else
}
static unsigned long
id_callback(void) {
return ((unsigned long)isc_thread_self());
}
static void *
}
static void
}
static void *
void *p;
p = NULL;
if (size > 0U) {
}
return (p);
}
#ifdef DNS_CRYPTO_LEAKS
#endif
nlocks = CRYPTO_num_locks();
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto cleanup_mutexalloc;
goto cleanup_mutexinit;
}
#ifdef USE_ENGINE
e = ENGINE_new();
if (e == NULL) {
goto cleanup_rm;
}
ENGINE_set_RAND(e, rm);
#else
#endif /* USE_ENGINE */
return (ISC_R_SUCCESS);
#ifdef USE_ENGINE
#endif
return (result);
}
void
/*
*/
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
#endif
EVP_cleanup();
#endif
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
#endif
ERR_remove_state(0);
#ifdef DNS_CRYPTO_LEAKS
#endif
#if 0
/*
* The old error sequence that leaked. Remove for 9.4.1 if
* there are no issues by then.
*/
#ifdef USE_ENGINE
if (e != NULL) {
ENGINE_free(e);
e = NULL;
}
#endif
#endif
}
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
RAND_cleanup();
#endif
}
}
int err = ERR_get_error();
switch (ERR_GET_REASON(err)) {
case ERR_R_MALLOC_FAILURE:
break;
default:
break;
}
return (result);
}
#else /* OPENSSL */
#endif /* OPENSSL */
/*! \file */