Deleted Added
full compact
pkcs7.c (109998) pkcs7.c (111147)
1/* apps/pkcs7.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 68 unchanged lines hidden (view full) ---

77 * -out arg - output file - default stdout
78 * -print_certs
79 */
80
81int MAIN(int, char **);
82
83int MAIN(int argc, char **argv)
84 {
1/* apps/pkcs7.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 68 unchanged lines hidden (view full) ---

77 * -out arg - output file - default stdout
78 * -print_certs
79 */
80
81int MAIN(int, char **);
82
83int MAIN(int argc, char **argv)
84 {
85#ifndef OPENSSL_NO_ENGINE
85 ENGINE *e = NULL;
86 ENGINE *e = NULL;
87#endif
86 PKCS7 *p7=NULL;
87 int i,badops=0;
88 BIO *in=NULL,*out=NULL;
89 int informat,outformat;
90 char *infile,*outfile,*prog;
91 int print_certs=0,text=0,noout=0;
92 int ret=1;
88 PKCS7 *p7=NULL;
89 int i,badops=0;
90 BIO *in=NULL,*out=NULL;
91 int informat,outformat;
92 char *infile,*outfile,*prog;
93 int print_certs=0,text=0,noout=0;
94 int ret=1;
95#ifndef OPENSSL_NO_ENGINE
93 char *engine=NULL;
96 char *engine=NULL;
97#endif
94
95 apps_startup();
96
97 if (bio_err == NULL)
98 if ((bio_err=BIO_new(BIO_s_file())) != NULL)
99 BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
100
101 infile=NULL;

--- 27 unchanged lines hidden (view full) ---

129 outfile= *(++argv);
130 }
131 else if (strcmp(*argv,"-noout") == 0)
132 noout=1;
133 else if (strcmp(*argv,"-text") == 0)
134 text=1;
135 else if (strcmp(*argv,"-print_certs") == 0)
136 print_certs=1;
98
99 apps_startup();
100
101 if (bio_err == NULL)
102 if ((bio_err=BIO_new(BIO_s_file())) != NULL)
103 BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
104
105 infile=NULL;

--- 27 unchanged lines hidden (view full) ---

133 outfile= *(++argv);
134 }
135 else if (strcmp(*argv,"-noout") == 0)
136 noout=1;
137 else if (strcmp(*argv,"-text") == 0)
138 text=1;
139 else if (strcmp(*argv,"-print_certs") == 0)
140 print_certs=1;
141#ifndef OPENSSL_NO_ENGINE
137 else if (strcmp(*argv,"-engine") == 0)
138 {
139 if (--argc < 1) goto bad;
140 engine= *(++argv);
141 }
142 else if (strcmp(*argv,"-engine") == 0)
143 {
144 if (--argc < 1) goto bad;
145 engine= *(++argv);
146 }
147#endif
142 else
143 {
144 BIO_printf(bio_err,"unknown option %s\n",*argv);
145 badops=1;
146 break;
147 }
148 argc--;
149 argv++;

--- 6 unchanged lines hidden (view full) ---

156 BIO_printf(bio_err,"where options are\n");
157 BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
158 BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
159 BIO_printf(bio_err," -in arg input file\n");
160 BIO_printf(bio_err," -out arg output file\n");
161 BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
162 BIO_printf(bio_err," -text print full details of certificates\n");
163 BIO_printf(bio_err," -noout don't output encoded data\n");
148 else
149 {
150 BIO_printf(bio_err,"unknown option %s\n",*argv);
151 badops=1;
152 break;
153 }
154 argc--;
155 argv++;

--- 6 unchanged lines hidden (view full) ---

162 BIO_printf(bio_err,"where options are\n");
163 BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
164 BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
165 BIO_printf(bio_err," -in arg input file\n");
166 BIO_printf(bio_err," -out arg output file\n");
167 BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
168 BIO_printf(bio_err," -text print full details of certificates\n");
169 BIO_printf(bio_err," -noout don't output encoded data\n");
170#ifndef OPENSSL_NO_ENGINE
164 BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
171 BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
172#endif
165 ret = 1;
166 goto end;
167 }
168
169 ERR_load_crypto_strings();
170
173 ret = 1;
174 goto end;
175 }
176
177 ERR_load_crypto_strings();
178
179#ifndef OPENSSL_NO_ENGINE
171 e = setup_engine(bio_err, engine, 0);
180 e = setup_engine(bio_err, engine, 0);
181#endif
172
173 in=BIO_new(BIO_s_file());
174 out=BIO_new(BIO_s_file());
175 if ((in == NULL) || (out == NULL))
176 {
177 ERR_print_errors(bio_err);
178 goto end;
179 }

--- 126 unchanged lines hidden ---
182
183 in=BIO_new(BIO_s_file());
184 out=BIO_new(BIO_s_file());
185 if ((in == NULL) || (out == NULL))
186 {
187 ERR_print_errors(bio_err);
188 goto end;
189 }

--- 126 unchanged lines hidden ---