Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U2F over NFC #1755

Closed
wants to merge 7 commits into from
Closed

U2F over NFC #1755

wants to merge 7 commits into from

Conversation

devsnek
Copy link

@devsnek devsnek commented Sep 20, 2022

What's new

Provides access to the U2F interface over NFC. This was originally based on #1510 but it kind of went off the rails due to the nuttiness of rafl/furi ISO-DEP support.

Verification

Head over to a site like https://webauthn.io on your phone, and try registering/logging in with NFC.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@zhovner
Copy link
Member

zhovner commented Sep 20, 2022

Wow, thank you!

@hedger hedger added WIP Work In Progress. Do not merge NFC NFC-related New Feature Contains an IMPLEMENTATION of a new feature labels Sep 21, 2022
@hedger hedger mentioned this pull request Sep 21, 2022
@Fishrock123
Copy link

@devsnek looks like we need to test uploading to device to run the rest of CI?

jbohack added a commit to Flipper-XFW/Xtreme-Firmware that referenced this pull request Jan 12, 2023
return 8;
} else if(in_buf[1] == U2F_CMD_APPLET_SELECTION) {
return u2f_applet_selection(in_buf, out_buf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to update any global state, so this makes it possible to communicate with the U2F applet without SELECT, which is explicitly disallowed by the CTAP 2.x spec (emphasis mine):

  • NFC, when the applet is selected as specified.
    • Authenticator SHALL NOT allow FIDO applet to be implicitly selected or enabled.
      • Recommended: Authenticator SHALL NOT have default applet selected on power cycle. All CTAP commands SHALL be preceded by an explicit applet selection command as described in Applet selection section.
      • Alternative: If authenticator has a FIDO applet selected for some reason at power cycle, it SHALL be in disabled mode and SHALL ONLY be enabled once it receives explicit applet selection command as described in Applet selection section.

The U2F 1.2 NFC spec also states that applet selection is required:

A FIDO client SHALL always send an applet selection command to begin interaction with a FIDO authenticator via NFC.

Some operating systems filter SELECT commands sent over smartcard interfaces in order to limit direct access to the CTAP/U2F applet; so any device which allows implicit selection would bypass this control.

The deselect command is also not implemented by this PR, but that's not part of the U2F 1.2 spec, so it may be worth waiting for proper CTAP2 support for that one.

@@ -100,7 +100,8 @@ void u2f_scene_main_on_enter(void* context) {
app->u2f_ready = u2f_init(app->u2f_instance);
if(app->u2f_ready == true) {
u2f_set_event_callback(app->u2f_instance, u2f_scene_main_event_callback, app);
app->u2f_hid = u2f_hid_start(app->u2f_instance);
// app->u2f_hid = u2f_hid_start(app->u2f_instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could both the USB and NFC interfaces be running at the same time? Or there be some way to select which one you want?

@gornekich
Copy link
Member

gornekich commented Nov 15, 2023

Hello everyone!
Recently we released new NFC stack in #3050 . Unfortunately, previous NFC API was not good enough to add new features like NFC over U2F. Now we finished working on new API and it is possible to make NFC over U2F application.

Thanks @devsnek for PR! I will close it for now, since we are not planning to support NFC over U2F in our firmware. However, if you want to continue working on it, you can write application and submit it to https://github.com/flipperdevices/flipper-application-catalog repository. If you have any questions, feel free to contact me on Discord.

@gornekich gornekich closed this Nov 15, 2023
@AccessViolation95
Copy link

Is this still the consensus on U2F over NFC, or would you be open to contributors implementing it into the U2F part of the firmware? There seems to be enough interest, which makes sense because it makes using U2F on mobile devices significantly more convenient. If not, I'd be interested in knowing the thoughts behind the decision 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Contains an IMPLEMENTATION of a new feature NFC NFC-related WIP Work In Progress. Do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants