X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Ferr%2Ferr.c;h=3492950b59be3e05bc1d5c82594b22265f0b2a16;hb=cd91fd7c32428c0deb503f19b8061e0980476876;hp=94784e972d58f0245605a5d79f4fefbdaf923866;hpb=ab3eafd5b5fbbb89fb500f05b8776f26a9f5e028;p=oweals%2Fopenssl.git diff --git a/crypto/err/err.c b/crypto/err/err.c index 94784e972d..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"}, @@ -428,7 +434,7 @@ 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) @@ -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