[compat,libressl] fix compilation issues

This commit is contained in:
Armin Novak
2023-12-18 14:47:08 +01:00
committed by akallabeth
parent 2f6cf5809c
commit 198774c035
4 changed files with 17 additions and 5 deletions

View File

@@ -180,7 +180,13 @@ X509* x509_from_rsa(const RSA* rsa)
{
EVP_PKEY* pubkey = NULL;
X509* x509 = NULL;
BIO* bio = BIO_new(BIO_s_secmem());
BIO* bio = BIO_new(
#if defined(LIBRESSL_VERSION_NUMBER)
BIO_s_mem()
#else
BIO_s_secmem()
#endif
);
if (!bio)
return NULL;

View File

@@ -99,7 +99,13 @@ static RSA* evp_pkey_to_rsa(const rdpPrivateKey* key)
}
RSA* rsa = NULL;
BIO* bio = BIO_new(BIO_s_secmem());
BIO* bio = BIO_new(
#if defined(LIBRESSL_VERSION_NUMBER)
BIO_s_mem()
#else
BIO_s_secmem()
#endif
);
if (!bio)
return NULL;
const int rc = PEM_write_bio_PrivateKey(bio, key->evp, NULL, NULL, 0, NULL, NULL);

View File

@@ -1107,8 +1107,8 @@ TlsHandshakeResult freerdp_tls_accept_ex(rdpTls* tls, BIO* underlying, rdpSettin
* Disable SSL client site renegotiation.
*/
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && OPENSSL_VERSION_NUMBER < 0x30000000L) || \
defined(LIBRESSL_VERSION_NUMBER)
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && (OPENSSL_VERSION_NUMBER < 0x30000000L) && \
!defined(LIBRESSL_VERSION_NUMBER)
options |= SSL_OP_NO_RENEGOTIATION;
#endif

View File

@@ -103,7 +103,7 @@ static char* makecert_read_str(BIO* bio, size_t* pOffset)
length = new_len;
x509_str = new_str;
ERR_clear_error();
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
status = BIO_read_ex(bio, &x509_str[offset], length - offset, &readBytes);
#else
status = BIO_read(bio, &x509_str[offset], length - offset);