ssl/libcrypto/src/crypto/libcrypto_wsd.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
       
     3 
       
     4 Redistribution and use in source and binary forms, with or without 
       
     5 modification, are permitted provided that the following conditions are met:
       
     6 
       
     7 * Redistributions of source code must retain the above copyright notice, this 
       
     8   list of conditions and the following disclaimer.
       
     9 * Redistributions in binary form must reproduce the above copyright notice, 
       
    10   this list of conditions and the following disclaimer in the documentation 
       
    11   and/or other materials provided with the distribution.
       
    12 * Neither the name of Nokia Corporation nor the names of its contributors 
       
    13   may be used to endorse or promote products derived from this software 
       
    14   without specific prior written permission.
       
    15 
       
    16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
       
    17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
       
    18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
       
    19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
       
    20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
       
    21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
       
    22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
       
    23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
       
    24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
       
    25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    26 
       
    27 Description:
       
    28 */
       
    29 
       
    30 #ifndef _LIBCRYPTO_WSD_H
       
    31 #define _LIBCRYPTO_WSD_H
       
    32 
       
    33 #include <_ansi.h>
       
    34 #include <sys/cdefs.h>
       
    35 #include <stdio.h>
       
    36 #include <stdlib.h>
       
    37 #include <errno.h>
       
    38 #include <sys/types.h>
       
    39 #include <sys/cdefs.h>
       
    40 #include <sys/socket.h>
       
    41 #include <sys/types.h>
       
    42 #include <sys/ioctl.h>
       
    43 #include <netinet/in.h>
       
    44 #include <libcrypto_wsd_macros.h>
       
    45 #include "cryptlib.h"
       
    46 #include <openssl/asn1.h>
       
    47 #include <openssl/lhash.h>
       
    48 #include <openssl/crypto.h>
       
    49 #include <openssl/err.h>
       
    50 #include <openssl/bn.h>
       
    51 #include <openssl/comp.h>
       
    52 #include <openssl/dso.h>
       
    53 #include <openssl/des.h>
       
    54 #include <openssl/engine.h>
       
    55 #include <openssl/lhash.h>
       
    56 #include <openssl/ossl_typ.h>
       
    57 #include "eng_int.h"
       
    58 #include "rand_lcl.h"
       
    59 #include <openssl/bio.h>
       
    60 #include <openssl/conf.h>
       
    61 #include <openssl/dh.h>
       
    62 #include <openssl/dso.h>
       
    63 #include <openssl/dsa.h>
       
    64 #include <openssl/rsa.h>
       
    65 #include <openssl/store.h>
       
    66 #include <openssl/x509v3.h>
       
    67 #include <openssl/ui.h>
       
    68 #include <openssl/rand.h>
       
    69 #include "str_locl.h"
       
    70 #include "ui_locl.h"
       
    71 #include <zlib.h>
       
    72 
       
    73 #ifdef EMULATOR
       
    74 #define BN_NIST_256_TOP	(256+BN_BITS2-1)/BN_BITS2
       
    75 #define BN_NIST_384_TOP	(384+BN_BITS2-1)/BN_BITS2
       
    76 
       
    77 # define Z_CALLCONV
       
    78 
       
    79 typedef int (Z_CALLCONV *compress_ft)(Bytef *dest,uLongf *destLen,
       
    80 	const Bytef *source, uLong sourceLen);
       
    81 typedef int (Z_CALLCONV *inflateEnd_ft)(z_streamp strm);
       
    82 typedef int (Z_CALLCONV *inflate_ft)(z_streamp strm, int flush);
       
    83 typedef int (Z_CALLCONV *inflateInit__ft)(z_streamp strm,
       
    84 	const char * version, int stream_size);
       
    85 typedef int (Z_CALLCONV *deflateEnd_ft)(z_streamp strm);
       
    86 typedef int (Z_CALLCONV *deflate_ft)(z_streamp strm, int flush);
       
    87 typedef int (Z_CALLCONV *deflateInit__ft)(z_streamp strm, int level,
       
    88 	const char * version, int stream_size);
       
    89 
       
    90 /* What an "implementation of ex_data functionality" looks like */
       
    91 struct st_CRYPTO_EX_DATA_IMPL
       
    92 	{
       
    93 	/*********************/
       
    94 	/* GLOBAL OPERATIONS */
       
    95 	/* Return a new class index */
       
    96 	int (*cb_new_class)(void);
       
    97 	/* Cleanup all state used by the implementation */
       
    98 	void (*cb_cleanup)(void);
       
    99 	/************************/
       
   100 	/* PER-CLASS OPERATIONS */
       
   101 	/* Get a new method index within a class */
       
   102 	int (*cb_get_new_index)(int class_index, long argl, void *argp,
       
   103 			CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
       
   104 			CRYPTO_EX_free *free_func);
       
   105 	/* Initialise a new CRYPTO_EX_DATA of a given class */
       
   106 	int (*cb_new_ex_data)(int class_index, void *obj,
       
   107 			CRYPTO_EX_DATA *ad);
       
   108 	/* Duplicate a CRYPTO_EX_DATA of a given class onto a copy */
       
   109 	int (*cb_dup_ex_data)(int class_index, CRYPTO_EX_DATA *to,
       
   110 			CRYPTO_EX_DATA *from);
       
   111 	/* Cleanup a CRYPTO_EX_DATA of a given class */
       
   112 	void (*cb_free_ex_data)(int class_index, void *obj,
       
   113 			CRYPTO_EX_DATA *ad);
       
   114 	};
       
   115 
       
   116 struct st_ERR_FNS
       
   117 	{
       
   118 	/* Works on the "error_hash" string table */
       
   119 	LHASH *(*cb_err_get)(int create);
       
   120 	void (*cb_err_del)(void);
       
   121 	ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *);
       
   122 	ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *);
       
   123 	ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *);
       
   124 	/* Works on the "thread_hash" error-state table */
       
   125 	LHASH *(*cb_thread_get)(int create);
       
   126 	void (*cb_thread_release)(LHASH **hash);
       
   127 	ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *);
       
   128 	ERR_STATE *(*cb_thread_set_item)(ERR_STATE *);
       
   129 	void (*cb_thread_del_item)(const ERR_STATE *);
       
   130 	/* Returns the next available error "library" numbers */
       
   131 	int (*cb_get_next_lib)(void);
       
   132 	};
       
   133 
       
   134 
       
   135 #ifdef __cplusplus
       
   136 extern "C" 
       
   137 {
       
   138 #endif
       
   139 
       
   140 typedef struct
       
   141 {
       
   142 	
       
   143 	
       
   144 	VARIABLE_DECL(tntmp,s,asn1_gen,struct tag_name_st*)
       
   145     VARIABLE_DECL(ia5string_meth,s,a_meth,ASN1_METHOD)
       
   146     VARIABLE_DECL(bit_string_meth,s,a_meth,ASN1_METHOD)
       
   147     VARIABLE_DECL(stable,s,a_strnid,STACK_OF(ASN1_STRING_TABLE)*)
       
   148     VARIABLE_DECL(global_mask,s,a_strnid,unsigned long)
       
   149     VARIABLE_DECL(app_locks,s,cryptlib,STACK *)
       
   150     VARIABLE_DECL(dyn_locks,s,cryptlib,STACK_OF(CRYPTO_dynlock)*)
       
   151     VARIABLE_DECL(allow_customize,s,mem,int)
       
   152     VARIABLE_DECL(allow_customize_debug,s,mem,int)
       
   153     VARIABLE_DECL(mh_mode,s,mem_dbg,int)
       
   154     VARIABLE_DECL(order,s,mem_dbg,unsigned long)
       
   155     VARIABLE_DECL(mh,s,mem_dbg,LHASH *)
       
   156     VARIABLE_DECL(amih,s,mem_dbg,LHASH *)
       
   157     VARIABLE_DECL(options,s,mem_dbg,unsigned long)
       
   158     VARIABLE_DECL(num_disable,s,mem_dbg,unsigned int)
       
   159     VARIABLE_DECL(disabling_thread,s,mem_dbg,unsigned long)
       
   160     VARIABLE_DECL(impl,s,ex_data,CRYPTO_EX_DATA_IMPL *)
       
   161     VARIABLE_DECL(ex_class,s,ex_data,int)
       
   162     VARIABLE_DECL(ex_data,s,ex_data,LHASH *)
       
   163     VARIABLE_DECL(init,s,bn_lib,int)
       
   164     VARIABLE_DECL_ARRAY(data,s,bn_lib,char,16)
       
   165     VARIABLE_DECL(data_one,s,bn_lib,BN_ULONG)
       
   166     VARIABLE_DECL(const_one,s,bn_lib,BIGNUM)
       
   167     VARIABLE_DECL_ARRAY(_256_data,s,bn_nist,BN_ULONG,BN_NIST_256_TOP*6)
       
   168     VARIABLE_DECL(_is_set_256_data,s,bn_nist,int)
       
   169     VARIABLE_DECL_ARRAY(_384_data,s,bn_nist,BN_ULONG,BN_NIST_384_TOP*8)
       
   170     VARIABLE_DECL(_is_set_384_data,s,bn_nist,int)
       
   171     VARIABLE_DECL(zlib_stateful_ex_idx,s,c_zlib,int)
       
   172     VARIABLE_DECL(p_compress,s,c_zlib,compress_ft)
       
   173     VARIABLE_DECL(p_inflateEnd,s,c_zlib,inflateEnd_ft)
       
   174     VARIABLE_DECL(p_inflate,s,c_zlib,inflate_ft)
       
   175     VARIABLE_DECL(p_inflateInit_,s,c_zlib,inflateInit__ft)
       
   176     VARIABLE_DECL(p_deflateEnd,s,c_zlib,deflateEnd_ft)
       
   177     VARIABLE_DECL(p_deflate,s,c_zlib,deflate_ft)
       
   178     VARIABLE_DECL(p_deflateInit_,s,c_zlib,deflateInit__ft)
       
   179     VARIABLE_DECL(zlib_loaded,s,c_zlib,int)
       
   180     VARIABLE_DECL(zlib_dso,s,c_zlib,DSO *)
       
   181  	  VARIABLE_DECL(supported_modules,s,conf_mod,STACK_OF(CONF_MODULE)*)
       
   182     VARIABLE_DECL(initialized_modules,s,conf_mod,STACK_OF(CONF_MODULE)*)
       
   183     VARIABLE_DECL(openssl_configured,s,conf_sap,int)
       
   184     VARIABLE_DECL(init,s,ecb_enc,int)
       
   185     VARIABLE_DECL_ARRAY(buf,s,ecb_enc,char,32)
       
   186     VARIABLE_DECL(net,s,enc_read,unsigned char *)
       
   187     VARIABLE_DECL(unnet,s,enc_read,unsigned char *)
       
   188     VARIABLE_DECL(unnet_start,s,enc_read,int)
       
   189     VARIABLE_DECL(unnet_left,s,enc_read,int)
       
   190     VARIABLE_DECL(tmpbuf,s,enc_read,unsigned char *)
       
   191     VARIABLE_DECL(outbuf,s,enc_write,unsigned char *)
       
   192     VARIABLE_DECL(start,s,enc_write,int)
       
   193     VARIABLE_DECL_ARRAY(weak_keys,s,set_key_c,DES_cblock,16)
       
   194     VARIABLE_DECL(cleanup_stack,s,eng_lib,STACK_OF(ENGINE_CLEANUP_ITEM) *)
       
   195     VARIABLE_DECL(internal_static_hack,s,eng_lib,int)
       
   196     VARIABLE_DECL(engine_list_head,s,eng_list,ENGINE *)
       
   197     VARIABLE_DECL(engine_list_tail,s,eng_list,ENGINE *)
       
   198     VARIABLE_DECL(table_flags,s,eng_table,unsigned int)
       
   199     VARIABLE_DECL(initialized_engines,s,eng_cnf,STACK_OF(ENGINE) *)
       
   200     VARIABLE_DECL(dynamic_ex_data_idx,s,eng_dyn,int)
       
   201     VARIABLE_DECL(rsa_table,s,tb_rsa,ENGINE_TABLE *)
       
   202     VARIABLE_DECL(dsa_table,s,tb_dsa,ENGINE_TABLE *)
       
   203     VARIABLE_DECL(ecdh_table,s,tb_ecdh,ENGINE_TABLE *)
       
   204     VARIABLE_DECL(ecdsa_table,s,tb_ecdsa,ENGINE_TABLE *)
       
   205     VARIABLE_DECL(rand_table,s,tb_rand,ENGINE_TABLE *)
       
   206     VARIABLE_DECL(digest_table,s,tb_digest,ENGINE_TABLE *)
       
   207     VARIABLE_DECL(store_table,s,tb_store,ENGINE_TABLE *)
       
   208     VARIABLE_DECL(dh_table,s,tb_dh,ENGINE_TABLE *)
       
   209     VARIABLE_DECL(cipher_table,s,tb_cipher,ENGINE_TABLE *)
       
   210     VARIABLE_DECL(err_fns,s,err,const ERR_FNS *)
       
   211     VARIABLE_DECL(int_error_hash,s,err,LHASH *)
       
   212     VARIABLE_DECL(int_thread_hash,s,err,LHASH *)
       
   213     VARIABLE_DECL(int_thread_hash_references,s,err,int)
       
   214     VARIABLE_DECL(int_err_library_number,s,err,int) 
       
   215     VARIABLE_DECL(init,s,err,int)
       
   216     VARIABLE_DECL(pbe_algs,s,evp_pbe,STACK *) 
       
   217     VARIABLE_DECL(names_lh,s,o_names,LHASH *)
       
   218     VARIABLE_DECL(names_type_num,s,o_names,int)
       
   219     VARIABLE_DECL(name_funcs_stack,s,o_names,STACK_OF(NAME_FUNCS)*)
       
   220     VARIABLE_DECL(free_type,s,o_names,int)     
       
   221     VARIABLE_DECL(new_nid,s,obj_dat,int)
       
   222     VARIABLE_DECL(added,s,obj_dat,LHASH *)
       
   223     VARIABLE_DECL(state_num,s,md_rand,int)
       
   224     VARIABLE_DECL(state_index,s,md_rand,int)
       
   225     VARIABLE_DECL_ARRAY(state,s,md_rand,unsigned char,1023+MD_DIGEST_LENGTH)
       
   226     VARIABLE_DECL_ARRAY(md,s,md_rand,unsigned char,MD_DIGEST_LENGTH)
       
   227     VARIABLE_DECL_ARRAY(md_count,s,md_rand,unsigned char,2)
       
   228     VARIABLE_DECL(entropy,s,md_rand,double)
       
   229     VARIABLE_DECL(initialized,s,md_rand,int)
       
   230     VARIABLE_DECL(crypto_lock_rand,s,md_rand,unsigned int)
       
   231     VARIABLE_DECL(locking_thread,s,md_rand,unsigned long)
       
   232     VARIABLE_DECL(default_RAND_meth,s,rand_lib,const RAND_METHOD *)
       
   233     VARIABLE_DECL(tty_in,s,ui_openssl,FILE *)
       
   234     VARIABLE_DECL(tty_out,s,ui_openssl,FILE *)
       
   235     VARIABLE_DECL(is_a_tty,s,ui_openssl,int)
       
   236     VARIABLE_DECL(ext_nids,s,x509_req,int*)
       
   237     VARIABLE_DECL_ARRAY(ext_nid_list,s,x509_req,int,3)
       
   238     VARIABLE_DECL(trtable,s,x509_trs,STACK_OF(X509_TRUST) *)
       
   239     VARIABLE_DECL(param_table,s,x509_vpm,STACK_OF(X509_VERIFY_PARAM) *)
       
   240     VARIABLE_DECL(ext_list,s,v3_lib,STACK_OF(X509V3_EXT_METHOD) *)
       
   241     VARIABLE_DECL(xptable,s,v3_purp,STACK_OF(X509_PURPOSE)*)
       
   242     VARIABLE_DECL(from,s,b_sock,struct sockaddr_in)    
       
   243     VARIABLE_DECL_ARRAY(buff,s,fcrypt,char,14)
       
   244     VARIABLE_DECL_ARRAY(buf,s,err,char,256)
       
   245     VARIABLE_DECL(fallback,s,err,ERR_STATE)
       
   246     VARIABLE_DECL_ARRAY(SYS_str_reasons,s,err,ERR_STRING_DATA,128)//NUM_SYS_STR_REASONS + 1
       
   247     VARIABLE_DECL_ARRAY(prompt_string,s,evp_key,char,80)
       
   248     VARIABLE_DECL_ARRAY(m,s,hmac,unsigned char,EVP_MAX_MD_SIZE)
       
   249     VARIABLE_DECL_ARRAY(m,s,md2,unsigned char,EVP_MAX_MD_SIZE)
       
   250     VARIABLE_DECL_ARRAY(m,s,md5,unsigned char,EVP_MAX_MD_SIZE)
       
   251     VARIABLE_DECL_ARRAY(m,s,sha1_one,unsigned char,SHA_DIGEST_LENGTH)
       
   252     VARIABLE_DECL_ARRAY(m,s,sha_one,unsigned char,EVP_MAX_MD_SIZE)
       
   253     VARIABLE_DECL_ARRAY(buf,s,x509_txt,char,100)
       
   254     VARIABLE_DECL_ARRAY(ASN1_str_functs,s,asn1_err, ERR_STRING_DATA,108)
       
   255     VARIABLE_DECL_ARRAY(ASN1_str_reasons,s,asn1_err,ERR_STRING_DATA,99)
       
   256     VARIABLE_DECL_ARRAY(CRYPTO_str_functs,s,cpt_err,ERR_STRING_DATA,10)
       
   257     VARIABLE_DECL_ARRAY(CRYPTO_str_reasons,s,cpt_err,ERR_STRING_DATA,2)
       
   258     VARIABLE_DECL_ARRAY(BIO_str_functs,s,bio_err,ERR_STRING_DATA,33)
       
   259     VARIABLE_DECL_ARRAY(BIO_str_reasons,s,bio_err,ERR_STRING_DATA,30)
       
   260     VARIABLE_DECL_ARRAY(BN_str_functs,s,bn_err,ERR_STRING_DATA,39)
       
   261     VARIABLE_DECL_ARRAY(BN_str_reasons,s,bn_err,ERR_STRING_DATA,18)
       
   262     VARIABLE_DECL_ARRAY(BUF_str_functs,s,buf_err,ERR_STRING_DATA,7)
       
   263     VARIABLE_DECL_ARRAY(BUF_str_reasons,s,buf_err,ERR_STRING_DATA,1)
       
   264     VARIABLE_DECL_ARRAY(COMP_str_functs,s,comp_err,ERR_STRING_DATA,1)
       
   265     VARIABLE_DECL_ARRAY(COMP_str_reasons,s,comp_err,ERR_STRING_DATA,1)
       
   266     VARIABLE_DECL_ARRAY(CONF_str_functs,s,conf_err,ERR_STRING_DATA,22)
       
   267     VARIABLE_DECL_ARRAY(CONF_str_reasons,s,conf_err,ERR_STRING_DATA,16)
       
   268     VARIABLE_DECL_ARRAY(DH_str_functs,s,dh_err,ERR_STRING_DATA,8)
       
   269     VARIABLE_DECL_ARRAY(DH_str_reasons,s,dh_err,ERR_STRING_DATA,4)
       
   270     VARIABLE_DECL_ARRAY(DSA_str_functs,s,dsa_err,ERR_STRING_DATA,15)
       
   271     VARIABLE_DECL_ARRAY(DSA_str_reasons,s,dsa_err,ERR_STRING_DATA,3)
       
   272     VARIABLE_DECL_ARRAY(DSO_str_functs,s,dso_err,ERR_STRING_DATA,38)
       
   273     VARIABLE_DECL_ARRAY(DSO_str_reasons,s,dso_err,ERR_STRING_DATA,18)
       
   274     VARIABLE_DECL_ARRAY(ENGINE_str_functs,s,eng_err,ERR_STRING_DATA,37)
       
   275     VARIABLE_DECL_ARRAY(ENGINE_str_reasons,s,eng_err,ERR_STRING_DATA,40)
       
   276     VARIABLE_DECL_ARRAY(ERR_str_libraries,s,err_err,ERR_STRING_DATA,25)
       
   277     VARIABLE_DECL_ARRAY(ERR_str_functs,s,err_err,ERR_STRING_DATA,11)
       
   278     VARIABLE_DECL_ARRAY(ERR_str_reasons,s,err_err,ERR_STRING_DATA,36)
       
   279     VARIABLE_DECL_ARRAY(EVP_str_functs,s,evp_err,ERR_STRING_DATA,36)
       
   280     VARIABLE_DECL_ARRAY(EVP_str_reasons,s,evp_err,ERR_STRING_DATA,45)
       
   281     VARIABLE_DECL_ARRAY(OBJ_str_functs,s,obj_err,ERR_STRING_DATA,8)
       
   282     VARIABLE_DECL_ARRAY(OBJ_str_reasons,s,obj_err,ERR_STRING_DATA,3)
       
   283     VARIABLE_DECL_ARRAY(OCSP_str_functs,s,ocsp_err,ERR_STRING_DATA,18)
       
   284     VARIABLE_DECL_ARRAY(OCSP_str_reasons,s,ocsp_err,ERR_STRING_DATA,31)
       
   285     VARIABLE_DECL_ARRAY(PEM_str_functs,s,pem_err,ERR_STRING_DATA,27)
       
   286     VARIABLE_DECL_ARRAY(PEM_str_reasons,s,pem_err,ERR_STRING_DATA,17)
       
   287     VARIABLE_DECL_ARRAY(PKCS7_str_functs,s,pkcs7_err,ERR_STRING_DATA,29)
       
   288     VARIABLE_DECL_ARRAY(PKCS7_str_reasons,s,pkcs7_err,ERR_STRING_DATA,47)
       
   289     VARIABLE_DECL_ARRAY(PKCS12_str_functs,s,pkcs12_err,ERR_STRING_DATA,30)
       
   290     VARIABLE_DECL_ARRAY(PKCS12_str_reasons,s,pkcs12_err,ERR_STRING_DATA,23)
       
   291     VARIABLE_DECL_ARRAY(RAND_str_functs,s,rand_err,ERR_STRING_DATA,3)
       
   292     VARIABLE_DECL_ARRAY(RAND_str_reasons,s,rand_err,ERR_STRING_DATA,2)
       
   293     VARIABLE_DECL_ARRAY(RSA_str_functs,s,rsa_err,ERR_STRING_DATA,38)
       
   294     VARIABLE_DECL_ARRAY(RSA_str_reasons,s,rsa_err,ERR_STRING_DATA,41)
       
   295     VARIABLE_DECL_ARRAY(UI_str_functs,s,ui_err,ERR_STRING_DATA,13)
       
   296     VARIABLE_DECL_ARRAY(UI_str_reasons,s,ui_err,ERR_STRING_DATA,8)
       
   297     VARIABLE_DECL_ARRAY(X509_str_functs,s,x509_err,ERR_STRING_DATA,46)
       
   298     VARIABLE_DECL_ARRAY(X509_str_reasons,s,x509_err,ERR_STRING_DATA,24)
       
   299     VARIABLE_DECL_ARRAY(X509V3_str_functs,s,x509v3_err,ERR_STRING_DATA,57)
       
   300     VARIABLE_DECL_ARRAY(X509V3_str_reasons,s,x509v3_err,ERR_STRING_DATA,61)
       
   301     VARIABLE_DECL(default_CONF_method,s,conf_lib,const CONF_METHOD *)
       
   302     VARIABLE_DECL(default_DH_method,s,dh_lib,const DH_METHOD *)
       
   303     VARIABLE_DECL(default_DSA_method,s,dsa_lib,const DSA_METHOD *)
       
   304     VARIABLE_DECL(default_DSO_meth,s,dso_lib,DSO_METHOD *)
       
   305     VARIABLE_DECL(default_RSA_meth,s,rsa_lib,const RSA_METHOD *)
       
   306     VARIABLE_DECL(default_UI_meth,s,ui_lib,const UI_METHOD *)
       
   307     
       
   308     void *(*malloc_func)(size_t);
       
   309     void *(*malloc_ex_func)(size_t, const char *file, int line);
       
   310     void *(*realloc_func)(void *, size_t);
       
   311     void *(*realloc_ex_func)(void *, size_t, const char *file, int line);
       
   312     void (*free_func_openssl)(void *);
       
   313     void *(*malloc_locked_func)(size_t);
       
   314     void *(*malloc_locked_ex_func)(size_t, const char *file, int line);
       
   315     void (*free_locked_func)(void *);
       
   316     void (*malloc_debug_func)(void *,int,const char *,int,int);
       
   317 	  void (*realloc_debug_func)(void *,void *,int,const char *,int,int);
       
   318     void (*free_debug_func)(void *,int);
       
   319     void (*set_debug_options_func)(long);
       
   320     long (*get_debug_options_func)(void);
       
   321     void (MS_FAR *locking_callback)(int mode,int type,
       
   322     const char *file,int line);
       
   323     int (MS_FAR *add_lock_callback)(int *pointer,int amount,
       
   324    	int type,const char *file,int line);
       
   325     unsigned long (MS_FAR *id_callback)(void);
       
   326     struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback)
       
   327 	  (const char *file,int line);
       
   328     void (MS_FAR *dynlock_lock_callback)(int mode,
       
   329 	  struct CRYPTO_dynlock_value *l, const char *file,int line);
       
   330     void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
       
   331 	  const char *file,int line);
       
   332     
       
   333     /*START-static structs*/
       
   334    	VARIABLE_DECL(impl_default,s,ex_data,CRYPTO_EX_DATA_IMPL)
       
   335    	VARIABLE_DECL(mem_method,s,bss_mem,BIO_METHOD)
       
   336    	VARIABLE_DECL(null_method,s,bss_null,BIO_METHOD)
       
   337     VARIABLE_DECL(methods_fdp,s,bss_fd,BIO_METHOD)
       
   338 	  VARIABLE_DECL(methods_sockp,s,bss_sock,BIO_METHOD)
       
   339 	  VARIABLE_DECL(methods_filep,s,bss_file,BIO_METHOD)
       
   340 	  VARIABLE_DECL(methods_dgramp,s,bss_dgram,BIO_METHOD)
       
   341 	  VARIABLE_DECL(methods_connectp,s,bss_conn,BIO_METHOD)
       
   342 	  VARIABLE_DECL(methods_biop,s,bss_bio,BIO_METHOD)
       
   343 	  VARIABLE_DECL(methods_acceptp,s,bss_acpt,BIO_METHOD)
       
   344 	  VARIABLE_DECL(rle_method,s,c_rle,COMP_METHOD)
       
   345 	  VARIABLE_DECL(zlib_method_nozlib,s,c_zlib,COMP_METHOD)
       
   346 #ifdef ZLIB	  
       
   347     VARIABLE_DECL(zlib_stateful_method,s,c_zlib,COMP_METHOD)
       
   348 #endif    
       
   349     VARIABLE_DECL(default_method,s,conf_def,CONF_METHOD)
       
   350     VARIABLE_DECL(WIN32_method,s,conf_def,CONF_METHOD)
       
   351     VARIABLE_DECL(dh_ossl,s,dh_key,DH_METHOD)
       
   352     VARIABLE_DECL(openssl_dsa_meth,s,dsa_ossl,DSA_METHOD)
       
   353     //VARIABLE_DECL(dso_meth_dl,s,dso_dl,DSO_METHOD)
       
   354     VARIABLE_DECL(dso_meth_dlfcn,s,dso_dlfcn,DSO_METHOD)
       
   355     VARIABLE_DECL(dso_meth_null,s,dso_null,DSO_METHOD)
       
   356     VARIABLE_DECL(methods_md,s,bio_md,BIO_METHOD)
       
   357     VARIABLE_DECL(methods_b64,s,bio_b64,BIO_METHOD)
       
   358     VARIABLE_DECL(methods_enc,s,bio_enc,BIO_METHOD)
       
   359     VARIABLE_DECL(methods_ok,s,bio_ok,BIO_METHOD)
       
   360     VARIABLE_DECL(rsa_pkcs1_eay_meth,s,rsa_eay,RSA_METHOD )
       
   361     VARIABLE_DECL(store_memory,s,str_mem,STORE_METHOD)
       
   362     VARIABLE_DECL(ui_openssl,s,ui_openssl,UI_METHOD)
       
   363     VARIABLE_DECL(nconf_method,s,v3_conf,X509V3_CONF_METHOD)
       
   364     VARIABLE_DECL(conf_lhash_method,s,v3_conf,X509V3_CONF_METHOD)
       
   365     VARIABLE_DECL(meth,s,x_x509,ASN1_METHOD)
       
   366     VARIABLE_DECL(method,s,rsa_asn1,ASN1_METHOD)
       
   367     VARIABLE_DECL(stirred_pool,s,md_rand,volatile int)
       
   368  
       
   369     char strerror_tab[127][32];
       
   370     int _shadow_DES_rw_mode;
       
   371     int _shadow_DES_check_key;
       
   372 
       
   373     /*END-static structs*/   
       
   374     /*START-global vars*/
       
   375     VARIABLE_DECL(cleanse_ctr,g,mem_clr,unsigned char)
       
   376     VARIABLE_DECL(rand_ssleay_meth,g,md_rand, RAND_METHOD)
       
   377     VARIABLE_DECL(x509_file_lookup,g,by_file,X509_LOOKUP_METHOD)
       
   378     VARIABLE_DECL(x509_dir_lookup,g,by_dir,X509_LOOKUP_METHOD)
       
   379    
       
   380     /*END-global vars*/
       
   381  
       
   382     }libcrypto_global_struct;
       
   383 #ifdef __cplusplus
       
   384 }
       
   385 #endif
       
   386 #ifdef __cplusplus
       
   387 extern "C" 
       
   388 {
       
   389 #endif
       
   390 libcrypto_global_struct * libcrypto_ImpurePtr();
       
   391 int libcrypto_Init(libcrypto_global_struct *);
       
   392 #ifdef __cplusplus
       
   393 }
       
   394 #endif
       
   395 
       
   396 #endif /* EMULATOR */
       
   397 #endif //_LIBCRYPTO_WSD_H