Improved U2F APDU Message error handling.

This commit is contained in:
2018-08-10 13:13:38 +00:00
parent 5d1d0ccb63
commit 2ced303d3a
6 changed files with 94 additions and 41 deletions

View File

@@ -9,7 +9,11 @@ using namespace std;
U2F_Version_APDU::U2F_Version_APDU(const U2F_Msg_CMD &msg)
{
//Don't actually respond yet
//Don't actually respond yet unless invalid
if (msg.p1 != 0 || msg.p2 != 0)
throw APDU_STATUS::SW_COMMAND_NOT_ALLOWED;
else if (msg.data.size() != 0)
throw APDU_STATUS::SW_WRONG_LENGTH;
}
void U2F_Version_APDU::respond(const uint32_t channelID) const