Merge pull request #10579 from akallabeth/transport_cb_doc

[core,transport] follow up to #10576
This commit is contained in:
Martin Fleisz 2024-09-09 14:15:15 +02:00 committed by GitHub
commit 86bfade4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -326,7 +326,19 @@ static BOOL transport_default_connect_tls(rdpTransport* transport)
}
transport->frontBio = tls->bio;
BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, (BIO_info_cb*)transport_ssl_cb);
/* See libfreerdp/crypto/tls.c transport_default_connect_tls
*
* we are wrapping a SSL object in the BIO and actually want to set
*
* SSL_set_info_callback there. So ensure our callback is of appropriate
* type for that instead of what the function prototype suggests.
*/
typedef void (*ssl_cb_t)(const SSL* ssl, int type, int val);
ssl_cb_t fkt = transport_ssl_cb;
BIO_info_cb* bfkt = WINPR_FUNC_PTR_CAST(fkt, BIO_info_cb*);
BIO_callback_ctrl(tls->bio, BIO_CTRL_SET_CALLBACK, bfkt);
SSL_set_app_data(tls->ssl, transport);
if (!transport->frontBio)