1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-13 00:46:32 +00:00

Fix compatibility with LibreSSL; new checks skipped initialization code

This commit is contained in:
dmiller
2017-02-07 20:10:02 +00:00
parent 67196742e9
commit b7e213b5cb
4 changed files with 8 additions and 8 deletions

View File

@@ -173,7 +173,7 @@ SSL_CTX *setup_ssl_listen(void)
if (sslctx)
goto done;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
SSL_library_init();
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();

View File

@@ -255,11 +255,11 @@ static int set_dNSNames(X509 *cert, const struct lstr dNSNames[])
if (gen_name == NULL)
goto stack_err;
gen_name->type = GEN_DNS;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
gen_name->d.dNSName = M_ASN1_IA5STRING_new();
#else
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined LIBRESSL_VERSION_NUMBER
gen_name->d.dNSName = ASN1_IA5STRING_new();
#endif
#else
gen_name->d.dNSName = M_ASN1_IA5STRING_new();
#endif
if (gen_name->d.dNSName == NULL)
goto name_err;
if (ASN1_STRING_set(gen_name->d.dNSName, name->s, name->len) == 0)
@@ -581,7 +581,7 @@ int main(void)
{
unsigned int i;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
SSL_library_init();
ERR_load_crypto_strings();
SSL_load_error_strings();

View File

@@ -602,7 +602,7 @@ static const struct luaL_Reg openssllib[] = {
LUALIB_API int luaopen_openssl(lua_State *L) {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
#else

View File

@@ -84,7 +84,7 @@ extern struct timeval nsock_tod;
static SSL_CTX *ssl_init_common() {
SSL_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
SSL_load_error_strings();
SSL_library_init();
#endif