73 #define POSTFIX ".rvk"
75 static const char *crl_usage[]={
78 " -inform arg - input format - default PEM (DER or PEM)\n",
79 " -outform arg - output format - default PEM\n",
80 " -text - print out a text format version\n",
81 " -in arg - input file - default stdin\n",
82 " -out arg - output file - default stdout\n",
83 " -hash - print hash value\n",
84 " -fingerprint - print the crl fingerprint\n",
85 " -issuer - print issuer DN\n",
86 " -lastupdate - lastUpdate field\n",
87 " -nextupdate - nextUpdate field\n",
88 " -crlnumber - print CRL number\n",
89 " -noout - no CRL output\n",
90 " -CAfile name - verify CRL using certificates in file \"name\"\n",
91 " -CApath dir - verify CRL using certificates in \"dir\"\n",
92 " -nameopt arg - various certificate name options\n",
99 int MAIN(
int,
char **);
101 int MAIN(
int argc,
char **argv)
103 unsigned long nmflag = 0;
105 char *CAfile = NULL, *CApath = NULL;
106 int ret=1,i,
num,badops=0;
108 int informat,outformat;
109 char *infile=NULL,*outfile=NULL;
110 int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,
text=0;
111 int fingerprint = 0, crlnumber = 0;
134 #ifdef OPENSSL_SYS_VMS
137 bio_out =
BIO_push(tmpbio, bio_out);
151 if (strcmp(*argv,
"-p") == 0)
153 if (--argc < 1)
goto bad;
157 if (strcmp(*argv,
"-inform") == 0)
159 if (--argc < 1)
goto bad;
162 else if (strcmp(*argv,
"-outform") == 0)
164 if (--argc < 1)
goto bad;
167 else if (strcmp(*argv,
"-in") == 0)
169 if (--argc < 1)
goto bad;
172 else if (strcmp(*argv,
"-out") == 0)
174 if (--argc < 1)
goto bad;
177 else if (strcmp(*argv,
"-CApath") == 0)
179 if (--argc < 1)
goto bad;
183 else if (strcmp(*argv,
"-CAfile") == 0)
185 if (--argc < 1)
goto bad;
189 else if (strcmp(*argv,
"-verify") == 0)
191 else if (strcmp(*argv,
"-text") == 0)
193 else if (strcmp(*argv,
"-hash") == 0)
195 else if (strcmp(*argv,
"-nameopt") == 0)
197 if (--argc < 1)
goto bad;
200 else if (strcmp(*argv,
"-issuer") == 0)
202 else if (strcmp(*argv,
"-lastupdate") == 0)
204 else if (strcmp(*argv,
"-nextupdate") == 0)
206 else if (strcmp(*argv,
"-noout") == 0)
208 else if (strcmp(*argv,
"-fingerprint") == 0)
210 else if (strcmp(*argv,
"-crlnumber") == 0)
230 for (pp=crl_usage; (*pp != NULL); pp++)
236 x=load_crl(infile,informat);
237 if (x == NULL) {
goto end; }
242 if (lookup == NULL)
goto end;
247 if (lookup == NULL)
goto end;
254 "Error initialising X509 store\n");
262 "Error getting CRL issuer certificate\n");
269 "Error getting CRL issuer public key\n");
281 for (i=1; i<=
num; i++)
296 ASN1_INTEGER_free(crlnum);
324 if (fingerprint == i)
337 for (j=0; j<(int)n; j++)
357 #ifdef OPENSSL_SYS_VMS
384 i=PEM_write_bio_X509_CRL(out,x);
430 x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);