xref: /onnv-gate/usr/src/common/openssl/crypto/engine/eng_lib.c (revision 2139:6243c3338933)
10Sstevel@tonic-gate /* crypto/engine/eng_lib.c */
20Sstevel@tonic-gate /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
30Sstevel@tonic-gate  * project 2000.
40Sstevel@tonic-gate  */
50Sstevel@tonic-gate /* ====================================================================
60Sstevel@tonic-gate  * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
90Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
100Sstevel@tonic-gate  * are met:
110Sstevel@tonic-gate  *
120Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
130Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
140Sstevel@tonic-gate  *
150Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
160Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in
170Sstevel@tonic-gate  *    the documentation and/or other materials provided with the
180Sstevel@tonic-gate  *    distribution.
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this
210Sstevel@tonic-gate  *    software must display the following acknowledgment:
220Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
230Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
260Sstevel@tonic-gate  *    endorse or promote products derived from this software without
270Sstevel@tonic-gate  *    prior written permission. For written permission, please contact
280Sstevel@tonic-gate  *    licensing@OpenSSL.org.
290Sstevel@tonic-gate  *
300Sstevel@tonic-gate  * 5. Products derived from this software may not be called "OpenSSL"
310Sstevel@tonic-gate  *    nor may "OpenSSL" appear in their names without prior written
320Sstevel@tonic-gate  *    permission of the OpenSSL Project.
330Sstevel@tonic-gate  *
340Sstevel@tonic-gate  * 6. Redistributions of any form whatsoever must retain the following
350Sstevel@tonic-gate  *    acknowledgment:
360Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
370Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
380Sstevel@tonic-gate  *
390Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
400Sstevel@tonic-gate  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
410Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
420Sstevel@tonic-gate  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
430Sstevel@tonic-gate  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
440Sstevel@tonic-gate  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
450Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
460Sstevel@tonic-gate  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
470Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
480Sstevel@tonic-gate  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
490Sstevel@tonic-gate  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
500Sstevel@tonic-gate  * OF THE POSSIBILITY OF SUCH DAMAGE.
510Sstevel@tonic-gate  * ====================================================================
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * This product includes cryptographic software written by Eric Young
540Sstevel@tonic-gate  * (eay@cryptsoft.com).  This product includes software written by Tim
550Sstevel@tonic-gate  * Hudson (tjh@cryptsoft.com).
560Sstevel@tonic-gate  *
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate 
590Sstevel@tonic-gate #include "eng_int.h"
60*2139Sjp161948 #include <openssl/rand.h>
610Sstevel@tonic-gate 
620Sstevel@tonic-gate /* The "new"/"free" stuff first */
630Sstevel@tonic-gate 
ENGINE_new(void)640Sstevel@tonic-gate ENGINE *ENGINE_new(void)
650Sstevel@tonic-gate 	{
660Sstevel@tonic-gate 	ENGINE *ret;
670Sstevel@tonic-gate 
680Sstevel@tonic-gate 	ret = (ENGINE *)OPENSSL_malloc(sizeof(ENGINE));
690Sstevel@tonic-gate 	if(ret == NULL)
700Sstevel@tonic-gate 		{
710Sstevel@tonic-gate 		ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
720Sstevel@tonic-gate 		return NULL;
730Sstevel@tonic-gate 		}
740Sstevel@tonic-gate 	memset(ret, 0, sizeof(ENGINE));
750Sstevel@tonic-gate 	ret->struct_ref = 1;
760Sstevel@tonic-gate 	engine_ref_debug(ret, 0, 1)
770Sstevel@tonic-gate 	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data);
780Sstevel@tonic-gate 	return ret;
790Sstevel@tonic-gate 	}
800Sstevel@tonic-gate 
810Sstevel@tonic-gate /* Placed here (close proximity to ENGINE_new) so that modifications to the
820Sstevel@tonic-gate  * elements of the ENGINE structure are more likely to be caught and changed
830Sstevel@tonic-gate  * here. */
engine_set_all_null(ENGINE * e)840Sstevel@tonic-gate void engine_set_all_null(ENGINE *e)
850Sstevel@tonic-gate 	{
860Sstevel@tonic-gate 	e->id = NULL;
870Sstevel@tonic-gate 	e->name = NULL;
880Sstevel@tonic-gate 	e->rsa_meth = NULL;
890Sstevel@tonic-gate 	e->dsa_meth = NULL;
900Sstevel@tonic-gate 	e->dh_meth = NULL;
910Sstevel@tonic-gate 	e->rand_meth = NULL;
92*2139Sjp161948 	e->store_meth = NULL;
930Sstevel@tonic-gate 	e->ciphers = NULL;
940Sstevel@tonic-gate 	e->digests = NULL;
950Sstevel@tonic-gate 	e->destroy = NULL;
960Sstevel@tonic-gate 	e->init = NULL;
970Sstevel@tonic-gate 	e->finish = NULL;
980Sstevel@tonic-gate 	e->ctrl = NULL;
990Sstevel@tonic-gate 	e->load_privkey = NULL;
1000Sstevel@tonic-gate 	e->load_pubkey = NULL;
1010Sstevel@tonic-gate 	e->cmd_defns = NULL;
1020Sstevel@tonic-gate 	e->flags = 0;
1030Sstevel@tonic-gate 	}
1040Sstevel@tonic-gate 
engine_free_util(ENGINE * e,int locked)1050Sstevel@tonic-gate int engine_free_util(ENGINE *e, int locked)
1060Sstevel@tonic-gate 	{
1070Sstevel@tonic-gate 	int i;
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate 	if(e == NULL)
1100Sstevel@tonic-gate 		{
111*2139Sjp161948 		ENGINEerr(ENGINE_F_ENGINE_FREE_UTIL,
1120Sstevel@tonic-gate 			ERR_R_PASSED_NULL_PARAMETER);
1130Sstevel@tonic-gate 		return 0;
1140Sstevel@tonic-gate 		}
1150Sstevel@tonic-gate 	if(locked)
1160Sstevel@tonic-gate 		i = CRYPTO_add(&e->struct_ref,-1,CRYPTO_LOCK_ENGINE);
1170Sstevel@tonic-gate 	else
1180Sstevel@tonic-gate 		i = --e->struct_ref;
1190Sstevel@tonic-gate 	engine_ref_debug(e, 0, -1)
1200Sstevel@tonic-gate 	if (i > 0) return 1;
1210Sstevel@tonic-gate #ifdef REF_CHECK
1220Sstevel@tonic-gate 	if (i < 0)
1230Sstevel@tonic-gate 		{
1240Sstevel@tonic-gate 		fprintf(stderr,"ENGINE_free, bad structural reference count\n");
1250Sstevel@tonic-gate 		abort();
1260Sstevel@tonic-gate 		}
1270Sstevel@tonic-gate #endif
1280Sstevel@tonic-gate 	/* Give the ENGINE a chance to do any structural cleanup corresponding
1290Sstevel@tonic-gate 	 * to allocation it did in its constructor (eg. unload error strings) */
1300Sstevel@tonic-gate 	if(e->destroy)
1310Sstevel@tonic-gate 		e->destroy(e);
1320Sstevel@tonic-gate 	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ENGINE, e, &e->ex_data);
1330Sstevel@tonic-gate 	OPENSSL_free(e);
1340Sstevel@tonic-gate 	return 1;
1350Sstevel@tonic-gate 	}
1360Sstevel@tonic-gate 
ENGINE_free(ENGINE * e)1370Sstevel@tonic-gate int ENGINE_free(ENGINE *e)
1380Sstevel@tonic-gate 	{
1390Sstevel@tonic-gate 	return engine_free_util(e, 1);
1400Sstevel@tonic-gate 	}
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate /* Cleanup stuff */
1430Sstevel@tonic-gate 
1440Sstevel@tonic-gate /* ENGINE_cleanup() is coded such that anything that does work that will need
1450Sstevel@tonic-gate  * cleanup can register a "cleanup" callback here. That way we don't get linker
1460Sstevel@tonic-gate  * bloat by referring to all *possible* cleanups, but any linker bloat into code
1470Sstevel@tonic-gate  * "X" will cause X's cleanup function to end up here. */
1480Sstevel@tonic-gate static STACK_OF(ENGINE_CLEANUP_ITEM) *cleanup_stack = NULL;
int_cleanup_check(int create)1490Sstevel@tonic-gate static int int_cleanup_check(int create)
1500Sstevel@tonic-gate 	{
1510Sstevel@tonic-gate 	if(cleanup_stack) return 1;
1520Sstevel@tonic-gate 	if(!create) return 0;
1530Sstevel@tonic-gate 	cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
1540Sstevel@tonic-gate 	return (cleanup_stack ? 1 : 0);
1550Sstevel@tonic-gate 	}
int_cleanup_item(ENGINE_CLEANUP_CB * cb)1560Sstevel@tonic-gate static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)
1570Sstevel@tonic-gate 	{
1580Sstevel@tonic-gate 	ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(
1590Sstevel@tonic-gate 					ENGINE_CLEANUP_ITEM));
1600Sstevel@tonic-gate 	if(!item) return NULL;
1610Sstevel@tonic-gate 	item->cb = cb;
1620Sstevel@tonic-gate 	return item;
1630Sstevel@tonic-gate 	}
engine_cleanup_add_first(ENGINE_CLEANUP_CB * cb)1640Sstevel@tonic-gate void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb)
1650Sstevel@tonic-gate 	{
1660Sstevel@tonic-gate 	ENGINE_CLEANUP_ITEM *item;
1670Sstevel@tonic-gate 	if(!int_cleanup_check(1)) return;
1680Sstevel@tonic-gate 	item = int_cleanup_item(cb);
1690Sstevel@tonic-gate 	if(item)
1700Sstevel@tonic-gate 		sk_ENGINE_CLEANUP_ITEM_insert(cleanup_stack, item, 0);
1710Sstevel@tonic-gate 	}
engine_cleanup_add_last(ENGINE_CLEANUP_CB * cb)1720Sstevel@tonic-gate void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb)
1730Sstevel@tonic-gate 	{
1740Sstevel@tonic-gate 	ENGINE_CLEANUP_ITEM *item;
1750Sstevel@tonic-gate 	if(!int_cleanup_check(1)) return;
1760Sstevel@tonic-gate 	item = int_cleanup_item(cb);
1770Sstevel@tonic-gate 	if(item)
1780Sstevel@tonic-gate 		sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item);
1790Sstevel@tonic-gate 	}
1800Sstevel@tonic-gate /* The API function that performs all cleanup */
engine_cleanup_cb_free(ENGINE_CLEANUP_ITEM * item)1810Sstevel@tonic-gate static void engine_cleanup_cb_free(ENGINE_CLEANUP_ITEM *item)
1820Sstevel@tonic-gate 	{
1830Sstevel@tonic-gate 	(*(item->cb))();
1840Sstevel@tonic-gate 	OPENSSL_free(item);
1850Sstevel@tonic-gate 	}
ENGINE_cleanup(void)1860Sstevel@tonic-gate void ENGINE_cleanup(void)
1870Sstevel@tonic-gate 	{
1880Sstevel@tonic-gate 	if(int_cleanup_check(0))
1890Sstevel@tonic-gate 		{
1900Sstevel@tonic-gate 		sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
1910Sstevel@tonic-gate 			engine_cleanup_cb_free);
1920Sstevel@tonic-gate 		cleanup_stack = NULL;
1930Sstevel@tonic-gate 		}
1940Sstevel@tonic-gate 	/* FIXME: This should be handled (somehow) through RAND, eg. by it
1950Sstevel@tonic-gate 	 * registering a cleanup callback. */
1960Sstevel@tonic-gate 	RAND_set_rand_method(NULL);
1970Sstevel@tonic-gate 	}
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate /* Now the "ex_data" support */
2000Sstevel@tonic-gate 
ENGINE_get_ex_new_index(long argl,void * argp,CRYPTO_EX_new * new_func,CRYPTO_EX_dup * dup_func,CRYPTO_EX_free * free_func)2010Sstevel@tonic-gate int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
2020Sstevel@tonic-gate 		CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
2030Sstevel@tonic-gate 	{
2040Sstevel@tonic-gate 	return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, argl, argp,
2050Sstevel@tonic-gate 			new_func, dup_func, free_func);
2060Sstevel@tonic-gate 	}
2070Sstevel@tonic-gate 
ENGINE_set_ex_data(ENGINE * e,int idx,void * arg)2080Sstevel@tonic-gate int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)
2090Sstevel@tonic-gate 	{
2100Sstevel@tonic-gate 	return(CRYPTO_set_ex_data(&e->ex_data, idx, arg));
2110Sstevel@tonic-gate 	}
2120Sstevel@tonic-gate 
ENGINE_get_ex_data(const ENGINE * e,int idx)2130Sstevel@tonic-gate void *ENGINE_get_ex_data(const ENGINE *e, int idx)
2140Sstevel@tonic-gate 	{
2150Sstevel@tonic-gate 	return(CRYPTO_get_ex_data(&e->ex_data, idx));
2160Sstevel@tonic-gate 	}
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate /* Functions to get/set an ENGINE's elements - mainly to avoid exposing the
2190Sstevel@tonic-gate  * ENGINE structure itself. */
2200Sstevel@tonic-gate 
ENGINE_set_id(ENGINE * e,const char * id)2210Sstevel@tonic-gate int ENGINE_set_id(ENGINE *e, const char *id)
2220Sstevel@tonic-gate 	{
2230Sstevel@tonic-gate 	if(id == NULL)
2240Sstevel@tonic-gate 		{
2250Sstevel@tonic-gate 		ENGINEerr(ENGINE_F_ENGINE_SET_ID,
2260Sstevel@tonic-gate 			ERR_R_PASSED_NULL_PARAMETER);
2270Sstevel@tonic-gate 		return 0;
2280Sstevel@tonic-gate 		}
2290Sstevel@tonic-gate 	e->id = id;
2300Sstevel@tonic-gate 	return 1;
2310Sstevel@tonic-gate 	}
2320Sstevel@tonic-gate 
ENGINE_set_name(ENGINE * e,const char * name)2330Sstevel@tonic-gate int ENGINE_set_name(ENGINE *e, const char *name)
2340Sstevel@tonic-gate 	{
2350Sstevel@tonic-gate 	if(name == NULL)
2360Sstevel@tonic-gate 		{
2370Sstevel@tonic-gate 		ENGINEerr(ENGINE_F_ENGINE_SET_NAME,
2380Sstevel@tonic-gate 			ERR_R_PASSED_NULL_PARAMETER);
2390Sstevel@tonic-gate 		return 0;
2400Sstevel@tonic-gate 		}
2410Sstevel@tonic-gate 	e->name = name;
2420Sstevel@tonic-gate 	return 1;
2430Sstevel@tonic-gate 	}
2440Sstevel@tonic-gate 
ENGINE_set_destroy_function(ENGINE * e,ENGINE_GEN_INT_FUNC_PTR destroy_f)2450Sstevel@tonic-gate int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f)
2460Sstevel@tonic-gate 	{
2470Sstevel@tonic-gate 	e->destroy = destroy_f;
2480Sstevel@tonic-gate 	return 1;
2490Sstevel@tonic-gate 	}
2500Sstevel@tonic-gate 
ENGINE_set_init_function(ENGINE * e,ENGINE_GEN_INT_FUNC_PTR init_f)2510Sstevel@tonic-gate int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f)
2520Sstevel@tonic-gate 	{
2530Sstevel@tonic-gate 	e->init = init_f;
2540Sstevel@tonic-gate 	return 1;
2550Sstevel@tonic-gate 	}
2560Sstevel@tonic-gate 
ENGINE_set_finish_function(ENGINE * e,ENGINE_GEN_INT_FUNC_PTR finish_f)2570Sstevel@tonic-gate int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f)
2580Sstevel@tonic-gate 	{
2590Sstevel@tonic-gate 	e->finish = finish_f;
2600Sstevel@tonic-gate 	return 1;
2610Sstevel@tonic-gate 	}
2620Sstevel@tonic-gate 
ENGINE_set_ctrl_function(ENGINE * e,ENGINE_CTRL_FUNC_PTR ctrl_f)2630Sstevel@tonic-gate int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f)
2640Sstevel@tonic-gate 	{
2650Sstevel@tonic-gate 	e->ctrl = ctrl_f;
2660Sstevel@tonic-gate 	return 1;
2670Sstevel@tonic-gate 	}
2680Sstevel@tonic-gate 
ENGINE_set_flags(ENGINE * e,int flags)2690Sstevel@tonic-gate int ENGINE_set_flags(ENGINE *e, int flags)
2700Sstevel@tonic-gate 	{
2710Sstevel@tonic-gate 	e->flags = flags;
2720Sstevel@tonic-gate 	return 1;
2730Sstevel@tonic-gate 	}
2740Sstevel@tonic-gate 
ENGINE_set_cmd_defns(ENGINE * e,const ENGINE_CMD_DEFN * defns)2750Sstevel@tonic-gate int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns)
2760Sstevel@tonic-gate 	{
2770Sstevel@tonic-gate 	e->cmd_defns = defns;
2780Sstevel@tonic-gate 	return 1;
2790Sstevel@tonic-gate 	}
2800Sstevel@tonic-gate 
ENGINE_get_id(const ENGINE * e)2810Sstevel@tonic-gate const char *ENGINE_get_id(const ENGINE *e)
2820Sstevel@tonic-gate 	{
2830Sstevel@tonic-gate 	return e->id;
2840Sstevel@tonic-gate 	}
2850Sstevel@tonic-gate 
ENGINE_get_name(const ENGINE * e)2860Sstevel@tonic-gate const char *ENGINE_get_name(const ENGINE *e)
2870Sstevel@tonic-gate 	{
2880Sstevel@tonic-gate 	return e->name;
2890Sstevel@tonic-gate 	}
2900Sstevel@tonic-gate 
ENGINE_get_destroy_function(const ENGINE * e)2910Sstevel@tonic-gate ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e)
2920Sstevel@tonic-gate 	{
2930Sstevel@tonic-gate 	return e->destroy;
2940Sstevel@tonic-gate 	}
2950Sstevel@tonic-gate 
ENGINE_get_init_function(const ENGINE * e)2960Sstevel@tonic-gate ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e)
2970Sstevel@tonic-gate 	{
2980Sstevel@tonic-gate 	return e->init;
2990Sstevel@tonic-gate 	}
3000Sstevel@tonic-gate 
ENGINE_get_finish_function(const ENGINE * e)3010Sstevel@tonic-gate ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e)
3020Sstevel@tonic-gate 	{
3030Sstevel@tonic-gate 	return e->finish;
3040Sstevel@tonic-gate 	}
3050Sstevel@tonic-gate 
ENGINE_get_ctrl_function(const ENGINE * e)3060Sstevel@tonic-gate ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e)
3070Sstevel@tonic-gate 	{
3080Sstevel@tonic-gate 	return e->ctrl;
3090Sstevel@tonic-gate 	}
3100Sstevel@tonic-gate 
ENGINE_get_flags(const ENGINE * e)3110Sstevel@tonic-gate int ENGINE_get_flags(const ENGINE *e)
3120Sstevel@tonic-gate 	{
3130Sstevel@tonic-gate 	return e->flags;
3140Sstevel@tonic-gate 	}
3150Sstevel@tonic-gate 
ENGINE_get_cmd_defns(const ENGINE * e)3160Sstevel@tonic-gate const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e)
3170Sstevel@tonic-gate 	{
3180Sstevel@tonic-gate 	return e->cmd_defns;
3190Sstevel@tonic-gate 	}
320*2139Sjp161948 
321*2139Sjp161948 /* eng_lib.o is pretty much linked into anything that touches ENGINE already, so
322*2139Sjp161948  * put the "static_state" hack here. */
323*2139Sjp161948 
324*2139Sjp161948 static int internal_static_hack = 0;
325*2139Sjp161948 
ENGINE_get_static_state(void)326*2139Sjp161948 void *ENGINE_get_static_state(void)
327*2139Sjp161948 	{
328*2139Sjp161948 	return &internal_static_hack;
329*2139Sjp161948 	}
330