crypto: export getSslMethod utility function

This commit is contained in:
David Fort
2022-12-22 18:12:29 +01:00
committed by Martin Fleisz
parent e2b5f41b2c
commit 07d9baad6d
2 changed files with 6 additions and 3 deletions

View File

@@ -99,6 +99,8 @@ extern "C"
{
#endif
FREERDP_API const SSL_METHOD* tls_get_ssl_method(BOOL isDtls, BOOL isClient);
FREERDP_API int tls_connect(rdpTls* tls, BIO* underlying);
FREERDP_API TlsHandshakeResult tls_connect_ex(rdpTls* tls, BIO* underlying,

View File

@@ -775,7 +775,7 @@ static void adjustSslOptions(int* options)
#endif
}
const SSL_METHOD* getSslMethod(BOOL isDtls, BOOL isClient)
const SSL_METHOD* tls_get_ssl_method(BOOL isDtls, BOOL isClient)
{
if (isClient)
{
@@ -946,7 +946,7 @@ static int pollAndHandshake(rdpTls* tls)
int tls_connect(rdpTls* tls, BIO* underlying)
{
const SSL_METHOD* method = getSslMethod(FALSE, TRUE);
const SSL_METHOD* method = tls_get_ssl_method(FALSE, TRUE);
WINPR_ASSERT(tls);
TlsHandshakeResult result = tls_connect_ex(tls, underlying, method);
@@ -980,7 +980,8 @@ static void tls_openssl_tlsext_debug_callback(SSL* s, int client_server, int typ
BOOL tls_accept(rdpTls* tls, BIO* underlying, rdpSettings* settings)
{
WINPR_ASSERT(tls);
TlsHandshakeResult res = tls_accept_ex(tls, underlying, settings, getSslMethod(FALSE, FALSE));
TlsHandshakeResult res =
tls_accept_ex(tls, underlying, settings, tls_get_ssl_method(FALSE, FALSE));
switch (res)
{
case TLS_HANDSHAKE_SUCCESS: