Botan: don't call deprecated functions (#10826)

* Botan: use raw_private_key_bits() if available

Botan 3.x introduces raw_private_key_bits() as an alias for
get_private_key(), and deprecates the latter.

* Botan: use Cipher_Dir::Encryption

Botan 3.x introduces Cipher_Dir::Encryption as an alias for
Cipher_Dir::ENCRYPTION, and deprecates the latter. Likewise for
Decryption/DECRYPTION.
This commit is contained in:
Carlo Teubner 2024-06-01 20:53:35 +01:00 committed by GitHub
parent 5de669eb7b
commit 9288bef4f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View file

@ -19,6 +19,7 @@
#include "BrowserMessageBuilder.h"
#include "BrowserService.h"
#include "PasskeyUtils.h"
#include "config-keepassx.h"
#include "crypto/Random.h"
#include <QJsonDocument>
#include <QJsonObject>
@ -276,7 +277,11 @@ BrowserPasskeys::buildCredentialPrivateKey(int alg, const QString& predefinedFir
try {
Botan::Ed25519_PrivateKey key(*randomGen()->getRng());
auto publicKey = key.get_public_key();
#ifdef WITH_XC_BOTAN3
auto privateKey = key.raw_private_key_bits();
#else
auto privateKey = key.get_private_key();
#endif
firstPart = browserMessageBuilder()->getQByteArray(publicKey.data(), publicKey.size());
secondPart = browserMessageBuilder()->getQByteArray(privateKey.data(), privateKey.size());