From 929e4bdf8dd157fb6faed4208cafcfa3f504fbdb Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Mon, 9 Sep 2024 17:42:14 +0800 Subject: [PATCH] [core,transport] fix ssl info callback function signature and some warnings. --- libfreerdp/core/transport.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 66be26fca..a6f0fc782 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -97,10 +97,8 @@ struct rdp_transport BOOL earlyUserAuth; }; -static int transport_ssl_cb(BIO* bio, int where, int ret) +static void transport_ssl_cb(const SSL* ssl, int where, int ret) { - SSL* ssl = (SSL*)bio; - if (where & SSL_CB_ALERT) { rdpTransport* transport = (rdpTransport*)SSL_get_app_data(ssl); @@ -147,7 +145,6 @@ static int transport_ssl_cb(BIO* bio, int where, int ret) } } } - return 0; } wStream* transport_send_stream_init(rdpTransport* transport, size_t size) @@ -329,7 +326,7 @@ static BOOL transport_default_connect_tls(rdpTransport* transport) } transport->frontBio = tls->bio; - BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, transport_ssl_cb); + BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, (BIO_info_cb*)transport_ssl_cb); SSL_set_app_data(tls->ssl, transport); if (!transport->frontBio) @@ -1488,8 +1485,9 @@ rdpTransportLayer* transport_connect_layer(rdpTransport* transport, const char* return IFCALLRESULT(NULL, transport->io.ConnectLayer, transport, hostname, port, timeout); } -rdpTransportLayer* transport_default_connect_layer(rdpTransport* transport, const char* hostname, - int port, DWORD timeout) +static rdpTransportLayer* transport_default_connect_layer(rdpTransport* transport, + const char* hostname, int port, + DWORD timeout) { rdpContext* context = transport_get_context(transport); WINPR_ASSERT(context); @@ -1505,7 +1503,7 @@ BOOL transport_attach_layer(rdpTransport* transport, rdpTransportLayer* layer) return IFCALLRESULT(FALSE, transport->io.AttachLayer, transport, layer); } -BOOL transport_default_attach_layer(rdpTransport* transport, rdpTransportLayer* layer) +static BOOL transport_default_attach_layer(rdpTransport* transport, rdpTransportLayer* layer) { BIO* layerBio = BIO_new(BIO_s_transport_layer()); if (!layerBio)