From bda9f60c8ff8bfe613455c89f7df054f8fbd71a5 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 9 May 2023 08:12:23 +0300 Subject: [PATCH] Fix building with Botan 3 --- src/browser/BrowserWebAuthn.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/browser/BrowserWebAuthn.cpp b/src/browser/BrowserWebAuthn.cpp index 3b545b95f7..ff648f6400 100644 --- a/src/browser/BrowserWebAuthn.cpp +++ b/src/browser/BrowserWebAuthn.cpp @@ -293,7 +293,12 @@ QByteArray BrowserWebAuthn::buildSignature(const QByteArray& authenticatorData, std::vector rawSignature; if (algName == "ECDSA") { Botan::ECDSA_PrivateKey privateKey(algId, privateKeyBytes); +#ifdef WITH_XC_BOTAN3 + Botan::PK_Signer signer( + privateKey, *randomGen()->getRng(), "EMSA1(SHA-256)", Botan::Signature_Format::DerSequence); +#else Botan::PK_Signer signer(privateKey, *randomGen()->getRng(), "EMSA1(SHA-256)", Botan::DER_SEQUENCE); +#endif signer.update(reinterpret_cast(attToBeSigned.constData()), attToBeSigned.size()); rawSignature = signer.signature(*randomGen()->getRng());