diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bio.h')
-rw-r--r-- | src/lib/libcrypto/bio/bio.h | 165 |
1 files changed, 87 insertions, 78 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h index 05699ab212..4f1d02ada5 100644 --- a/src/lib/libcrypto/bio/bio.h +++ b/src/lib/libcrypto/bio/bio.h | |||
@@ -151,7 +151,7 @@ extern "C" { | |||
151 | 151 | ||
152 | #define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ | 152 | #define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ |
153 | #define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */ | 153 | #define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */ |
154 | 154 | ||
155 | /* #ifdef IP_MTU_DISCOVER */ | 155 | /* #ifdef IP_MTU_DISCOVER */ |
156 | #define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ | 156 | #define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ |
157 | /* #endif */ | 157 | /* #endif */ |
@@ -282,9 +282,10 @@ void BIO_clear_flags(BIO *b, int flags); | |||
282 | #define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) | 282 | #define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) |
283 | #define BIO_cb_post(a) ((a)&BIO_CB_RETURN) | 283 | #define BIO_cb_post(a) ((a)&BIO_CB_RETURN) |
284 | 284 | ||
285 | long (*BIO_get_callback(const BIO *b)) (struct bio_st *,int,const char *,int, long,long); | 285 | long (*BIO_get_callback(const BIO *b))(struct bio_st *, int, const char *, |
286 | void BIO_set_callback(BIO *b, | 286 | int, long, long); |
287 | long (*callback)(struct bio_st *,int,const char *,int, long,long)); | 287 | void BIO_set_callback(BIO *b, |
288 | long (*callback)(struct bio_st *, int, const char *, int, long, long)); | ||
288 | char *BIO_get_callback_arg(const BIO *b); | 289 | char *BIO_get_callback_arg(const BIO *b); |
289 | void BIO_set_callback_arg(BIO *b, char *arg); | 290 | void BIO_set_callback_arg(BIO *b, char *arg); |
290 | 291 | ||
@@ -293,8 +294,7 @@ int BIO_method_type(const BIO *b); | |||
293 | 294 | ||
294 | typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); | 295 | typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); |
295 | 296 | ||
296 | typedef struct bio_method_st | 297 | typedef struct bio_method_st { |
297 | { | ||
298 | int type; | 298 | int type; |
299 | const char *name; | 299 | const char *name; |
300 | int (*bwrite)(BIO *, const char *, int); | 300 | int (*bwrite)(BIO *, const char *, int); |
@@ -304,14 +304,13 @@ typedef struct bio_method_st | |||
304 | long (*ctrl)(BIO *, int, long, void *); | 304 | long (*ctrl)(BIO *, int, long, void *); |
305 | int (*create)(BIO *); | 305 | int (*create)(BIO *); |
306 | int (*destroy)(BIO *); | 306 | int (*destroy)(BIO *); |
307 | long (*callback_ctrl)(BIO *, int, bio_info_cb *); | 307 | long (*callback_ctrl)(BIO *, int, bio_info_cb *); |
308 | } BIO_METHOD; | 308 | } BIO_METHOD; |
309 | 309 | ||
310 | struct bio_st | 310 | struct bio_st { |
311 | { | ||
312 | BIO_METHOD *method; | 311 | BIO_METHOD *method; |
313 | /* bio, mode, argp, argi, argl, ret */ | 312 | /* bio, mode, argp, argi, argl, ret */ |
314 | long (*callback)(struct bio_st *,int,const char *,int, long,long); | 313 | long (*callback)(struct bio_st *, int, const char *, int, long, long); |
315 | char *cb_arg; /* first argument for the callback */ | 314 | char *cb_arg; /* first argument for the callback */ |
316 | 315 | ||
317 | int init; | 316 | int init; |
@@ -327,12 +326,11 @@ struct bio_st | |||
327 | unsigned long num_write; | 326 | unsigned long num_write; |
328 | 327 | ||
329 | CRYPTO_EX_DATA ex_data; | 328 | CRYPTO_EX_DATA ex_data; |
330 | }; | 329 | }; |
331 | 330 | ||
332 | DECLARE_STACK_OF(BIO) | 331 | DECLARE_STACK_OF(BIO) |
333 | 332 | ||
334 | typedef struct bio_f_buffer_ctx_struct | 333 | typedef struct bio_f_buffer_ctx_struct { |
335 | { | ||
336 | /* Buffers are setup like this: | 334 | /* Buffers are setup like this: |
337 | * | 335 | * |
338 | * <---------------------- size -----------------------> | 336 | * <---------------------- size -----------------------> |
@@ -346,30 +344,28 @@ typedef struct bio_f_buffer_ctx_struct | |||
346 | int ibuf_size; /* how big is the input buffer */ | 344 | int ibuf_size; /* how big is the input buffer */ |
347 | int obuf_size; /* how big is the output buffer */ | 345 | int obuf_size; /* how big is the output buffer */ |
348 | 346 | ||
349 | char *ibuf; /* the char array */ | 347 | char *ibuf; /* the char array */ |
350 | int ibuf_len; /* how many bytes are in it */ | 348 | int ibuf_len; /* how many bytes are in it */ |
351 | int ibuf_off; /* write/read offset */ | 349 | int ibuf_off; /* write/read offset */ |
352 | 350 | ||
353 | char *obuf; /* the char array */ | 351 | char *obuf; /* the char array */ |
354 | int obuf_len; /* how many bytes are in it */ | 352 | int obuf_len; /* how many bytes are in it */ |
355 | int obuf_off; /* write/read offset */ | 353 | int obuf_off; /* write/read offset */ |
356 | } BIO_F_BUFFER_CTX; | 354 | } BIO_F_BUFFER_CTX; |
357 | 355 | ||
358 | /* Prefix and suffix callback in ASN1 BIO */ | 356 | /* Prefix and suffix callback in ASN1 BIO */ |
359 | typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); | 357 | typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); |
360 | 358 | ||
361 | #ifndef OPENSSL_NO_SCTP | 359 | #ifndef OPENSSL_NO_SCTP |
362 | /* SCTP parameter structs */ | 360 | /* SCTP parameter structs */ |
363 | struct bio_dgram_sctp_sndinfo | 361 | struct bio_dgram_sctp_sndinfo { |
364 | { | ||
365 | uint16_t snd_sid; | 362 | uint16_t snd_sid; |
366 | uint16_t snd_flags; | 363 | uint16_t snd_flags; |
367 | uint32_t snd_ppid; | 364 | uint32_t snd_ppid; |
368 | uint32_t snd_context; | 365 | uint32_t snd_context; |
369 | }; | 366 | }; |
370 | 367 | ||
371 | struct bio_dgram_sctp_rcvinfo | 368 | struct bio_dgram_sctp_rcvinfo { |
372 | { | ||
373 | uint16_t rcv_sid; | 369 | uint16_t rcv_sid; |
374 | uint16_t rcv_ssn; | 370 | uint16_t rcv_ssn; |
375 | uint16_t rcv_flags; | 371 | uint16_t rcv_flags; |
@@ -377,13 +373,12 @@ struct bio_dgram_sctp_rcvinfo | |||
377 | uint32_t rcv_tsn; | 373 | uint32_t rcv_tsn; |
378 | uint32_t rcv_cumtsn; | 374 | uint32_t rcv_cumtsn; |
379 | uint32_t rcv_context; | 375 | uint32_t rcv_context; |
380 | }; | 376 | }; |
381 | 377 | ||
382 | struct bio_dgram_sctp_prinfo | 378 | struct bio_dgram_sctp_prinfo { |
383 | { | ||
384 | uint16_t pr_policy; | 379 | uint16_t pr_policy; |
385 | uint32_t pr_value; | 380 | uint32_t pr_value; |
386 | }; | 381 | }; |
387 | #endif | 382 | #endif |
388 | 383 | ||
389 | /* connect BIO stuff */ | 384 | /* connect BIO stuff */ |
@@ -519,7 +514,7 @@ struct bio_dgram_sctp_prinfo | |||
519 | /* If you are wondering why this isn't defined, its because CONST_STRICT is | 514 | /* If you are wondering why this isn't defined, its because CONST_STRICT is |
520 | * purely a compile-time kludge to allow const to be checked. | 515 | * purely a compile-time kludge to allow const to be checked. |
521 | */ | 516 | */ |
522 | int BIO_read_filename(BIO *b,const char *name); | 517 | int BIO_read_filename(BIO *b, const char *name); |
523 | #else | 518 | #else |
524 | #define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ | 519 | #define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ |
525 | BIO_CLOSE|BIO_FP_READ,(char *)name) | 520 | BIO_CLOSE|BIO_FP_READ,(char *)name) |
@@ -611,22 +606,27 @@ int BIO_ctrl_reset_read_request(BIO *b); | |||
611 | /* These two aren't currently implemented */ | 606 | /* These two aren't currently implemented */ |
612 | /* int BIO_get_ex_num(BIO *bio); */ | 607 | /* int BIO_get_ex_num(BIO *bio); */ |
613 | /* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ | 608 | /* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ |
614 | int BIO_set_ex_data(BIO *bio,int idx,void *data); | 609 | int BIO_set_ex_data(BIO *bio, int idx, void *data); |
615 | void *BIO_get_ex_data(BIO *bio,int idx); | 610 | void *BIO_get_ex_data(BIO *bio, int idx); |
616 | int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 611 | int |
617 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 612 | BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
613 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | ||
618 | unsigned long BIO_number_read(BIO *bio); | 614 | unsigned long BIO_number_read(BIO *bio); |
619 | unsigned long BIO_number_written(BIO *bio); | 615 | unsigned long BIO_number_written(BIO *bio); |
620 | 616 | ||
621 | /* For BIO_f_asn1() */ | 617 | /* For BIO_f_asn1() */ |
622 | int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, | 618 | int |
623 | asn1_ps_func *prefix_free); | 619 | BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, |
624 | int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, | 620 | asn1_ps_func *prefix_free); |
625 | asn1_ps_func **pprefix_free); | 621 | int |
626 | int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, | 622 | BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, |
627 | asn1_ps_func *suffix_free); | 623 | asn1_ps_func **pprefix_free); |
628 | int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, | 624 | int |
629 | asn1_ps_func **psuffix_free); | 625 | BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, |
626 | asn1_ps_func *suffix_free); | ||
627 | int | ||
628 | BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, | ||
629 | asn1_ps_func **psuffix_free); | ||
630 | 630 | ||
631 | # ifndef OPENSSL_NO_FP_API | 631 | # ifndef OPENSSL_NO_FP_API |
632 | BIO_METHOD *BIO_s_file(void ); | 632 | BIO_METHOD *BIO_s_file(void ); |
@@ -635,22 +635,23 @@ BIO *BIO_new_fp(FILE *stream, int close_flag); | |||
635 | # define BIO_s_file_internal BIO_s_file | 635 | # define BIO_s_file_internal BIO_s_file |
636 | # endif | 636 | # endif |
637 | BIO * BIO_new(BIO_METHOD *type); | 637 | BIO * BIO_new(BIO_METHOD *type); |
638 | int BIO_set(BIO *a,BIO_METHOD *type); | 638 | int BIO_set(BIO *a, BIO_METHOD *type); |
639 | int BIO_free(BIO *a); | 639 | int BIO_free(BIO *a); |
640 | void BIO_vfree(BIO *a); | 640 | void BIO_vfree(BIO *a); |
641 | int BIO_read(BIO *b, void *data, int len); | 641 | int BIO_read(BIO *b, void *data, int len); |
642 | int BIO_gets(BIO *bp,char *buf, int size); | 642 | int BIO_gets(BIO *bp, char *buf, int size); |
643 | int BIO_write(BIO *b, const void *data, int len); | 643 | int BIO_write(BIO *b, const void *data, int len); |
644 | int BIO_puts(BIO *bp,const char *buf); | 644 | int BIO_puts(BIO *bp, const char *buf); |
645 | int BIO_indent(BIO *b,int indent,int max); | 645 | int BIO_indent(BIO *b, int indent, int max); |
646 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); | 646 | long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); |
647 | long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)); | 647 | long BIO_callback_ctrl(BIO *b, int cmd, |
648 | char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); | 648 | void (*fp)(struct bio_st *, int, const char *, int, long, long)); |
649 | long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); | 649 | char * BIO_ptr_ctrl(BIO *bp, int cmd, long larg); |
650 | BIO * BIO_push(BIO *b,BIO *append); | 650 | long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); |
651 | BIO * BIO_push(BIO *b, BIO *append); | ||
651 | BIO * BIO_pop(BIO *b); | 652 | BIO * BIO_pop(BIO *b); |
652 | void BIO_free_all(BIO *a); | 653 | void BIO_free_all(BIO *a); |
653 | BIO * BIO_find_type(BIO *b,int bio_type); | 654 | BIO * BIO_find_type(BIO *b, int bio_type); |
654 | BIO * BIO_next(BIO *b); | 655 | BIO * BIO_next(BIO *b); |
655 | BIO * BIO_get_retry_BIO(BIO *bio, int *reason); | 656 | BIO * BIO_get_retry_BIO(BIO *bio, int *reason); |
656 | int BIO_get_retry_reason(BIO *bio); | 657 | int BIO_get_retry_reason(BIO *bio); |
@@ -661,8 +662,8 @@ int BIO_nread(BIO *bio, char **buf, int num); | |||
661 | int BIO_nwrite0(BIO *bio, char **buf); | 662 | int BIO_nwrite0(BIO *bio, char **buf); |
662 | int BIO_nwrite(BIO *bio, char **buf, int num); | 663 | int BIO_nwrite(BIO *bio, char **buf, int num); |
663 | 664 | ||
664 | long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, | 665 | long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, |
665 | long argl,long ret); | 666 | long argl, long ret); |
666 | 667 | ||
667 | BIO_METHOD *BIO_s_mem(void); | 668 | BIO_METHOD *BIO_s_mem(void); |
668 | BIO *BIO_new_mem_buf(void *buf, int len); | 669 | BIO *BIO_new_mem_buf(void *buf, int len); |
@@ -696,12 +697,14 @@ int BIO_dgram_non_fatal_error(int error); | |||
696 | 697 | ||
697 | int BIO_fd_should_retry(int i); | 698 | int BIO_fd_should_retry(int i); |
698 | int BIO_fd_non_fatal_error(int error); | 699 | int BIO_fd_non_fatal_error(int error); |
699 | int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), | 700 | int |
700 | void *u, const char *s, int len); | 701 | BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), |
701 | int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), | 702 | void *u, const char *s, int len); |
702 | void *u, const char *s, int len, int indent); | 703 | int |
703 | int BIO_dump(BIO *b,const char *bytes,int len); | 704 | BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), |
704 | int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent); | 705 | void *u, const char *s, int len, int indent); |
706 | int BIO_dump(BIO *b, const char *bytes, int len); | ||
707 | int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent); | ||
705 | #ifndef OPENSSL_NO_FP_API | 708 | #ifndef OPENSSL_NO_FP_API |
706 | int BIO_dump_fp(FILE *fp, const char *s, int len); | 709 | int BIO_dump_fp(FILE *fp, const char *s, int len); |
707 | int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); | 710 | int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); |
@@ -717,23 +720,24 @@ struct hostent *BIO_gethostbyname(const char *name); | |||
717 | */ | 720 | */ |
718 | int BIO_sock_error(int sock); | 721 | int BIO_sock_error(int sock); |
719 | int BIO_socket_ioctl(int fd, long type, void *arg); | 722 | int BIO_socket_ioctl(int fd, long type, void *arg); |
720 | int BIO_socket_nbio(int fd,int mode); | 723 | int BIO_socket_nbio(int fd, int mode); |
721 | int BIO_get_port(const char *str, unsigned short *port_ptr); | 724 | int BIO_get_port(const char *str, unsigned short *port_ptr); |
722 | int BIO_get_host_ip(const char *str, unsigned char *ip); | 725 | int BIO_get_host_ip(const char *str, unsigned char *ip); |
723 | int BIO_get_accept_socket(char *host_port,int mode); | 726 | int BIO_get_accept_socket(char *host_port, int mode); |
724 | int BIO_accept(int sock,char **ip_port); | 727 | int BIO_accept(int sock, char **ip_port); |
725 | int BIO_sock_init(void ); | 728 | int BIO_sock_init(void ); |
726 | void BIO_sock_cleanup(void); | 729 | void BIO_sock_cleanup(void); |
727 | int BIO_set_tcp_ndelay(int sock,int turn_on); | 730 | int BIO_set_tcp_ndelay(int sock, int turn_on); |
728 | 731 | ||
729 | BIO *BIO_new_socket(int sock, int close_flag); | 732 | BIO *BIO_new_socket(int sock, int close_flag); |
730 | BIO *BIO_new_dgram(int fd, int close_flag); | 733 | BIO *BIO_new_dgram(int fd, int close_flag); |
731 | #ifndef OPENSSL_NO_SCTP | 734 | #ifndef OPENSSL_NO_SCTP |
732 | BIO *BIO_new_dgram_sctp(int fd, int close_flag); | 735 | BIO *BIO_new_dgram_sctp(int fd, int close_flag); |
733 | int BIO_dgram_is_sctp(BIO *bio); | 736 | int BIO_dgram_is_sctp(BIO *bio); |
734 | int BIO_dgram_sctp_notification_cb(BIO *b, | 737 | int |
735 | void (*handle_notifications)(BIO *bio, void *context, void *buf), | 738 | BIO_dgram_sctp_notification_cb(BIO *b, |
736 | void *context); | 739 | void (*handle_notifications)(BIO *bio, void *context, void *buf), |
740 | void *context); | ||
737 | int BIO_dgram_sctp_wait_for_dry(BIO *b); | 741 | int BIO_dgram_sctp_wait_for_dry(BIO *b); |
738 | int BIO_dgram_sctp_msg_waiting(BIO *b); | 742 | int BIO_dgram_sctp_msg_waiting(BIO *b); |
739 | #endif | 743 | #endif |
@@ -741,8 +745,9 @@ BIO *BIO_new_fd(int fd, int close_flag); | |||
741 | BIO *BIO_new_connect(char *host_port); | 745 | BIO *BIO_new_connect(char *host_port); |
742 | BIO *BIO_new_accept(char *host_port); | 746 | BIO *BIO_new_accept(char *host_port); |
743 | 747 | ||
744 | int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, | 748 | int |
745 | BIO **bio2, size_t writebuf2); | 749 | BIO_new_bio_pair(BIO **bio1, size_t writebuf1, |
750 | BIO **bio2, size_t writebuf2); | ||
746 | /* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. | 751 | /* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. |
747 | * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. | 752 | * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. |
748 | * Size 0 uses default value. | 753 | * Size 0 uses default value. |
@@ -757,14 +762,18 @@ void BIO_copy_next_retry(BIO *b); | |||
757 | #else | 762 | #else |
758 | # define __bio_h__attr__(x) | 763 | # define __bio_h__attr__(x) |
759 | #endif | 764 | #endif |
760 | int BIO_printf(BIO *bio, const char *format, ...) | 765 | int |
761 | __bio_h__attr__((__format__(__printf__,2,3))); | 766 | BIO_printf(BIO *bio, const char *format, ...) |
762 | int BIO_vprintf(BIO *bio, const char *format, va_list args) | 767 | __bio_h__attr__((__format__(__printf__, 2, 3))); |
763 | __bio_h__attr__((__format__(__printf__,2,0))); | 768 | int |
764 | int BIO_snprintf(char *buf, size_t n, const char *format, ...) | 769 | BIO_vprintf(BIO *bio, const char *format, va_list args) |
765 | __bio_h__attr__((__format__(__printf__,3,4))); | 770 | __bio_h__attr__((__format__(__printf__, 2, 0))); |
766 | int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) | 771 | int |
767 | __bio_h__attr__((__format__(__printf__,3,0))); | 772 | BIO_snprintf(char *buf, size_t n, const char *format, ...) |
773 | __bio_h__attr__((__format__(__printf__, 3, 4))); | ||
774 | int | ||
775 | BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) | ||
776 | __bio_h__attr__((__format__(__printf__, 3, 0))); | ||
768 | #undef __bio_h__attr__ | 777 | #undef __bio_h__attr__ |
769 | 778 | ||
770 | /* BEGIN ERROR CODES */ | 779 | /* BEGIN ERROR CODES */ |