diff options
author | djm <> | 2009-01-09 12:14:09 +0000 |
---|---|---|
committer | djm <> | 2009-01-09 12:14:09 +0000 |
commit | c38e9fa1885187364cfeba026e9bf38d6845886f (patch) | |
tree | 9b645adc5cf0aa0820e1501ee5c6f2c41c454e7c /src/lib/libssl/src/apps/crl.c | |
parent | 221e4bfdc56c7ec8942006900694c958c515c143 (diff) | |
download | openbsd-c38e9fa1885187364cfeba026e9bf38d6845886f.tar.gz openbsd-c38e9fa1885187364cfeba026e9bf38d6845886f.tar.bz2 openbsd-c38e9fa1885187364cfeba026e9bf38d6845886f.zip |
import openssl-0.9.8j
Diffstat (limited to 'src/lib/libssl/src/apps/crl.c')
-rw-r--r-- | src/lib/libssl/src/apps/crl.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/libssl/src/apps/crl.c b/src/lib/libssl/src/apps/crl.c index a0040fba11..c395b2afd5 100644 --- a/src/lib/libssl/src/apps/crl.c +++ b/src/lib/libssl/src/apps/crl.c | |||
@@ -85,6 +85,7 @@ static const char *crl_usage[]={ | |||
85 | " -issuer - print issuer DN\n", | 85 | " -issuer - print issuer DN\n", |
86 | " -lastupdate - lastUpdate field\n", | 86 | " -lastupdate - lastUpdate field\n", |
87 | " -nextupdate - nextUpdate field\n", | 87 | " -nextupdate - nextUpdate field\n", |
88 | " -crlnumber - print CRL number\n", | ||
88 | " -noout - no CRL output\n", | 89 | " -noout - no CRL output\n", |
89 | " -CAfile name - verify CRL using certificates in file \"name\"\n", | 90 | " -CAfile name - verify CRL using certificates in file \"name\"\n", |
90 | " -CApath dir - verify CRL using certificates in \"dir\"\n", | 91 | " -CApath dir - verify CRL using certificates in \"dir\"\n", |
@@ -107,7 +108,7 @@ int MAIN(int argc, char **argv) | |||
107 | int informat,outformat; | 108 | int informat,outformat; |
108 | char *infile=NULL,*outfile=NULL; | 109 | char *infile=NULL,*outfile=NULL; |
109 | int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0; | 110 | int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0; |
110 | int fingerprint = 0; | 111 | int fingerprint = 0, crlnumber = 0; |
111 | const char **pp; | 112 | const char **pp; |
112 | X509_STORE *store = NULL; | 113 | X509_STORE *store = NULL; |
113 | X509_STORE_CTX ctx; | 114 | X509_STORE_CTX ctx; |
@@ -206,6 +207,8 @@ int MAIN(int argc, char **argv) | |||
206 | noout= ++num; | 207 | noout= ++num; |
207 | else if (strcmp(*argv,"-fingerprint") == 0) | 208 | else if (strcmp(*argv,"-fingerprint") == 0) |
208 | fingerprint= ++num; | 209 | fingerprint= ++num; |
210 | else if (strcmp(*argv,"-crlnumber") == 0) | ||
211 | crlnumber= ++num; | ||
209 | else if ((md_alg=EVP_get_digestbyname(*argv + 1))) | 212 | else if ((md_alg=EVP_get_digestbyname(*argv + 1))) |
210 | { | 213 | { |
211 | /* ok */ | 214 | /* ok */ |
@@ -281,7 +284,21 @@ bad: | |||
281 | { | 284 | { |
282 | print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag); | 285 | print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag); |
283 | } | 286 | } |
284 | 287 | if (crlnumber == i) | |
288 | { | ||
289 | ASN1_INTEGER *crlnum; | ||
290 | crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, | ||
291 | NULL, NULL); | ||
292 | BIO_printf(bio_out,"crlNumber="); | ||
293 | if (crlnum) | ||
294 | { | ||
295 | i2a_ASN1_INTEGER(bio_out, crlnum); | ||
296 | ASN1_INTEGER_free(crlnum); | ||
297 | } | ||
298 | else | ||
299 | BIO_puts(bio_out, "<NONE>"); | ||
300 | BIO_printf(bio_out,"\n"); | ||
301 | } | ||
285 | if (hash == i) | 302 | if (hash == i) |
286 | { | 303 | { |
287 | BIO_printf(bio_out,"%08lx\n", | 304 | BIO_printf(bio_out,"%08lx\n", |