summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bf_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bf_null.c')
-rw-r--r--src/lib/libcrypto/bio/bf_null.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/src/lib/libcrypto/bio/bf_null.c b/src/lib/libcrypto/bio/bf_null.c
index a47a65741a..3254a55dce 100644
--- a/src/lib/libcrypto/bio/bf_null.c
+++ b/src/lib/libcrypto/bio/bf_null.c
@@ -59,13 +59,12 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include "bio.h" 62#include <openssl/bio.h>
63#include "evp.h" 63#include <openssl/evp.h>
64 64
65/* BIO_put and BIO_get both add to the digest, 65/* BIO_put and BIO_get both add to the digest,
66 * BIO_gets returns the digest */ 66 * BIO_gets returns the digest */
67 67
68#ifndef NOPROTO
69static int nullf_write(BIO *h,char *buf,int num); 68static int nullf_write(BIO *h,char *buf,int num);
70static int nullf_read(BIO *h,char *buf,int size); 69static int nullf_read(BIO *h,char *buf,int size);
71static int nullf_puts(BIO *h,char *str); 70static int nullf_puts(BIO *h,char *str);
@@ -73,16 +72,6 @@ static int nullf_gets(BIO *h,char *str,int size);
73static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2); 72static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2);
74static int nullf_new(BIO *h); 73static int nullf_new(BIO *h);
75static int nullf_free(BIO *data); 74static int nullf_free(BIO *data);
76#else
77static int nullf_write();
78static int nullf_read();
79static int nullf_puts();
80static int nullf_gets();
81static long nullf_ctrl();
82static int nullf_new();
83static int nullf_free();
84#endif
85
86static BIO_METHOD methods_nullf= 75static BIO_METHOD methods_nullf=
87 { 76 {
88 BIO_TYPE_NULL_FILTER, 77 BIO_TYPE_NULL_FILTER,
@@ -96,13 +85,12 @@ static BIO_METHOD methods_nullf=
96 nullf_free, 85 nullf_free,
97 }; 86 };
98 87
99BIO_METHOD *BIO_f_null() 88BIO_METHOD *BIO_f_null(void)
100 { 89 {
101 return(&methods_nullf); 90 return(&methods_nullf);
102 } 91 }
103 92
104static int nullf_new(bi) 93static int nullf_new(BIO *bi)
105BIO *bi;
106 { 94 {
107 bi->init=1; 95 bi->init=1;
108 bi->ptr=NULL; 96 bi->ptr=NULL;
@@ -110,8 +98,7 @@ BIO *bi;
110 return(1); 98 return(1);
111 } 99 }
112 100
113static int nullf_free(a) 101static int nullf_free(BIO *a)
114BIO *a;
115 { 102 {
116 if (a == NULL) return(0); 103 if (a == NULL) return(0);
117/* a->ptr=NULL; 104/* a->ptr=NULL;
@@ -120,10 +107,7 @@ BIO *a;
120 return(1); 107 return(1);
121 } 108 }
122 109
123static int nullf_read(b,out,outl) 110static int nullf_read(BIO *b, char *out, int outl)
124BIO *b;
125char *out;
126int outl;
127 { 111 {
128 int ret=0; 112 int ret=0;
129 113
@@ -135,10 +119,7 @@ int outl;
135 return(ret); 119 return(ret);
136 } 120 }
137 121
138static int nullf_write(b,in,inl) 122static int nullf_write(BIO *b, char *in, int inl)
139BIO *b;
140char *in;
141int inl;
142 { 123 {
143 int ret=0; 124 int ret=0;
144 125
@@ -150,11 +131,7 @@ int inl;
150 return(ret); 131 return(ret);
151 } 132 }
152 133
153static long nullf_ctrl(b,cmd,num,ptr) 134static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr)
154BIO *b;
155int cmd;
156long num;
157char *ptr;
158 { 135 {
159 long ret; 136 long ret;
160 137
@@ -175,19 +152,14 @@ char *ptr;
175 return(ret); 152 return(ret);
176 } 153 }
177 154
178static int nullf_gets(bp,buf,size) 155static int nullf_gets(BIO *bp, char *buf, int size)
179BIO *bp;
180char *buf;
181int size;
182 { 156 {
183 if (bp->next_bio == NULL) return(0); 157 if (bp->next_bio == NULL) return(0);
184 return(BIO_gets(bp->next_bio,buf,size)); 158 return(BIO_gets(bp->next_bio,buf,size));
185 } 159 }
186 160
187 161
188static int nullf_puts(bp,str) 162static int nullf_puts(BIO *bp, char *str)
189BIO *bp;
190char *str;
191 { 163 {
192 if (bp->next_bio == NULL) return(0); 164 if (bp->next_bio == NULL) return(0);
193 return(BIO_puts(bp->next_bio,str)); 165 return(BIO_puts(bp->next_bio,str));