diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-10-08 23:21:22 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-12-16 10:20:12 +0100 |
commit | 5200dbb73c7cf63481c563025ad4d67b71e306d2 (patch) | |
tree | 4b1469579623461784fc86596becd59ed7d07690 /ssl | |
parent | 48ad955fc5f0e19acbc8acaa100af6526bc6b158 (diff) |
Fix invalid function type casts.
Rename bio_info_cb to BIO_info_cb.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4943)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/bio_ssl.c | 22 | ||||
-rw-r--r-- | ssl/s3_lib.c | 18 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 84 |
3 files changed, 88 insertions, 36 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 7388db1797..352c8a1321 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -22,7 +22,7 @@ static int ssl_puts(BIO *h, const char *str); static long ssl_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int ssl_new(BIO *h); static int ssl_free(BIO *data); -static long ssl_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); +static long ssl_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp); typedef struct bio_ssl_st { SSL *ssl; /* The ssl handle :-) */ /* re-negotiate every time the total number of bytes is this size */ @@ -394,14 +394,6 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) #endif } break; - case BIO_CTRL_GET_CALLBACK: - { - void (**fptr) (const SSL *xssl, int type, int val); - - fptr = (void (**)(const SSL *xssl, int type, int val))ptr; - *fptr = SSL_get_info_callback(ssl); - } - break; default: ret = BIO_ctrl(ssl->rbio, cmd, num, ptr); break; @@ -409,7 +401,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) return (ret); } -static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) +static long ssl_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) { SSL *ssl; BIO_SSL *bs; @@ -419,16 +411,10 @@ static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) ssl = bs->ssl; switch (cmd) { case BIO_CTRL_SET_CALLBACK: - { - /* - * FIXME: setting this via a completely different prototype seems - * like a crap idea - */ - SSL_set_info_callback(ssl, (void (*)(const SSL *, int, int))fp); - } + ret = BIO_callback_ctrl(ssl->rbio, cmd, fp); break; default: - ret = BIO_callback_ctrl(ssl->rbio, cmd, fp); + ret = 0; break; } return (ret); diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 9ec50d09c5..ad7532bd0c 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2736,6 +2736,20 @@ void ssl_sort_cipher_list(void) cipher_compare); } +static int ssl_undefined_function_1(SSL *ssl, unsigned char *r, size_t s, + const char * t, size_t u, + const unsigned char * v, size_t w, int x) +{ + (void)r; + (void)s; + (void)t; + (void)u; + (void)v; + (void)w; + (void)x; + return ssl_undefined_function(ssl); +} + const SSL3_ENC_METHOD SSLv3_enc_data = { ssl3_enc, n_ssl3_mac, @@ -2747,9 +2761,7 @@ const SSL3_ENC_METHOD SSLv3_enc_data = { SSL3_MD_CLIENT_FINISHED_CONST, 4, SSL3_MD_SERVER_FINISHED_CONST, 4, ssl3_alert_code, - (int (*)(SSL *, unsigned char *, size_t, const char *, - size_t, const unsigned char *, size_t, - int use_context))ssl_undefined_function, + ssl_undefined_function_1, 0, SSL3_HM_HEADER_LENGTH, ssl3_set_handshake_header, diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index d259ff4294..8dddee1bc8 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -54,28 +54,82 @@ const char SSL_version_str[] = OPENSSL_VERSION_TEXT; +static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, unsigned int s, + int t) +{ + (void)r; + (void)s; + (void)t; + return ssl_undefined_function(ssl); +} + +static int ssl_undefined_function_2(SSL *ssl, SSL3_RECORD *r, unsigned char *s, + int t) +{ + (void)r; + (void)s; + (void)t; + return ssl_undefined_function(ssl); +} + +static int ssl_undefined_function_3(SSL *ssl, unsigned char *r, + unsigned char *s, int t) +{ + (void)r; + (void)s; + (void)t; + return ssl_undefined_function(ssl); +} + +static int ssl_undefined_function_4(SSL *ssl, int r) +{ + (void)r; + return ssl_undefined_function(ssl); +} + +static int ssl_undefined_function_5(SSL *ssl, const char *r, int s, + unsigned char *t) +{ + (void)r; + (void)s; + (void)t; + return ssl_undefined_function(ssl); +} + +static int ssl_undefined_function_6(int r) +{ + (void)r; + return ssl_undefined_function(NULL); +} + +static int ssl_undefined_function_7(SSL *ssl, unsigned char *r, size_t s, + const char *t, size_t u, + const unsigned char *v, size_t w, int x) +{ + (void)r; + (void)s; + (void)t; + (void)u; + (void)v; + (void)w; + (void)x; + return ssl_undefined_function(ssl); +} + SSL3_ENC_METHOD ssl3_undef_enc_method = { - /* - * evil casts, but these functions are only called if there's a library - * bug - */ - (int (*)(SSL *, SSL3_RECORD *, unsigned int, int))ssl_undefined_function, - (int (*)(SSL *, SSL3_RECORD *, unsigned char *, int))ssl_undefined_function, + ssl_undefined_function_1, + ssl_undefined_function_2, ssl_undefined_function, - (int (*)(SSL *, unsigned char *, unsigned char *, int)) - ssl_undefined_function, - (int (*)(SSL *, int))ssl_undefined_function, - (int (*)(SSL *, const char *, int, unsigned char *)) - ssl_undefined_function, + ssl_undefined_function_3, + ssl_undefined_function_4, + ssl_undefined_function_5, 0, /* finish_mac_length */ NULL, /* client_finished_label */ 0, /* client_finished_label_len */ NULL, /* server_finished_label */ 0, /* server_finished_label_len */ - (int (*)(int))ssl_undefined_function, - (int (*)(SSL *, unsigned char *, size_t, const char *, - size_t, const unsigned char *, size_t, - int use_context))ssl_undefined_function, + ssl_undefined_function_6, + ssl_undefined_function_7, }; struct ssl_async_args { |