Added authorisation.
This commit is contained in:
@@ -61,7 +61,13 @@ U2F_Register_APDU::U2F_Register_APDU(const U2F_Msg_CMD& msg, const vector<uint8_
|
||||
Storage::keyCounts[this->keyH] = 0;
|
||||
}
|
||||
|
||||
void U2F_Register_APDU::respond(const uint32_t channelID) const {
|
||||
void U2F_Register_APDU::respond(const uint32_t channelID, bool hasAuthorisation) const {
|
||||
if (!hasAuthorisation) {
|
||||
error(channelID, APDU_STATUS::SW_CONDITIONS_NOT_SATISFIED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
U2FMessage m{};
|
||||
m.cid = channelID;
|
||||
m.cmd = U2FHID_MSG;
|
||||
@@ -118,3 +124,7 @@ void U2F_Register_APDU::respond(const uint32_t channelID) const {
|
||||
|
||||
m.write();
|
||||
}
|
||||
|
||||
bool U2F_Register_APDU::requiresAuthorisation() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user