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
macOS: works with Yubikey 4 but not Yubico Security Key (U2F-only) #166
Comments
|
I was able to capture debug, by rebuilding with SK_DEBUG defined: While waiting for the touch, it chats away like this: After touch: I don't know if that helps at all. I can't tell yet if this is a Mac-specific problem, and I guess I'd need to set up a Linux machine with OpenSSH 8.2 to be sure. I see libfido2 comes with some CLI tools: Let me know if there's anything useful I can try with these. |
|
This key works under Linux: Setup:
However, Ubuntu 20.04 uses libfido2 1.3.1, so I can't be sure whether it's a Mac USB issue, or a difference with libfido2 1.4.0. |
|
Hi, This looks like a regression with U2F-only devices on macOS introduced by 8f8a99d. The FIDO2 spec gives the impression (to me, at least) that CTAPHID_KEEPALIVE exists in CTAP1 (U2F), when it is actually a CTAP2 extension. If it is not too much hassle, can you try to revert 8f8a99d? Regarding OpenSSH and fido_init(), OpenSSH should be calling fido_init(). There are currently no ill effects from not calling it, but that might change in the future. Thanks for the comprehensive report! -p. |
|
Yes, that fixes the problem, thank you! Workaround for homebrew: followed by the output of |
|
Thanks! I will see what I can do about this bug. It's a bit late here, so hopefully tomorrow. -p. |
|
Fixed in 39544a2. Thanks for the detailed report and testing. |
|
All working fine with that tiny patch. The odd thing is: according to this matrix, Yubikey 4 is not FIDO2. Perhaps I was just lucky, and being a newer device it was able to complete the crypto operation in less than 300ms? |
|
I was only able to reproduce the problem with an older Yubikey NEO, so I suppose your theory makes sense: the difference in behaviour is not due to FIDO2-capable devices sending CTAPHID_KEEPALIVE when in U2F-only mode (which would be nonsensical, since CTAPHID_KEEPALIVE is unspecified in U2F), but likely due to different (faster) hardware. |
Background: I am testing out the U2F functionality of OpenSSH, and I have installed OpenSSH 8.2p1 from homebrew under macOS 10.14.6. This has brought in libfido2 1.4.0_1 as well.
When I use a Yubikey 4 it all works fine. I can generate an ecdsa-sk key and authenticate using it.
When I use an older Yubikey U2F-only key, it fails. This is the blue "security key", which identifies itself as:
Mine is pretty old, although it's still made (possibly a newer revision):
https://www.yubico.com/product/security-key-by-yubico
The key I have works quite happily for U2F authentication on websites like Google, Github etc.
This is what I see when I try to generate a key with openssh:
It seems there is an error coming back from fido_dev_make_cred
Any suggestions what is going on? I wasn't sure whether to raise it here first, or with openssh.
However I believe that OpenSSH and libfido2 have been built correctly, given that it works with the new key. You can see the flags they were built with here:
And the call to fido_dev_make_cred is here.
P.S. Neither Yubikey supports ed25519-sk: the generation fails immediately, without a touch, saying "Key enrollment failed: invalid format". But that's to be expected I think.
The text was updated successfully, but these errors were encountered: