diff options
author | beck <> | 2000-03-19 11:13:58 +0000 |
---|---|---|
committer | beck <> | 2000-03-19 11:13:58 +0000 |
commit | 796d609550df3a33fc11468741c5d2f6d3df4c11 (patch) | |
tree | 6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/bio/bio.h | |
parent | 5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff) | |
download | openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2 openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip |
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2
if you are using the ssl26 packages for ssh and other things to work you will
need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/bio/bio.h')
-rw-r--r-- | src/lib/libcrypto/bio/bio.h | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h index 54bf622a3b..bc08401eeb 100644 --- a/src/lib/libcrypto/bio/bio.h +++ b/src/lib/libcrypto/bio/bio.h | |||
@@ -76,7 +76,7 @@ extern "C" { | |||
76 | #define BIO_TYPE_SOCKET (5|0x0400|0x0100) | 76 | #define BIO_TYPE_SOCKET (5|0x0400|0x0100) |
77 | #define BIO_TYPE_NULL (6|0x0400) | 77 | #define BIO_TYPE_NULL (6|0x0400) |
78 | #define BIO_TYPE_SSL (7|0x0200) | 78 | #define BIO_TYPE_SSL (7|0x0200) |
79 | #define BIO_TYPE_MD (8|0x0200) /* pasive filter */ | 79 | #define BIO_TYPE_MD (8|0x0200) /* passive filter */ |
80 | #define BIO_TYPE_BUFFER (9|0x0200) /* filter */ | 80 | #define BIO_TYPE_BUFFER (9|0x0200) /* filter */ |
81 | #define BIO_TYPE_CIPHER (10|0x0200) /* filter */ | 81 | #define BIO_TYPE_CIPHER (10|0x0200) /* filter */ |
82 | #define BIO_TYPE_BASE64 (11|0x0200) /* filter */ | 82 | #define BIO_TYPE_BASE64 (11|0x0200) /* filter */ |
@@ -147,6 +147,11 @@ extern "C" { | |||
147 | 147 | ||
148 | #define BIO_FLAGS_BASE64_NO_NL 0x100 | 148 | #define BIO_FLAGS_BASE64_NO_NL 0x100 |
149 | 149 | ||
150 | /* This is used with memory BIOs: it means we shouldn't free up or change the | ||
151 | * data in any way. | ||
152 | */ | ||
153 | #define BIO_FLAGS_MEM_RDONLY 0x200 | ||
154 | |||
150 | #define BIO_set_flags(b,f) ((b)->flags|=(f)) | 155 | #define BIO_set_flags(b,f) ((b)->flags|=(f)) |
151 | #define BIO_get_flags(b) ((b)->flags) | 156 | #define BIO_get_flags(b) ((b)->flags) |
152 | #define BIO_set_retry_special(b) \ | 157 | #define BIO_set_retry_special(b) \ |
@@ -163,7 +168,7 @@ extern "C" { | |||
163 | #define BIO_get_retry_flags(b) \ | 168 | #define BIO_get_retry_flags(b) \ |
164 | ((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) | 169 | ((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) |
165 | 170 | ||
166 | /* These shouldbe used by the application to tell why we should retry */ | 171 | /* These should be used by the application to tell why we should retry */ |
167 | #define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ) | 172 | #define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ) |
168 | #define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE) | 173 | #define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE) |
169 | #define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL) | 174 | #define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL) |
@@ -214,6 +219,7 @@ typedef struct bio_method_st | |||
214 | long (*ctrl)(); | 219 | long (*ctrl)(); |
215 | int (*create)(); | 220 | int (*create)(); |
216 | int (*destroy)(); | 221 | int (*destroy)(); |
222 | long (*callback_ctrl)(); | ||
217 | } BIO_METHOD; | 223 | } BIO_METHOD; |
218 | #else | 224 | #else |
219 | typedef struct bio_method_st | 225 | typedef struct bio_method_st |
@@ -227,6 +233,7 @@ typedef struct bio_method_st | |||
227 | long (_far *ctrl)(); | 233 | long (_far *ctrl)(); |
228 | int (_far *create)(); | 234 | int (_far *create)(); |
229 | int (_far *destroy)(); | 235 | int (_far *destroy)(); |
236 | long (_fat *callback_ctrl)(); | ||
230 | } BIO_METHOD; | 237 | } BIO_METHOD; |
231 | #endif | 238 | #endif |
232 | 239 | ||
@@ -278,9 +285,6 @@ typedef struct bio_f_buffer_ctx_struct | |||
278 | #define BIO_CONN_S_NBIO 8 | 285 | #define BIO_CONN_S_NBIO 8 |
279 | /*#define BIO_CONN_get_param_hostname BIO_ctrl */ | 286 | /*#define BIO_CONN_get_param_hostname BIO_ctrl */ |
280 | 287 | ||
281 | #define BIO_number_read(b) ((b)->num_read) | ||
282 | #define BIO_number_written(b) ((b)->num_write) | ||
283 | |||
284 | #define BIO_C_SET_CONNECT 100 | 288 | #define BIO_C_SET_CONNECT 100 |
285 | #define BIO_C_DO_STATE_MACHINE 101 | 289 | #define BIO_C_DO_STATE_MACHINE 101 |
286 | #define BIO_C_SET_NBIO 102 | 290 | #define BIO_C_SET_NBIO 102 |
@@ -325,9 +329,14 @@ typedef struct bio_f_buffer_ctx_struct | |||
325 | #define BIO_C_GET_WRITE_GUARANTEE 140 | 329 | #define BIO_C_GET_WRITE_GUARANTEE 140 |
326 | #define BIO_C_GET_READ_REQUEST 141 | 330 | #define BIO_C_GET_READ_REQUEST 141 |
327 | #define BIO_C_SHUTDOWN_WR 142 | 331 | #define BIO_C_SHUTDOWN_WR 142 |
332 | #define BIO_C_NREAD0 143 | ||
333 | #define BIO_C_NREAD 144 | ||
334 | #define BIO_C_NWRITE0 145 | ||
335 | #define BIO_C_NWRITE 146 | ||
336 | #define BIO_C_RESET_READ_REQUEST 147 | ||
328 | 337 | ||
329 | 338 | ||
330 | #define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,(char *)arg) | 339 | #define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) |
331 | #define BIO_get_app_data(s) BIO_get_ex_data(s,0) | 340 | #define BIO_get_app_data(s) BIO_get_ex_data(s,0) |
332 | 341 | ||
333 | /* BIO_s_connect() and BIO_s_socks4a_connect() */ | 342 | /* BIO_s_connect() and BIO_s_socks4a_connect() */ |
@@ -366,7 +375,7 @@ typedef struct bio_f_buffer_ctx_struct | |||
366 | /* BIO_set_nbio(b,n) */ | 375 | /* BIO_set_nbio(b,n) */ |
367 | #define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) | 376 | #define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) |
368 | /* BIO *BIO_get_filter_bio(BIO *bio); */ | 377 | /* BIO *BIO_get_filter_bio(BIO *bio); */ |
369 | #define BIO_set_proxy_cb(b,cb) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(char *)(cb)) | 378 | #define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) |
370 | #define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) | 379 | #define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) |
371 | #define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) | 380 | #define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) |
372 | 381 | ||
@@ -445,8 +454,8 @@ int BIO_read_filename(BIO *b,const char *name); | |||
445 | size_t BIO_ctrl_pending(BIO *b); | 454 | size_t BIO_ctrl_pending(BIO *b); |
446 | size_t BIO_ctrl_wpending(BIO *b); | 455 | size_t BIO_ctrl_wpending(BIO *b); |
447 | #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) | 456 | #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) |
448 | #define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(char *)cbp) | 457 | #define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(void (**)())(cbp)) |
449 | #define BIO_set_info_callback(b,cb) (int)BIO_ctrl(b,BIO_CTRL_SET_CALLBACK,0,(char *)cb) | 458 | #define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(void (*)())(cb)) |
450 | 459 | ||
451 | /* For the BIO_f_buffer() type */ | 460 | /* For the BIO_f_buffer() type */ |
452 | #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) | 461 | #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) |
@@ -461,8 +470,7 @@ size_t BIO_ctrl_wpending(BIO *b); | |||
461 | #define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) | 470 | #define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) |
462 | size_t BIO_ctrl_get_write_guarantee(BIO *b); | 471 | size_t BIO_ctrl_get_write_guarantee(BIO *b); |
463 | size_t BIO_ctrl_get_read_request(BIO *b); | 472 | size_t BIO_ctrl_get_read_request(BIO *b); |
464 | 473 | int BIO_ctrl_reset_read_request(BIO *b); | |
465 | |||
466 | 474 | ||
467 | #ifdef NO_STDIO | 475 | #ifdef NO_STDIO |
468 | #define NO_FP_API | 476 | #define NO_FP_API |
@@ -472,10 +480,12 @@ size_t BIO_ctrl_get_read_request(BIO *b); | |||
472 | /* These two aren't currently implemented */ | 480 | /* These two aren't currently implemented */ |
473 | /* int BIO_get_ex_num(BIO *bio); */ | 481 | /* int BIO_get_ex_num(BIO *bio); */ |
474 | /* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ | 482 | /* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ |
475 | int BIO_set_ex_data(BIO *bio,int idx,char *data); | 483 | int BIO_set_ex_data(BIO *bio,int idx,void *data); |
476 | char *BIO_get_ex_data(BIO *bio,int idx); | 484 | void *BIO_get_ex_data(BIO *bio,int idx); |
477 | int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | 485 | int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
478 | int (*dup_func)(), void (*free_func)()); | 486 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
487 | unsigned long BIO_number_read(BIO *bio); | ||
488 | unsigned long BIO_number_written(BIO *bio); | ||
479 | 489 | ||
480 | # if defined(WIN16) && defined(_WINDLL) | 490 | # if defined(WIN16) && defined(_WINDLL) |
481 | BIO_METHOD *BIO_s_file_internal(void); | 491 | BIO_METHOD *BIO_s_file_internal(void); |
@@ -500,6 +510,7 @@ int BIO_gets(BIO *bp,char *buf, int size); | |||
500 | int BIO_write(BIO *b, const char *data, int len); | 510 | int BIO_write(BIO *b, const char *data, int len); |
501 | int BIO_puts(BIO *bp,const char *buf); | 511 | int BIO_puts(BIO *bp,const char *buf); |
502 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); | 512 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); |
513 | long BIO_callback_ctrl(BIO *bp,int cmd,void (*fp)()); | ||
503 | char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); | 514 | char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); |
504 | long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); | 515 | long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); |
505 | BIO * BIO_push(BIO *b,BIO *append); | 516 | BIO * BIO_push(BIO *b,BIO *append); |
@@ -510,6 +521,11 @@ BIO * BIO_get_retry_BIO(BIO *bio, int *reason); | |||
510 | int BIO_get_retry_reason(BIO *bio); | 521 | int BIO_get_retry_reason(BIO *bio); |
511 | BIO * BIO_dup_chain(BIO *in); | 522 | BIO * BIO_dup_chain(BIO *in); |
512 | 523 | ||
524 | int BIO_nread0(BIO *bio, char **buf); | ||
525 | int BIO_nread(BIO *bio, char **buf, int num); | ||
526 | int BIO_nwrite0(BIO *bio, char **buf); | ||
527 | int BIO_nwrite(BIO *bio, char **buf, int num); | ||
528 | |||
513 | #ifndef WIN16 | 529 | #ifndef WIN16 |
514 | long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, | 530 | long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, |
515 | long argl,long ret); | 531 | long argl,long ret); |
@@ -519,6 +535,7 @@ long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, | |||
519 | #endif | 535 | #endif |
520 | 536 | ||
521 | BIO_METHOD *BIO_s_mem(void); | 537 | BIO_METHOD *BIO_s_mem(void); |
538 | BIO *BIO_new_mem_buf(void *buf, int len); | ||
522 | BIO_METHOD *BIO_s_socket(void); | 539 | BIO_METHOD *BIO_s_socket(void); |
523 | BIO_METHOD *BIO_s_connect(void); | 540 | BIO_METHOD *BIO_s_connect(void); |
524 | BIO_METHOD *BIO_s_accept(void); | 541 | BIO_METHOD *BIO_s_accept(void); |
@@ -597,11 +614,17 @@ int BIO_printf(BIO *bio, ...); | |||
597 | #define BIO_F_BIO_MAKE_PAIR 121 | 614 | #define BIO_F_BIO_MAKE_PAIR 121 |
598 | #define BIO_F_BIO_NEW 108 | 615 | #define BIO_F_BIO_NEW 108 |
599 | #define BIO_F_BIO_NEW_FILE 109 | 616 | #define BIO_F_BIO_NEW_FILE 109 |
617 | #define BIO_F_BIO_NEW_MEM_BUF 126 | ||
618 | #define BIO_F_BIO_NREAD 123 | ||
619 | #define BIO_F_BIO_NREAD0 124 | ||
620 | #define BIO_F_BIO_NWRITE 125 | ||
621 | #define BIO_F_BIO_NWRITE0 122 | ||
600 | #define BIO_F_BIO_PUTS 110 | 622 | #define BIO_F_BIO_PUTS 110 |
601 | #define BIO_F_BIO_READ 111 | 623 | #define BIO_F_BIO_READ 111 |
602 | #define BIO_F_BIO_SOCK_INIT 112 | 624 | #define BIO_F_BIO_SOCK_INIT 112 |
603 | #define BIO_F_BIO_WRITE 113 | 625 | #define BIO_F_BIO_WRITE 113 |
604 | #define BIO_F_BUFFER_CTRL 114 | 626 | #define BIO_F_BUFFER_CTRL 114 |
627 | #define BIO_F_CONN_CTRL 127 | ||
605 | #define BIO_F_CONN_STATE 115 | 628 | #define BIO_F_CONN_STATE 115 |
606 | #define BIO_F_FILE_CTRL 116 | 629 | #define BIO_F_FILE_CTRL 116 |
607 | #define BIO_F_MEM_WRITE 117 | 630 | #define BIO_F_MEM_WRITE 117 |
@@ -634,6 +657,7 @@ int BIO_printf(BIO *bio, ...); | |||
634 | #define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 | 657 | #define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 |
635 | #define BIO_R_UNINITIALIZED 120 | 658 | #define BIO_R_UNINITIALIZED 120 |
636 | #define BIO_R_UNSUPPORTED_METHOD 121 | 659 | #define BIO_R_UNSUPPORTED_METHOD 121 |
660 | #define BIO_R_WRITE_TO_READ_ONLY_BIO 126 | ||
637 | #define BIO_R_WSASTARTUP 122 | 661 | #define BIO_R_WSASTARTUP 122 |
638 | 662 | ||
639 | #ifdef __cplusplus | 663 | #ifdef __cplusplus |