Skip to content

Commit

Permalink
Fix building with Botan 3
Browse files Browse the repository at this point in the history
  • Loading branch information
varjolintu committed May 9, 2023
1 parent 7fae36d commit 9090394
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/browser/BrowserWebAuthn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ QByteArray BrowserWebAuthn::buildSignature(const QByteArray& authenticatorData,
std::vector<uint8_t> 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<const uint8_t*>(attToBeSigned.constData()), attToBeSigned.size());
rawSignature = signer.signature(*randomGen()->getRng());
Expand Down

0 comments on commit 9090394

Please sign in to comment.