From a91bf57794dc7ff0284f06178c02d571ed6f38c3 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 14 Jan 2025 22:47:54 +0200 Subject: [PATCH] Amend: Avoid reallocation in PIN padding Signed-off-by: Raul Metsma --- tests/integration/test-authenticate.cpp | 1 + tests/integration/test-signing.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/integration/test-authenticate.cpp b/tests/integration/test-authenticate.cpp index 0ff19ea..47b3ce9 100644 --- a/tests/integration/test-authenticate.cpp +++ b/tests/integration/test-authenticate.cpp @@ -58,6 +58,7 @@ TEST(electronic_id_test, authenticate) GTEST_ASSERT_GE(cardInfo->eid().authPinRetriesLeft().first, 0U); byte_vector pin {'1', '2', '3', '4'}; + pin.reserve(64); std::cout << "WARNING! Using hard-coded PIN " << std::string_view(reinterpret_cast(pin.data()), pin.size()) << '\n'; diff --git a/tests/integration/test-signing.cpp b/tests/integration/test-signing.cpp index 72a4491..019c4d3 100644 --- a/tests/integration/test-signing.cpp +++ b/tests/integration/test-signing.cpp @@ -59,6 +59,7 @@ static void signing(HashAlgorithm hashAlgo) pin = {'1', '2', '3', '4', '5', '6'}; // FinEID custom PIN else throw std::runtime_error("TEST signing: Unknown card"); + pin.reserve(64); std::cout << "WARNING! Using hard-coded PIN " << std::string(pin.cbegin(), pin.cend()) << '\n';