Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/electronic-ids/pcsc/EstEIDThales.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class EstEIDThales : public EIDThales
return CommandApdu::selectEF(0x08, {0xAD, 0xF1, 0x34, 0x11});
}
constexpr byte_type authPinReference() const override { return 0x81; }
PinInfo authPinInfoImpl(const SmartCard::Session& session) const override
{
// Some EstEID cards must set PIN-s first to use card
return pinRetriesLeft(session, authPinReference(), false);
}
constexpr int8_t maximumPinRetries() const override { return 3; }
PCSC_CPP_CONSTEXPR_VECTOR CommandApdu signCertFile() const override
{
Expand Down
20 changes: 11 additions & 9 deletions tests/integration/test-signing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#include "gtest/gtest.h"

#include <algorithm>

using namespace electronic_id;
using namespace pcsc_cpp;

Expand All @@ -49,14 +47,18 @@ static void signing(HashAlgorithm hashAlgo)
GTEST_ASSERT_GE(cardInfo->signingPinInfo().retryCount, 0U);

byte_vector pin;
if (cardInfo->name() == "EstEID IDEMIA v1" || cardInfo->name() == "EstEIDThales")
pin = {'1', '2', '3', '4', '5'}; // EstIDEMIA test card default PIN2
else if (cardInfo->name() == "LatEID IDEMIA v1" || cardInfo->name() == "LatEID IDEMIA v2")
pin = {'1', '2', '3', '4', '5', '6'}; // LatIDEMIA test card default PIN2
else if (cardInfo->name() == "FinEID v3" || cardInfo->name() == "FinEID v4")
pin = {'1', '2', '3', '4', '5', '6'}; // FinEID custom PIN
else
switch (cardInfo->type()) {
using enum ElectronicID::Type;
case ElectronicID::EstEID:
pin = {'1', '2', '3', '4', '5'}; // EstEID test card default PIN2
break;
case ElectronicID::LatEID: // LatIDEMIA test card default PIN2
case ElectronicID::FinEID: // FinEID custom PIN
pin = {'1', '2', '3', '4', '5', '6'};
break;
default:
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';
Expand Down
Loading