X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fverify.c;h=3c4566393b83551804a22d9a07c6aa6704c5e2fe;hb=2c4ee10c0aa231a30977aad47bae1d0dbe6bbef4;hp=40e19d45dc9ad6dd034d09784bc358d0b34ff159;hpb=a392ef20f0a9fedc811b6a06bf50ff3f151e266f;p=oweals%2Fopenssl.git diff --git a/apps/verify.c b/apps/verify.c index 40e19d45dc..3c4566393b 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -18,7 +18,7 @@ #include static int cb(int ok, X509_STORE_CTX *ctx); -static int check(X509_STORE *ctx, char *file, +static int check(X509_STORE *ctx, const char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, STACK_OF(X509_CRL) *crls, int show_chain); static int v_verbose = 0, vflags = 0; @@ -60,11 +60,12 @@ OPTIONS verify_options[] = { int verify_main(int argc, char **argv) { + ENGINE *e = NULL; STACK_OF(X509) *untrusted = NULL, *trusted = NULL; STACK_OF(X509_CRL) *crls = NULL; X509_STORE *store = NULL; X509_VERIFY_PARAM *vpm = NULL; - char *prog, *CApath = NULL, *CAfile = NULL; + const char *prog, *CApath = NULL, *CAfile = NULL; int noCApath = 0, noCAfile = 0; int vpmtouched = 0, crl_download = 0, show_chain = 0, i = 0, ret = 1; OPTION_CHOICE o; @@ -140,7 +141,7 @@ int verify_main(int argc, char **argv) crl_download = 1; break; case OPT_ENGINE: - if (setup_engine(opt_arg(), 0) == NULL) { + if ((e = setup_engine(opt_arg(), 0)) == NULL) { /* Failure message already displayed */ goto end; } @@ -191,10 +192,11 @@ int verify_main(int argc, char **argv) sk_X509_pop_free(untrusted, X509_free); sk_X509_pop_free(trusted, X509_free); sk_X509_CRL_pop_free(crls, X509_CRL_free); + release_engine(e); return (ret < 0 ? 2 : ret); } -static int check(X509_STORE *ctx, char *file, +static int check(X509_STORE *ctx, const char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, STACK_OF(X509_CRL) *crls, int show_chain) {