
1: An initial review of the OpenSSL code was done to determine how many 2: global variables where present. The idea was to determine the amount of 3: work required to pull the globals into an instance data structure in 4: order to build a Library NLM for NetWare. This file contains the results 5: of the review. Each file is listed along with the globals in the file. 6: The initial review was done very quickly so this list is probably 7: not a comprehensive list. 8: 9: 10: cryptlib.c 11: =========================================== 12: 13: static STACK *app_locks=NULL; 14: 15: static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL; 16: 17: static void (MS_FAR *locking_callback)(int mode,int type, 18: const char *file,int line)=NULL; 19: static int (MS_FAR *add_lock_callback)(int *pointer,int amount, 20: int type,const char *file,int line)=NULL; 21: static unsigned long (MS_FAR *id_callback)(void)=NULL; 22: static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback) 23: (const char *file,int line)=NULL; 24: static void (MS_FAR *dynlock_lock_callback)(int mode, 25: struct CRYPTO_dynlock_value *l, const char *file,int line)=NULL; 26: static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l, 27: const char *file,int line)=NULL; 28: 29: 30: mem.c 31: =========================================== 32: static int allow_customize = 1; /* we provide flexible functions for */ 33: static int allow_customize_debug = 1;/* exchanging memory-related functions at 34: 35: /* may be changed as long as `allow_customize' is set */ 36: static void *(*malloc_locked_func)(size_t) = malloc; 37: static void (*free_locked_func)(void *) = free; 38: static void *(*malloc_func)(size_t) = malloc; 39: static void *(*realloc_func)(void *, size_t)= realloc; 40: static void (*free_func)(void *) = free; 41: 42: /* use default functions from mem_dbg.c */ 43: static void (*malloc_debug_func)(void *,int,const char *,int,int) 44: = CRYPTO_dbg_malloc; 45: static void (*realloc_debug_func)(void *,void *,int,const char *,int,int) 46: = CRYPTO_dbg_realloc; 47: static void (*free_debug_func)(void *,int) = CRYPTO_dbg_free; 48: static void (*set_debug_options_func)(long) = CRYPTO_dbg_set_options; 49: static long (*get_debug_options_func)(void) = CRYPTO_dbg_get_options; 50: 51: 52: mem_dbg.c 53: =========================================== 54: static int mh_mode=CRYPTO_MEM_CHECK_OFF; 55: static unsigned long order = 0; /* number of memory requests */ 56: static LHASH *mh=NULL; /* hash-table of memory requests (address as key) */ 57: 58: static LHASH *amih=NULL; /* hash-table with those app_mem_info_st's */ 59: static long options = /* extra information to be recorded */ 60: static unsigned long disabling_thread = 0; 61: 62: 63: err.c 64: =========================================== 65: static LHASH *error_hash=NULL; 66: static LHASH *thread_hash=NULL; 67: 68: several files have routines with static "init" to track if error strings 69: have been loaded ( may not want seperate error strings for each process ) 70: The "init" variable can't be left "global" because the error has is a ptr 71: that is malloc'ed. The malloc'ed error has is dependant on the "init" 72: vars. 73: 74: files: 75: pem_err.c 76: cpt_err.c 77: pk12err.c 78: asn1_err.c 79: bio_err.c 80: bn_err.c 81: buf_err.c 82: comp_err.c 83: conf_err.c 84: cpt_err.c 85: dh_err.c 86: dsa_err.c 87: dso_err.c 88: evp_err.c 89: obj_err.c 90: pkcs7err.c 91: rand_err.c 92: rsa_err.c 93: rsar_err.c 94: ssl_err.c 95: x509_err.c 96: v3err.c 97: err.c 98: 99: These file have similar "init" globals but they are for other stuff not 100: error strings: 101: 102: bn_lib.c 103: ecc_enc.c 104: s23_clnt.c 105: s23_meth.c 106: s23_srvr.c 107: s2_clnt.c 108: s2_lib.c 109: s2_meth.c 110: s2_srvr.c 111: s3_clnt.c 112: s3_lib.c 113: s3_srvr.c 114: t1_clnt.c 115: t1_meth.c 116: t1_srvr.c 117: 118: rand_lib.c 119: =========================================== 120: static RAND_METHOD *rand_meth= &rand_ssleay_meth; 121: 122: md_rand.c 123: =========================================== 124: static int state_num=0,state_index=0; 125: static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH]; 126: static unsigned char md[MD_DIGEST_LENGTH]; 127: static long md_count[2]={0,0}; 128: static double entropy=0; 129: static int initialized=0; 130: 131: /* This should be set to 1 only when ssleay_rand_add() is called inside 132: an already locked state, so it doesn't try to lock and thereby cause 133: a hang. And it should always be reset back to 0 before unlocking. */ 134: static int add_do_not_lock=0; 135: 136: obj_dat.c 137: ============================================ 138: static int new_nid=NUM_NID; 139: static LHASH *added=NULL; 140: 141: b_sock.c 142: =========================================== 143: static unsigned long BIO_ghbn_hits=0L; 144: static unsigned long BIO_ghbn_miss=0L; 145: static struct ghbn_cache_st 146: { 147: char name[129]; 148: struct hostent *ent; 149: unsigned long order; 150: } ghbn_cache[GHBN_NUM]; 151: 152: static int wsa_init_done=0; 153: 154: 155: bio_lib.c 156: =========================================== 157: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *bio_meth=NULL; 158: static int bio_meth_num=0; 159: 160: 161: bn_lib.c 162: ======================================== 163: static int bn_limit_bits=0; 164: static int bn_limit_num=8; /* (1<<bn_limit_bits) */ 165: static int bn_limit_bits_low=0; 166: static int bn_limit_num_low=8; /* (1<<bn_limit_bits_low) */ 167: static int bn_limit_bits_high=0; 168: static int bn_limit_num_high=8; /* (1<<bn_limit_bits_high) */ 169: static int bn_limit_bits_mont=0; 170: static int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */ 171: 172: conf_lib.c 173: ======================================== 174: static CONF_METHOD *default_CONF_method=NULL; 175: 176: dh_lib.c 177: ======================================== 178: static DH_METHOD *default_DH_method; 179: static int dh_meth_num = 0; 180: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL; 181: 182: dsa_lib.c 183: ======================================== 184: static DSA_METHOD *default_DSA_method; 185: static int dsa_meth_num = 0; 186: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL; 187: 188: dso_lib.c 189: ======================================== 190: static DSO_METHOD *default_DSO_meth = NULL; 191: 192: rsa_lib.c 193: ======================================== 194: static RSA_METHOD *default_RSA_meth=NULL; 195: static int rsa_meth_num=0; 196: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *rsa_meth=NULL; 197: 198: x509_trs.c 199: ======================================= 200: static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; 201: static STACK_OF(X509_TRUST) *trtable = NULL; 202: 203: x509_req.c 204: ======================================= 205: static int *ext_nids = ext_nid_list; 206: 207: o_names.c 208: ====================================== 209: static LHASH *names_lh=NULL; 210: static STACK_OF(NAME_FUNCS) *name_funcs_stack; 211: static int free_type; 212: static int names_type_num=OBJ_NAME_TYPE_NUM; 213: 214: 215: th-lock.c - NEED to add support for locking for NetWare 216: ============================================== 217: static long *lock_count; 218: (other platform specific globals) 219: 220: x_x509.c 221: ============================================== 222: static int x509_meth_num = 0; 223: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; 224: 225: 226: evp_pbe.c 227: ============================================ 228: static STACK *pbe_algs; 229: 230: evp_key.c 231: ============================================ 232: static char prompt_string[80]; 233: 234: ssl_ciph.c 235: ============================================ 236: static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL; 237: 238: ssl_lib.c 239: ============================================= 240: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_meth=NULL; 241: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_ctx_meth=NULL; 242: static int ssl_meth_num=0; 243: static int ssl_ctx_meth_num=0; 244: 245: ssl_sess.c 246: ============================================= 247: static int ssl_session_num=0; 248: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_session_meth=NULL; 249: 250: x509_vfy.c 251: ============================================ 252: static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_method=NULL; 253: static int x509_store_ctx_num=0; 254: