Skip to content

Commit 7e7e69d

Browse files
metsmamrts
authored andcommitted
Amend: Avoid reallocation in PIN padding
Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent c58fd30 commit 7e7e69d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tests/integration/test-authenticate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ TEST(electronic_id_test, authenticate)
5858
GTEST_ASSERT_GE(cardInfo->eid().authPinRetriesLeft().first, 0U);
5959

6060
byte_vector pin {'1', '2', '3', '4'};
61+
pin.reserve(64);
6162

6263
std::cout << "WARNING! Using hard-coded PIN "
6364
<< std::string_view(reinterpret_cast<const char*>(pin.data()), pin.size()) << '\n';

tests/integration/test-signing.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static void signing(HashAlgorithm hashAlgo)
5959
pin = {'1', '2', '3', '4', '5', '6'}; // FinEID custom PIN
6060
else
6161
throw std::runtime_error("TEST signing: Unknown card");
62+
pin.reserve(64);
6263

6364
std::cout << "WARNING! Using hard-coded PIN " << std::string(pin.cbegin(), pin.cend()) << '\n';
6465

0 commit comments

Comments
 (0)