Commit 604b53b
Implement NFC (#152)
Very heavily based on #105, with the following additions:
- Fleshed out the APDU-calls
- Added `select_fido2()` to discover both U2F and FIDO2-only devices
- Made `NfcDevice` derive `Clone` and other minor tweaks, so we can
easily use it in `credentialsd`
- Added the build with both NFC-features to the github CI (including the
installation of libnfc et al.). I kept this separate from the original,
un-featured build, so we can be sure the former works even without
libnfc installed.
Open questions:
- Biggest question to me is, how to handle the multiple backends and
multiple devices. Since we can't run the "blink and wait for user
presence"-scheme with NFC as we do with USB, I'm leaning towards simply
always returning the very first found NFC-device instead of a list of
found devices and use that. With this, we could get rid of the
duplication-problem. I'm not sure many setups would include more than
one NFC-reader (with different devices on there).
- The cancel-handle is currently unused, and I'm not sure if we can use
it anywhere at all.
- No testing yet. Not sure how easy that would be to add.
- Given that `credentialsd` uses a poll-mechanism to find USB-devices
(simply looping over `list_devices()`) as well, I did not investigate to
get a blocking device discovery.
- For testing, I hacked my local credentialsd-repo by simply replacing
`hid` with `nfc` in the USB-handler. Thus, I needed a dummy
`blink_and_wait_for_user_presence()`-implementation. This should
probably be removed, esp. if we go for the "return first device"-scheme
mentioned above. But doing that, I was able to successfully use
NFC-devices with Firefox.
---------
Co-authored-by: Mikael Magnusson <mikma@users.sourceforge.net>1 parent c0e4a86 commit 604b53b
File tree
21 files changed
+1660
-203
lines changed- .github/workflows
- libwebauthn
- examples
- src
- proto/ctap1/apdu
- transport
- ble
- cable
- hid
- mock
- nfc
- libnfc
- pcsc
- webauthn
21 files changed
+1660
-203
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments