From e21afefb8626fb9a38b59d03097ebbc60be49191 Mon Sep 17 00:00:00 2001 From: amazingfate Date: Fri, 23 Feb 2024 19:24:25 +0800 Subject: [PATCH] fix build with openssl < 1.1.1 --- libfreerdp/crypto/privatekey.c | 6 ++++++ libfreerdp/crypto/tls.c | 2 +- libfreerdp/emu/scard/smartcard_virtual_gids.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libfreerdp/crypto/privatekey.c b/libfreerdp/crypto/privatekey.c index 159157cf7..55379d4d6 100644 --- a/libfreerdp/crypto/privatekey.c +++ b/libfreerdp/crypto/privatekey.c @@ -482,13 +482,19 @@ char* freerdp_key_get_param(const rdpPrivateKey* key, enum FREERDP_KEY_PARAM par switch (param) { case FREERDP_KEY_PARAM_RSA_D: +#if OPENSSL_VERSION_NUMBER >= 0x10101007L cbn = RSA_get0_d(rsa); +#endif break; case FREERDP_KEY_PARAM_RSA_E: +#if OPENSSL_VERSION_NUMBER >= 0x10101007L cbn = RSA_get0_e(rsa); +#endif break; case FREERDP_KEY_PARAM_RSA_N: +#if OPENSSL_VERSION_NUMBER >= 0x10101007L cbn = RSA_get0_n(rsa); +#endif break; default: return NULL; diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 371b81b8d..24c84c908 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1107,7 +1107,7 @@ TlsHandshakeResult freerdp_tls_accept_ex(rdpTls* tls, BIO* underlying, rdpSettin * Disable SSL client site renegotiation. */ -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && (OPENSSL_VERSION_NUMBER < 0x30000000L) && \ +#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && (OPENSSL_VERSION_NUMBER < 0x30000000L) && \ !defined(LIBRESSL_VERSION_NUMBER) options |= SSL_OP_NO_RENEGOTIATION; #endif diff --git a/libfreerdp/emu/scard/smartcard_virtual_gids.c b/libfreerdp/emu/scard/smartcard_virtual_gids.c index 3d4dda375..a916113d8 100644 --- a/libfreerdp/emu/scard/smartcard_virtual_gids.c +++ b/libfreerdp/emu/scard/smartcard_virtual_gids.c @@ -1047,8 +1047,10 @@ static BOOL vgids_perform_digital_signature(vgidsContext* context) { g_PKCS1_SHA256, sizeof(g_PKCS1_SHA256), EVP_sha256() }, { g_PKCS1_SHA384, sizeof(g_PKCS1_SHA384), EVP_sha384() }, { g_PKCS1_SHA512, sizeof(g_PKCS1_SHA512), EVP_sha512() }, +#if OPENSSL_VERSION_NUMBER >= 0x10101000L { g_PKCS1_SHA512_224, sizeof(g_PKCS1_SHA512_224), EVP_sha512_224() }, { g_PKCS1_SHA512_256, sizeof(g_PKCS1_SHA512_256), EVP_sha512_256() } +#endif }; if (!pk)