Skip to content

feat(nfc): dedupe USB-HID authenticators#270

Open
AlfioEmanueleFresta wants to merge 1 commit into
masterfrom
feat/nfc-dedupe-usb-hid
Open

feat(nfc): dedupe USB-HID authenticators#270
AlfioEmanueleFresta wants to merge 1 commit into
masterfrom
feat/nfc-dedupe-usb-hid

Conversation

@AlfioEmanueleFresta

Copy link
Copy Markdown
Member

Some security keys appear twice when we go looking for authenticators. The same key shows up once as a USB device over HID, and again as a PC/SC reader for its built-in smart-card interface. Both entries are the same physical key, but until now nothing connected them, so a single key plugged into USB also looked like a separate NFC authenticator waiting to be used.

We now recognize the two entries as one device by comparing the USB address behind each. When a reader resolves to the same physical USB device as a key we already see over HID, we drop it from the NFC list. A key plugged in over USB is no longer offered as a separate NFC device.

Reading real NFC keys is unchanged. A key held to a contactless reader has no matching USB device, so it stays in the list and is read exactly as before.

Relates to #182

A USB security key exposes a FIDO HID interface and a USB-CCID interface that PC/SC lists as a reader, so the same key appears twice during discovery. Match the two by the USB (bus, address) behind each and drop the NFC entry that duplicates a connected HID key. Reading real NFC keys is unchanged.

Relates to #182
@AlfioEmanueleFresta AlfioEmanueleFresta marked this pull request as draft June 15, 2026 21:33
@AlfioEmanueleFresta AlfioEmanueleFresta changed the title fix(nfc): drop USB keys that show up as duplicate NFC readers feat(nfc): dedupe USB-HID authenticators Jun 15, 2026
@AlfioEmanueleFresta AlfioEmanueleFresta marked this pull request as ready for review June 15, 2026 21:42

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't been able to run this yet, but it looks good to me from reading the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants