Skip to content

Commit

Permalink
Merge pull request #4061 from vakartel/master
Browse files Browse the repository at this point in the history
Fix build with LibreSSL
  • Loading branch information
hardening committed Jul 27, 2017
2 parents f8c9f43 + 9bf9ff9 commit 7891a0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libfreerdp/crypto/crypto.c
Expand Up @@ -388,7 +388,7 @@ BOOL x509_verify_certificate(CryptoCert cert, char* certificate_store_path)
if (cert_ctx == NULL)
goto end;

#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
OpenSSL_add_all_algorithms();
#else
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
Expand Down
6 changes: 3 additions & 3 deletions winpr/libwinpr/utils/ssl.c
Expand Up @@ -255,7 +255,7 @@ static BOOL CALLBACK _winpr_openssl_initialize(PINIT_ONCE once, PVOID param, PVO
}
#endif
/* SSL_load_error_strings() is void */
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
SSL_load_error_strings();
/* SSL_library_init() always returns "1" */
SSL_library_init();
Expand Down Expand Up @@ -296,7 +296,7 @@ BOOL winpr_CleanupSSL(DWORD flags)
#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
_winpr_openssl_cleanup_locking();
#endif
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
EVP_cleanup();
Expand All @@ -307,7 +307,7 @@ BOOL winpr_CleanupSSL(DWORD flags)
#ifdef WINPR_OPENSSL_LOCKING_REQUIRED
if (flags & WINPR_SSL_CLEANUP_THREAD)
{
#if (OPENSSL_VERSION_NUMBER < 0x10000000L)
#if (OPENSSL_VERSION_NUMBER < 0x10000000L) || defined(LIBRESSL_VERSION_NUMBER)
ERR_remove_state(0);
#else
ERR_remove_thread_state(NULL);
Expand Down
6 changes: 3 additions & 3 deletions winpr/tools/makecert/makecert.c
Expand Up @@ -620,7 +620,7 @@ int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* pa
printf("Using default export password \"password\"\n");
}

#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
OpenSSL_add_all_algorithms();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
Expand Down Expand Up @@ -1008,7 +1008,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv)
key_length = atoi(arg->Value);
}

#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
context->rsa = RSA_generate_key(key_length, RSA_F4, NULL, NULL);
#else
{
Expand Down Expand Up @@ -1043,7 +1043,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv)
{
ASN1_TIME* before;
ASN1_TIME* after;
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
before = X509_get_notBefore(context->x509);
after = X509_get_notAfter(context->x509);
#else
Expand Down

0 comments on commit 7891a0f

Please sign in to comment.