X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fasn1pars.c;h=f104ebc1f08ae27078c4a98b501dcfefd6b7e239;hp=8c9837ef81ca8d01fe84e66c36c2186afb410eb5;hb=1472f300d57e01401b722886803a0868f7d59c9b;hpb=651d0aff98d28e2db146afa1790e9e22f3ef22db diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 8c9837ef81..f104ebc1f0 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -64,32 +64,32 @@ #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]