diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 57b3a8351..2f483ea62 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -93,11 +93,8 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type); static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, X509_OBJECT *ret); static X509_LOOKUP_METHOD x509_dir_lookup = { - "Load certs from files in a directory", new_dir, // new free_dir, // free - NULL, // init - NULL, // shutdown dir_ctrl, // ctrl get_cert_by_subject, // get_by_subject }; diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c index 2c83137b1..a46124616 100644 --- a/crypto/x509/by_file.c +++ b/crypto/x509/by_file.c @@ -66,11 +66,8 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); static X509_LOOKUP_METHOD x509_file_lookup = { - "Load file into cache", NULL, // new NULL, // free - NULL, // init - NULL, // shutdown by_file_ctrl, // ctrl NULL, // get_by_subject }; diff --git a/crypto/x509/internal.h b/crypto/x509/internal.h index 0f3f55414..574c56069 100644 --- a/crypto/x509/internal.h +++ b/crypto/x509/internal.h @@ -313,11 +313,8 @@ DECLARE_ASN1_ITEM(NETSCAPE_SPKAC) // This is a static that defines the function interface struct x509_lookup_method_st { - const char *name; int (*new_item)(X509_LOOKUP *ctx); void (*free)(X509_LOOKUP *ctx); - int (*init)(X509_LOOKUP *ctx); - int (*shutdown)(X509_LOOKUP *ctx); int (*ctrl)(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); int (*get_by_subject)(X509_LOOKUP *ctx, int type, X509_NAME *name, @@ -357,8 +354,6 @@ struct x509_store_st { // This is the functions plus an instance of the local variables. struct x509_lookup_st { - int init; // have we been started - int skip; // don't use us. X509_LOOKUP_METHOD *method; // the functions void *method_data; // method data diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index 2f5ba58bd..4b59fc8e6 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -77,7 +77,6 @@ static int X509_OBJECT_up_ref_count(X509_OBJECT *a); static X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); static int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, X509_OBJECT *ret); -static int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); static X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) { X509_LOOKUP *ret = OPENSSL_zalloc(sizeof(X509_LOOKUP)); @@ -97,23 +96,12 @@ void X509_LOOKUP_free(X509_LOOKUP *ctx) { if (ctx == NULL) { return; } - if ((ctx->method != NULL) && (ctx->method->free != NULL)) { + if (ctx->method != NULL && ctx->method->free != NULL) { (*ctx->method->free)(ctx); } OPENSSL_free(ctx); } -static int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) { - if (ctx->method == NULL) { - return 0; - } - if (ctx->method->shutdown != NULL) { - return ctx->method->shutdown(ctx); - } else { - return 1; - } -} - int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret) { if (ctx->method == NULL) { @@ -128,10 +116,7 @@ int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, static int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, X509_OBJECT *ret) { - if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) { - return 0; - } - if (ctx->skip) { + if (ctx->method == NULL || ctx->method->get_by_subject == NULL) { return 0; } // Note |get_by_subject| leaves |ret| in an inconsistent state. It has @@ -224,7 +209,6 @@ void X509_STORE_free(X509_STORE *vfy) { sk = vfy->get_cert_methods; for (j = 0; j < sk_X509_LOOKUP_num(sk); j++) { lu = sk_X509_LOOKUP_value(sk, j); - X509_LOOKUP_shutdown(lu); X509_LOOKUP_free(lu); } sk_X509_LOOKUP_free(sk);