openssl_link.c revision 325564098182c662d91d62beb6b9fa6a67951d74
/*
* Portions Copyright (C) 2004-2010 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.
*
* 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.29 2010/09/15 12:38:36 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
#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 *
#ifdef OPENSSL_LEAKS
void *ptr;
return (ptr);
#else
#endif
}
static void
}
static void *
#ifdef OPENSSL_LEAKS
void *rptr;
return (rptr);
#else
#endif
}
dst__openssl_init(const char *engine) {
#ifdef USE_ENGINE
#else
#endif
#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_by_id(engine);
if (e == NULL) {
goto cleanup_rm;
}
/* This will init the engine. */
if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
goto cleanup_rm;
}
}
re = ENGINE_new();
goto cleanup_rm;
}
} else
#else
#endif /* USE_ENGINE */
return (ISC_R_SUCCESS);
#ifdef USE_ENGINE
if (e != NULL)
ENGINE_free(e);
e = NULL;
#endif
return (result);
}
void
/*
*/
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
RAND_cleanup();
#endif
}
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
#endif
OBJ_cleanup();
EVP_cleanup();
#if defined(USE_ENGINE)
if (e != NULL)
ENGINE_free(e);
e = NULL;
#endif
#endif
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
#endif
ERR_remove_state(0);
#ifdef DNS_CRYPTO_LEAKS
#endif
}
}
int err = ERR_get_error();
switch (ERR_GET_REASON(err)) {
case ERR_R_MALLOC_FAILURE:
break;
default:
break;
}
return (result);
}
ENGINE *
dst__openssl_getengine(const char *engine) {
return (NULL);
#if defined(USE_ENGINE)
if (e == NULL)
return (NULL);
return (e);
#endif
return (NULL);
}
#else /* OPENSSL */
#endif /* OPENSSL */
/*! \file */