X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=apps%2Fpkcs7.c;h=c3e9f5c692608e09cf9b07b810f84f3cd974931e;hb=ff455d993ce13dbc8e308753aa15310f94231fab;hp=85994cda26cdde1cce7da3c332464bb80a154c4d;hpb=12d56b2992ebd61e1b30c99ca1898dde42345cf7;p=openssl.git diff --git a/apps/pkcs7.c b/apps/pkcs7.c index 85994cda26..c3e9f5c692 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include @@ -25,7 +26,7 @@ typedef enum OPTION_choice { OPT_TEXT, OPT_PRINT, OPT_PRINT_CERTS, OPT_ENGINE } OPTION_CHOICE; -OPTIONS pkcs7_options[] = { +const OPTIONS pkcs7_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"in", OPT_IN, '<', "Input file"}, @@ -44,6 +45,7 @@ OPTIONS pkcs7_options[] = { int pkcs7_main(int argc, char **argv) { + ENGINE *e = NULL; PKCS7 *p7 = NULL; BIO *in = NULL, *out = NULL; int informat = FORMAT_PEM, outformat = FORMAT_PEM; @@ -90,7 +92,7 @@ int pkcs7_main(int argc, char **argv) print_certs = 1; break; case OPT_ENGINE: - (void)setup_engine(opt_arg(), 0); + e = setup_engine(opt_arg(), 0); break; } } @@ -162,7 +164,7 @@ int pkcs7_main(int argc, char **argv) for (i = 0; i < sk_X509_CRL_num(crls); i++) { crl = sk_X509_CRL_value(crls, i); - X509_CRL_print(out, crl); + X509_CRL_print_ex(out, crl, get_nameopt()); if (!noout) PEM_write_bio_X509_CRL(out, crl); @@ -189,7 +191,8 @@ int pkcs7_main(int argc, char **argv) ret = 0; end: PKCS7_free(p7); + release_engine(e); BIO_free(in); BIO_free_all(out); - return (ret); + return ret; }