summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/x509/x509_lu.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/x509/x509_lu.c')
-rw-r--r--crypto/openssl/crypto/x509/x509_lu.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/crypto/openssl/crypto/x509/x509_lu.c b/crypto/openssl/crypto/x509/x509_lu.c
index 18bfecb..a20006d 100644
--- a/crypto/openssl/crypto/x509/x509_lu.c
+++ b/crypto/openssl/crypto/x509/x509_lu.c
@@ -61,8 +61,8 @@
#include <openssl/lhash.h>
#include <openssl/x509.h>
-static STACK *x509_store_meth=NULL;
-static STACK *x509_store_ctx_meth=NULL;
+static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_meth=NULL;
+static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_meth=NULL;
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
{
@@ -244,7 +244,7 @@ void X509_STORE_free(X509_STORE *vfy)
}
sk_X509_LOOKUP_free(sk);
- CRYPTO_free_ex_data(x509_store_meth,(char *)vfy,&vfy->ex_data);
+ CRYPTO_free_ex_data(x509_store_meth,vfy,&vfy->ex_data);
lh_doall(vfy->certs,cleanup);
lh_free(vfy->certs);
Free(vfy);
@@ -377,10 +377,24 @@ X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h, int type,
abort();
}
- tmp=(X509_OBJECT *)lh_retrieve(h,(char *)&stmp);
+ tmp=(X509_OBJECT *)lh_retrieve(h,&stmp);
return(tmp);
}
+X509_STORE_CTX *X509_STORE_CTX_new(void)
+{
+ X509_STORE_CTX *ctx;
+ ctx = (X509_STORE_CTX *)Malloc(sizeof(X509_STORE_CTX));
+ if(ctx) memset(ctx, 0, sizeof(X509_STORE_CTX));
+ return ctx;
+}
+
+void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
+{
+ X509_STORE_CTX_cleanup(ctx);
+ Free(ctx);
+}
+
void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
STACK_OF(X509) *chain)
{
@@ -389,6 +403,8 @@ void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
ctx->cert=x509;
ctx->untrusted=chain;
ctx->last_untrusted=0;
+ ctx->purpose=0;
+ ctx->trust=0;
ctx->valid=0;
ctx->chain=NULL;
ctx->depth=9;
@@ -404,7 +420,7 @@ void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
sk_X509_pop_free(ctx->chain,X509_free);
ctx->chain=NULL;
}
- CRYPTO_free_ex_data(x509_store_ctx_meth,(char *)ctx,&(ctx->ex_data));
+ CRYPTO_free_ex_data(x509_store_ctx_meth,ctx,&(ctx->ex_data));
memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
}
OpenPOWER on IntegriCloud