diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 60 |
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) | |||
| 141 | void BIO_vfree(BIO *a) | 141 | void BIO_vfree(BIO *a) |
| 142 | { BIO_free(a); } | 142 | { BIO_free(a); } |
| 143 | 143 | ||
| 144 | void BIO_clear_flags(BIO *b, int flags) | ||
| 145 | { | ||
| 146 | b->flags &= ~flags; | ||
| 147 | } | ||
| 148 | |||
| 149 | int BIO_test_flags(const BIO *b, int flags) | ||
| 150 | { | ||
| 151 | return (b->flags & flags); | ||
| 152 | } | ||
| 153 | |||
| 154 | void BIO_set_flags(BIO *b, int flags) | ||
| 155 | { | ||
| 156 | b->flags |= flags; | ||
| 157 | } | ||
| 158 | |||
| 159 | long (*BIO_get_callback(const BIO *b))(struct bio_st *,int,const char *,int, long,long) | ||
| 160 | { | ||
| 161 | return b->callback; | ||
| 162 | } | ||
| 163 | |||
| 164 | void BIO_set_callback(BIO *b, long (*cb)(struct bio_st *,int,const char *,int, long,long)) | ||
| 165 | { | ||
| 166 | b->callback = cb; | ||
| 167 | } | ||
| 168 | |||
| 169 | void BIO_set_callback_arg(BIO *b, char *arg) | ||
| 170 | { | ||
| 171 | b->cb_arg = arg; | ||
| 172 | } | ||
| 173 | |||
| 174 | char * BIO_get_callback_arg(const BIO *b) | ||
| 175 | { | ||
| 176 | return b->cb_arg; | ||
| 177 | } | ||
| 178 | |||
| 179 | const char * BIO_method_name(const BIO *b) | ||
| 180 | { | ||
| 181 | return b->method->name; | ||
| 182 | } | ||
| 183 | |||
| 184 | int BIO_method_type(const BIO *b) | ||
| 185 | { | ||
| 186 | return b->method->type; | ||
| 187 | } | ||
| 188 | |||
| 189 | |||
| 144 | int BIO_read(BIO *b, void *out, int outl) | 190 | int 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) | |||
| 176 | int BIO_write(BIO *b, const void *in, int inl) | 222 | int 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) | |||
| 211 | int BIO_puts(BIO *b, const char *in) | 257 | int 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) | |||
| 244 | int BIO_gets(BIO *b, char *in, int inl) | 290 | int 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) | |||
| 305 | long BIO_ctrl(BIO *b, int cmd, long larg, void *parg) | 351 | long 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) | |||
| 332 | long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)) | 378 | long 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 | ||
