X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fdgst.c;h=9107a5230d1917064ca65d8abbce7e8ba6bfe7aa;hb=da70ff710c712645cddbb7505491a5786abca0b9;hp=6d7a1787f4a12aec1e6f7b4f01397aa23d64bf4a;hpb=b7896b3cb86d80206af14a14d69b0717786f2729;p=oweals%2Fopenssl.git diff --git a/apps/dgst.c b/apps/dgst.c index 6d7a1787f4..9107a5230d 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -1,5 +1,5 @@ /* apps/dgst.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -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,22 +73,15 @@ #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 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]; int separator=0; @@ -103,7 +96,7 @@ char **argv; } if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) - BIO_set_fp(bio_err,stderr,BIO_NOCLOSE); + BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); /* first check the program name */ program_name(argv[0],pname,PROG_NAME_SIZE); @@ -112,7 +105,7 @@ char **argv; argc--; argv++; - for (i=0; i 0) { if ((*argv)[0] != '-') break; if (strcmp(*argv,"-c") == 0) @@ -135,17 +128,19 @@ char **argv; BIO_printf(bio_err,"unknown option '%s'\n",*argv); BIO_printf(bio_err,"options are\n"); BIO_printf(bio_err,"-c to output the digest with separating colons\n"); - BIO_printf(bio_err,"-c to output debug info\n"); - BIO_printf(bio_err,"-%3s to use the %s message digest alogorithm (default)\n", + BIO_printf(bio_err,"-d to output debug info\n"); + BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n", LN_md5,LN_md5); - BIO_printf(bio_err,"-%3s to use the %s message digest alogorithm\n", + BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n", LN_md2,LN_md2); - BIO_printf(bio_err,"-%3s to use the %s message digest alogorithm\n", + BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n", LN_sha1,LN_sha1); - BIO_printf(bio_err,"-%3s to use the %s message digest alogorithm\n", + BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n", LN_sha,LN_sha); - BIO_printf(bio_err,"-%3s to use the %s message digest alogorithm\n", + 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; } @@ -201,10 +196,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;