Improved U2F APDU Message error handling.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user