diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bss_conn.c')
-rw-r--r-- | src/lib/libcrypto/bio/bss_conn.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c index 8ed8d2076d..8e30bccd51 100644 --- a/src/lib/libcrypto/bio/bss_conn.c +++ b/src/lib/libcrypto/bio/bss_conn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bss_conn.c,v 1.36 2022/01/07 09:02:17 tb Exp $ */ | 1 | /* $OpenBSD: bss_conn.c,v 1.37 2022/01/14 08:40:57 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -92,7 +92,7 @@ typedef struct bio_connect_st { | |||
92 | /* called when the connection is initially made | 92 | /* called when the connection is initially made |
93 | * callback(BIO,state,ret); The callback should return | 93 | * callback(BIO,state,ret); The callback should return |
94 | * 'ret'. state is for compatibility with the ssl info_callback */ | 94 | * 'ret'. state is for compatibility with the ssl info_callback */ |
95 | int (*info_callback)(const BIO *bio, int state, int ret); | 95 | BIO_info_cb *info_callback; |
96 | } BIO_CONNECT; | 96 | } BIO_CONNECT; |
97 | 97 | ||
98 | static int conn_write(BIO *h, const char *buf, int num); | 98 | static int conn_write(BIO *h, const char *buf, int num); |
@@ -101,7 +101,7 @@ static int conn_puts(BIO *h, const char *str); | |||
101 | static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2); | 101 | static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2); |
102 | static int conn_new(BIO *h); | 102 | static int conn_new(BIO *h); |
103 | static int conn_free(BIO *data); | 103 | static int conn_free(BIO *data); |
104 | static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *); | 104 | static long conn_callback_ctrl(BIO *h, int cmd, BIO_info_cb *); |
105 | 105 | ||
106 | static int conn_state(BIO *b, BIO_CONNECT *c); | 106 | static int conn_state(BIO *b, BIO_CONNECT *c); |
107 | static void conn_close_socket(BIO *data); | 107 | static void conn_close_socket(BIO *data); |
@@ -126,7 +126,7 @@ conn_state(BIO *b, BIO_CONNECT *c) | |||
126 | int ret = -1, i; | 126 | int ret = -1, i; |
127 | unsigned long l; | 127 | unsigned long l; |
128 | char *p, *q; | 128 | char *p, *q; |
129 | int (*cb)(const BIO *, int, int) = NULL; | 129 | BIO_info_cb *cb = NULL; |
130 | 130 | ||
131 | if (c->info_callback != NULL) | 131 | if (c->info_callback != NULL) |
132 | cb = c->info_callback; | 132 | cb = c->info_callback; |
@@ -523,9 +523,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
523 | BIO_set_conn_hostname(dbio, | 523 | BIO_set_conn_hostname(dbio, |
524 | data->param_hostname); | 524 | data->param_hostname); |
525 | BIO_set_nbio(dbio, data->nbio); | 525 | BIO_set_nbio(dbio, data->nbio); |
526 | /* FIXME: the cast of the function seems unlikely to be a good idea */ | 526 | (void)BIO_set_info_callback(dbio, data->info_callback); |
527 | (void)BIO_set_info_callback(dbio, | ||
528 | (bio_info_cb *)data->info_callback); | ||
529 | } | 527 | } |
530 | break; | 528 | break; |
531 | case BIO_CTRL_SET_CALLBACK: | 529 | case BIO_CTRL_SET_CALLBACK: |
@@ -540,9 +538,8 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
540 | break; | 538 | break; |
541 | case BIO_CTRL_GET_CALLBACK: | 539 | case BIO_CTRL_GET_CALLBACK: |
542 | { | 540 | { |
543 | int (**fptr)(const BIO *bio, int state, int xret); | 541 | BIO_info_cb **fptr = ptr; |
544 | 542 | ||
545 | fptr = (int (**)(const BIO *bio, int state, int xret))ptr; | ||
546 | *fptr = data->info_callback; | 543 | *fptr = data->info_callback; |
547 | } | 544 | } |
548 | break; | 545 | break; |
@@ -554,7 +551,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
554 | } | 551 | } |
555 | 552 | ||
556 | static long | 553 | static long |
557 | conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) | 554 | conn_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) |
558 | { | 555 | { |
559 | long ret = 1; | 556 | long ret = 1; |
560 | BIO_CONNECT *data; | 557 | BIO_CONNECT *data; |
@@ -563,9 +560,7 @@ conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) | |||
563 | 560 | ||
564 | switch (cmd) { | 561 | switch (cmd) { |
565 | case BIO_CTRL_SET_CALLBACK: | 562 | case BIO_CTRL_SET_CALLBACK: |
566 | { | 563 | data->info_callback = (BIO_info_cb *)fp; |
567 | data->info_callback = (int (*)(const struct bio_st *, int, int))fp; | ||
568 | } | ||
569 | break; | 564 | break; |
570 | default: | 565 | default: |
571 | ret = 0; | 566 | ret = 0; |