Compare commits

..

6 Commits

Author SHA1 Message Date
neru df146989df fix: prevent windows from breaking min and max 2026-06-19 14:20:37 -03:00
neru 699dc354c8 fix: missing > 2026-06-19 12:08:19 -03:00
neru efca4fd3fd fix: add missing includes 2026-06-19 12:06:53 -03:00
neru 4d54533f9a fix: invalid null usage 2026-06-19 11:07:55 -03:00
neru 558f964ce2 fix: initializer list order 2026-06-19 11:07:35 -03:00
neru 409c41e196 fix: link crypt32 via list 2026-06-19 11:06:41 -03:00
3 changed files with 10 additions and 3 deletions
+6
View File
@@ -55,6 +55,8 @@ FetchContent_MakeAvailable(wolfssl)
target_compile_definitions(wolfssl PUBLIC target_compile_definitions(wolfssl PUBLIC
-DWOLFSSL_ALT_NAMES -DWOLFSSL_ALT_NAMES
-DWOLFSSL_ALPN -DWOLFSSL_ALPN
-DWOLFSSL_HAVE_MIN
-DWOLFSSL_HAVE_MAX
) )
# --------------------- # ---------------------
@@ -82,6 +84,10 @@ if (TINYMITM_LOGS OR $CACHE{TINYMITM_LOGS})
target_compile_definitions(tinymitm PUBLIC TINYMITM_LOGS) target_compile_definitions(tinymitm PUBLIC TINYMITM_LOGS)
endif() endif()
if (WIN32)
target_link_libraries(tinymitm PRIVATE crypt32)
endif()
# ------------------------------ # ------------------------------
# test # test
# ------------------------------ # ------------------------------
+2
View File
@@ -6,6 +6,8 @@
#include <seallib/log.h> #include <seallib/log.h>
#endif #endif
#include <condition_variable>
#include <mutex>
#include <thread> #include <thread>
#include <atomic> #include <atomic>
#include <queue> #include <queue>
+2 -3
View File
@@ -13,13 +13,12 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <wincrypt.h> #include <wincrypt.h>
#pragma comment(lib, "crypt32.lib")
#endif #endif
/* /*
CertificateManager implementation CertificateManager implementation
*/ */
CertificateManager::CertificateManager() : _rng(new WC_RNG()), _caKey(nullptr), _sessionKey(nullptr) {} CertificateManager::CertificateManager() : _caKey(nullptr), _sessionKey(nullptr), _rng(new WC_RNG()) {}
CertificateManager::~CertificateManager() CertificateManager::~CertificateManager()
{ {
@@ -148,7 +147,7 @@ bool CertificateManager::installCertificate()
(DWORD)_caCertDer.size()); (DWORD)_caCertDer.size());
if (!certCtx) return false; if (!certCtx) return false;
HCERTSTORE rootStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL, CERT_SYSTEM_STORE_CURRENT_USER, L"Root"); HCERTSTORE rootStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"Root");
bool success = false; bool success = false;
if (rootStore) if (rootStore)
{ {