Loading crypto/err/err.c +26 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ struct st_ERR_FNS void (*cb_err_del)(void); ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *); ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *); ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *); /* Works on the "thread_hash" error-state table */ LHASH *(*cb_thread_get)(void); ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *); Loading @@ -232,6 +233,7 @@ static LHASH *int_err_get(void); static void int_err_del(void); static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *); static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *); static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *); static LHASH *int_thread_get(void); static ERR_STATE *int_thread_get_item(const ERR_STATE *); static ERR_STATE *int_thread_set_item(ERR_STATE *); Loading @@ -244,6 +246,7 @@ static const ERR_FNS err_defaults = int_err_del, int_err_get_item, int_err_set_item, int_err_del_item, int_thread_get, int_thread_get_item, int_thread_set_item, Loading Loading @@ -368,6 +371,19 @@ static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *d) CRYPTO_r_unlock(CRYPTO_LOCK_ERR); return p; } static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *d) { ERR_STRING_DATA *p; LHASH *hash; err_fns_check(); hash = ERRFN(err_get)(); if(!hash) return NULL; CRYPTO_r_lock(CRYPTO_LOCK_ERR); p = (ERR_STRING_DATA *)lh_delete(hash, d); CRYPTO_r_unlock(CRYPTO_LOCK_ERR); return p; } static LHASH *int_thread_get(void) { LHASH *toret = NULL; Loading Loading @@ -545,6 +561,16 @@ void ERR_load_strings(int lib, ERR_STRING_DATA *str) } } void ERR_unload_strings(int lib, ERR_STRING_DATA *str) { while(str->error) { str->error|=ERR_PACK(lib,0,0); ERRFN(err_del_item)(str); str++; } } void ERR_free_strings(void) { err_fns_check(); Loading crypto/err/err.h +1 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,7 @@ void ERR_print_errors(BIO *bp); void ERR_add_error_data(int num, ...); #endif void ERR_load_strings(int lib,ERR_STRING_DATA str[]); void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); void ERR_load_ERR_strings(void); void ERR_load_crypto_strings(void); void ERR_free_strings(void); Loading Loading
crypto/err/err.c +26 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ struct st_ERR_FNS void (*cb_err_del)(void); ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *); ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *); ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *); /* Works on the "thread_hash" error-state table */ LHASH *(*cb_thread_get)(void); ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *); Loading @@ -232,6 +233,7 @@ static LHASH *int_err_get(void); static void int_err_del(void); static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *); static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *); static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *); static LHASH *int_thread_get(void); static ERR_STATE *int_thread_get_item(const ERR_STATE *); static ERR_STATE *int_thread_set_item(ERR_STATE *); Loading @@ -244,6 +246,7 @@ static const ERR_FNS err_defaults = int_err_del, int_err_get_item, int_err_set_item, int_err_del_item, int_thread_get, int_thread_get_item, int_thread_set_item, Loading Loading @@ -368,6 +371,19 @@ static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *d) CRYPTO_r_unlock(CRYPTO_LOCK_ERR); return p; } static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *d) { ERR_STRING_DATA *p; LHASH *hash; err_fns_check(); hash = ERRFN(err_get)(); if(!hash) return NULL; CRYPTO_r_lock(CRYPTO_LOCK_ERR); p = (ERR_STRING_DATA *)lh_delete(hash, d); CRYPTO_r_unlock(CRYPTO_LOCK_ERR); return p; } static LHASH *int_thread_get(void) { LHASH *toret = NULL; Loading Loading @@ -545,6 +561,16 @@ void ERR_load_strings(int lib, ERR_STRING_DATA *str) } } void ERR_unload_strings(int lib, ERR_STRING_DATA *str) { while(str->error) { str->error|=ERR_PACK(lib,0,0); ERRFN(err_del_item)(str); str++; } } void ERR_free_strings(void) { err_fns_check(); Loading
crypto/err/err.h +1 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,7 @@ void ERR_print_errors(BIO *bp); void ERR_add_error_data(int num, ...); #endif void ERR_load_strings(int lib,ERR_STRING_DATA str[]); void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); void ERR_load_ERR_strings(void); void ERR_load_crypto_strings(void); void ERR_free_strings(void); Loading