From de8f24ea083384bb66b32ec105dc4743c5663cdf Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 29 Sep 1999 04:37:45 +0000 Subject: OpenSSL 0.9.4 merge --- src/lib/libcrypto/evp/bio_md.c | 48 ++++++++++-------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'src/lib/libcrypto/evp/bio_md.c') diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index fa5fdc055b..317167f9c4 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c @@ -59,13 +59,12 @@ #include #include #include "cryptlib.h" -#include "buffer.h" -#include "evp.h" +#include +#include /* BIO_put and BIO_get both add to the digest, * BIO_gets returns the digest */ -#ifndef NOPROTO static int md_write(BIO *h,char *buf,int num); static int md_read(BIO *h,char *buf,int size); /*static int md_puts(BIO *h,char *str); */ @@ -73,16 +72,6 @@ static int md_gets(BIO *h,char *str,int size); static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); static int md_new(BIO *h); static int md_free(BIO *data); -#else -static int md_write(); -static int md_read(); -/*static int md_puts(); */ -static int md_gets(); -static long md_ctrl(); -static int md_new(); -static int md_free(); -#endif - static BIO_METHOD methods_md= { BIO_TYPE_MD,"message digest", @@ -95,13 +84,12 @@ static BIO_METHOD methods_md= md_free, }; -BIO_METHOD *BIO_f_md() +BIO_METHOD *BIO_f_md(void) { return(&methods_md); } -static int md_new(bi) -BIO *bi; +static int md_new(BIO *bi) { EVP_MD_CTX *ctx; @@ -114,8 +102,7 @@ BIO *bi; return(1); } -static int md_free(a) -BIO *a; +static int md_free(BIO *a) { if (a == NULL) return(0); Free(a->ptr); @@ -125,10 +112,7 @@ BIO *a; return(1); } -static int md_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int md_read(BIO *b, char *out, int outl) { int ret=0; EVP_MD_CTX *ctx; @@ -152,10 +136,7 @@ int outl; return(ret); } -static int md_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int md_write(BIO *b, char *in, int inl) { int ret=0; EVP_MD_CTX *ctx; @@ -178,14 +159,10 @@ int inl; return(ret); } -static long md_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long md_ctrl(BIO *b, int cmd, long num, char *ptr) { EVP_MD_CTX *ctx,*dctx,**pctx; - EVP_MD **ppmd; + const EVP_MD **ppmd; EVP_MD *md; long ret=1; BIO *dbio; @@ -204,7 +181,7 @@ char *ptr; case BIO_C_GET_MD: if (b->init) { - ppmd=(EVP_MD **)ptr; + ppmd=(const EVP_MD **)ptr; *ppmd=ctx->digest; } else @@ -243,10 +220,7 @@ char *ptr; return(ret); } -static int md_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int md_gets(BIO *bp, char *buf, int size) { EVP_MD_CTX *ctx; unsigned int ret; -- cgit v1.2.3-55-g6feb