Add optional support for Botan3#8994
Conversation
Codecov ReportBase: 64.85% // Head: 64.57% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #8994 +/- ##
===========================================
- Coverage 64.85% 64.57% -0.28%
===========================================
Files 342 340 -2
Lines 44426 44142 -284
===========================================
- Hits 28812 28504 -308
- Misses 15614 15638 +24
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Botan 3 is not yet released. I would be hesitant to add support until it stabilizes to some extent. |
Right. I am not imagining that releases would be built against Botan 3, but this will make it possible to test/develop against Botan 3. |
|
In that case I'd call the cmake switch something like KPXC_DEV_BOTAN3 |
Will do. I was not sure what the naming scheme was for the cmake options. |
992e62c to
1b3ef37
Compare
1e963f7 to
a7b1c5c
Compare
Update CMake config to add a WITH_XC_BOTAN3 option. This will result in CMake setting the C++ standard to C++20 instead of C++17, ignoring the 'deprecated-enum-enum-conversion' and 'deprecated' warnings, and using the Botan 3 version/include dir/libraries instead of the Botan 2 ones. The value of this option will be made available to the c++ code via the config-keepassxc.h header. This also makes some minimal compatability fixes to the code (behind a ifndef-else-endif compiler directive) - For Botan 3, just check that the botan major version is 3 - In SessionCipher.cpp, if we are compiling against Botan 3, use the pubkey api instead of the pk_ops api.
Fix Botan 3 build (#9388) * SymmetricCipher: Fix Botan 3 build Botan commit 819cf8fe6278a19b8266f449228f02fc28a4f784 changed Botan::Cipher_Dir to be a scoped enumeration, so the users must be adapted. This change causes no issues with Botan 2 because normal enumeration values can also be referred to the same way scoped enumeration values are accessed. * Auto detect Botan3 * AsyncTask: Do not use `std::result_of` `std::result_of` was deprecated in C++17 and then it was subsequently removed in C++20. One could use `std::invoke_result_t`, but let Qt figure out the return type instead. * Collapse Botan2 and Botan3 find package into one * Update COPYING
Update CMake config to add a KPXC_DEV_BOTAN3 option. This will result in CMake setting the C++ standard to C++20 instead of C++17, ignoring the 'deprecated-enum-enum-conversion' and 'deprecated' warnings, and using the Botan 3 version/include dir/libraries instead of the Botan 2 ones.
The value of this option will be made available to the c++ code via the config-keepassxc.h header.
This also makes some minimal compatability fixes to the code (behind a ifndef-else-endif compiler directive)
Testing strategy
Compiled an ran the application with
WITH_XC_ALLandKPXC_DEV_BOTAN3.Type of change