Skip to content
Draft
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: 2 additions & 3 deletions include/electronic-id/electronic-id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ class VerifyPinFailed : public Error
INVALID_PIN_LENGTH,
PIN_ENTRY_TIMEOUT,
PIN_ENTRY_CANCEL,
// Retry not allowed starting from PIN_BLOCKED.
PIN_BLOCKED,
UNKNOWN_ERROR
// Retry not allowed in case of PIN_BLOCKED.
PIN_BLOCKED
};

explicit VerifyPinFailed(const Status s,
Expand Down
4 changes: 2 additions & 2 deletions src/electronic-ids/pcsc/pcsc-common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ inline void verifyPin(pcsc_cpp::SmartCard& card, pcsc_cpp::byte_vector::value_ty
// (re-entered PIN is different) that only apply during PIN change, we treat them as unknown
// errors here.

// Other unknown errors.
throw VerifyPinFailed(VerifyPinFailed::Status::UNKNOWN_ERROR, &response);
THROW(SmartCardError,
"Command VERIFY PIN failed with error " + pcsc_cpp::bytes2hexstr(response.toBytes()));
}

inline pcsc_cpp::byte_vector internalAuthenticate(pcsc_cpp::SmartCard& card,
Expand Down
6 changes: 3 additions & 3 deletions tests/mock/select-certificate-script-EST-GEMALTO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const PcscMock::ApduScript ESTEID_GEMALTO_V3_5_8_GET_AUTH_CERTIFICATE_AND_AUTHEN

// Get retry count
{{0x00, 0xb2, 0x01, 0x04},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x90, 0x00}}, // FIXME: get correct result
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x90, 0x00}}, // TODO: get correct result

// 3. Authenticate.
// Verify PIN.
Expand All @@ -199,7 +199,7 @@ const PcscMock::ApduScript ESTEID_GEMALTO_V3_5_8_GET_SIGN_CERTIFICATE_AND_SIGNIN
{{0x00, 0xa4, 0x00, 0x0c}, {0x90, 0x00}},
// Select EE directory.
{{0x00, 0xa4, 0x01, 0x0c, 0x02, 0xee, 0xee}, {0x90, 0x00}},
// Select authentication certificate file.
// Select signing certificate file.
{{0x00, 0xa4, 0x02, 0x0c, 0x02, 0xdd, 0xce}, {0x90, 0x00}},

// Read data length.
Expand Down Expand Up @@ -342,7 +342,7 @@ const PcscMock::ApduScript ESTEID_GEMALTO_V3_5_8_GET_SIGN_CERTIFICATE_AND_SIGNIN

// Get retry count
{{0x00, 0xb2, 0x02, 0x04},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x90, 0x00}}, // FIXME: get correct result
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x90, 0x00}}, // TODO: get correct result

// 3. Signing.
// Verify PIN.
Expand Down