X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fdgst.c;h=1b56d6ef44167bbe1ac3c2a4f00bab2bf27cce98;hp=eea291db1274f907c27b61ab2c02d5e5eded113f;hb=a8883854a33757ecc3132bc6549e7e51d736e6c4;hpb=7dfb0b774e6592dcbfe47015168a0ac8b44e2a17 diff --git a/apps/dgst.c b/apps/dgst.c index eea291db12..1b56d6ef44 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -60,12 +60,12 @@ #include #include #include "apps.h" -#include "bio.h" -#include "err.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" -#include "pem.h" +#include +#include +#include +#include +#include +#include #undef BUFSIZE #define BUFSIZE 1024*8 @@ -73,24 +73,20 @@ #undef PROG #define PROG dgst_main -#ifndef NOPROTO void do_fp(unsigned char *buf,BIO *f,int sep); -#else -void do_fp(); -#endif -int MAIN(argc,argv) -int argc; -char **argv; +int MAIN(int, char **); + +int MAIN(int argc, char **argv) { unsigned char *buf=NULL; int i,err=0; - EVP_MD *md=NULL,*m; + const EVP_MD *md=NULL,*m; BIO *in=NULL,*inp; BIO *bmd=NULL; - char *name; + const char *name; #define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; + char pname[PROG_NAME_SIZE]; int separator=0; int debug=0; @@ -106,13 +102,13 @@ char **argv; BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); /* first check the program name */ - program_name(argv[0],pname,PROG_NAME_SIZE); + program_name(argv[0],pname,PROG_NAME_SIZE); md=EVP_get_digestbyname(pname); argc--; argv++; - for (i=0; i 0) { if ((*argv)[0] != '-') break; if (strcmp(*argv,"-c") == 0) @@ -146,6 +142,8 @@ char **argv; LN_sha,LN_sha); BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n", LN_mdc2,LN_mdc2); + BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n", + LN_ripemd160,LN_ripemd160); err=1; goto end; } @@ -187,7 +185,7 @@ char **argv; } printf("%s(%s)= ",name,argv[i]); do_fp(buf,inp,separator); - BIO_reset(bmd); + (void)BIO_reset(bmd); } } end: @@ -201,10 +199,7 @@ end: EXIT(err); } -void do_fp(buf,bp,sep) -unsigned char *buf; -BIO *bp; -int sep; +void do_fp(unsigned char *buf, BIO *bp, int sep) { int len; int i;