Skip to content
Open
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
8 changes: 0 additions & 8 deletions lib/libpcsc-cpp/include/pcsc-cpp/comp_winscard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
#undef IGNORE
#endif

#ifdef __APPLE__
#pragma pack(1)
#else
#pragma pack(push, 1)
#endif

#ifndef SCARD_CTL_CODE
#define SCARD_CTL_CODE(code) (0x42000000 + (code))
Expand Down Expand Up @@ -148,8 +144,4 @@ struct PIN_VERIFY_STRUCTURE
uint32_t ulDataLength; // length of Data to be sent to the ICC
};

#ifdef __APPLE__
#pragma pack()
#else
#pragma pack(pop)
#endif
8 changes: 4 additions & 4 deletions lib/libpcsc-cpp/src/SmartCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ class CardImpl
{
uint8_t PINFrameOffset = 0;
uint8_t PINLengthOffset = 0;
byte_vector cmd(sizeof(PIN_VERIFY_STRUCTURE));
auto* data = (PIN_VERIFY_STRUCTURE*)cmd.data();
const byte_vector& d = commandApdu;
byte_vector cmd(sizeof(PIN_VERIFY_STRUCTURE) + d.size());
auto* data = new (cmd.data()) PIN_VERIFY_STRUCTURE {};
data->bTimerOut = PIN_PAD_PIN_ENTRY_TIMEOUT;
data->bTimerOut2 = PIN_PAD_PIN_ENTRY_TIMEOUT;
data->bmFormatString =
Expand All @@ -161,9 +162,8 @@ class CardImpl
data->bNumberMessage = CCIDDefaultInvitationMessage;
data->wLangId = lang;
data->bMsgIndex = NoInvitationMessage;
const byte_vector& d = commandApdu;
data->ulDataLength = uint32_t(d.size());
cmd.insert(cmd.cend(), d.cbegin(), d.cend());
std::copy(d.cbegin(), d.cend(), cmd.begin() + sizeof(PIN_VERIFY_STRUCTURE));

auto ioctl = feature(FEATURE_VERIFY_PIN_START);
if (feature(FEATURE_VERIFY_PIN_START) == features.cend())
Expand Down
Loading