X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_ssl_openssl.cpp;h=60c90988a7aed04b4d87e67795f1d6e341b2f6dc;hb=88dccdd5f04e9244323de0eb197590ab8e7292fd;hp=9a54ff80b7c6a0cb29a762d1dd3e4fadf320119b;hpb=5ae804239ee1e2f8731b73ab37e9f16d8153d477;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 9a54ff80b..60c90988a 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -36,13 +36,8 @@ #include "ssl.h" #ifdef _WIN32 -# pragma comment(lib, "libcrypto.lib") -# pragma comment(lib, "libssl.lib") -# pragma comment(lib, "user32.lib") -# pragma comment(lib, "advapi32.lib") -# pragma comment(lib, "libgcc.lib") -# pragma comment(lib, "libmingwex.lib") -# pragma comment(lib, "gdi32.lib") +# pragma comment(lib, "ssleay32.lib") +# pragma comment(lib, "libeay32.lib") # undef MAX_DESCRIPTORS # define MAX_DESCRIPTORS 10000 #endif @@ -249,7 +244,11 @@ class ModuleSSLOpenSSL : public Module ERR_print_errors_cb(error_callback, this); } +#ifdef _WIN32 + BIO* dhpfile = BIO_new_file(dhfile.c_str(), "r"); +#else FILE* dhpfile = fopen(dhfile.c_str(), "r"); +#endif DH* ret; if (dhpfile == NULL) @@ -259,7 +258,12 @@ class ModuleSSLOpenSSL : public Module } else { +#ifdef _WIN32 + ret = PEM_read_bio_DHparams(dhpfile, NULL, NULL, NULL); + BIO_free(dhpfile); +#else ret = PEM_read_DHparams(dhpfile, NULL, NULL, NULL); +#endif if ((SSL_CTX_set_tmp_dh(ctx, ret) < 0) || (SSL_CTX_set_tmp_dh(clictx, ret) < 0)) { ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters %s. SSL errors follow:", dhfile.c_str()); @@ -268,7 +272,9 @@ class ModuleSSLOpenSSL : public Module DH_free(ret); } +#ifndef _WIN32 fclose(dhpfile); +#endif } void On005Numeric(std::string &output)