diff options
author | Ben Laurie <ben@openssl.org> | 2000-05-17 10:08:05 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2000-05-17 10:08:05 +0000 |
commit | 0d3b0afe9e59962f92b0cc6c63fc65a8e8dbc0de (patch) | |
tree | 35674c2a4e17a88f0e6da534bb188ca6ca2de540 /crypto/x509v3 | |
parent | abc9400e100632760727d150946f5269a0a5227b (diff) |
Typesafety Thought Police last part.
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/v3_lib.c | 14 | ||||
-rw-r--r-- | crypto/x509v3/x509v3.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c index 289bce6e0d..dcdf7d607d 100644 --- a/crypto/x509v3/v3_lib.c +++ b/crypto/x509v3/v3_lib.c @@ -64,18 +64,18 @@ #include "ext_dat.h" -static STACK *ext_list = NULL; +static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL; static int ext_cmp(X509V3_EXT_METHOD **a, X509V3_EXT_METHOD **b); static void ext_list_free(X509V3_EXT_METHOD *ext); int X509V3_EXT_add(X509V3_EXT_METHOD *ext) { - if(!ext_list && !(ext_list = sk_new((int (*)(const void *, const void *))ext_cmp))) { + if(!ext_list && !(ext_list = sk_X509V3_EXT_METHOD_new(ext_cmp))) { X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE); return 0; } - if(!sk_push(ext_list, (char *)ext)) { + if(!sk_X509V3_EXT_METHOD_push(ext_list, ext)) { X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE); return 0; } @@ -98,9 +98,9 @@ X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) sizeof(X509V3_EXT_METHOD *), (int (*)(const void *, const void *))ext_cmp); if(ret) return *ret; if(!ext_list) return NULL; - idx = sk_find(ext_list, (char *)&tmp); + idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp); if(idx == -1) return NULL; - return (X509V3_EXT_METHOD *)sk_value(ext_list, idx); + return sk_X509V3_EXT_METHOD_value(ext_list, idx); } X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) @@ -137,7 +137,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from) void X509V3_EXT_cleanup(void) { - sk_pop_free(ext_list, (void(*)(void *)) ext_list_free); + sk_X509V3_EXT_METHOD_pop_free(ext_list, ext_list_free); ext_list = NULL; } @@ -219,3 +219,5 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) if(crit) *crit = -1; return NULL; } + +IMPLEMENT_STACK_OF(X509V3_EXT_METHOD) diff --git a/crypto/x509v3/x509v3.h b/crypto/x509v3/x509v3.h index 8498aec014..f2225d3980 100644 --- a/crypto/x509v3/x509v3.h +++ b/crypto/x509v3/x509v3.h @@ -131,6 +131,8 @@ void *db; typedef struct v3_ext_method X509V3_EXT_METHOD; typedef struct v3_ext_ctx X509V3_CTX; +DECLARE_STACK_OF(X509V3_EXT_METHOD) + /* ext_flags values */ #define X509V3_EXT_DYNAMIC 0x1 #define X509V3_EXT_CTX_DEP 0x2 |