diff --git a/lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp b/lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp index 377904d..9e12ecb 100644 --- a/lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp +++ b/lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp @@ -182,9 +182,9 @@ struct CommandApdu constexpr operator const byte_vector&() const { return d; } /** - * A helper function to create a SELECT command APDU. + * A helper function to create a SELECT FILE command APDU. * - * The ISO 7816-4 Section 6.11 SELECT command has the form: + * The ISO 7816-4 Section 6.11 SELECT FILE command has the form: * CLA = 0x00 * INS = 0xA4 * P1 = varies, see below. @@ -193,6 +193,7 @@ struct CommandApdu * * The P1 parameter for the SELECT command controls the selection mode, * we use the following modes: + * 0x02 = Select EF under current DF, * 0x04 = Select AID (application identifier), * direct selection by DF (dedicated file, directory) name. * 0x08 = Select from MF (master file, root directory). @@ -203,6 +204,32 @@ struct CommandApdu return {0x00, 0xA4, p1, 0x0C, std::move(file)}; } + /** + * A helper function to create a SELECT EF command APDU. + * + * Same as select() but with P2 set to 0x04 and returns the file identifier as data. + */ + static PCSC_CPP_CONSTEXPR_VECTOR CommandApdu selectEF(byte_type p1, byte_vector file) + { + return {0x00, 0xA4, p1, 0x04, std::move(file), 0x00}; + } + + /** + * A helper function to create a READ BINARY command APDU. + * + * The ISO 7816-4 Section 6.1 READ BINARY command has the form: + * CLA = 0x00 + * INS = 0xB0 + * P1, P2 = if bit8=0 in P1, then P1||P2 is the offset of the first byte to be read in data units from the + * beginning of the file. + * Lc and Data field = Empty + * Le = Number of bytes to be read + */ + static PCSC_CPP_CONSTEXPR_VECTOR CommandApdu readBinary(uint16_t pos, byte_type le) + { + return {0x00, 0xb0, byte_type(pos >> 8), byte_type(pos), le}; + } + byte_vector d; }; @@ -279,11 +306,8 @@ std::vector listReaders(); /** Transmit APDU command and verify that expected response is received. */ void transmitApduWithExpectedResponse(const SmartCard& card, const CommandApdu& command); -/** Read data length from currently selected file header, file must be ASN.1-encoded. */ -size_t readDataLengthFromAsn1(const SmartCard& card); - /** Read lenght bytes from currently selected binary file in blockLength-sized chunks. */ -byte_vector readBinary(const SmartCard& card, const size_t length, byte_type blockLength); +byte_vector readBinary(const SmartCard& card, const uint16_t length, byte_type blockLength = 0x00); // Errors. diff --git a/lib/libpcsc-cpp/src/utils.cpp b/lib/libpcsc-cpp/src/utils.cpp index ae6ea19..e5d8d73 100644 --- a/lib/libpcsc-cpp/src/utils.cpp +++ b/lib/libpcsc-cpp/src/utils.cpp @@ -23,34 +23,16 @@ #include "pcsc-cpp/pcsc-cpp.hpp" #include "pcsc-cpp/pcsc-cpp-utils.hpp" -#include +#include #include +#include using namespace pcsc_cpp; using namespace std::string_literals; -#ifdef HIBYTE -#undef HIBYTE -#endif -#ifdef LOBYTE -#undef LOBYTE -#endif - -constexpr byte_type HIBYTE(size_t w) noexcept -{ - return static_cast((w >> 8) & 0xff); -} -constexpr byte_type LOBYTE(size_t w) noexcept -{ - return static_cast(w & 0xff); -} - namespace { -const byte_type DER_SEQUENCE_TYPE_TAG = 0x30; -const byte_type DER_TWO_BYTE_LENGTH = 0x82; - class UnexpectedResponseError : public Error { public: @@ -93,68 +75,25 @@ void transmitApduWithExpectedResponse(const SmartCard& card, const CommandApdu& } } -size_t readDataLengthFromAsn1(const SmartCard& card) -{ - // p1 - offset size first byte, 0 - // p2 - offset size second byte, 0 - // le - number of bytes to read, need 4 bytes from start for length - const CommandApdu readBinary4Bytes {0x00, 0xb0, 0x00, 0x00, 0x04}; - - auto response = card.transmit(readBinary4Bytes); - - // Verify expected DER header, first byte must be SEQUENCE. - if (response.data[0] != DER_SEQUENCE_TYPE_TAG) { - // TODO: more specific exception - THROW(Error, - "readDataLengthFromAsn1(): First byte must be SEQUENCE (0x30), but is "s - + int2hexstr(response.data[0])); - } - - // TODO: support other lenghts besides 2. - // Assume 2-byte length, so second byte must be 0x82. - if (response.data[1] != DER_TWO_BYTE_LENGTH) { - // TODO: more specific exception - THROW(Error, - "readDataLengthFromAsn1(): Second byte must be two-byte length indicator "s - "(0x82), but is "s - + int2hexstr(response.data[1])); - } - - // Read 2-byte length field at offset 2 and 3 and add the 4 DER length bytes. - const auto length = size_t((response.data[2] << 8) + response.data[3] + 4); - if (length < 128 || length > 0x0f00) { - // TODO: more specific exception - THROW(Error, - "readDataLengthFromAsn1(): Unexpected data length in DER header: "s - + std::to_string(length)); - } - - return length; -} - -byte_vector readBinary(const SmartCard& card, const size_t length, byte_type blockLength) +byte_vector readBinary(const SmartCard& card, const uint16_t length, byte_type blockLength) { - auto lengthCounter = length; - auto resultBytes = byte_vector {}; - - for (size_t offset = 0; lengthCounter != 0; - offset += blockLength, lengthCounter -= blockLength) { - - if (blockLength > lengthCounter) { - blockLength = byte_type(lengthCounter); + byte_vector resultBytes; + resultBytes.reserve(length); + while (resultBytes.size() < length) { + byte_type chunk = byte_type(std::min(length - resultBytes.size(), blockLength)); + auto response = card.transmit(CommandApdu::readBinary(uint16_t(resultBytes.size()), chunk)); + if (chunk > 0 && response.data.size() != chunk) { + THROW(Error, + "Length mismatch, expected "s + std::to_string(chunk) + ", received " + + std::to_string(response.data.size()) + " bytes"); } - - CommandApdu readBinary {0x00, 0xb0, HIBYTE(offset), LOBYTE(offset), blockLength}; - auto response = card.transmit(readBinary); - resultBytes.insert(resultBytes.end(), response.data.cbegin(), response.data.cend()); } - if (resultBytes.size() != length) { - // TODO: more specific exception - THROW(Error, "readBinary(): Invalid length: "s + std::to_string(resultBytes.size())); + THROW(Error, + "Length mismatch, expected "s + std::to_string(length) + ", received " + + std::to_string(resultBytes.size()) + " bytes"); } - return resultBytes; } diff --git a/src/electronic-ids/TLV.hpp b/src/electronic-ids/TLV.hpp index 418de82..ee63092 100644 --- a/src/electronic-ids/TLV.hpp +++ b/src/electronic-ids/TLV.hpp @@ -117,11 +117,6 @@ struct TLV } return TLV({}); } - template - static PCSC_CPP_CONSTEXPR_VECTOR TLV path(const byte_vector& data, uint32_t tag, Tags... tags) - { - return path(TLV(data), tag, tags...); - } constexpr operator bool() const noexcept { return begin < end; } }; diff --git a/src/electronic-ids/pcsc/EIDIDEMIA.cpp b/src/electronic-ids/pcsc/EIDIDEMIA.cpp index 8c2108d..09211c7 100644 --- a/src/electronic-ids/pcsc/EIDIDEMIA.cpp +++ b/src/electronic-ids/pcsc/EIDIDEMIA.cpp @@ -46,8 +46,8 @@ const auto ADF1_AID = CommandApdu::select( const auto ADF2_AID = CommandApdu::select(0x04, {0x51, 0x53, 0x43, 0x44, 0x20, 0x41, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E}); -const auto AUTH_CERT = CommandApdu::select(0x09, {0xAD, 0xF1, 0x34, 0x01}); -const auto SIGN_CERT = CommandApdu::select(0x09, {0xAD, 0xF2, 0x34, 0x1F}); +const auto AUTH_CERT = CommandApdu::selectEF(0x09, {0xAD, 0xF1, 0x34, 0x01}); +const auto SIGN_CERT = CommandApdu::selectEF(0x09, {0xAD, 0xF2, 0x34, 0x1F}); } // namespace @@ -69,7 +69,8 @@ void EIDIDEMIA::selectADF2() const byte_vector EIDIDEMIA::getCertificateImpl(const CertificateType type) const { selectMain(); - return electronic_id::getCertificate(*card, type.isAuthentication() ? AUTH_CERT : SIGN_CERT); + // Set block lenght to 0xC0 to workaround for the 2018 v2 card, with reader Alcor Micro AU9540 + return readFile(*card, type.isAuthentication() ? AUTH_CERT : SIGN_CERT, 0xC0); } EIDIDEMIA::KeyInfo EIDIDEMIA::authKeyRef() const @@ -143,7 +144,7 @@ ElectronicID::PinRetriesRemainingAndMax EIDIDEMIA::pinRetriesLeft(byte_type pinR if (!response.isOK()) { THROW(SmartCardError, "Command GET DATA ODD failed with error " + response); } - TLV info = TLV::path(response.data, 0x70, 0xBF8100 | ref, 0xA0); + TLV info = TLV::path(TLV(response.data), 0x70, 0xBF8100 | ref, 0xA0); TLV max = info[0x9A]; TLV tries = info[0x9B]; if (max && tries) { diff --git a/src/electronic-ids/pcsc/FinEID.cpp b/src/electronic-ids/pcsc/FinEID.cpp index 903a8fc..ce2f70e 100644 --- a/src/electronic-ids/pcsc/FinEID.cpp +++ b/src/electronic-ids/pcsc/FinEID.cpp @@ -43,9 +43,9 @@ namespace const auto SELECT_MAIN_AID = CommandApdu::select( 0x04, {0xa0, 0x00, 0x00, 0x00, 0x63, 0x50, 0x4b, 0x43, 0x53, 0x2d, 0x31, 0x35}); -const auto SELECT_AUTH_CERT_FILE = CommandApdu::select(0x08, {0x43, 0x31}); -const auto SELECT_SIGN_CERT_FILE_V3 = CommandApdu::select(0x08, {0x50, 0x16, 0x43, 0x35}); -const auto SELECT_SIGN_CERT_FILE_V4 = CommandApdu::select(0x08, {0x50, 0x16, 0x43, 0x32}); +const auto SELECT_AUTH_CERT_FILE = CommandApdu::selectEF(0x08, {0x43, 0x31}); +const auto SELECT_SIGN_CERT_FILE_V3 = CommandApdu::selectEF(0x08, {0x50, 0x16, 0x43, 0x35}); +const auto SELECT_SIGN_CERT_FILE_V4 = CommandApdu::selectEF(0x08, {0x50, 0x16, 0x43, 0x32}); constexpr byte_type PIN_PADDING_CHAR = 0x00; constexpr byte_type AUTH_PIN_REFERENCE = 0x11; @@ -64,8 +64,8 @@ namespace electronic_id byte_vector FinEIDv3::getCertificateImpl(const CertificateType type) const { transmitApduWithExpectedResponse(*card, SELECT_MAIN_AID); - return electronic_id::getCertificate( - *card, type.isAuthentication() ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V3); + return readFile(*card, + type.isAuthentication() ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V3); } byte_vector FinEIDv3::signWithAuthKeyImpl(byte_vector&& pin, const byte_vector& hash) const @@ -179,8 +179,8 @@ ElectronicID::PinRetriesRemainingAndMax FinEIDv3::pinRetriesLeft(byte_type pinRe byte_vector FinEIDv4::getCertificateImpl(const CertificateType type) const { transmitApduWithExpectedResponse(*card, SELECT_MAIN_AID); - return electronic_id::getCertificate( - *card, type.isAuthentication() ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V4); + return readFile(*card, + type.isAuthentication() ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V4); } byte_vector FinEIDv4::signWithAuthKeyImpl(byte_vector&& pin, const byte_vector& hash) const diff --git a/src/electronic-ids/pcsc/LatEIDIDEMIAv2.cpp b/src/electronic-ids/pcsc/LatEIDIDEMIAv2.cpp index df747ee..6e2442f 100644 --- a/src/electronic-ids/pcsc/LatEIDIDEMIAv2.cpp +++ b/src/electronic-ids/pcsc/LatEIDIDEMIAv2.cpp @@ -63,7 +63,7 @@ byte_vector LatEIDIDEMIAV2::getCertificateImpl(const CertificateType type) const auto info = readDCODInfo(CERT_FILE_REF, type.isAuthentication() ? data->authCache : data->signCache); if (TLV id = TLV::path(info, 0x30, 0xA1, 0x30, 0x30, 0x04)) { - return electronic_id::getCertificate(*card, CommandApdu::select(0x02, {id.begin, id.end})); + return readFile(*card, CommandApdu::selectEF(0x02, {id.begin, id.end})); } THROW(SmartCardError, "EF.CD reference not found"); } @@ -109,29 +109,25 @@ EIDIDEMIA::KeyInfo LatEIDIDEMIAV2::signKeyRef() const } template -const byte_vector& LatEIDIDEMIAV2::readEF_File(byte_vector file, C& cache) const +TLV LatEIDIDEMIAV2::readEF_File(byte_vector file, C& cache) const { if (auto it = cache.find(file); it != cache.end()) { - return it->second; + return TLV(it->second); } - auto response = card->transmit({0x00, 0xA4, 0x02, 0x04, file, 0x00}); - if (!response.isOK()) { - THROW(SmartCardError, "Failed to read EF file"); - } - TLV size = TLV::path(response.data, 0x62, 0x80); - if (!size || size.length != 2) { - THROW(SmartCardError, "Failed to read EF file length"); - } - return cache[std::move(file)] = - readBinary(*card, size_t(*size.begin << 8) + *(size.begin + 1), 0xFF); + return TLV(cache[std::move(file)] = readFile(*card, CommandApdu::selectEF(0x02, file))); } template -const byte_vector& LatEIDIDEMIAV2::readDCODInfo(byte_type type, C& cache) const +TLV LatEIDIDEMIAV2::readDCODInfo(byte_type type, C& cache) const { const auto info = readEF_File(EF_OD, cache); - if (auto file = TLV::path(info, type, 0x30, 0x04); file && file.length == 2) { - return readEF_File({file.begin, file.end}, cache); + for (TLV ref(info); ref; ++ref) { + if (ref.tag != type) { + continue; + } + if (auto file = ref[0x30][0x04]; file && file.length == 2) { + return readEF_File({file.begin, file.end}, cache); + } } THROW(SmartCardError, "EF.DCOD reference not found"); } @@ -139,12 +135,11 @@ const byte_vector& LatEIDIDEMIAV2::readDCODInfo(byte_type type, C& cache) const template EIDIDEMIA::KeyInfo LatEIDIDEMIAV2::readPrKDInfo(byte_type keyID, C& cache) const { - auto info = readDCODInfo(PRIV_FILE_REF, cache); - if (info.empty()) { + TLV prKD = readDCODInfo(PRIV_FILE_REF, cache); + if (!prKD) { THROW(SmartCardError, "EF.PrKD reference not found"); } - TLV prKD(info); - TLV key = TLV::path(prKD.child(), 0x30); + TLV key = prKD[0x30]; key = TLV::path(++key, 0x30, 0x02); return {key.length == 2 ? *std::next(key.begin) : keyID, prKD.tag == 0xA0}; } diff --git a/src/electronic-ids/pcsc/LatEIDIDEMIAv2.hpp b/src/electronic-ids/pcsc/LatEIDIDEMIAv2.hpp index 3ae397d..73ff9c2 100644 --- a/src/electronic-ids/pcsc/LatEIDIDEMIAv2.hpp +++ b/src/electronic-ids/pcsc/LatEIDIDEMIAv2.hpp @@ -29,6 +29,8 @@ namespace electronic_id { +struct TLV; + class LatEIDIDEMIAV2 : public EIDIDEMIA { public: @@ -52,9 +54,9 @@ class LatEIDIDEMIAV2 : public EIDIDEMIA KeyInfo signKeyRef() const override; template - const byte_vector& readEF_File(byte_vector file, C& cache) const; + TLV readEF_File(byte_vector file, C& cache) const; template - const byte_vector& readDCODInfo(byte_type type, C& cache) const; + TLV readDCODInfo(byte_type type, C& cache) const; template KeyInfo readPrKDInfo(byte_type keyID, C& cache) const; diff --git a/src/electronic-ids/pcsc/pcsc-common.hpp b/src/electronic-ids/pcsc/pcsc-common.hpp index 8ec6323..d47b9ed 100644 --- a/src/electronic-ids/pcsc/pcsc-common.hpp +++ b/src/electronic-ids/pcsc/pcsc-common.hpp @@ -23,6 +23,7 @@ #pragma once #include "electronic-id/electronic-id.hpp" +#include "../TLV.hpp" #include "pcsc-cpp/pcsc-cpp-utils.hpp" @@ -31,16 +32,26 @@ namespace electronic_id { -inline pcsc_cpp::byte_vector getCertificate(pcsc_cpp::SmartCard& card, - const pcsc_cpp::CommandApdu& selectCertFileCmd) +inline pcsc_cpp::byte_vector readFile(pcsc_cpp::SmartCard& card, + const pcsc_cpp::CommandApdu& select, + pcsc_cpp::byte_type blockLength = 0x00) { - static const pcsc_cpp::byte_type MAX_LE_VALUE = 0xb5; - - transmitApduWithExpectedResponse(card, selectCertFileCmd); - - const auto length = readDataLengthFromAsn1(card); - - return readBinary(card, length, MAX_LE_VALUE); + auto response = card.transmit(select); + if (!response.isOK()) { + THROW(SmartCardError, "Failed to select EF file"); + } + TLV fci(response.data); + if (fci.tag != 0x62) { + THROW(SmartCardError, "Failed to read EF file length"); + } + TLV size = fci[0x80]; + if (!size) { + size = fci[0x81]; + } + if (size.length != 2) { + THROW(SmartCardError, "Failed to read EF file length"); + } + return pcsc_cpp::readBinary(card, pcsc_cpp::toSW(*size.begin, *(size.begin + 1)), blockLength); } PCSC_CPP_CONSTEXPR_VECTOR inline pcsc_cpp::byte_vector @@ -74,50 +85,45 @@ inline void verifyPin(pcsc_cpp::SmartCard& card, pcsc_cpp::byte_type p2, response = card.transmit(verifyPin); } - if (response.isOK()) { - return; - } - // NOTE: in case card-specific error handling logic is needed, // move response error handling to ElectronicID.getVerifyPinError(). - - using Status = pcsc_cpp::ResponseApdu::Status; - using pcsc_cpp::toSW; - switch (response.toSW()) { + using pcsc_cpp::toSW; + using enum pcsc_cpp::ResponseApdu::Status; + using enum VerifyPinFailed::Status; + case toSW(OK, 0x00): + return; // Fail, retry allowed unless SW2 == 0xc0. - case toSW(Status::VERIFICATION_FAILED, 0xc0): - throw VerifyPinFailed(VerifyPinFailed::Status::PIN_BLOCKED, &response); + case toSW(VERIFICATION_FAILED, 0xc0): + throw VerifyPinFailed(PIN_BLOCKED, &response); // Fail, PIN pad PIN entry errors, retry allowed. - case toSW(Status::VERIFICATION_CANCELLED, 0x00): - throw VerifyPinFailed(VerifyPinFailed::Status::PIN_ENTRY_TIMEOUT, &response); - case toSW(Status::VERIFICATION_CANCELLED, 0x01): - throw VerifyPinFailed(VerifyPinFailed::Status::PIN_ENTRY_CANCEL, &response); - case toSW(Status::VERIFICATION_CANCELLED, 0x03): - throw VerifyPinFailed(VerifyPinFailed::Status::INVALID_PIN_LENGTH, &response); - case toSW(Status::VERIFICATION_CANCELLED, 0x04): - throw VerifyPinFailed(VerifyPinFailed::Status::PIN_ENTRY_DISABLED, &response); + case toSW(VERIFICATION_CANCELLED, 0x00): + throw VerifyPinFailed(PIN_ENTRY_TIMEOUT, &response); + case toSW(VERIFICATION_CANCELLED, 0x01): + throw VerifyPinFailed(PIN_ENTRY_CANCEL, &response); + case toSW(VERIFICATION_CANCELLED, 0x03): + throw VerifyPinFailed(INVALID_PIN_LENGTH, &response); + case toSW(VERIFICATION_CANCELLED, 0x04): + throw VerifyPinFailed(PIN_ENTRY_DISABLED, &response); // Fail, invalid PIN length, retry allowed. - case toSW(Status::WRONG_LENGTH, 0x00): - case toSW(Status::WRONG_PARAMETERS, 0x80): - throw VerifyPinFailed(VerifyPinFailed::Status::INVALID_PIN_LENGTH, &response); + case toSW(WRONG_LENGTH, 0x00): + case toSW(WRONG_PARAMETERS, 0x80): + throw VerifyPinFailed(INVALID_PIN_LENGTH, &response); // Fail, retry not allowed. - case toSW(Status::COMMAND_NOT_ALLOWED, 0x83): - throw VerifyPinFailed(VerifyPinFailed::Status::PIN_BLOCKED, &response); + case toSW(COMMAND_NOT_ALLOWED, 0x83): + throw VerifyPinFailed(PIN_BLOCKED, &response); default: - if (response.sw1 == Status::VERIFICATION_FAILED) { - throw VerifyPinFailed(VerifyPinFailed::Status::RETRY_ALLOWED, &response, - response.sw2 & 0x0f); + if (response.sw1 == VERIFICATION_FAILED) { + throw VerifyPinFailed(RETRY_ALLOWED, &response, response.sw2 & 0x0f); } - break; - } - // There are other known response codes like 0x6985 (old and new are PIN same), 0x6402 - // (re-entered PIN is different) that only apply during PIN change, we treat them as unknown - // errors here. + // There are other known response codes like 0x6985 (old and new are PIN same), 0x6402 + // (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); + // Other unknown errors. + throw VerifyPinFailed(UNKNOWN_ERROR, &response); + } } inline pcsc_cpp::byte_vector internalAuthenticate(pcsc_cpp::SmartCard& card, diff --git a/tests/mock/select-certificate-script-EST-IDEMIA.hpp b/tests/mock/select-certificate-script-EST-IDEMIA.hpp index 44736a8..fd2ca32 100644 --- a/tests/mock/select-certificate-script-EST-IDEMIA.hpp +++ b/tests/mock/select-certificate-script-EST-IDEMIA.hpp @@ -31,13 +31,11 @@ const PcscMock::ApduScript ESTEID_IDEMIA_V1_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI {0x90, 0x00}}, // Select authentication certificate file. - {{0x00, 0xA4, 0x09, 0x0C, 0x04, 0xAD, 0xF1, 0x34, 0x01}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x04, 0x03, 0x90, 0x00}}, + {{0x00, 0xA4, 0x09, 0x04, 0x04, 0xAD, 0xF1, 0x34, 0x01, 0x00}, + {0x62, 0x04, 0x80, 0x02, 0x04, 0x07, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0xc0}, {0x30, 0x82, 0x04, 0x03, 0x30, 0x82, 0x03, 0x65, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x39, 0x69, 0x01, 0x59, 0x73, 0x43, 0x26, 0x6d, 0x5b, 0xc8, 0x57, 0x77, 0x5e, 0xc5, 0xa4, 0xbe, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, 0x30, 0x60, @@ -50,80 +48,76 @@ const PcscMock::ApduScript ESTEID_IDEMIA_V1_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x49, 0x44, 0x32, 0x30, 0x31, 0x38, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x31, 0x30, 0x31, 0x38, 0x30, 0x39, 0x35, 0x30, 0x34, 0x37, 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x31, 0x30, 0x31, 0x37, 0x32, 0x31, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x7f, 0x31, 0x0b, 0x30, 0x09, 0x06, - 0x03, 0x90, 0x00}}, + 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x45, 0x45, 0x31, 0x2a, 0x30, 0x28, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, - {0x55, 0x04, 0x06, 0x13, 0x02, 0x45, 0x45, 0x31, 0x2a, 0x30, 0x28, 0x06, 0x03, 0x55, 0x04, - 0x03, 0x0c, 0x21, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x2c, 0x4a, 0x41, 0x41, 0x4b, - 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x2c, 0x33, 0x38, 0x30, 0x30, 0x31, - 0x30, 0x38, 0x35, 0x37, 0x31, 0x38, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x04, - 0x0c, 0x07, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, - 0x55, 0x04, 0x2a, 0x0c, 0x0d, 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, - 0x4a, 0x41, 0x4e, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x11, 0x50, - 0x4e, 0x4f, 0x45, 0x45, 0x2d, 0x33, 0x38, 0x30, 0x30, 0x31, 0x30, 0x38, 0x35, 0x37, 0x31, - 0x38, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, - 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0x79, 0x93, 0x59, 0x57, 0xce, - 0xf4, 0x9e, 0x23, 0xd3, 0xbf, 0xd6, 0xcd, 0x69, 0x66, 0xf8, 0xe1, 0x11, 0x6f, 0x27, 0x22, - 0xd2, 0x68, 0x1b, 0x41, 0x01, 0x17, 0x19, 0x8b, 0x11, 0x8e, 0x92, 0xee, 0x48, 0xb5, 0xbc, - 0x5d, 0x90, 0x00}}, + {{0x00, 0xb0, 0x00, 0xc0, 0xc0}, + {0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x21, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x2c, + 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x2c, 0x33, + 0x38, 0x30, 0x30, 0x31, 0x30, 0x38, 0x35, 0x37, 0x31, 0x38, 0x31, 0x10, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x04, 0x04, 0x0c, 0x07, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x31, 0x16, + 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x2a, 0x0c, 0x0d, 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, + 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, + 0x05, 0x13, 0x11, 0x50, 0x4e, 0x4f, 0x45, 0x45, 0x2d, 0x33, 0x38, 0x30, 0x30, 0x31, 0x30, + 0x38, 0x35, 0x37, 0x31, 0x38, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0x79, + 0x93, 0x59, 0x57, 0xce, 0xf4, 0x9e, 0x23, 0xd3, 0xbf, 0xd6, 0xcd, 0x69, 0x66, 0xf8, 0xe1, + 0x11, 0x6f, 0x27, 0x22, 0xd2, 0x68, 0x1b, 0x41, 0x01, 0x17, 0x19, 0x8b, 0x11, 0x8e, 0x92, + 0xee, 0x48, 0xb5, 0xbc, 0x5d, 0x90, 0xdd, 0x31, 0x03, 0xc7, 0xa7, 0x4d, 0xce, 0xd2, 0x35, + 0x5e, 0xdc, 0x7d, 0xe9, 0xcb, 0x3c, 0xaf, 0x8c, 0xd8, 0x4f, 0x07, 0x62, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, - {0x90, 0xdd, 0x31, 0x03, 0xc7, 0xa7, 0x4d, 0xce, 0xd2, 0x35, 0x5e, 0xdc, 0x7d, 0xe9, 0xcb, - 0x3c, 0xaf, 0x8c, 0xd8, 0x4f, 0x07, 0x62, 0x42, 0x80, 0xe0, 0xee, 0x4d, 0xdd, 0x89, 0x4b, - 0x91, 0xf6, 0x74, 0xd6, 0x1b, 0x14, 0x04, 0x30, 0xed, 0x45, 0x0e, 0x8e, 0x18, 0xf5, 0xf0, - 0x26, 0x88, 0xf1, 0x96, 0x4f, 0xef, 0x86, 0xb8, 0xe5, 0x68, 0x65, 0x06, 0x37, 0x5f, 0x18, - 0xa3, 0x82, 0x01, 0xc3, 0x30, 0x82, 0x01, 0xbf, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, - 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, - 0x04, 0x03, 0x02, 0x03, 0x88, 0x30, 0x47, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x40, 0x30, - 0x3e, 0x30, 0x32, 0x06, 0x0b, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x83, 0x91, 0x21, 0x01, 0x02, - 0x01, 0x30, 0x23, 0x30, 0x21, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, - 0x16, 0x15, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, - 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x43, 0x50, 0x53, 0x30, 0x08, 0x06, 0x06, 0x04, 0x00, 0x8f, - 0x7a, 0x01, 0x02, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x18, 0x30, 0x16, 0x81, - 0x14, 0x90, 0x00}}, + {{0x00, 0xb0, 0x01, 0x80, 0xc0}, + {0x42, 0x80, 0xe0, 0xee, 0x4d, 0xdd, 0x89, 0x4b, 0x91, 0xf6, 0x74, 0xd6, 0x1b, 0x14, 0x04, + 0x30, 0xed, 0x45, 0x0e, 0x8e, 0x18, 0xf5, 0xf0, 0x26, 0x88, 0xf1, 0x96, 0x4f, 0xef, 0x86, + 0xb8, 0xe5, 0x68, 0x65, 0x06, 0x37, 0x5f, 0x18, 0xa3, 0x82, 0x01, 0xc3, 0x30, 0x82, 0x01, + 0xbf, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x03, 0x88, 0x30, 0x47, + 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x40, 0x30, 0x3e, 0x30, 0x32, 0x06, 0x0b, 0x2b, 0x06, + 0x01, 0x04, 0x01, 0x83, 0x91, 0x21, 0x01, 0x02, 0x01, 0x30, 0x23, 0x30, 0x21, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x15, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x43, 0x50, + 0x53, 0x30, 0x08, 0x06, 0x06, 0x04, 0x00, 0x8f, 0x7a, 0x01, 0x02, 0x30, 0x1f, 0x06, 0x03, + 0x55, 0x1d, 0x11, 0x04, 0x18, 0x30, 0x16, 0x81, 0x14, 0x33, 0x38, 0x30, 0x30, 0x31, 0x30, + 0x38, 0x35, 0x37, 0x31, 0x38, 0x40, 0x65, 0x65, 0x73, 0x74, 0x69, 0x2e, 0x65, 0x65, 0x30, + 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe4, 0x2c, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, - {0x33, 0x38, 0x30, 0x30, 0x31, 0x30, 0x38, 0x35, 0x37, 0x31, 0x38, 0x40, 0x65, 0x65, 0x73, - 0x74, 0x69, 0x2e, 0x65, 0x65, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, - 0x14, 0xe4, 0x2c, 0xbd, 0x34, 0x09, 0x10, 0x15, 0x4c, 0x31, 0x29, 0xa1, 0xc9, 0x95, 0xf9, - 0x6e, 0x26, 0xd8, 0x26, 0xe6, 0xc0, 0x30, 0x61, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, - 0x07, 0x01, 0x03, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, - 0x01, 0x05, 0x30, 0x47, 0x30, 0x45, 0x16, 0x3f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x65, 0x6e, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2d, 0x66, 0x6f, 0x72, 0x2d, 0x75, 0x73, 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x13, 0x02, 0x45, 0x4e, - 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, - 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, - 0x05, 0x90, 0x00}}, + {{0x00, 0xb0, 0x02, 0x40, 0xc0}, + {0xbd, 0x34, 0x09, 0x10, 0x15, 0x4c, 0x31, 0x29, 0xa1, 0xc9, 0x95, 0xf9, 0x6e, 0x26, 0xd8, + 0x26, 0xe6, 0xc0, 0x30, 0x61, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x03, + 0x04, 0x55, 0x30, 0x53, 0x30, 0x51, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x05, 0x30, + 0x47, 0x30, 0x45, 0x16, 0x3f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x6b, + 0x2e, 0x65, 0x65, 0x2f, 0x65, 0x6e, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, + 0x6f, 0x72, 0x2d, 0x75, 0x73, 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x13, 0x02, 0x45, 0x4e, 0x30, 0x20, 0x06, + 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x04, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xc0, + 0x84, 0x99, 0x29, 0xc4, 0x4e, 0x9f, 0x3b, 0x02, 0x34, 0xf6, 0x99, 0xe1, 0x0a, 0x56, 0x00, + 0x08, 0x29, 0x3e, 0x7b, 0x30, 0x73, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, - {0x07, 0x03, 0x04, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, - 0x14, 0xc0, 0x84, 0x99, 0x29, 0xc4, 0x4e, 0x9f, 0x3b, 0x02, 0x34, 0xf6, 0x99, 0xe1, 0x0a, - 0x56, 0x00, 0x08, 0x29, 0x3e, 0x7b, 0x30, 0x73, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, - 0x07, 0x01, 0x01, 0x04, 0x67, 0x30, 0x65, 0x30, 0x2c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, - 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x69, - 0x61, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x65, 0x73, - 0x74, 0x65, 0x69, 0x64, 0x32, 0x30, 0x31, 0x38, 0x30, 0x35, 0x06, 0x08, 0x2b, 0x06, 0x01, - 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x29, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, - 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x54, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x66, 0x5f, - 0x45, 0x53, 0x54, 0x45, 0x49, 0x44, 0x32, 0x30, 0x31, 0x38, 0x2e, 0x64, 0x65, 0x72, 0x2e, - 0x63, 0x72, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, - 0x03, 0x81, 0x8b, 0x00, 0x30, 0x81, 0x87, 0x02, 0x42, 0x01, 0xf5, 0x52, 0xc9, 0x8c, 0x76, - 0xd2, 0x90, 0x00}}, + {{0x00, 0xb0, 0x03, 0x00, 0xc0}, + {0x05, 0x07, 0x01, 0x01, 0x04, 0x67, 0x30, 0x65, 0x30, 0x2c, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x61, + 0x69, 0x61, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x65, + 0x73, 0x74, 0x65, 0x69, 0x64, 0x32, 0x30, 0x31, 0x38, 0x30, 0x35, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x29, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, + 0x63, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x54, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x66, + 0x5f, 0x45, 0x53, 0x54, 0x45, 0x49, 0x44, 0x32, 0x30, 0x31, 0x38, 0x2e, 0x64, 0x65, 0x72, + 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, + 0x04, 0x03, 0x81, 0x8b, 0x00, 0x30, 0x81, 0x87, 0x02, 0x42, 0x01, 0xf5, 0x52, 0xc9, 0x8c, + 0x76, 0xd2, 0xd9, 0xb6, 0x2e, 0x75, 0x16, 0xad, 0x90, 0x47, 0x8c, 0x14, 0x90, 0x0c, 0x29, + 0xb2, 0x78, 0x6c, 0x05, 0x5d, 0x87, 0x42, 0xa5, 0x17, 0x15, 0x80, 0x49, 0xec, 0x45, 0xe7, + 0x2c, 0x29, 0x1a, 0x5e, 0x37, 0x59, 0x2a, 0x41, 0xe9, 0x00, 0x17, 0xcc, 0xd1, 0x01, 0x31, + 0xed, 0x45, 0x21, 0x68, 0x8e, 0x22, 0xe7, 0x78, 0xe2, 0x27, 0xb1, 0x35, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x03, 0x89, 0x7e}, - {0xd9, 0xb6, 0x2e, 0x75, 0x16, 0xad, 0x90, 0x47, 0x8c, 0x14, 0x90, 0x0c, 0x29, 0xb2, 0x78, - 0x6c, 0x05, 0x5d, 0x87, 0x42, 0xa5, 0x17, 0x15, 0x80, 0x49, 0xec, 0x45, 0xe7, 0x2c, 0x29, - 0x1a, 0x5e, 0x37, 0x59, 0x2a, 0x41, 0xe9, 0x00, 0x17, 0xcc, 0xd1, 0x01, 0x31, 0xed, 0x45, - 0x21, 0x68, 0x8e, 0x22, 0xe7, 0x78, 0xe2, 0x27, 0xb1, 0x35, 0x63, 0xb5, 0x8e, 0x00, 0x02, - 0x41, 0x0d, 0x7e, 0x33, 0xeb, 0x5a, 0x67, 0x88, 0x72, 0x5a, 0xa4, 0x8d, 0x5b, 0x90, 0xc2, - 0x22, 0x25, 0x0f, 0xed, 0x8b, 0xb8, 0x5a, 0xf1, 0xf7, 0x49, 0x48, 0xc4, 0xa9, 0x01, 0xdb, - 0x39, 0x0b, 0x21, 0xc8, 0xc8, 0x79, 0x10, 0xcd, 0x69, 0x55, 0xcb, 0xce, 0x9f, 0xf6, 0x60, - 0x3b, 0x12, 0xed, 0xe8, 0x44, 0xef, 0xf5, 0xab, 0xe7, 0x85, 0x53, 0x30, 0xdb, 0x34, 0xdd, - 0xd5, 0xbf, 0x2e, 0xe0, 0x41, 0x64, 0x90, 0x00}}, + {{0x00, 0xb0, 0x03, 0xc0, 0x47}, + {0x63, 0xb5, 0x8e, 0x00, 0x02, 0x41, 0x0d, 0x7e, 0x33, 0xeb, 0x5a, 0x67, 0x88, 0x72, 0x5a, + 0xa4, 0x8d, 0x5b, 0x90, 0xc2, 0x22, 0x25, 0x0f, 0xed, 0x8b, 0xb8, 0x5a, 0xf1, 0xf7, 0x49, + 0x48, 0xc4, 0xa9, 0x01, 0xdb, 0x39, 0x0b, 0x21, 0xc8, 0xc8, 0x79, 0x10, 0xcd, 0x69, 0x55, + 0xcb, 0xce, 0x9f, 0xf6, 0x60, 0x3b, 0x12, 0xed, 0xe8, 0x44, 0xef, 0xf5, 0xab, 0xe7, 0x85, + 0x53, 0x30, 0xdb, 0x34, 0xdd, 0xd5, 0xbf, 0x2e, 0xe0, 0x41, 0x64, 0x90, 0x00}}, // 2. PIN Retry count // Select main AID. @@ -176,13 +170,11 @@ const PcscMock::ApduScript ESTEID_IDEMIA_V1_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x08, 0x00, 0x07, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x01, 0x00}, {0x90, 0x00}}, // Select signing certificate file. - {{0x00, 0xA4, 0x09, 0x0C, 0x04, 0xAD, 0xF2, 0x34, 0x1F}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x03, 0xec, 0x90, 0x00}}, + {{0x00, 0xA4, 0x09, 0x04, 0x04, 0xAD, 0xF2, 0x34, 0x1F, 0x00}, + {0x62, 0x04, 0x80, 0x02, 0x03, 0xF0, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0xc0}, {0x30, 0x82, 0x03, 0xec, 0x30, 0x82, 0x03, 0x4d, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x19, 0x66, 0xaa, 0x25, 0x7f, 0x89, 0x98, 0x71, 0x5b, 0xc8, 0x57, 0x78, 0x6d, 0xad, 0x69, 0x6a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, 0x30, 0x60, @@ -195,78 +187,75 @@ const PcscMock::ApduScript ESTEID_IDEMIA_V1_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x49, 0x44, 0x32, 0x30, 0x31, 0x38, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x31, 0x30, 0x31, 0x38, 0x30, 0x39, 0x35, 0x30, 0x34, 0x37, 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x31, 0x30, 0x31, 0x37, 0x32, 0x31, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x7f, 0x31, 0x0b, 0x30, 0x09, 0x06, - 0x03, 0x90, 0x00}}, + 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x45, 0x45, 0x31, 0x2a, 0x30, 0x28, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, - {0x55, 0x04, 0x06, 0x13, 0x02, 0x45, 0x45, 0x31, 0x2a, 0x30, 0x28, 0x06, 0x03, 0x55, 0x04, - 0x03, 0x0c, 0x21, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x2c, 0x4a, 0x41, 0x41, 0x4b, - 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x2c, 0x33, 0x38, 0x30, 0x30, 0x31, - 0x30, 0x38, 0x35, 0x37, 0x31, 0x38, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x04, - 0x0c, 0x07, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, - 0x55, 0x04, 0x2a, 0x0c, 0x0d, 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, - 0x4a, 0x41, 0x4e, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x11, 0x50, - 0x4e, 0x4f, 0x45, 0x45, 0x2d, 0x33, 0x38, 0x30, 0x30, 0x31, 0x30, 0x38, 0x35, 0x37, 0x31, - 0x38, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, - 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xc5, 0xd2, 0xd7, 0x3b, 0xe1, - 0x98, 0xc4, 0xf5, 0x43, 0x69, 0xe2, 0x25, 0xb0, 0x30, 0x54, 0x3f, 0xce, 0x89, 0x6b, 0x0c, - 0x1f, 0x57, 0x1f, 0xff, 0xc5, 0x25, 0xdc, 0x13, 0xeb, 0x29, 0xd0, 0x05, 0x3f, 0x2f, 0xe8, - 0x73, 0x90, 0x00}}, + {{0x00, 0xb0, 0x00, 0xc0, 0xc0}, + {0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x21, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x2c, + 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x2c, 0x33, + 0x38, 0x30, 0x30, 0x31, 0x30, 0x38, 0x35, 0x37, 0x31, 0x38, 0x31, 0x10, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x04, 0x04, 0x0c, 0x07, 0x4a, 0xc3, 0x95, 0x45, 0x4f, 0x52, 0x47, 0x31, 0x16, + 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x2a, 0x0c, 0x0d, 0x4a, 0x41, 0x41, 0x4b, 0x2d, 0x4b, + 0x52, 0x49, 0x53, 0x54, 0x4a, 0x41, 0x4e, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, + 0x05, 0x13, 0x11, 0x50, 0x4e, 0x4f, 0x45, 0x45, 0x2d, 0x33, 0x38, 0x30, 0x30, 0x31, 0x30, + 0x38, 0x35, 0x37, 0x31, 0x38, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xc5, + 0xd2, 0xd7, 0x3b, 0xe1, 0x98, 0xc4, 0xf5, 0x43, 0x69, 0xe2, 0x25, 0xb0, 0x30, 0x54, 0x3f, + 0xce, 0x89, 0x6b, 0x0c, 0x1f, 0x57, 0x1f, 0xff, 0xc5, 0x25, 0xdc, 0x13, 0xeb, 0x29, 0xd0, + 0x05, 0x3f, 0x2f, 0xe8, 0x73, 0x5d, 0xc5, 0x11, 0x7e, 0xcf, 0xef, 0x0f, 0xf3, 0x57, 0x91, + 0x30, 0x73, 0x5b, 0xf9, 0x57, 0xa1, 0x50, 0xd5, 0x28, 0x6f, 0xfb, 0x39, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, - {0x5d, 0xc5, 0x11, 0x7e, 0xcf, 0xef, 0x0f, 0xf3, 0x57, 0x91, 0x30, 0x73, 0x5b, 0xf9, 0x57, - 0xa1, 0x50, 0xd5, 0x28, 0x6f, 0xfb, 0x39, 0x7a, 0xde, 0xe2, 0x5b, 0x46, 0xca, 0xdb, 0xcc, - 0x90, 0xae, 0x54, 0xdc, 0xc8, 0x77, 0xd0, 0x37, 0x11, 0xcc, 0x7c, 0x12, 0x45, 0xcc, 0x39, - 0x7e, 0xe9, 0x02, 0x26, 0x53, 0x67, 0xd7, 0x28, 0xa2, 0xb8, 0xa2, 0x8a, 0x55, 0xdb, 0xcb, - 0xa3, 0x82, 0x01, 0xab, 0x30, 0x82, 0x01, 0xa7, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, - 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, - 0x04, 0x03, 0x02, 0x06, 0x40, 0x30, 0x48, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x41, 0x30, - 0x3f, 0x30, 0x32, 0x06, 0x0b, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x83, 0x91, 0x21, 0x01, 0x02, - 0x01, 0x30, 0x23, 0x30, 0x21, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, - 0x16, 0x15, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, - 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x43, 0x50, 0x53, 0x30, 0x09, 0x06, 0x07, 0x04, 0x00, 0x8b, - 0xec, 0x40, 0x01, 0x02, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, - 0xe2, 0x90, 0x00}}, + {{0x00, 0xb0, 0x01, 0x80, 0xc0}, + {0x7a, 0xde, 0xe2, 0x5b, 0x46, 0xca, 0xdb, 0xcc, 0x90, 0xae, 0x54, 0xdc, 0xc8, 0x77, 0xd0, + 0x37, 0x11, 0xcc, 0x7c, 0x12, 0x45, 0xcc, 0x39, 0x7e, 0xe9, 0x02, 0x26, 0x53, 0x67, 0xd7, + 0x28, 0xa2, 0xb8, 0xa2, 0x8a, 0x55, 0xdb, 0xcb, 0xa3, 0x82, 0x01, 0xab, 0x30, 0x82, 0x01, + 0xa7, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40, 0x30, 0x48, + 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x41, 0x30, 0x3f, 0x30, 0x32, 0x06, 0x0b, 0x2b, 0x06, + 0x01, 0x04, 0x01, 0x83, 0x91, 0x21, 0x01, 0x02, 0x01, 0x30, 0x23, 0x30, 0x21, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x15, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x43, 0x50, + 0x53, 0x30, 0x09, 0x06, 0x07, 0x04, 0x00, 0x8b, 0xec, 0x40, 0x01, 0x02, 0x30, 0x1d, 0x06, + 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe2, 0x83, 0x9c, 0x1c, 0x90, 0xc2, 0xbd, + 0x96, 0xc8, 0x92, 0xf9, 0x26, 0xdc, 0x02, 0xe6, 0x54, 0x3c, 0x85, 0xb1, 0xd4, 0x30, 0x81, + 0x8a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x03, 0x04, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, - {0x83, 0x9c, 0x1c, 0x90, 0xc2, 0xbd, 0x96, 0xc8, 0x92, 0xf9, 0x26, 0xdc, 0x02, 0xe6, 0x54, - 0x3c, 0x85, 0xb1, 0xd4, 0x30, 0x81, 0x8a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, - 0x01, 0x03, 0x04, 0x7e, 0x30, 0x7c, 0x30, 0x08, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, - 0x01, 0x30, 0x08, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x04, 0x30, 0x13, 0x06, 0x06, - 0x04, 0x00, 0x8e, 0x46, 0x01, 0x06, 0x30, 0x09, 0x06, 0x07, 0x04, 0x00, 0x8e, 0x46, 0x01, - 0x06, 0x01, 0x30, 0x51, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x05, 0x30, 0x47, 0x30, - 0x45, 0x16, 0x3f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x6b, 0x2e, 0x65, - 0x65, 0x2f, 0x65, 0x6e, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, 0x6f, 0x72, - 0x2d, 0x75, 0x73, 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x13, 0x02, 0x45, 0x4e, 0x30, 0x1f, 0x06, 0x03, 0x55, - 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xc0, 0x84, 0x99, 0x29, 0xc4, 0x4e, 0x9f, - 0x3b, 0x90, 0x00}}, + {{0x00, 0xb0, 0x02, 0x40, 0xc0}, + {0x7e, 0x30, 0x7c, 0x30, 0x08, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x01, 0x30, 0x08, + 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x04, 0x30, 0x13, 0x06, 0x06, 0x04, 0x00, 0x8e, + 0x46, 0x01, 0x06, 0x30, 0x09, 0x06, 0x07, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x06, 0x01, 0x30, + 0x51, 0x06, 0x06, 0x04, 0x00, 0x8e, 0x46, 0x01, 0x05, 0x30, 0x47, 0x30, 0x45, 0x16, 0x3f, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x65, + 0x6e, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, 0x6f, 0x72, 0x2d, 0x75, 0x73, + 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x2f, 0x13, 0x02, 0x45, 0x4e, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, + 0x18, 0x30, 0x16, 0x80, 0x14, 0xc0, 0x84, 0x99, 0x29, 0xc4, 0x4e, 0x9f, 0x3b, 0x02, 0x34, + 0xf6, 0x99, 0xe1, 0x0a, 0x56, 0x00, 0x08, 0x29, 0x3e, 0x7b, 0x30, 0x73, 0x06, 0x08, 0x2b, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x67, 0x30, 0x65, 0x30, 0x2c, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, - {0x02, 0x34, 0xf6, 0x99, 0xe1, 0x0a, 0x56, 0x00, 0x08, 0x29, 0x3e, 0x7b, 0x30, 0x73, 0x06, - 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x67, 0x30, 0x65, 0x30, 0x2c, - 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x69, 0x61, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x73, 0x6b, - 0x2e, 0x65, 0x65, 0x2f, 0x65, 0x73, 0x74, 0x65, 0x69, 0x64, 0x32, 0x30, 0x31, 0x38, 0x30, - 0x35, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x29, 0x68, 0x74, - 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x54, 0x65, - 0x73, 0x74, 0x5f, 0x6f, 0x66, 0x5f, 0x45, 0x53, 0x54, 0x45, 0x49, 0x44, 0x32, 0x30, 0x31, - 0x38, 0x2e, 0x64, 0x65, 0x72, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, 0x03, 0x81, 0x8c, 0x00, 0x30, 0x81, 0x88, 0x02, 0x42, - 0x01, 0x60, 0xa0, 0x10, 0x22, 0x7e, 0x3a, 0xb4, 0x3b, 0x9e, 0x8e, 0xf2, 0x2b, 0xf1, 0x01, - 0x62, 0x3a, 0xcf, 0x20, 0x70, 0x43, 0xc5, 0x69, 0x6a, 0x0d, 0x6a, 0x6a, 0x7b, 0xa1, 0xed, - 0x07, 0x90, 0x00}}, + {{0x00, 0xb0, 0x03, 0x00, 0xc0}, + {0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x69, 0x61, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x73, + 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x65, 0x73, 0x74, 0x65, 0x69, 0x64, 0x32, 0x30, 0x31, 0x38, + 0x30, 0x35, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x29, 0x68, + 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x2e, 0x73, 0x6b, 0x2e, 0x65, 0x65, 0x2f, 0x54, + 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x66, 0x5f, 0x45, 0x53, 0x54, 0x45, 0x49, 0x44, 0x32, 0x30, + 0x31, 0x38, 0x2e, 0x64, 0x65, 0x72, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, 0x03, 0x81, 0x8c, 0x00, 0x30, 0x81, 0x88, 0x02, + 0x42, 0x01, 0x60, 0xa0, 0x10, 0x22, 0x7e, 0x3a, 0xb4, 0x3b, 0x9e, 0x8e, 0xf2, 0x2b, 0xf1, + 0x01, 0x62, 0x3a, 0xcf, 0x20, 0x70, 0x43, 0xc5, 0x69, 0x6a, 0x0d, 0x6a, 0x6a, 0x7b, 0xa1, + 0xed, 0x07, 0x31, 0xb2, 0x96, 0x9c, 0xe2, 0x66, 0x6c, 0x85, 0xcf, 0xa6, 0x69, 0x61, 0xb6, + 0x65, 0xcc, 0x4b, 0x48, 0xd4, 0x8e, 0x27, 0x56, 0xbc, 0x93, 0x13, 0x8a, 0x7b, 0xed, 0xcf, + 0x09, 0xb8, 0xad, 0xb5, 0xc7, 0xf0, 0x3e, 0x02, 0x42, 0x00, 0xd7, 0x3d, 0x75, 0x39, 0xe0, + 0x59, 0x37, 0x3f, 0xf0, 0xf2, 0xcb, 0x5c, 0xce, 0xb6, 0x5b, 0x71, 0x5e, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x03, 0x89, 0x67}, - {0x31, 0xb2, 0x96, 0x9c, 0xe2, 0x66, 0x6c, 0x85, 0xcf, 0xa6, 0x69, 0x61, 0xb6, 0x65, 0xcc, - 0x4b, 0x48, 0xd4, 0x8e, 0x27, 0x56, 0xbc, 0x93, 0x13, 0x8a, 0x7b, 0xed, 0xcf, 0x09, 0xb8, - 0xad, 0xb5, 0xc7, 0xf0, 0x3e, 0x02, 0x42, 0x00, 0xd7, 0x3d, 0x75, 0x39, 0xe0, 0x59, 0x37, - 0x3f, 0xf0, 0xf2, 0xcb, 0x5c, 0xce, 0xb6, 0x5b, 0x71, 0x5e, 0x46, 0x78, 0x50, 0xa8, 0x5b, - 0x70, 0xfb, 0x96, 0xac, 0x90, 0x82, 0x84, 0x07, 0x0e, 0x5e, 0xea, 0x66, 0x8e, 0xaf, 0x13, - 0xf6, 0x99, 0xcc, 0xfd, 0xca, 0xf9, 0xdf, 0x83, 0x48, 0xd2, 0xe7, 0x68, 0x10, 0xd2, 0xbf, - 0x74, 0xe4, 0x07, 0xf4, 0x6f, 0x0a, 0x7a, 0xbd, 0x5c, 0x4e, 0x6f, 0x15, 0x54, 0x90, 0x00}}, + {{0x00, 0xb0, 0x03, 0xc0, 0x30}, + {0x46, 0x78, 0x50, 0xa8, 0x5b, 0x70, 0xfb, 0x96, 0xac, 0x90, 0x82, 0x84, 0x07, + 0x0e, 0x5e, 0xea, 0x66, 0x8e, 0xaf, 0x13, 0xf6, 0x99, 0xcc, 0xfd, 0xca, 0xf9, + 0xdf, 0x83, 0x48, 0xd2, 0xe7, 0x68, 0x10, 0xd2, 0xbf, 0x74, 0xe4, 0x07, 0xf4, + 0x6f, 0x0a, 0x7a, 0xbd, 0x5c, 0x4e, 0x6f, 0x15, 0x54, 0x90, 0x00}}, // 2. PIN Retry count // Select QSCD AID. diff --git a/tests/mock/select-certificate-script-FIN-V3.hpp b/tests/mock/select-certificate-script-FIN-V3.hpp index fc88d5b..c88a02f 100644 --- a/tests/mock/select-certificate-script-FIN-V3.hpp +++ b/tests/mock/select-certificate-script-FIN-V3.hpp @@ -30,13 +30,11 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x31, 0x35}, {0x90, 0x00}}, // Select authentication certificate file. - {{0x00, 0xA4, 0x08, 0x0C, 0x02, 0x43, 0x31}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x06, 0x7c, 0x90, 0x00}}, + {{0x00, 0xA4, 0x08, 0x04, 0x02, 0x43, 0x31, 0x00}, + {0x62, 0x04, 0x81, 0x02, 0x06, 0x80, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x06, 0x7c, 0x30, 0x82, 0x04, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x06, 0x05, 0x40, 0x44, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x74, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, @@ -52,7 +50,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x39, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x35, 0x39, 0x5a, 0x30, 0x75, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x49, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x09, 0x39, 0x39, 0x39, 0x30, 0x30, 0x33, 0x33, 0x35, 0x45, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, @@ -67,7 +65,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x88, 0x1a, 0x36, 0xb8, 0xac, 0xe3, 0xb6, 0x74, 0xce, 0x7a, 0xde, 0xd9, 0xff, 0x48, 0x87, 0x7a, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x46, 0x60, 0x23, 0x5c, 0xcb, 0x9c, 0xb9, 0x30, 0x25, 0xce, 0x4f, 0x26, 0x71, 0xc3, 0x3b, 0x43, 0x9a, 0xf3, 0x33, 0xb0, 0xb9, 0xfb, 0x39, 0x30, 0xb8, 0x59, 0x67, 0xc9, 0x15, 0x13, 0x5e, 0xb4, 0xa2, 0x32, 0xe2, 0x50, 0xf8, 0x34, 0xd2, 0x47, 0x8a, 0x5b, 0x0a, 0x2a, 0xf6, @@ -82,7 +80,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0xe1, 0xe5, 0xcf, 0x14, 0xe8, 0x7e, 0x77, 0x4a, 0xe4, 0x12, 0x94, 0x69, 0x21, 0x9e, 0xbc, 0x1d, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0x59, 0x85, 0xf5, 0x14, 0xb1, 0x19, 0xa4, 0x6a, 0x1c, 0x66, 0x2c, 0x2f, 0xed, 0x02, 0x6b, 0xea, 0xe4, 0xd4, 0xc5, 0x65, 0xc5, 0xf9, 0xac, 0x3f, 0x55, 0x64, 0xf6, 0x10, 0x17, 0x67, 0xa9, 0x69, 0xc3, 0x04, 0xb2, 0x58, 0x62, 0xca, 0x35, 0xb4, 0x31, 0x9a, 0x7f, 0xcc, 0x5b, @@ -97,7 +95,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x05, 0x63, 0x0a, 0x20, 0x01, 0x30, 0x81, 0xb1, 0x30, 0x27, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x05, 0x07, 0x02, 0x01, 0x16, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, 0x39, 0x39, 0x2f, 0x30, 0x81, 0x85, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, @@ -112,7 +110,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x70, 0x73, 0x39, 0x39, 0x30, 0x33, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x2c, 0x30, 0x2a, 0x81, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0x28, 0x47, 0x33, 0x74, 0x65, 0x73, 0x74, 0x69, 0x4c, 0x69, 0x69, 0x73, 0x61, 0x30, 0x31, 0x36, 0x2e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x4d, 0x45, 0x4e, 0x2d, 0x6e, 0x69, 0x73, 0x79, 0x6a, 0x75, 0x40, 0x74, 0x65, 0x73, 0x74, 0x69, 0x2e, 0x66, 0x69, 0x30, 0x0f, 0x06, 0x03, @@ -127,7 +125,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x66, 0x69, 0x2f, 0x63, 0x61, 0x2f, 0x76, 0x72, 0x6b, 0x74, 0x70, 0x33, 0x2e, 0x63, 0x72, 0x74, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0x3e, 0xb5}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0x30, 0x2c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x76, 0x72, 0x6b, 0x74, 0x70, @@ -142,7 +140,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x70, 0x84, 0x98, 0x50, 0x74, 0x2e, 0x0c, 0x3a, 0xb6, 0x79, 0xb1, 0x24, 0xea, 0xc5, 0x2d, 0x6a, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0xf3, 0xb5}, + {{0x00, 0xb0, 0x04, 0xf3, 0x00}, {0x0f, 0xb3, 0xcd, 0x0d, 0x11, 0x56, 0xf6, 0x6d, 0x67, 0x78, 0xd0, 0xac, 0x33, 0x22, 0x12, 0xb8, 0x5c, 0xcd, 0x61, 0xdf, 0x9d, 0xea, 0xb1, 0x35, 0x97, 0xf5, 0x52, 0x07, 0xab, 0xfb, 0x35, 0x06, 0x41, 0xb3, 0x3c, 0x03, 0x0f, 0xf6, 0x45, 0x87, 0xdf, 0x07, 0x70, 0x65, 0x26, @@ -157,7 +155,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0x2a, 0xa5, 0x44, 0xf1, 0x4c, 0x08, 0x59, 0x9e, 0x84, 0xc8, 0x2d, 0x2d, 0x59, 0x2e, 0x1d, 0x95, 0x90, 0x00}}, - {{0x00, 0xb0, 0x05, 0xa8, 0xb5}, + {{0x00, 0xb0, 0x05, 0xa8, 0x00}, {0x74, 0x83, 0xe8, 0x58, 0x21, 0x04, 0xb2, 0x16, 0x33, 0xd9, 0xde, 0x9c, 0xaf, 0xf3, 0xc9, 0xfd, 0xd5, 0x07, 0xd9, 0xb4, 0x62, 0x57, 0x53, 0x2d, 0x52, 0x6a, 0xa8, 0x95, 0xa0, 0xec, 0xbe, 0xe4, 0xcb, 0xe0, 0x38, 0xde, 0x4e, 0x9c, 0xd0, 0x15, 0xca, 0x34, 0xf2, 0x24, 0x6a, @@ -173,7 +171,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE = 0xf3, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x06, 0x5d, 0x23}, + {{0x00, 0xb0, 0x06, 0x5d, 0x00}, {0x40, 0x77, 0xb4, 0x91, 0x19, 0xca, 0x66, 0x6f, 0xa9, 0x22, 0xa7, 0xa7, 0xba, 0x53, 0x5a, 0x07, 0x73, 0xde, 0x67, 0x1f, 0xf0, 0xe1, 0xbb, 0xcf, 0x9d, 0xb4, 0x51, 0x9e, 0xc3, 0x55, 0xac, 0x9c, 0x19, 0x99, 0xb1, 0x90, 0x00}}, @@ -227,13 +225,11 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x31, 0x35}, {0x90, 0x00}}, // Select signing certificate file. - {{0x00, 0xA4, 0x08, 0x0C, 0x04, 0x50, 0x16, 0x43, 0x35}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x05, 0xcb, 0x90, 0x00}}, + {{0x00, 0xA4, 0x08, 0x04, 0x04, 0x50, 0x16, 0x43, 0x35, 0x00}, + {0x62, 0x04, 0x81, 0x02, 0x05, 0xCF, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x05, 0xcb, 0x30, 0x82, 0x03, 0xb3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x06, 0x05, 0x40, 0x46, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x74, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, @@ -249,7 +245,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x39, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x35, 0x39, 0x5a, 0x30, 0x75, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x49, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x09, 0x39, 0x39, 0x39, 0x30, 0x30, 0x33, 0x33, 0x35, 0x45, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, @@ -264,7 +260,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0xf9, 0xb9, 0xd0, 0x10, 0xcd, 0x3e, 0x8b, 0xc2, 0x0d, 0xe0, 0xaf, 0xd0, 0xec, 0x3b, 0xcb, 0x52, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x29, 0x96, 0x71, 0xa2, 0x90, 0xb5, 0x39, 0x12, 0xa6, 0xe4, 0x62, 0x10, 0x5b, 0xa4, 0xe3, 0x61, 0x4a, 0x31, 0xff, 0xfd, 0xc7, 0x2d, 0x2f, 0x82, 0x8e, 0x9b, 0x77, 0x10, 0x8e, 0x39, 0x10, 0xf1, 0xa3, 0x82, 0x02, 0x2d, 0x30, 0x82, 0x02, 0x29, 0x30, 0x1f, 0x06, 0x03, 0x55, @@ -279,7 +275,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, 0x39, 0x39, 0x2f, 0x30, 0x81, 0x85, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, 0x30, 0x79, 0x1a, 0x77, 0x56, 0x61, 0x72, 0x6d, 0x65, 0x6e, 0x6e, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x74, 0x69, 0x69, 0x6b, 0x6b, @@ -294,7 +290,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x74, 0x69, 0x4c, 0x69, 0x69, 0x73, 0x61, 0x30, 0x31, 0x36, 0x2e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x4d, 0x45, 0x4e, 0x2d, 0x6e, 0x69, 0x73, 0x79, 0x6a, 0x75, 0x40, 0x74, 0x65, 0x73, 0x74, 0x69, 0x2e, 0x66, 0x69, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0x00, 0x30, 0x37, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x30, @@ -309,7 +305,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0x63, 0x73, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x76, 0x72, 0x6b, 0x74, 0x70, 0x33, 0x30, 0x18, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x03, 0x04, 0x0c, 0x30, 0x0a, 0x30, 0x08, 0x06, 0x06, 0x04, @@ -324,7 +320,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x43, 0x53, 0x5c, 0x31, 0x25, 0x41, 0x2f, 0x17, 0x4e, 0xad, 0x9e, 0x85, 0x2b, 0x00, 0x12, 0x7b, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0x3e, 0xb5}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0x21, 0x1f, 0x01, 0xd6, 0xee, 0xe9, 0x86, 0x00, 0x08, 0xb7, 0xc1, 0x3e, 0xbd, 0x5b, 0xc6, 0x9e, 0x0f, 0xcb, 0x00, 0x69, 0x4e, 0x6e, 0xd9, 0x58, 0xaa, 0x68, 0x71, 0x7e, 0x7c, 0x42, 0xad, 0xf2, 0x43, 0x56, 0x01, 0x0c, 0xf6, 0x5e, 0x26, 0xb7, 0x4f, 0x7a, 0x6c, 0xc6, 0xa1, @@ -339,7 +335,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0xf8, 0x09, 0x0c, 0x9c, 0x0b, 0x6a, 0x39, 0x0d, 0x8d, 0xdf, 0xf3, 0xd6, 0xd0, 0x60, 0x64, 0xce, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0xf3, 0xb5}, + {{0x00, 0xb0, 0x04, 0xf3, 0x00}, {0x70, 0x71, 0x7d, 0xea, 0x35, 0xd3, 0xd1, 0x6f, 0x0a, 0xd5, 0xb9, 0x5c, 0x01, 0x22, 0xf4, 0xc1, 0xf6, 0x89, 0x44, 0xe9, 0x1a, 0x08, 0x5d, 0x32, 0x07, 0x19, 0x3c, 0xc4, 0x7f, 0x65, 0xe4, 0x7a, 0xdd, 0x69, 0x47, 0xd4, 0x43, 0x10, 0xee, 0xf5, 0x6d, 0xdc, 0x89, 0x40, 0x18, @@ -355,7 +351,7 @@ const PcscMock::ApduScript FINEID_V3_SELECT_SIGN_CERTIFICATE_AND_SIGNING = { 0x75, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x05, 0xa8, 0x27}, + {{0x00, 0xb0, 0x05, 0xa8, 0x00}, {0x37, 0xa8, 0x3b, 0xe9, 0xc2, 0x19, 0x75, 0xa0, 0x97, 0x22, 0xf0, 0x6c, 0x9c, 0x24, 0x6e, 0xee, 0x15, 0x67, 0x72, 0x01, 0x61, 0x0a, 0xf7, 0x73, 0x98, 0x6c, 0xe8, 0xea, 0x9c, 0x11, 0xfa, 0xdb, 0x4d, 0x00, 0x34, 0x64, 0x2a, 0xd9, 0xa3, 0x90, 0x00}}, diff --git a/tests/mock/select-certificate-script-FIN-V4.hpp b/tests/mock/select-certificate-script-FIN-V4.hpp index b1cd4ec..efaa0d8 100644 --- a/tests/mock/select-certificate-script-FIN-V4.hpp +++ b/tests/mock/select-certificate-script-FIN-V4.hpp @@ -30,13 +30,11 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0x31, 0x35}, {0x90, 0x00}}, // Select authentication certificate file. - {{0x00, 0xA4, 0x08, 0x0C, 0x02, 0x43, 0x31}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x04, 0x3b, 0x90, 0x00}}, + {{0x00, 0xA4, 0x08, 0x04, 0x02, 0x43, 0x31, 0x00}, + {0x62, 0x04, 0x81, 0x02, 0x04, 0x3f, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x04, 0x3b, 0x30, 0x82, 0x03, 0xbf, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x06, 0x1c, 0x09, 0x65, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, 0x05, 0x00, 0x30, 0x78, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, @@ -52,7 +50,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0x32, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x31, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x79, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x49, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x09, 0x39, 0x39, 0x39, 0x30, 0x32, 0x30, 0x33, 0x38, 0x43, 0x31, 0x0f, 0x30, 0x0d, @@ -67,7 +65,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0xef, 0x2f, 0x61, 0x6e, 0x65, 0xa9, 0xfb, 0x44, 0x92, 0x8e, 0x43, 0x83, 0x65, 0xb5, 0xfa, 0x69, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x3f, 0x28, 0x4a, 0x6c, 0xc4, 0xb5, 0x26, 0x8e, 0x1a, 0xec, 0x2c, 0x52, 0x63, 0x97, 0x55, 0x35, 0x82, 0xed, 0x2f, 0x66, 0x12, 0xb7, 0x27, 0xfa, 0x29, 0xc5, 0x7a, 0xf4, 0x4a, 0x55, 0x6e, 0x31, 0x12, 0xd9, 0xc9, 0x5a, 0x76, 0x8a, 0x30, 0xe3, 0x0f, 0xc2, 0x9e, 0xa9, 0x66, @@ -82,7 +80,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x81, 0xbf, 0x06, 0x0a, 0x2a, 0x81, 0x76, 0x84, 0x05, 0x63, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0x0a, 0x82, 0x60, 0x01, 0x30, 0x81, 0xb0, 0x30, 0x27, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, @@ -97,7 +95,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x39, 0x39, 0x30, 0x30, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x29, 0x30, 0x27, 0x81, 0x25, 0x53, 0x31, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x30, 0x38, 0x37, 0x2e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x4d, 0x45, 0x4e, 0x2d, 0x41, 0x75, 0x76, 0x69, 0x6e, 0x65, 0x6e, 0x40, 0x74, @@ -112,7 +110,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0x61, 0x2f, 0x64, 0x76, 0x76, 0x74, 0x70, 0x35, 0x65, 0x63, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x2e, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x66, @@ -128,7 +126,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_AUTH_CERTIFICATE_AND_AUTHENTICATE { 0xff, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x04, 0x3e, 0x01}, {0x7d, 0x90, 0x00}}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0x7d, 0x90, 0x00}}, // 2. PIN Retry count // Get retry count @@ -169,13 +167,11 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x31, 0x35}, {0x90, 0x00}}, // Select signing certificate file. - {{0x00, 0xA4, 0x08, 0x0C, 0x04, 0x50, 0x16, 0x43, 0x32}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x04, 0x74, 0x90, 0x00}}, + {{0x00, 0xA4, 0x08, 0x04, 0x04, 0x50, 0x16, 0x43, 0x32, 0x00}, + {0x62, 0x04, 0x81, 0x02, 0x04, 0x78, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x04, 0x74, 0x30, 0x82, 0x03, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x06, 0x1c, 0x09, 0x66, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, 0x05, 0x00, 0x30, 0x78, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, @@ -191,7 +187,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x32, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x31, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x79, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x49, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x09, 0x39, 0x39, 0x39, 0x30, 0x32, 0x30, 0x33, 0x38, 0x43, 0x31, 0x0f, 0x30, 0x0d, @@ -206,7 +202,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0xf7, 0x02, 0x39, 0xcc, 0x87, 0xb5, 0x6b, 0x47, 0xb9, 0x34, 0xf3, 0x56, 0xc5, 0x86, 0x45, 0x2c, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x64, 0x94, 0xe1, 0x1f, 0x6c, 0xb0, 0x20, 0xc7, 0x8e, 0x57, 0x33, 0xfc, 0xb0, 0xca, 0xb1, 0x92, 0xde, 0x77, 0x6c, 0xf5, 0x1e, 0x43, 0xae, 0x74, 0x56, 0xd1, 0x61, 0xc7, 0xb1, 0x50, 0xa1, 0x91, 0x27, 0x74, 0x2e, 0xb9, 0x78, 0xd8, 0x97, 0x57, 0x9a, 0x45, 0x9b, 0x8c, 0x33, @@ -221,7 +217,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x81, 0xbf, 0x06, 0x0a, 0x2a, 0x81, 0x76, 0x84, 0x05, 0x63, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0x0a, 0x82, 0x60, 0x01, 0x30, 0x81, 0xb0, 0x30, 0x27, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, @@ -236,7 +232,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x77, 0x77, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x70, 0x73, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x39, 0x39, 0x30, 0x30, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x29, 0x30, 0x27, 0x81, 0x25, 0x53, 0x31, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x30, 0x38, 0x37, 0x2e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x4d, 0x45, 0x4e, 0x2d, 0x41, 0x75, 0x76, 0x69, 0x6e, 0x65, 0x6e, 0x40, 0x74, @@ -251,7 +247,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x66, 0x69, 0x2f, 0x63, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0x61, 0x2f, 0x64, 0x76, 0x76, 0x74, 0x70, 0x35, 0x65, 0x63, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x2e, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x66, @@ -267,7 +263,7 @@ const PcscMock::ApduScript FINEID_V4_SELECT_SIGN_CERTIFICATE_AND_SIGNING { 0x0f, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x04, 0x3e, 0x3a}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0xba, 0x9f, 0x4a, 0x7d, 0xb5, 0xf5, 0x40, 0x13, 0x02, 0x30, 0x14, 0x16, 0xe5, 0x2d, 0x53, 0x54, 0xf5, 0x30, 0x53, 0xdc, 0x55, 0xee, 0xec, 0x2c, 0xa2, 0x42, 0x45, 0xff, 0x71, 0xae, 0xdb, 0xc8, 0x3a, 0xe1, 0xc1, 0xd6, 0x66, 0x58, 0xf1, 0x67, 0xcb, 0x07, 0x4b, 0x25, 0xbf, diff --git a/tests/mock/select-certificate-script-LAT-V2.hpp b/tests/mock/select-certificate-script-LAT-V2.hpp index cebb39b..fcd9132 100644 --- a/tests/mock/select-certificate-script-LAT-V2.hpp +++ b/tests/mock/select-certificate-script-LAT-V2.hpp @@ -39,24 +39,22 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x50, 0x31, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x10, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x10}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0xA4, 0x06, 0x30, 0x04, 0x04, 0x02, 0x70, 0x05, 0xA0, 0x06, 0x30, 0x04, 0x04, 0x02, 0x70, 0x01, 0x90, 0x00}}, {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x70, 0x05, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x0C, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x0C}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0x30, 0x0A, 0xA1, 0x08, 0x30, 0x06, 0x30, 0x04, 0x04, 0x02, 0x34, 0x01, 0x90, 0x00}}, // Select authentication certificate file. - {{0x00, 0xA4, 0x02, 0x0C, 0x02, 0x34, 0x01}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x06, 0xc1, 0x90, 0x00}}, + {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x34, 0x01, 0x00}, + {0x62, 0x04, 0x80, 0x02, 0x06, 0xc5, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x06, 0xc1, 0x30, 0x82, 0x04, 0xa9, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x59, 0x79, 0xd9, 0x1f, 0xb8, 0x79, 0x21, 0x05, 0x5d, 0x5e, 0x8d, 0x2e, 0x6d, 0x8b, 0x82, 0x16, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, @@ -72,7 +70,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x30, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x38, 0x32, 0x32, 0x31, 0x32, 0x34, 0x30, 0x31, 0x34, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x38, 0x32, 0x32, 0x31, 0x32, 0x33, 0x32, 0x31, 0x37, 0x5a, 0x30, 0x68, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4c, @@ -87,7 +85,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x02, 0x82, 0x01, 0x01, 0x00, 0xd0, 0x37, 0xb8, 0xdf, 0x99, 0x3e, 0xbf, 0x7e, 0x51, 0xeb, 0x9d, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x31, 0x8d, 0x07, 0x8c, 0x89, 0x18, 0xa8, 0x76, 0xf3, 0x20, 0x9d, 0xdf, 0x89, 0x9a, 0x20, 0xbc, 0x57, 0x2f, 0x88, 0x0c, 0xa6, 0xd7, 0xbc, 0xbd, 0x36, 0xb1, 0x52, 0x4a, 0xd6, 0x25, 0x0d, 0xd0, 0x44, 0x16, 0x17, 0x12, 0x57, 0xb7, 0x06, 0xbb, 0x4e, 0x89, 0xa8, 0x4a, 0xfd, @@ -102,7 +100,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x67, 0x4c, 0x48, 0xea, 0x70, 0xc1, 0xa5, 0x95, 0x0d, 0x4b, 0x37, 0x3c, 0x8f, 0xc3, 0x5f, 0x2a, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0xae, 0x09, 0x45, 0x12, 0x35, 0x6a, 0x70, 0x5e, 0xad, 0x1c, 0x06, 0xe1, 0x71, 0x22, 0x10, 0x89, 0x73, 0xec, 0xda, 0x3b, 0xb2, 0xb2, 0xb0, 0x52, 0x3a, 0x64, 0x16, 0x7a, 0xce, 0xba, 0xa8, 0x48, 0x2d, 0xff, 0xf4, 0xf3, 0x09, 0xd3, 0xd8, 0x37, 0xd2, 0x85, 0xa8, 0xee, 0xf8, @@ -117,7 +115,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0xae, 0xd7, 0xcb, 0xfc, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x14, 0x8f, 0x68, 0xce, 0xbc, 0xe2, 0xc7, 0x40, 0x21, 0x53, 0x09, 0x42, 0xbb, 0xe5, 0x9e, 0x1d, 0x8c, 0x4b, 0xcd, 0xbd, 0x38, 0x30, 0x81, 0xfb, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x81, 0xf3, 0x30, 0x81, 0xf0, 0x30, 0x3b, 0x06, 0x06, 0x04, 0x00, 0x8f, 0x7a, 0x01, 0x02, @@ -132,7 +130,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x30, 0x6c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, 0x30, 0x60, 0x0c, 0x5e, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0xc5, 0xa0, 0x69, 0x73, 0x20, 0x73, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0xc4, 0x81, 0x74, 0x73, 0x20, 0x69, 0x72, 0x20, 0x69, 0x65, 0x6b, 0xc4, 0xbc, 0x61, 0x75, 0x74, 0x73, 0x20, 0x4c, 0x61, 0x74, 0x76, 0x69, 0x6a, 0x61, 0x73, 0x20, 0x52, 0x65, 0x70, 0x75, 0x62, @@ -147,7 +145,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x5f, 0x49, 0x43, 0x41, 0x5f, 0x32, 0x30, 0x31, 0x37, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x29, 0x06, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0x3e, 0xb5}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x1d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x70, 0x72, 0x65, 0x70, 0x2e, 0x65, 0x70, 0x61, 0x72, 0x61, 0x6b, 0x73, 0x74, 0x73, 0x2e, 0x6c, 0x76, 0x30, 0x49, 0x06, 0x03, 0x55, @@ -162,7 +160,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x49, 0x63, 0x61, 0x1e, 0x55, 0x39, 0x00, 0x6d, 0x21, 0xc5, 0xe0, 0x89, 0xbd, 0xe5, 0x74, 0x18, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0xf3, 0xb5}, + {{0x00, 0xb0, 0x04, 0xf3, 0x00}, {0x87, 0x91, 0x8f, 0xf8, 0xba, 0xc5, 0xdc, 0xf4, 0x6d, 0x16, 0xb9, 0x54, 0x6a, 0xea, 0x00, 0xa4, 0xe0, 0x94, 0x1b, 0x35, 0xd8, 0x7f, 0x9d, 0x8d, 0x73, 0xba, 0x44, 0x65, 0xc9, 0x8a, 0x0d, 0x02, 0x7a, 0xb3, 0x59, 0x68, 0xc4, 0xd2, 0x53, 0x87, 0xdd, 0x12, 0xc8, 0xea, 0x62, @@ -177,7 +175,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x58, 0xc2, 0x2c, 0x03, 0x70, 0x62, 0x09, 0x99, 0xfe, 0x67, 0xfe, 0x51, 0xcb, 0xce, 0xd7, 0x26, 0x90, 0x00}}, - {{0x00, 0xb0, 0x05, 0xa8, 0xb5}, + {{0x00, 0xb0, 0x05, 0xa8, 0x00}, {0xc0, 0x7c, 0xe1, 0x96, 0xd0, 0x4d, 0x36, 0x54, 0x10, 0x4a, 0x3f, 0x25, 0xd6, 0x85, 0xe7, 0xdf, 0xa5, 0x33, 0x18, 0xc3, 0x77, 0xb0, 0xb0, 0xda, 0x92, 0xba, 0xe6, 0x36, 0x22, 0xee, 0x74, 0x85, 0x87, 0x74, 0xe3, 0x38, 0xa3, 0x38, 0x1a, 0xbd, 0x6d, 0xde, 0xec, 0x85, 0xf9, @@ -193,7 +191,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI 0x26, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x06, 0x5d, 0x68}, + {{0x00, 0xb0, 0x06, 0x5d, 0x00}, {0x7c, 0xdf, 0x98, 0xfb, 0x5d, 0x71, 0x04, 0x4c, 0xdf, 0xc8, 0x8a, 0x03, 0x94, 0xc3, 0x1b, 0xdb, 0xe3, 0x0f, 0x2a, 0x6d, 0xa3, 0x9b, 0xcd, 0xa7, 0x09, 0x94, 0x09, 0x4c, 0x29, 0xd8, 0xcb, 0x07, 0x47, 0x2a, 0x46, 0x9d, 0xcc, 0xdd, 0x1b, 0xb8, 0xd6, 0x19, @@ -226,7 +224,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_AUTH_CERTIFICATE_AND_AUTHENTI {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x70, 0x01, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x0A, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x0A}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0x30, 0x08, 0x30, 0x00, 0x30, 0x04, 0x02, 0x02, 0x00, 0x81, 0x90, 0x00}}, // Select AWP AID. @@ -281,24 +279,22 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x50, 0x31, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x10, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x10}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0xA4, 0x06, 0x30, 0x04, 0x04, 0x02, 0x70, 0x05, 0xA0, 0x06, 0x30, 0x04, 0x04, 0x02, 0x70, 0x01, 0x90, 0x00}}, {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x70, 0x05, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x0C, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x0C}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0x30, 0x0A, 0xA1, 0x08, 0x30, 0x06, 0x30, 0x04, 0x04, 0x02, 0x34, 0x1F, 0x90, 0x00}}, // Select signing certificate file. - {{0x00, 0xA4, 0x02, 0x0C, 0x02, 0x34, 0x1F}, {0x90, 0x00}}, - - // Read data length. - {{0x00, 0xb0, 0x00, 0x00, 0x04}, {0x30, 0x82, 0x08, 0x48, 0x90, 0x00}}, + {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x34, 0x1F, 0x00}, + {0x62, 0x04, 0x80, 0x02, 0x08, 0x4c, 0x90, 0x00}}, // Read first block. - {{0x00, 0xb0, 0x00, 0x00, 0xb5}, + {{0x00, 0xb0, 0x00, 0x00, 0x00}, {0x30, 0x82, 0x08, 0x48, 0x30, 0x82, 0x06, 0x30, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x61, 0x93, 0x6c, 0xae, 0x52, 0xe7, 0x84, 0x96, 0x5d, 0x5e, 0x8d, 0x2e, 0x68, 0x4d, 0xbc, 0x7a, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, @@ -314,7 +310,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x30, 0x90, 0x00}}, // Keep reading blocks until done. - {{0x00, 0xb0, 0x00, 0xb5, 0xb5}, + {{0x00, 0xb0, 0x00, 0xb5, 0x00}, {0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x38, 0x32, 0x32, 0x31, 0x32, 0x34, 0x30, 0x31, 0x34, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x38, 0x32, 0x32, 0x31, 0x32, 0x33, 0x32, 0x31, 0x37, 0x5a, 0x30, 0x68, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4c, @@ -329,7 +325,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x02, 0x82, 0x01, 0x01, 0x00, 0xda, 0x96, 0xfc, 0x26, 0x03, 0xd1, 0x63, 0xfc, 0x96, 0xac, 0x79, 0x90, 0x00}}, - {{0x00, 0xb0, 0x01, 0x6a, 0xb5}, + {{0x00, 0xb0, 0x01, 0x6a, 0x00}, {0x52, 0x6a, 0xbc, 0x9f, 0x54, 0xf7, 0x85, 0xac, 0x8a, 0xcf, 0xeb, 0xb5, 0x3e, 0xd3, 0x26, 0x6f, 0x98, 0x61, 0x92, 0x6a, 0x3b, 0x42, 0x00, 0x74, 0x91, 0x69, 0xc9, 0xdc, 0xe0, 0x82, 0xe9, 0x68, 0x8e, 0x47, 0x02, 0xb3, 0x82, 0x3e, 0x8e, 0xdd, 0xb9, 0x9b, 0xb4, 0x74, 0x91, @@ -344,7 +340,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x30, 0xa2, 0xca, 0xe4, 0x0b, 0xe1, 0x08, 0xa6, 0xb1, 0x41, 0x8c, 0x70, 0x03, 0x04, 0x44, 0x72, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0x1f, 0xb5}, + {{0x00, 0xb0, 0x02, 0x1f, 0x00}, {0xe0, 0x97, 0x7f, 0x8a, 0x2f, 0xcc, 0x9f, 0xe5, 0xdf, 0x93, 0x7a, 0xb1, 0xea, 0xbc, 0x3b, 0x8d, 0x78, 0x22, 0x51, 0x69, 0x20, 0x98, 0x01, 0x4b, 0x09, 0x96, 0x4a, 0x86, 0x5b, 0xa0, 0x94, 0xd5, 0x1f, 0xc2, 0xe0, 0x16, 0x9b, 0xe9, 0x2f, 0x4e, 0x4c, 0x9b, 0x96, 0x1a, 0x76, @@ -359,7 +355,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x1d, 0x8c, 0x4b, 0xcd, 0xbd, 0x38, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x18, 0x30, 0x90, 0x00}}, - {{0x00, 0xb0, 0x02, 0xd4, 0xb5}, + {{0x00, 0xb0, 0x02, 0xd4, 0x00}, {0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x0c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x30, 0x82, 0x01, 0xd2, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x82, 0x01, 0xc9, 0x30, 0x82, 0x01, 0xc5, 0x30, 0x3c, 0x06, 0x07, 0x04, @@ -374,7 +370,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x30, 0x82, 0x01, 0x3c, 0x06, 0x08, 0x2b, 0x06, 0x90, 0x00}}, - {{0x00, 0xb0, 0x03, 0x89, 0xb5}, + {{0x00, 0xb0, 0x03, 0x89, 0x00}, {0x01, 0x05, 0x05, 0x07, 0x02, 0x02, 0x30, 0x82, 0x01, 0x2e, 0x0c, 0x82, 0x01, 0x2a, 0xc5, 0xa0, 0x69, 0x73, 0x20, 0x73, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0xc4, 0x81, 0x74, 0x73, 0x20, 0x69, 0x72, 0x20, 0x69, 0x65, 0x6b, 0xc4, 0xbc, 0x61, 0x75, 0x74, 0x73, 0x20, @@ -389,7 +385,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0xc4, 0xab, 0x7a, 0x69, 0x6a, 0x61, 0x73, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x73, 0x20, 0x28, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0x3e, 0xb5}, + {{0x00, 0xb0, 0x04, 0x3e, 0x00}, {0x72, 0x65, 0xc4, 0xa3, 0x2e, 0x4e, 0x72, 0x2e, 0x20, 0x34, 0x30, 0x30, 0x30, 0x33, 0x30, 0x31, 0x31, 0x32, 0x30, 0x33, 0x29, 0x2c, 0x20, 0x6e, 0x6f, 0x64, 0x72, 0x6f, 0xc5, 0xa1, 0x69, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x74, 0x62, 0x69, 0x6c, 0x73, 0x74, 0xc4, 0xab, 0x62, @@ -404,7 +400,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x65, 0x70, 0x61, 0x72, 0x61, 0x6b, 0x73, 0x74, 0x90, 0x00}}, - {{0x00, 0xb0, 0x04, 0xf3, 0xb5}, + {{0x00, 0xb0, 0x04, 0xf3, 0x00}, {0x73, 0x2e, 0x6c, 0x76, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x5f, 0x4c, 0x56, 0x5f, 0x65, 0x49, 0x44, 0x5f, 0x49, 0x43, 0x41, 0x5f, 0x32, 0x30, 0x31, 0x37, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x29, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, @@ -419,7 +415,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x00, 0x8e, 0x46, 0x01, 0x05, 0x30, 0x4e, 0x30, 0x25, 0x16, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x90, 0x00}}, - {{0x00, 0xb0, 0x05, 0xa8, 0xb5}, + {{0x00, 0xb0, 0x05, 0xa8, 0x00}, {0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x70, 0x61, 0x72, 0x61, 0x6b, 0x73, 0x74, 0x73, 0x2e, 0x6c, 0x76, 0x2f, 0x65, 0x6e, 0x2f, 0x70, 0x64, 0x73, 0x13, 0x02, 0x65, 0x6e, 0x30, 0x25, 0x16, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, @@ -434,7 +430,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0xd1, 0xc9, 0xc4, 0xc7, 0x98, 0x72, 0x1d, 0x7d, 0xee, 0xf9, 0x11, 0xce, 0xcd, 0xf9, 0xae, 0x6c, 0x90, 0x00}}, - {{0x00, 0xb0, 0x06, 0x5d, 0xb5}, + {{0x00, 0xb0, 0x06, 0x5d, 0x00}, {0xd0, 0xfd, 0x85, 0xc9, 0xef, 0xe9, 0x23, 0xf8, 0xa1, 0xf9, 0x7c, 0x00, 0x3d, 0x01, 0xdf, 0x54, 0xa0, 0xbd, 0xfe, 0xd6, 0xff, 0x4c, 0xda, 0x40, 0x24, 0x35, 0x39, 0xc7, 0xc3, 0x6a, 0x46, 0x83, 0x5c, 0xe9, 0x59, 0xb9, 0xda, 0x25, 0x26, 0x4c, 0xf0, 0x30, 0xed, 0xbc, 0x8d, @@ -449,7 +445,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x7e, 0x1c, 0x09, 0xa1, 0x5f, 0xb4, 0x5d, 0x0e, 0x78, 0xb0, 0xbb, 0xdd, 0x00, 0x91, 0x2a, 0x88, 0x90, 0x00}}, - {{0x00, 0xb0, 0x07, 0x12, 0xb5}, + {{0x00, 0xb0, 0x07, 0x12, 0x00}, {0xef, 0xf8, 0x76, 0xfe, 0x2d, 0x31, 0x84, 0xf5, 0x0e, 0x04, 0xf6, 0x80, 0xb3, 0x9e, 0x97, 0xda, 0xa5, 0xc1, 0x51, 0x8c, 0x44, 0x4f, 0x8b, 0x80, 0xb3, 0x46, 0x8b, 0x99, 0xb1, 0x4e, 0xdf, 0x77, 0xe0, 0x6a, 0x6c, 0x9e, 0x89, 0x02, 0xe3, 0x17, 0x99, 0x8a, 0x11, 0x8a, 0x04, @@ -465,7 +461,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING 0x2d, 0x90, 0x00}}, // Read final block. - {{0x00, 0xb0, 0x07, 0xc7, 0x85}, + {{0x00, 0xb0, 0x07, 0xc7, 0x00}, {0xff, 0xfa, 0x6e, 0x60, 0x2b, 0x4b, 0x48, 0x49, 0xa9, 0xd4, 0x66, 0xd8, 0x6e, 0xfe, 0x3c, 0x28, 0x3a, 0x01, 0x1f, 0xd2, 0xd1, 0xe9, 0x3f, 0x8e, 0xe2, 0xce, 0x0e, 0xdd, 0x07, 0x63, 0x5b, 0xe5, 0x71, 0xe7, 0xd9, 0x41, 0xb6, 0xd0, 0x3a, 0x46, 0x0f, 0x3a, 0x00, 0xd9, 0x50, @@ -499,7 +495,7 @@ const PcscMock::ApduScript LATEID_IDEMIA_V2_SELECT_SIGN_CERTIFICATE_AND_SIGNING {{0x00, 0xA4, 0x02, 0x04, 0x02, 0x70, 0x01, 0x00}, {0x62, 0x04, 0x80, 0x02, 0x00, 0x0A, 0x90, 0x00}}, - {{0x00, 0xB0, 0x00, 0x00, 0x0A}, + {{0x00, 0xB0, 0x00, 0x00, 0x00}, {0x30, 0x08, 0x30, 0x00, 0x30, 0x04, 0x02, 0x02, 0x00, 0x9F, 0x90, 0x00}}, // Select QSCD AID.