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

Fido2luks does not work #177

Open
szszszsz opened this issue Feb 16, 2023 · 5 comments
Open

Fido2luks does not work #177

szszszsz opened this issue Feb 16, 2023 · 5 comments
Labels
app:fido bug Something isn't working tracking This issue is tracking an upstream issue

Comments

@szszszsz
Copy link
Member

Fido2luks fails with setting up LUKS device. This works with Nitrokey FIDO2.

Dev returns: Device returned error: CborError: 0x14: Missing non-optional parameter.)
If I have not made mistake during the early retest, this was the kty field, as reported by serde.

Logs with full traffic attached, as well as the used Makefile.
Sim version: v1.2.2-alpha.20221130-111-ga1d9dd0 (current main), with updated dependencies to the latest (cargo update; see attached Cargo lock file).

PS I expect the same problem occurs, while running example of the responsible for the ctap communication underlying ctap_hmac crate. Might be easier for the debugging.

cc @robin-nitrokey

@robin-nitrokey
Copy link
Member

This is caused by a bug in a Deserialize implementation in ctap-types: trussed-dev/ctap-types#7.

@robin-nitrokey robin-nitrokey added the tracking This issue is tracking an upstream issue label Feb 16, 2023
@robin-nitrokey
Copy link
Member

Though the algorithm field is really missing:

https://github.com/shimunn/ctap/blob/bf862f6a4bbc007263cbe679db33c8dd3c2ffc79/src/cbor.rs#L589-L590

I’m not sure whether this is valid.

@robin-nitrokey
Copy link
Member

Okay, it’s optional:

   COSE_Key = {
       1 => tstr / int,          ; kty
       ? 2 => bstr,              ; kid
       ? 3 => tstr / int,        ; alg
       ? 4 => [+ (tstr / int) ], ; key_ops
       ? 5 => bstr,              ; Base IV
       * label => values
   }

https://www.rfc-editor.org/rfc/rfc8152#section-7

alg: This parameter is used to restrict the algorithm that is used
with the key. If this parameter is present in the key structure,
the application MUST verify that this algorithm matches the
algorithm for which the key is being used.

https://www.rfc-editor.org/rfc/rfc8152#section-7.1

robin-nitrokey added a commit to robin-nitrokey/solo2 that referenced this issue Feb 27, 2023
This patch replaces upstream ctap-types with a fork that improves
compatibility when deserializing COSE keys.

Fixes Nitrokey#177
@intr-cx
Copy link

intr-cx commented May 9, 2023

Hi, sorry to bump this, but I'm curious about the state of this issue. Since the fido2luks project seems unmaintained/dead (although the software still works fine with the NK FIDO2), I'm wondering if this can be resolved from this side of the fence.

@robin-nitrokey
Copy link
Member

@intr-cx The CTAP2 issues described above are fixed in the firmware, although we might revert some of the fixes in the future because the specification requires a strict implementation that rejects invalid data. Additionally, there is a bug in the USB descriptor parser used by fido2luks. We don’t want to work around that bug in the firmware. I’ve submitted patches to fix the parser. They might work for you, though I have only tested the device selection, not the entire LUKS setup:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:fido bug Something isn't working tracking This issue is tracking an upstream issue
Projects
None yet
Development

No branches or pull requests

3 participants