Compare commits
No commits in common. "c181fe99fa7a63b94adb45e4b838e3ee21d8d45f" and "9ff0bada4ecd0cc0c6dc836973a5f118d4b8c164" have entirely different histories.
c181fe99fa
...
9ff0bada4e
4 changed files with 3 additions and 27 deletions
18
README.md
18
README.md
|
|
@ -33,24 +33,6 @@ cmake --build build
|
||||||
|
|
||||||
To skip the test executables, add `-DBUILD_TESTS=OFF` to the configure command.
|
To skip the test executables, add `-DBUILD_TESTS=OFF` to the configure command.
|
||||||
|
|
||||||
### Building on Windows
|
|
||||||
|
|
||||||
Tested with Visual Studio 2022 (Professional) and Qt 6.8.2 (MSVC 2022, 64-bit). Run these commands from a "x64 Native Tools Command Prompt for VS 2022", with `VCPKG_ROOT` set and Qt installed in `C:\Qt\6.8.2\msvc2022_64`:
|
|
||||||
|
|
||||||
```
|
|
||||||
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake -DCMAKE_PREFIX_PATH=C:/Qt/6.8.2/msvc2022_64
|
|
||||||
cmake --build build --config Release
|
|
||||||
ctest --test-dir build -C Release --output-on-failure
|
|
||||||
```
|
|
||||||
|
|
||||||
The executables are placed in `build\pglab\Release\pglab.exe` and `build\tests\*\Release\`. They need the Qt and vcpkg DLLs next to them. Run `windeployqt` on `pglab.exe` and on each test executable, and copy the vcpkg runtime DLLs from `build\vcpkg_installed\x64-windows\bin` into the same folders. For the app:
|
|
||||||
|
|
||||||
```
|
|
||||||
C:\Qt\6.8.2\msvc2022_64\bin\windeployqt.exe --release build\pglab\Release\pglab.exe
|
|
||||||
```
|
|
||||||
|
|
||||||
If another Qt installation (for example one shipped with another program) is on your `PATH`, its `Qt6Core.dll` may be loaded instead, which causes "entry point not found" errors at startup. Deploying the DLLs next to the executables avoids this.
|
|
||||||
|
|
||||||
## Running the tests
|
## Running the tests
|
||||||
|
|
||||||
From the build directory, run:
|
From the build directory, run:
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ add_executable(pglab
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set_target_properties(pglab PROPERTIES WIN32_EXECUTABLE ON)
|
set_target_properties(pglab PROPERTIES WIN32_EXECUTABLE ON)
|
||||||
target_link_libraries(pglab PRIVATE ws2_32)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(pglab PRIVATE
|
target_link_libraries(pglab PRIVATE
|
||||||
|
|
|
||||||
|
|
@ -158,10 +158,9 @@ add_library(pglablib STATIC
|
||||||
|
|
||||||
find_package(Boost REQUIRED COMPONENTS container timer chrono assert)
|
find_package(Boost REQUIRED COMPONENTS container timer chrono assert)
|
||||||
|
|
||||||
find_package(botan CONFIG QUIET)
|
find_path(BOTAN_INCLUDE_DIR botan/hash.h REQUIRED)
|
||||||
|
find_library(BOTAN_LIBRARY NAMES botan-3 botan REQUIRED)
|
||||||
if(NOT TARGET Botan::Botan)
|
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)
|
add_library(Botan::Botan STATIC IMPORTED)
|
||||||
set_target_properties(Botan::Botan PROPERTIES
|
set_target_properties(Botan::Botan PROPERTIES
|
||||||
IMPORTED_LOCATION "${BOTAN_LIBRARY}"
|
IMPORTED_LOCATION "${BOTAN_LIBRARY}"
|
||||||
|
|
|
||||||
|
|
@ -267,11 +267,7 @@ KeyStrengthener PasswordManager::createKeyStrengthener()
|
||||||
const std::string algo = "Scrypt";
|
const std::string algo = "Scrypt";
|
||||||
auto pwh_fam = Botan::PasswordHashFamily::create(algo);
|
auto pwh_fam = Botan::PasswordHashFamily::create(algo);
|
||||||
return KeyStrengthener(
|
return KeyStrengthener(
|
||||||
#ifdef _WIN32
|
pwh_fam->tune(key_size, std::chrono::seconds(2), 130),
|
||||||
pwh_fam->tune_params(key_size, 2000, 130),
|
|
||||||
#else
|
|
||||||
pwh_fam->tune(key_size, std::chrono::seconds(2), 130),
|
|
||||||
#endif
|
|
||||||
salt,
|
salt,
|
||||||
key_size
|
key_size
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue