ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/vendor-crypto/openssl/dist/apps/pkcs7.c
(Generate patch)

Comparing vendor-crypto/openssl/dist/apps/pkcs7.c (file contents):
Revision 7101 by laffer1, Fri Mar 20 00:01:13 2015 UTC vs.
Revision 7102 by laffer1, Fri Jul 17 14:04:28 2015 UTC

# Line 88 | Line 88 | int MAIN(int argc, char **argv)
88      BIO *in = NULL, *out = NULL;
89      int informat, outformat;
90      char *infile, *outfile, *prog;
91 <    int print_certs = 0, text = 0, noout = 0;
91 >    int print_certs = 0, text = 0, noout = 0, p7_print = 0;
92      int ret = 1;
93   #ifndef OPENSSL_NO_ENGINE
94      char *engine = NULL;
# Line 132 | Line 132 | int MAIN(int argc, char **argv)
132              noout = 1;
133          else if (strcmp(*argv, "-text") == 0)
134              text = 1;
135 +        else if (strcmp(*argv, "-print") == 0)
136 +            p7_print = 1;
137          else if (strcmp(*argv, "-print_certs") == 0)
138              print_certs = 1;
139   #ifndef OPENSSL_NO_ENGINE
# Line 187 | Line 189 | int MAIN(int argc, char **argv)
189      if (infile == NULL)
190          BIO_set_fp(in, stdin, BIO_NOCLOSE);
191      else {
192 <        if (BIO_read_filename(in, infile) <= 0)
193 <            if (in == NULL) {
194 <                perror(infile);
195 <                goto end;
196 <            }
192 >        if (BIO_read_filename(in, infile) <= 0) {
193 >            BIO_printf(bio_err, "unable to load input file\n");
194 >            ERR_print_errors(bio_err);
195 >            goto end;
196 >        }
197      }
198  
199      if (informat == FORMAT_ASN1)
# Line 222 | Line 224 | int MAIN(int argc, char **argv)
224              goto end;
225          }
226      }
227 +
228 +    if (p7_print)
229 +        PKCS7_print_ctx(out, p7, 0, NULL);
230  
231      if (print_certs) {
232          STACK_OF(X509) *certs = NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines