X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Ferr%2Ferr.c;h=3492950b59be3e05bc1d5c82594b22265f0b2a16;hb=cd91fd7c32428c0deb503f19b8061e0980476876;hp=66d4da85560c38eb8c3f0de03b8b65b8a48874d7;hpb=3c1d6bbc9242900af0e5db927fdcda38539bd54a;p=oweals%2Fopenssl.git diff --git a/crypto/err/err.c b/crypto/err/err.c index 66d4da8556..3492950b59 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -109,6 +109,8 @@ * */ +#define OPENSSL_NO_FIPS_ERR + #include #include #include @@ -143,6 +145,8 @@ static ERR_STRING_DATA ERR_str_libraries[]= {ERR_PACK(ERR_LIB_CONF,0,0) ,"configuration file routines"}, {ERR_PACK(ERR_LIB_CRYPTO,0,0) ,"common libcrypto routines"}, {ERR_PACK(ERR_LIB_EC,0,0) ,"elliptic curve routines"}, +{ERR_PACK(ERR_LIB_ECDSA,0,0) ,"ECDSA routines"}, +{ERR_PACK(ERR_LIB_ECDH,0,0) ,"ECDH routines"}, {ERR_PACK(ERR_LIB_SSL,0,0) ,"SSL routines"}, {ERR_PACK(ERR_LIB_BIO,0,0) ,"BIO routines"}, {ERR_PACK(ERR_LIB_PKCS7,0,0) ,"PKCS7 routines"}, @@ -153,8 +157,9 @@ static ERR_STRING_DATA ERR_str_libraries[]= {ERR_PACK(ERR_LIB_TS,0,0) ,"time stamp routines"}, {ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"}, {ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"}, -{ERR_PACK(ERR_LIB_HMAC,0,0) ,"HMAC routines"}, +{ERR_PACK(ERR_LIB_FIPS,0,0) ,"FIPS routines"}, {ERR_PACK(ERR_LIB_CMS,0,0) ,"CMS routines"}, +{ERR_PACK(ERR_LIB_HMAC,0,0) ,"HMAC routines"}, {0,NULL}, }; @@ -202,6 +207,7 @@ static ERR_STRING_DATA ERR_str_reasons[]= {ERR_R_ENGINE_LIB ,"ENGINE lib"}, {ERR_R_OCSP_LIB ,"OCSP lib"}, {ERR_R_TS_LIB ,"TS lib"}, +{ERR_R_ECDSA_LIB ,"ECDSA lib"}, {ERR_R_NESTED_ASN1_ERROR ,"nested asn1 error"}, {ERR_R_BAD_ASN1_OBJECT_HEADER ,"bad asn1 object header"}, @@ -337,14 +343,14 @@ static unsigned long err_string_data_hash(const ERR_STRING_DATA *a) ret=l^ERR_GET_LIB(l)^ERR_GET_FUNC(l); return(ret^ret%19*13); } -static IMPLEMENT_LHASH_HASH_FN(err_string_data, ERR_STRING_DATA); +static IMPLEMENT_LHASH_HASH_FN(err_string_data, ERR_STRING_DATA) static int err_string_data_cmp(const ERR_STRING_DATA *a, const ERR_STRING_DATA *b) { return (int)(a->error - b->error); } -static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA); +static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA) static LHASH_OF(ERR_STRING_DATA) *int_err_get(int create) { @@ -428,15 +434,15 @@ static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *d) static unsigned long err_state_hash(const ERR_STATE *a) { - return CRYPTO_THREADID_hash(&a->tid); + return CRYPTO_THREADID_hash(&a->tid) * 13; } -static IMPLEMENT_LHASH_HASH_FN(err_state, ERR_STATE); +static IMPLEMENT_LHASH_HASH_FN(err_state, ERR_STATE) static int err_state_cmp(const ERR_STATE *a, const ERR_STATE *b) { return CRYPTO_THREADID_cmp(&a->tid, &b->tid); } -static IMPLEMENT_LHASH_COMP_FN(err_state, ERR_STATE); +static IMPLEMENT_LHASH_COMP_FN(err_state, ERR_STATE) static LHASH_OF(ERR_STATE) *int_thread_get(int create) { @@ -979,14 +985,14 @@ const char *ERR_reason_error_string(unsigned long e) return((p == NULL)?NULL:p->string); } -void ERR_remove_thread_state(CRYPTO_THREADID *tid) +void ERR_remove_thread_state(const CRYPTO_THREADID *id) { ERR_STATE tmp; - if (tid) - CRYPTO_THREADID_cpy(&tmp.tid, tid); + if (id) + CRYPTO_THREADID_cpy(&tmp.tid, id); else - CRYPTO_THREADID_set(&tmp.tid); + CRYPTO_THREADID_current(&tmp.tid); err_fns_check(); /* thread_del_item automatically destroys the LHASH if the number of * items reaches zero. */ @@ -1003,12 +1009,12 @@ void ERR_remove_state(unsigned long pid) ERR_STATE *ERR_get_state(void) { static ERR_STATE fallback; - CRYPTO_THREADID tid; ERR_STATE *ret,tmp,*tmpp=NULL; int i; + CRYPTO_THREADID tid; err_fns_check(); - CRYPTO_THREADID_set(&tid); + CRYPTO_THREADID_current(&tid); CRYPTO_THREADID_cpy(&tmp.tid, &tid); ret=ERRFN(thread_get_item)(&tmp); @@ -1032,7 +1038,7 @@ ERR_STATE *ERR_get_state(void) ERR_STATE_free(ret); /* could not insert it */ return(&fallback); } - /* If a race occured in this function and we came second, tmpp + /* If a race occurred in this function and we came second, tmpp * is the first one that we just replaced. */ if (tmpp) ERR_STATE_free(tmpp); @@ -1065,6 +1071,13 @@ void ERR_set_error_data(char *data, int flags) void ERR_add_error_data(int num, ...) { va_list args; + va_start(args, num); + ERR_add_error_vdata(num, args); + va_end(args); + } + +void ERR_add_error_vdata(int num, va_list args) + { int i,n,s; char *str,*p,*a; @@ -1073,7 +1086,6 @@ void ERR_add_error_data(int num, ...) if (str == NULL) return; str[0]='\0'; - va_start(args, num); n=0; for (i=0; i