diff options
author | Richard Levitte <levitte@openssl.org> | 2003-07-03 20:45:09 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-07-03 20:45:09 +0000 |
commit | 94805c84d104310305c29a0c25fb0c6f0330b378 (patch) | |
tree | 985a361b478678e221b706fed12fff99ca88a90c /apps/x509.c | |
parent | 6f2f534b5848ba9088462fc85b09ae0a7aa97502 (diff) |
Add -issuer_hash and make -subject_hash the default way to get the
subject hash, with -hash a synonym kept around for backward
compatibility reasons.
PR: 650
Diffstat (limited to 'apps/x509.c')
-rw-r--r-- | apps/x509.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/x509.c b/apps/x509.c index ed9e40574a..f0ef5596fa 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -92,7 +92,9 @@ static char *x509_usage[]={ " -out arg - output file - default stdout\n", " -passin arg - private key password source\n", " -serial - print serial number value\n", -" -hash - print hash value\n", +" -subject_hash - print subject hash value\n", +" -issuer_hash - print issuer hash value\n", +" -hash - synonym for -subject_hash\n", " -subject - print subject DN\n", " -issuer - print issuer DN\n", " -email - print email address(es)\n", @@ -167,8 +169,8 @@ int MAIN(int argc, char **argv) char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL; char *CAkeyfile=NULL,*CAserial=NULL; char *alias=NULL; - int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0; - int ocspid=0; + int text=0,serial=0,subject=0,issuer=0,startdate=0,enddate=0; + int subject_hash=0,issuer_hash=0,ocspid=0; int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0; int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0; int C=0; @@ -379,8 +381,11 @@ int MAIN(int argc, char **argv) x509req= ++num; else if (strcmp(*argv,"-text") == 0) text= ++num; - else if (strcmp(*argv,"-hash") == 0) - hash= ++num; + else if (strcmp(*argv,"-hash") == 0 + || strcmp(*argv,"-subject_hash") == 0) + subject_hash= ++num; + else if (strcmp(*argv,"-issuer_hash") == 0) + issuer_hash= ++num; else if (strcmp(*argv,"-subject") == 0) subject= ++num; else if (strcmp(*argv,"-issuer") == 0) @@ -707,10 +712,14 @@ bad: if (alstr) BIO_printf(STDout,"%s\n", alstr); else BIO_puts(STDout,"<No Alias>\n"); } - else if (hash == i) + else if (subject_hash == i) { BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x)); } + else if (issuer_hash == i) + { + BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash(x)); + } else if (pprint == i) { X509_PURPOSE *ptmp; |