rust-u2f icon indicating copy to clipboard operation
rust-u2f copied to clipboard

Site name not displayed when facet is set

Open chrysn opened this issue 3 years ago • 1 comments

Describe the bug

When setting a non-trivial facet ID at the demonstrator https://u2f.bin.coffee/ (an example facet ID would be "https://u2f.bin.coffee/fjord" rather than the default "https://u2f.bin.coffee" -- you may need to refresh the page after having set the facet ID), the popup just shows "Register site" rather than the expected "Register site u2f.bin.coffee"

Logs

(I didn't start the daemons through systemd, so I'm not sure how I would get them to output debug information in the first place -- I hope this is easy enough to reproduce without them).

chrysn avatar Jul 16 '22 16:07 chrysn

This is simply a limitation with U2F as a protocol, the newer Webauthn and FIDO2 standards are more flexible around this. I've started adding support if you'd like to help out!

More specifically, the facet ID is hashed using SHA256 into an app id, in this case: SHA256("https://u2f.bin.coffee/fjord") = 0x75537e4127782254ff6738f9873f0652e275f18a95705f3941ffeb0edbc23c2a

For convenience I have hard-coded a few known hashes so they can be reversed into friendly domain names, if you have additional suggestions I'm happy to merge a PR, but it's simply not feasible to support every custom facet ID with this approach. (https://github.com/danstiner/rust-u2f/blob/master/u2f-core/src/known_app_ids.rs)

danstiner avatar Oct 26 '22 04:10 danstiner