X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=apps%2Fasn1pars.c;h=f104ebc1f08ae27078c4a98b501dcfefd6b7e239;hb=f2716dada0527bcf200e628fd572514bd395fbfb;hp=edeffaaa8463943a9233adc5393a3e192be6c420;hpb=31b8d8684441e6cd5138832bb1b2ddb10acd6ba6;p=openssl.git diff --git a/apps/asn1pars.c b/apps/asn1pars.c index edeffaaa84..f104ebc1f0 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -57,39 +57,39 @@ */ /* A nice addition from Dr Stephen Henson to - * add the -strparse option which parses nested binarary structures + * add the -strparse option which parses nested binary structures */ #include #include #include #include "apps.h" -#include "err.h" -#include "evp.h" -#include "x509.h" -#include "pem.h" +#include +#include +#include +#include /* -inform arg - input format - default PEM (DER or PEM) * -in arg - input file - default stdin * -i - indent the details by depth * -offset - where in the file to start * -length - how many bytes to use - * -oid file - extra oid decription file + * -oid file - extra oid description file */ #undef PROG #define PROG asn1parse_main -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int, char **); + +int MAIN(int argc, char **argv) { int i,badops=0,offset=0,ret=1,j; unsigned int length=0; long num,tmplen; - BIO *in=NULL,*out=NULL,*b64=NULL; - int informat,indent=0; - char *infile=NULL,*str=NULL,*prog,*oidfile=NULL; + BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL; + int informat,indent=0, noout = 0; + char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL; unsigned char *tmpbuf; BUF_MEM *buf=NULL; STACK *osk=NULL; @@ -123,10 +123,16 @@ char **argv; if (--argc < 1) goto bad; infile= *(++argv); } + else if (strcmp(*argv,"-out") == 0) + { + if (--argc < 1) goto bad; + derfile= *(++argv); + } else if (strcmp(*argv,"-i") == 0) { indent=1; } + else if (strcmp(*argv,"-noout") == 0) noout = 1; else if (strcmp(*argv,"-oid") == 0) { if (--argc < 1) goto bad; @@ -164,14 +170,17 @@ bad: BIO_printf(bio_err,"%s [options]