Compare commits

..

3 Commits

Author SHA1 Message Date
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
2 changed files with 6 additions and 3 deletions
+4
View File
@@ -82,6 +82,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 -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)
{ {