Files
U2FDevice/U2F_Version_APDU.cpp
Michael Kuc 48840ad36c Added resumable loading, along with signal handling.
This version can store state after receiving SIGINT.
This is achieved by polling FIFO read state;
2018-08-09 20:23:23 +00:00

29 lines
607 B
C++

#include "U2F_Version_APDU.hpp"
#include <iostream>
#include "U2FMessage.hpp"
#include "u2f.hpp"
#include "Field.hpp"
#include "APDU.hpp"
using namespace std;
U2F_Version_APDU::U2F_Version_APDU(const U2F_Msg_CMD &msg)
{
clog << "Got U2F_Ver APDU request" << endl;
//Don't actually respond yet
}
void U2F_Version_APDU::respond(const uint32_t channelID) const
{
char ver[]{ 'U', '2', 'F', '_', 'V', '2' };
U2FMessage m{};
m.cid = channelID;
m.cmd = U2FHID_MSG;
m.data.insert(m.data.end(), FIELD(ver));
auto sC = APDU_STATUS::SW_NO_ERROR;
m.data.insert(m.data.end(), FIELD_BE(sC));
m.write();
}