openssl_link.c revision 1676408640d8283c9f17eec0b183e1302ea7fd70
/*
* Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
* 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.57 2004/03/18 02:58:05 marka 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
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);
}
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
return (ISC_R_SUCCESS);
#ifdef USE_ENGINE
#endif
return (result);
}
void
#ifdef USE_ENGINE
if (e != NULL) {
ENGINE_free(e);
e = NULL;
}
#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 */