Make builds on windows work.

This commit is contained in:
Eelke Klein 2026-10-19 15:07:29 +02:00
parent 9ff0bada4e
commit aaaadfc105
No known key found for this signature in database
4 changed files with 27 additions and 3 deletions

View file

@ -158,9 +158,10 @@ add_library(pglablib STATIC
find_package(Boost REQUIRED COMPONENTS container timer chrono assert)
find_path(BOTAN_INCLUDE_DIR botan/hash.h REQUIRED)
find_library(BOTAN_LIBRARY NAMES botan-3 botan REQUIRED)
find_package(botan CONFIG QUIET)
if(NOT TARGET Botan::Botan)
find_path(BOTAN_INCLUDE_DIR botan/hash.h REQUIRED)
find_library(BOTAN_LIBRARY NAMES botan-3 botan REQUIRED)
add_library(Botan::Botan STATIC IMPORTED)
set_target_properties(Botan::Botan PROPERTIES
IMPORTED_LOCATION "${BOTAN_LIBRARY}"

View file

@ -267,7 +267,11 @@ KeyStrengthener PasswordManager::createKeyStrengthener()
const std::string algo = "Scrypt";
auto pwh_fam = Botan::PasswordHashFamily::create(algo);
return KeyStrengthener(
pwh_fam->tune(key_size, std::chrono::seconds(2), 130),
#ifdef _WIN32
pwh_fam->tune_params(key_size, 2000, 130),
#else
pwh_fam->tune(key_size, std::chrono::seconds(2), 130),
#endif
salt,
key_size
);