summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bio_lib.c
diff options
context:
space:
mode:
authordjm <>2008-09-06 12:15:56 +0000
committerdjm <>2008-09-06 12:15:56 +0000
commit5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80 (patch)
treeaba68249883aa9d2361d92eef69a81d0c4961732 /src/lib/libcrypto/bio/bio_lib.c
parentf6198d4d0ab97685dc56be2d48715ed39fcc74b9 (diff)
downloadopenbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.gz
openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.bz2
openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.zip
import of OpenSSL 0.9.8h
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
-rw-r--r--src/lib/libcrypto/bio/bio_lib.c60
1 files changed, 53 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c
index 692c8fb5c6..3f52ae953c 100644
--- a/src/lib/libcrypto/bio/bio_lib.c
+++ b/src/lib/libcrypto/bio/bio_lib.c
@@ -141,10 +141,56 @@ int BIO_free(BIO *a)
141void BIO_vfree(BIO *a) 141void BIO_vfree(BIO *a)
142 { BIO_free(a); } 142 { BIO_free(a); }
143 143
144void BIO_clear_flags(BIO *b, int flags)
145 {
146 b->flags &= ~flags;
147 }
148
149int BIO_test_flags(const BIO *b, int flags)
150 {
151 return (b->flags & flags);
152 }
153
154void BIO_set_flags(BIO *b, int flags)
155 {
156 b->flags |= flags;
157 }
158
159long (*BIO_get_callback(const BIO *b))(struct bio_st *,int,const char *,int, long,long)
160 {
161 return b->callback;
162 }
163
164void BIO_set_callback(BIO *b, long (*cb)(struct bio_st *,int,const char *,int, long,long))
165 {
166 b->callback = cb;
167 }
168
169void BIO_set_callback_arg(BIO *b, char *arg)
170 {
171 b->cb_arg = arg;
172 }
173
174char * BIO_get_callback_arg(const BIO *b)
175 {
176 return b->cb_arg;
177 }
178
179const char * BIO_method_name(const BIO *b)
180 {
181 return b->method->name;
182 }
183
184int BIO_method_type(const BIO *b)
185 {
186 return b->method->type;
187 }
188
189
144int BIO_read(BIO *b, void *out, int outl) 190int BIO_read(BIO *b, void *out, int outl)
145 { 191 {
146 int i; 192 int i;
147 long (*cb)(); 193 long (*cb)(BIO *,int,const char *,int,long,long);
148 194
149 if ((b == NULL) || (b->method == NULL) || (b->method->bread == NULL)) 195 if ((b == NULL) || (b->method == NULL) || (b->method->bread == NULL))
150 { 196 {
@@ -176,7 +222,7 @@ int BIO_read(BIO *b, void *out, int outl)
176int BIO_write(BIO *b, const void *in, int inl) 222int BIO_write(BIO *b, const void *in, int inl)
177 { 223 {
178 int i; 224 int i;
179 long (*cb)(); 225 long (*cb)(BIO *,int,const char *,int,long,long);
180 226
181 if (b == NULL) 227 if (b == NULL)
182 return(0); 228 return(0);
@@ -211,7 +257,7 @@ int BIO_write(BIO *b, const void *in, int inl)
211int BIO_puts(BIO *b, const char *in) 257int BIO_puts(BIO *b, const char *in)
212 { 258 {
213 int i; 259 int i;
214 long (*cb)(); 260 long (*cb)(BIO *,int,const char *,int,long,long);
215 261
216 if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) 262 if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL))
217 { 263 {
@@ -244,7 +290,7 @@ int BIO_puts(BIO *b, const char *in)
244int BIO_gets(BIO *b, char *in, int inl) 290int BIO_gets(BIO *b, char *in, int inl)
245 { 291 {
246 int i; 292 int i;
247 long (*cb)(); 293 long (*cb)(BIO *,int,const char *,int,long,long);
248 294
249 if ((b == NULL) || (b->method == NULL) || (b->method->bgets == NULL)) 295 if ((b == NULL) || (b->method == NULL) || (b->method->bgets == NULL))
250 { 296 {
@@ -305,7 +351,7 @@ char *BIO_ptr_ctrl(BIO *b, int cmd, long larg)
305long BIO_ctrl(BIO *b, int cmd, long larg, void *parg) 351long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
306 { 352 {
307 long ret; 353 long ret;
308 long (*cb)(); 354 long (*cb)(BIO *,int,const char *,int,long,long);
309 355
310 if (b == NULL) return(0); 356 if (b == NULL) return(0);
311 357
@@ -332,13 +378,13 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
332long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)) 378long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long))
333 { 379 {
334 long ret; 380 long ret;
335 long (*cb)(); 381 long (*cb)(BIO *,int,const char *,int,long,long);
336 382
337 if (b == NULL) return(0); 383 if (b == NULL) return(0);
338 384
339 if ((b->method == NULL) || (b->method->callback_ctrl == NULL)) 385 if ((b->method == NULL) || (b->method->callback_ctrl == NULL))
340 { 386 {
341 BIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD); 387 BIOerr(BIO_F_BIO_CALLBACK_CTRL,BIO_R_UNSUPPORTED_METHOD);
342 return(-2); 388 return(-2);
343 } 389 }
344 390