From 5c0a48655fc342086d4babb57fee8e052a7b2e2f Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 2 Jun 1999 22:01:56 +0000 Subject: [PATCH] stack --- crypto/x509/x509_lu.c | 23 ++++++++++++----------- crypto/x509/x509_vfy.h | 4 +++- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index 2ef8e3fff1..18bfecb11e 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -201,7 +201,7 @@ X509_STORE *X509_STORE_new(void) return(NULL); ret->certs=lh_new(x509_object_hash,x509_object_cmp); ret->cache=1; - ret->get_cert_methods=sk_new_null(); + ret->get_cert_methods=sk_X509_LOOKUP_new_null(); ret->verify=NULL; ret->verify_cb=NULL; memset(&ret->ex_data,0,sizeof(CRYPTO_EX_DATA)); @@ -229,20 +229,20 @@ static void cleanup(X509_OBJECT *a) void X509_STORE_free(X509_STORE *vfy) { int i; - STACK *sk; + STACK_OF(X509_LOOKUP) *sk; X509_LOOKUP *lu; if(vfy == NULL) return; sk=vfy->get_cert_methods; - for (i=0; iex_data); lh_doall(vfy->certs,cleanup); @@ -253,13 +253,13 @@ void X509_STORE_free(X509_STORE *vfy) X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) { int i; - STACK *sk; + STACK_OF(X509_LOOKUP) *sk; X509_LOOKUP *lu; sk=v->get_cert_methods; - for (i=0; imethod) { return(lu); @@ -272,7 +272,7 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) else { lu->store_ctx=v; - if (sk_push(v->get_cert_methods,(char *)lu)) + if (sk_X509_LOOKUP_push(v->get_cert_methods,lu)) return(lu); else { @@ -294,9 +294,9 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, if (tmp == NULL) { - for (i=vs->current_method; iget_cert_methods); i++) + for (i=vs->current_method; iget_cert_methods); i++) { - lu=(X509_LOOKUP *)sk_value(ctx->get_cert_methods,i); + lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i); j=X509_LOOKUP_by_subject(lu,type,name,&stmp); if (j < 0) { @@ -408,3 +408,4 @@ void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA)); } +IMPLEMENT_STACK_OF(X509_LOOKUP) diff --git a/crypto/x509/x509_vfy.h b/crypto/x509/x509_vfy.h index ea28359bab..ecfd4cf9ed 100644 --- a/crypto/x509/x509_vfy.h +++ b/crypto/x509/x509_vfy.h @@ -127,6 +127,8 @@ typedef struct x509_object_st typedef struct x509_lookup_st X509_LOOKUP; +DECLARE_STACK_OF(X509_LOOKUP) + /* This is a static that defines the function interface */ typedef struct x509_lookup_method_st { @@ -164,7 +166,7 @@ typedef struct x509_store_st #endif /* These are external lookup methods */ - STACK *get_cert_methods;/* X509_LOOKUP */ + STACK_OF(X509_LOOKUP) *get_cert_methods; int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ -- 2.25.1