Skip to content

Commit

Permalink
[clean] Removing erratic 'is_nfc' for a simpler (but never-working) o…
Browse files Browse the repository at this point in the history
…ne - code freeze choice
  • Loading branch information
lpascal-ledger committed Jul 10, 2024
1 parent af3708c commit 91e5984
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ void app_main() {
ui_idle();

for (;;) {
g.is_nfc = CMD_IS_OVER_U2F_NFC;

// Receive command bytes in G_io_apdu_buffer
if ((input_len = io_recv_command()) < 0) {
PRINTF("=> io_recv_command failure\n");
Expand Down
1 change: 0 additions & 1 deletion src/ctap2_get_assertion.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ void ctap2_get_assertion_handle(u2f_service_t *service, uint8_t *buffer, uint16_
// the user
// -> when credentials comes from rk, the spec ask to use authenticatorGetNextAssertion
// features
g.is_nfc = true;
ctap2_get_assertion_confirm(1);
} else if (!ctap2AssertData->userPresenceRequired && !ctap2AssertData->pinRequired) {
// No up nor uv required, skip UX and reply immediately
Expand Down
1 change: 0 additions & 1 deletion src/ctap2_make_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ void ctap2_make_credential_handle(u2f_service_t *service, uint8_t *buffer, uint1
if (CMD_IS_OVER_U2F_NFC) {
// No up nor uv requested, skip UX and reply immediately
// TODO: is this what we want?
g.is_nfc = true;
ctap2_make_credential_confirm();
} else {
ctap2_make_credential_ux();
Expand Down
1 change: 0 additions & 1 deletion src/ctap2_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ void send_cbor_error(u2f_service_t *service, uint8_t error) {

void send_cbor_response(u2f_service_t *service, uint32_t length) {
if (CMD_IS_OVER_U2F_NFC) {
g.is_nfc = true;
const char *status = NULL;
if (cmdType == CBOR_MAKE_CREDENTIAL) {
status = "Registration details\nsent";
Expand Down
1 change: 0 additions & 1 deletion src/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ void prepare_display_status() {
g.display_status[0] = '\0';
return;
}
g.is_nfc = false;
strncpy(g.display_status, g.rpID, strlen(g.rpID));
g.display_status[strlen(g.rpID)] = '\n';
strncpy(g.display_status + strlen(g.rpID) + 1, g.verifyHash, strlen(g.verifyHash));
Expand Down
5 changes: 0 additions & 5 deletions src/u2f_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ static int u2f_handle_apdu_enroll(const uint8_t *rx, uint32_t data_length, const
sizeof(reg_req->application_param));

if (CMD_IS_OVER_U2F_NFC) {
g.is_nfc = true;
uint16_t length = 0;
uint16_t sw = u2f_prepare_enroll_response(responseBuffer, &length);

Expand Down Expand Up @@ -765,7 +764,6 @@ static int u2f_handle_apdu_sign(const uint8_t *rx, uint32_t data_length, uint8_t
// following macros + `else if` was messing with clang until the `return`
#ifdef HAVE_NFC
if (CMD_IS_OVER_U2F_NFC) {
g.is_nfc = true;
// Android doesn't support answering SW_MORE_DATA here...
// so compute the real answer as fast as possible
uint16_t length = 0;
Expand Down Expand Up @@ -826,7 +824,6 @@ static int u2f_handle_apdu_applet_select(uint8_t *rx, int data_length, const uin

int u2f_handle_apdu(uint8_t *rx, int rx_length) {
// PRINTF("=> RAW=%.*H\n", rx_length, rx);
g.is_nfc = false;

uint8_t *data = NULL;
uint32_t le = 0;
Expand All @@ -843,7 +840,6 @@ int u2f_handle_apdu(uint8_t *rx, int rx_length) {
}

if (CMD_IS_OVER_U2F_NFC) {
g.is_nfc = true;
nfc_io_set_le(le);
}

Expand Down Expand Up @@ -876,7 +872,6 @@ int u2f_handle_apdu(uint8_t *rx, int rx_length) {
if (!CMD_IS_OVER_U2F_NFC) {
return io_send_sw(SW_INS_NOT_SUPPORTED);
}
g.is_nfc = true;
return nfc_io_send_prepared_response();

default:
Expand Down

0 comments on commit 91e5984

Please sign in to comment.