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; |
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 |
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) |
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; |