X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbio%2Fbf_null.c;h=2678a1a85d91fdfc6b558b72bb48b1591aec44bc;hb=7df1c720f60ad3813cc88607c4520da031e41e88;hp=8bbf3531461c48ac044610aee1ded4f9cb1a7253;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c index 8bbf353146..2678a1a85d 100644 --- a/crypto/bio/bf_null.c +++ b/crypto/bio/bf_null.c @@ -59,30 +59,20 @@ #include #include #include "cryptlib.h" -#include "bio.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 nullf_write(BIO *h,char *buf,int num); -static int nullf_read(BIO *h,char *buf,int size); -static int nullf_puts(BIO *h,char *str); -static int nullf_gets(BIO *h,char *str,int size); -static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2); +static int nullf_write(BIO *h, const char *buf, int num); +static int nullf_read(BIO *h, char *buf, int size); +static int nullf_puts(BIO *h, const char *str); +static int nullf_gets(BIO *h, char *str, int size); +static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int nullf_new(BIO *h); static int nullf_free(BIO *data); -#else -static int nullf_write(); -static int nullf_read(); -static int nullf_puts(); -static int nullf_gets(); -static long nullf_ctrl(); -static int nullf_new(); -static int nullf_free(); -#endif - +static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); static BIO_METHOD methods_nullf= { BIO_TYPE_NULL_FILTER, @@ -94,6 +84,7 @@ static BIO_METHOD methods_nullf= nullf_ctrl, nullf_new, nullf_free, + nullf_callback_ctrl, }; BIO_METHOD *BIO_f_null(void) @@ -130,7 +121,7 @@ static int nullf_read(BIO *b, char *out, int outl) return(ret); } -static int nullf_write(BIO *b, char *in, int inl) +static int nullf_write(BIO *b, const char *in, int inl) { int ret=0; @@ -142,7 +133,7 @@ static int nullf_write(BIO *b, char *in, int inl) return(ret); } -static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr) +static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr) { long ret; @@ -163,6 +154,20 @@ static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr) return(ret); } +static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) + { + long ret=1; + + if (b->next_bio == NULL) return(0); + switch (cmd) + { + default: + ret=BIO_callback_ctrl(b->next_bio,cmd,fp); + break; + } + return(ret); + } + static int nullf_gets(BIO *bp, char *buf, int size) { if (bp->next_bio == NULL) return(0); @@ -170,7 +175,7 @@ static int nullf_gets(BIO *bp, char *buf, int size) } -static int nullf_puts(BIO *bp, char *str) +static int nullf_puts(BIO *bp, const char *str) { if (bp->next_bio == NULL) return(0); return(BIO_puts(bp->next_bio,str));