diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-07-27 21:10:00 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-07-27 21:10:00 +0000 |
commit | c869da8839ef5af9df5a4d98f518b079240a0d4b (patch) | |
tree | 4993ede240e5c1851ad9c32f304ee9f650193173 /crypto | |
parent | d80866041ea4a5800a3f4a2ac4b83200eb8fd9c2 (diff) |
Update from 1.0.0-stable
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/cryptlib.c | 10 | ||||
-rw-r--r-- | crypto/engine/eng_dyn.c | 12 | ||||
-rw-r--r-- | crypto/lhash/lhash.h | 4 | ||||
-rw-r--r-- | crypto/stack/safestack.h | 168 | ||||
-rw-r--r-- | crypto/txt_db/txt_db.c | 60 | ||||
-rw-r--r-- | crypto/txt_db/txt_db.h | 18 | ||||
-rw-r--r-- | crypto/x509v3/v3_utl.c | 36 | ||||
-rw-r--r-- | crypto/x509v3/x509v3.h | 8 |
8 files changed, 158 insertions, 158 deletions
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index ed27d66099..2768c48796 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -174,7 +174,7 @@ static const char* const lock_names[CRYPTO_NUM_LOCKS] = /* This is for applications to allocate new type names in the non-dynamic array of lock names. These are numbered with positive numbers. */ -static STACK_OF(STRING) *app_locks=NULL; +static STACK_OF(OPENSSL_STRING) *app_locks=NULL; /* For applications that want a more dynamic way of handling threads, the following stack is used. These are externally numbered with negative @@ -210,7 +210,7 @@ int CRYPTO_get_new_lockid(char *name) SSLeay_MSVC5_hack=(double)name[0]*(double)name[1]; #endif - if ((app_locks == NULL) && ((app_locks=sk_STRING_new_null()) == NULL)) + if ((app_locks == NULL) && ((app_locks=sk_OPENSSL_STRING_new_null()) == NULL)) { CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE); return(0); @@ -220,7 +220,7 @@ int CRYPTO_get_new_lockid(char *name) CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE); return(0); } - i=sk_STRING_push(app_locks,str); + i=sk_OPENSSL_STRING_push(app_locks,str); if (!i) OPENSSL_free(str); else @@ -651,10 +651,10 @@ const char *CRYPTO_get_lock_name(int type) return("dynamic"); else if (type < CRYPTO_NUM_LOCKS) return(lock_names[type]); - else if (type-CRYPTO_NUM_LOCKS > sk_STRING_num(app_locks)) + else if (type-CRYPTO_NUM_LOCKS > sk_OPENSSL_STRING_num(app_locks)) return("ERROR"); else - return(sk_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS)); + return(sk_OPENSSL_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS)); } #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c index de164a69f1..807da7a5eb 100644 --- a/crypto/engine/eng_dyn.c +++ b/crypto/engine/eng_dyn.c @@ -146,7 +146,7 @@ struct st_dynamic_data_ctx * 'dirs' for loading. Default is to use 'dirs' as a fallback. */ int dir_load; /* A stack of directories from which ENGINEs could be loaded */ - STACK_OF(STRING) *dirs; + STACK_OF(OPENSSL_STRING) *dirs; }; /* This is the "ex_data" index we obtain and reserve for use with our context @@ -174,7 +174,7 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr, if(ctx->engine_id) OPENSSL_free((void*)ctx->engine_id); if(ctx->dirs) - sk_STRING_pop_free(ctx->dirs, int_free_str); + sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str); OPENSSL_free(ctx); } } @@ -203,7 +203,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx) c->DYNAMIC_F1 = "v_check"; c->DYNAMIC_F2 = "bind_engine"; c->dir_load = 1; - c->dirs = sk_STRING_new_null(); + c->dirs = sk_OPENSSL_STRING_new_null(); if(!c->dirs) { ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE); @@ -393,7 +393,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) ERR_R_MALLOC_FAILURE); return 0; } - sk_STRING_insert(ctx->dirs, tmp_str, -1); + sk_OPENSSL_STRING_insert(ctx->dirs, tmp_str, -1); } return 1; default: @@ -411,11 +411,11 @@ static int int_load(dynamic_data_ctx *ctx) ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL) return 1; /* If we're not allowed to use 'dirs' or we have none, fail */ - if(!ctx->dir_load || (num = sk_STRING_num(ctx->dirs)) < 1) + if(!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1) return 0; for(loop = 0; loop < num; loop++) { - const char *s = sk_STRING_value(ctx->dirs, loop); + const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop); char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s); if(!merge) return 0; diff --git a/crypto/lhash/lhash.h b/crypto/lhash/lhash.h index 2fd376ade1..e7d8763591 100644 --- a/crypto/lhash/lhash.h +++ b/crypto/lhash/lhash.h @@ -230,8 +230,8 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); lh_stats_bio(CHECKED_LHASH_OF(type, lh), out) #define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh)) -DECLARE_LHASH_OF(STRING); -DECLARE_LHASH_OF(CSTRING); +DECLARE_LHASH_OF(OPENSSL_STRING); +DECLARE_LHASH_OF(OPENSSL_CSTRING); #ifdef __cplusplus } diff --git a/crypto/stack/safestack.h b/crypto/stack/safestack.h index 8a0a9c1ea1..18fbd38da7 100644 --- a/crypto/stack/safestack.h +++ b/crypto/stack/safestack.h @@ -110,9 +110,9 @@ o * In practice, however, it appears to be hard to have a const * string. For now, I'm settling for dealing with the fact it is a * string at all. */ -typedef char *STRING; +typedef char *OPENSSL_STRING; -typedef const char *CSTRING; +typedef const char *OPENSSL_CSTRING; /* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but * STACK_OF(STRING) is really more like STACK_OF(char), only, as @@ -122,7 +122,7 @@ typedef const char *CSTRING; * macros below. */ -DECLARE_SPECIAL_STACK_OF(STRING, char) +DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) /* Similarly, we sometimes use a block of characters, NOT * nul-terminated. These should also be distinguished from "normal" @@ -2030,29 +2030,29 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void) #define sk_void_sort(st) SKM_sk_sort(void, (st)) #define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) -#define sk_STRING_new(cmp) ((STACK_OF(STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) -#define sk_STRING_new_null() ((STACK_OF(STRING) *)sk_new_null()) -#define sk_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) -#define sk_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) -#define sk_STRING_value(st, i) ((STRING)sk_value(CHECKED_PTR_OF(STACK_OF(STRING), st), i)) -#define sk_STRING_num(st) SKM_sk_num(STRING, st) -#define sk_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_SK_FREE_FUNC2(STRING, free_func)) -#define sk_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val), i) -#define sk_STRING_free(st) SKM_sk_free(STRING, st) -#define sk_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), i, CHECKED_PTR_OF(char, val)) -#define sk_STRING_zero(st) SKM_sk_zero(STRING, (st)) -#define sk_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) -#define sk_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(STRING), st), CHECKED_CONST_PTR_OF(char, val)) -#define sk_STRING_delete(st, i) SKM_sk_delete(STRING, (st), (i)) -#define sk_STRING_delete_ptr(st, ptr) (STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, ptr)) -#define sk_STRING_set_cmp_func(st, cmp) \ +#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) +#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) +#define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i)) +#define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func)) +#define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val), i) +#define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i, CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) +#define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, ptr)) +#define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ ((int (*)(const char * const *,const char * const *)) \ - sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_SK_CMP_FUNC(char, cmp))) -#define sk_STRING_dup(st) SKM_sk_dup(STRING, st) -#define sk_STRING_shift(st) SKM_sk_shift(STRING, (st)) -#define sk_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st)) -#define sk_STRING_sort(st) SKM_sk_sort(STRING, (st)) -#define sk_STRING_is_sorted(st) SKM_sk_is_sorted(STRING, (st)) + sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_CMP_FUNC(char, cmp))) +#define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st)) +#define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) #define sk_BLOCK_new(cmp) ((STACK_OF(BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) @@ -2080,29 +2080,29 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void) #define sk_BLOCK_is_sorted(st) SKM_sk_is_sorted(BLOCK, (st)) -#define sk_PSTRING_new(cmp) ((STACK_OF(PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(STRING, cmp))) -#define sk_PSTRING_new_null() ((STACK_OF(PSTRING) *)sk_new_null()) -#define sk_PSTRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) -#define sk_PSTRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) -#define sk_PSTRING_value(st, i) ((PSTRING)sk_value(CHECKED_PTR_OF(STACK_OF(PSTRING), st), i)) -#define sk_PSTRING_num(st) SKM_sk_num(PSTRING, st) -#define sk_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_SK_FREE_FUNC2(PSTRING, free_func)) -#define sk_PSTRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val), i) -#define sk_PSTRING_free(st) SKM_sk_free(PSTRING, st) -#define sk_PSTRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), i, CHECKED_PTR_OF(STRING, val)) -#define sk_PSTRING_zero(st) SKM_sk_zero(PSTRING, (st)) -#define sk_PSTRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) -#define sk_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(PSTRING), st), CHECKED_CONST_PTR_OF(STRING, val)) -#define sk_PSTRING_delete(st, i) SKM_sk_delete(PSTRING, (st), (i)) -#define sk_PSTRING_delete_ptr(st, ptr) (PSTRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, ptr)) -#define sk_PSTRING_set_cmp_func(st, cmp) \ - ((int (*)(const STRING * const *,const STRING * const *)) \ - sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_SK_CMP_FUNC(STRING, cmp))) -#define sk_PSTRING_dup(st) SKM_sk_dup(PSTRING, st) -#define sk_PSTRING_shift(st) SKM_sk_shift(PSTRING, (st)) -#define sk_PSTRING_pop(st) (STRING *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st)) -#define sk_PSTRING_sort(st) SKM_sk_sort(PSTRING, (st)) -#define sk_PSTRING_is_sorted(st) SKM_sk_is_sorted(PSTRING, (st)) +#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) +#define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) +#define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i)) +#define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) +#define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) +#define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) +#define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) +#define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ + ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ + sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) +#define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st)) +#define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ @@ -2390,24 +2390,6 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void) LHM_lh_stats_bio(CONF_VALUE,lh,out) #define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh) -#define lh_CSTRING_new() LHM_lh_new(CSTRING,cstring) -#define lh_CSTRING_insert(lh,inst) LHM_lh_insert(CSTRING,lh,inst) -#define lh_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(CSTRING,lh,inst) -#define lh_CSTRING_delete(lh,inst) LHM_lh_delete(CSTRING,lh,inst) -#define lh_CSTRING_doall(lh,fn) LHM_lh_doall(CSTRING,lh,fn) -#define lh_CSTRING_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(CSTRING,lh,fn,arg_type,arg) -#define lh_CSTRING_error(lh) LHM_lh_error(CSTRING,lh) -#define lh_CSTRING_num_items(lh) LHM_lh_num_items(CSTRING,lh) -#define lh_CSTRING_down_load(lh) LHM_lh_down_load(CSTRING,lh) -#define lh_CSTRING_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(CSTRING,lh,out) -#define lh_CSTRING_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(CSTRING,lh,out) -#define lh_CSTRING_stats_bio(lh,out) \ - LHM_lh_stats_bio(CSTRING,lh,out) -#define lh_CSTRING_free(lh) LHM_lh_free(CSTRING,lh) - #define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile) #define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst) #define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst) @@ -2534,6 +2516,42 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void) LHM_lh_stats_bio(OBJ_NAME,lh,out) #define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh) +#define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring) +#define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn) +#define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg) +#define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_stats_bio(lh,out) \ + LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh) + +#define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string) +#define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn) +#define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg) +#define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_stats_bio(lh,out) \ + LHM_lh_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh) + #define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session) #define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst) #define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst) @@ -2551,24 +2569,6 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void) #define lh_SSL_SESSION_stats_bio(lh,out) \ LHM_lh_stats_bio(SSL_SESSION,lh,out) #define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh) - -#define lh_STRING_new() LHM_lh_new(STRING,string) -#define lh_STRING_insert(lh,inst) LHM_lh_insert(STRING,lh,inst) -#define lh_STRING_retrieve(lh,inst) LHM_lh_retrieve(STRING,lh,inst) -#define lh_STRING_delete(lh,inst) LHM_lh_delete(STRING,lh,inst) -#define lh_STRING_doall(lh,fn) LHM_lh_doall(STRING,lh,fn) -#define lh_STRING_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(STRING,lh,fn,arg_type,arg) -#define lh_STRING_error(lh) LHM_lh_error(STRING,lh) -#define lh_STRING_num_items(lh) LHM_lh_num_items(STRING,lh) -#define lh_STRING_down_load(lh) LHM_lh_down_load(STRING,lh) -#define lh_STRING_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(STRING,lh,out) -#define lh_STRING_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(STRING,lh,out) -#define lh_STRING_stats_bio(lh,out) \ - LHM_lh_stats_bio(STRING,lh,out) -#define lh_STRING_free(lh) LHM_lh_free(STRING,lh) /* End of util/mkstack.pl block, you may now edit :-) */ #endif /* !defined HEADER_SAFESTACK_H */ diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c index 7e33f143cb..6f2ce3b5a4 100644 --- a/crypto/txt_db/txt_db.c +++ b/crypto/txt_db/txt_db.c @@ -78,7 +78,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) int size=BUFSIZE; int offset=0; char *p,*f; - STRING *pp; + OPENSSL_STRING *pp; BUF_MEM *buf=NULL; if ((buf=BUF_MEM_new()) == NULL) goto err; @@ -89,7 +89,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) ret->num_fields=num; ret->index=NULL; ret->qual=NULL; - if ((ret->data=sk_PSTRING_new_null()) == NULL) + if ((ret->data=sk_OPENSSL_PSTRING_new_null()) == NULL) goto err; if ((ret->index=OPENSSL_malloc(sizeof(*ret->index)*num)) == NULL) goto err; @@ -163,7 +163,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) goto err; } pp[n]=p; - if (!sk_PSTRING_push(ret->data,pp)) + if (!sk_OPENSSL_PSTRING_push(ret->data,pp)) { #if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */ fprintf(stderr,"failure in sk_push\n"); @@ -182,7 +182,7 @@ err: #endif if (ret != NULL) { - if (ret->data != NULL) sk_PSTRING_free(ret->data); + if (ret->data != NULL) sk_OPENSSL_PSTRING_free(ret->data); if (ret->index != NULL) OPENSSL_free(ret->index); if (ret->qual != NULL) OPENSSL_free(ret->qual); if (ret != NULL) OPENSSL_free(ret); @@ -193,10 +193,10 @@ err: return(ret); } -STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, STRING *value) +OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value) { - STRING *ret; - LHASH_OF(STRING) *lh; + OPENSSL_STRING *ret; + LHASH_OF(OPENSSL_STRING) *lh; if (idx >= db->num_fields) { @@ -209,16 +209,16 @@ STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, STRING *value) db->error=DB_ERROR_NO_INDEX; return(NULL); } - ret=lh_STRING_retrieve(lh,value); + ret=lh_OPENSSL_STRING_retrieve(lh,value); db->error=DB_ERROR_OK; return(ret); } -int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(STRING *), +int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp) { - LHASH_OF(STRING) *idx; - STRING *r; + LHASH_OF(OPENSSL_STRING) *idx; + OPENSSL_STRING *r; int i,n; if (field >= db->num_fields) @@ -227,26 +227,26 @@ int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(STRING *), return(0); } /* FIXME: we lose type checking at this point */ - if ((idx=(LHASH_OF(STRING) *)lh_new(hash,cmp)) == NULL) + if ((idx=(LHASH_OF(OPENSSL_STRING) *)lh_new(hash,cmp)) == NULL) { db->error=DB_ERROR_MALLOC; return(0); } - n=sk_PSTRING_num(db->data); + n=sk_OPENSSL_PSTRING_num(db->data); for (i=0; i<n; i++) { - r=sk_PSTRING_value(db->data,i); + r=sk_OPENSSL_PSTRING_value(db->data,i); if ((qual != NULL) && (qual(r) == 0)) continue; - if ((r=lh_STRING_insert(idx,r)) != NULL) + if ((r=lh_OPENSSL_STRING_insert(idx,r)) != NULL) { db->error=DB_ERROR_INDEX_CLASH; - db->arg1=sk_PSTRING_find(db->data,r); + db->arg1=sk_OPENSSL_PSTRING_find(db->data,r); db->arg2=i; - lh_STRING_free(idx); + lh_OPENSSL_STRING_free(idx); return(0); } } - if (db->index[field] != NULL) lh_STRING_free(db->index[field]); + if (db->index[field] != NULL) lh_OPENSSL_STRING_free(db->index[field]); db->index[field]=idx; db->qual[field]=qual; return(1); @@ -261,11 +261,11 @@ long TXT_DB_write(BIO *out, TXT_DB *db) if ((buf=BUF_MEM_new()) == NULL) goto err; - n=sk_PSTRING_num(db->data); + n=sk_OPENSSL_PSTRING_num(db->data); nn=db->num_fields; for (i=0; i<n; i++) { - pp=sk_PSTRING_value(db->data,i); + pp=sk_OPENSSL_PSTRING_value(db->data,i); l=0; for (j=0; j<nn; j++) @@ -300,10 +300,10 @@ err: return(ret); } -int TXT_DB_insert(TXT_DB *db, STRING *row) +int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) { int i; - STRING *r; + OPENSSL_STRING *r; for (i=0; i<db->num_fields; i++) { @@ -311,7 +311,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row) { if ((db->qual[i] != NULL) && (db->qual[i](row) == 0)) continue; - r=lh_STRING_retrieve(db->index[i],row); + r=lh_OPENSSL_STRING_retrieve(db->index[i],row); if (r != NULL) { db->error=DB_ERROR_INDEX_CLASH; @@ -322,7 +322,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row) } } /* We have passed the index checks, now just append and insert */ - if (!sk_PSTRING_push(db->data,row)) + if (!sk_OPENSSL_PSTRING_push(db->data,row)) { db->error=DB_ERROR_MALLOC; goto err; @@ -334,7 +334,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row) { if ((db->qual[i] != NULL) && (db->qual[i](row) == 0)) continue; - (void)lh_STRING_insert(db->index[i],row); + (void)lh_OPENSSL_STRING_insert(db->index[i],row); } } return(1); @@ -353,18 +353,18 @@ void TXT_DB_free(TXT_DB *db) if (db->index != NULL) { for (i=db->num_fields-1; i>=0; i--) - if (db->index[i] != NULL) lh_STRING_free(db->index[i]); + if (db->index[i] != NULL) lh_OPENSSL_STRING_free(db->index[i]); OPENSSL_free(db->index); } if (db->qual != NULL) OPENSSL_free(db->qual); if (db->data != NULL) { - for (i=sk_PSTRING_num(db->data)-1; i>=0; i--) + for (i=sk_OPENSSL_PSTRING_num(db->data)-1; i>=0; i--) { /* check if any 'fields' have been allocated * from outside of the initial block */ - p=sk_PSTRING_value(db->data,i); + p=sk_OPENSSL_PSTRING_value(db->data,i); max=p[db->num_fields]; /* last address */ if (max == NULL) /* new row */ { @@ -380,9 +380,9 @@ void TXT_DB_free(TXT_DB *db) OPENSSL_free(p[n]); } } - OPENSSL_free(sk_PSTRING_value(db->data,i)); + OPENSSL_free(sk_OPENSSL_PSTRING_value(db->data,i)); } - sk_PSTRING_free(db->data); + sk_OPENSSL_PSTRING_free(db->data); } OPENSSL_free(db); } diff --git a/crypto/txt_db/txt_db.h b/crypto/txt_db/txt_db.h index 4076493e45..6abe435bc8 100644 --- a/crypto/txt_db/txt_db.h +++ b/crypto/txt_db/txt_db.h @@ -77,19 +77,19 @@ extern "C" { #endif -typedef STRING *PSTRING; -DECLARE_SPECIAL_STACK_OF(PSTRING, STRING) +typedef OPENSSL_STRING *OPENSSL_PSTRING; +DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) typedef struct txt_db_st { int num_fields; - STACK_OF(PSTRING) *data; - LHASH_OF(STRING) **index; - int (**qual)(STRING *); + STACK_OF(OPENSSL_PSTRING) *data; + LHASH_OF(OPENSSL_STRING) **index; + int (**qual)(OPENSSL_STRING *); long error; long arg1; long arg2; - STRING *arg_row; + OPENSSL_STRING *arg_row; } TXT_DB; #ifndef OPENSSL_NO_BIO @@ -99,11 +99,11 @@ long TXT_DB_write(BIO *out, TXT_DB *db); TXT_DB *TXT_DB_read(char *in, int num); long TXT_DB_write(char *out, TXT_DB *db); #endif -int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(STRING *), +int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(OPENSSL_STRING *), LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); void TXT_DB_free(TXT_DB *db); -STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, STRING *value); -int TXT_DB_insert(TXT_DB *db, STRING *value); +OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value); +int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); #ifdef __cplusplus } diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 4a8751722d..e030234540 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -67,9 +67,9 @@ static char *strip_spaces(char *name); static int sk_strcmp(const char * const *a, const char * const *b); -static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); -static void str_free(STRING str); -static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email); +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); +static void str_free(OPENSSL_STRING str); +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); static int ipv4_from_asc(unsigned char *v4, const char *in); static int ipv6_from_asc(unsigned char *v6, const char *in); @@ -463,10 +463,10 @@ static int sk_strcmp(const char * const *a, const char * const *b) return strcmp(*a, *b); } -STACK_OF(STRING) *X509_get1_email(X509 *x) +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) { GENERAL_NAMES *gens; - STACK_OF(STRING) *ret; + STACK_OF(OPENSSL_STRING) *ret; gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); ret = get_email(X509_get_subject_name(x), gens); @@ -474,10 +474,10 @@ STACK_OF(STRING) *X509_get1_email(X509 *x) return ret; } -STACK_OF(STRING) *X509_get1_ocsp(X509 *x) +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) { AUTHORITY_INFO_ACCESS *info; - STACK_OF(STRING) *ret = NULL; + STACK_OF(OPENSSL_STRING) *ret = NULL; int i; info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); @@ -499,11 +499,11 @@ STACK_OF(STRING) *X509_get1_ocsp(X509 *x) return ret; } -STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x) +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) { GENERAL_NAMES *gens; STACK_OF(X509_EXTENSION) *exts; - STACK_OF(STRING) *ret; + STACK_OF(OPENSSL_STRING) *ret; exts = X509_REQ_get_extensions(x); gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); @@ -514,9 +514,9 @@ STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x) } -static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) +static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) { - STACK_OF(STRING) *ret = NULL; + STACK_OF(OPENSSL_STRING) *ret = NULL; X509_NAME_ENTRY *ne; ASN1_IA5STRING *email; GENERAL_NAME *gen; @@ -539,23 +539,23 @@ static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) return ret; } -static void str_free(STRING str) +static void str_free(OPENSSL_STRING str) { OPENSSL_free(str); } -static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email) +static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) { char *emtmp; /* First some sanity checks */ if(email->type != V_ASN1_IA5STRING) return 1; if(!email->data || !email->length) return 1; - if(!*sk) *sk = sk_STRING_new(sk_strcmp); + if(!*sk) *sk = sk_OPENSSL_STRING_new(sk_strcmp); if(!*sk) return 0; /* Don't add duplicates */ - if(sk_STRING_find(*sk, (char *)email->data) != -1) return 1; + if(sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1) return 1; emtmp = BUF_strdup((char *)email->data); - if(!emtmp || !sk_STRING_push(*sk, emtmp)) { + if(!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { X509_email_free(*sk); *sk = NULL; return 0; @@ -563,9 +563,9 @@ static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email) return 1; } -void X509_email_free(STACK_OF(STRING) *sk) +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) { - sk_STRING_pop_free(sk, str_free); + sk_OPENSSL_STRING_pop_free(sk, str_free); } /* Convert IP addresses both IPv4 and IPv6 into an diff --git a/crypto/x509v3/x509v3.h b/crypto/x509v3/x509v3.h index f9bacb6f01..b308abe7cd 100644 --- a/crypto/x509v3/x509v3.h +++ b/crypto/x509v3/x509v3.h @@ -693,10 +693,10 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp); void X509_PURPOSE_cleanup(void); int X509_PURPOSE_get_id(X509_PURPOSE *); -STACK_OF(STRING) *X509_get1_email(X509 *x); -STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x); -void X509_email_free(STACK_OF(STRING) *sk); -STACK_OF(STRING) *X509_get1_ocsp(X509 *x); +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); |