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

Non-canonical CBOR sent on GET_INFO call #73

Open
szszszsz opened this issue Mar 20, 2023 · 0 comments
Open

Non-canonical CBOR sent on GET_INFO call #73

szszszsz opened this issue Mar 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@szszszsz
Copy link
Member

Environment

  • pynitrokey.cli fido2 version: 1.1.0
  • Windows 10 x64
  • pynitrokey version: 0.4.33
  • Python version: 3.10.10

Relevant CBOR info

  File "Python\Python310\lib\site-packages\pynitrokey\fido2\client.py", line 112, in find_device
    self.ctap2: Optional[Ctap2] = Ctap2(dev)
  File "Python\Python310\lib\site-packages\fido2\ctap2\base.py", line 208, in __init__
    self._info = self.get_info()
  File "Python\Python310\lib\site-packages\fido2\ctap2\base.py", line 262, in get_info
    return Info.from_dict(self.send_cbor(Ctap2.CMD.GET_INFO))
  File "Python\Python310\lib\site-packages\fido2\ctap2\base.py", line 249, in send_cbor
    raise ValueError(
ValueError: Non-canonical CBOR from Authenticator.
Got: a80183665532465f5632684649444f5f325f306c4649444f5f325f315f50524502826b6372656450726f746563746b686d61632d7365637265740350c39efba6fcf44c3e828bfc4a6115a0ff04a562726bf5627570f564706c6174f47563726564656e7469616c4d676d7450726576696577f569636c69656e7450696ef5051904b00681010714081880
Expected: a80183665532465f5632684649444f5f325f306c4649444f5f325f315f50524502826b6372656450726f746563746b686d61632d7365637265740350c39efba6fcf44c3e828bfc4a6115a0ff04a562726bf5627570f564706c6174f469636c69656e7450696ef57563726564656e7469616c4d676d7450726576696577f5051904b00681010714081880

Is

{
    1: ["U2F_V2", "FIDO_2_0", "FIDO_2_1_PRE"],
    2: ["credProtect", "hmac-secret"],
     h'c39efba6fcf44c3e828bfc4a6115a0ff',
    4: {
        "rk": true,
        "up": true,
        "plat": false,
        "credentialMgmtPreview": true,
        "clientPin": true,
    },
    5: 1200_1,
    6: [1],
    7: 20,
    8: 128_0,
}

Expected - compare position 4

{
    1: ["U2F_V2", "FIDO_2_0", "FIDO_2_1_PRE"],
    2: ["credProtect", "hmac-secret"],
     h'c39efba6fcf44c3e828bfc4a6115a0ff',
    4: {
        "rk": true,
        "up": true,
        "plat": false,
        "clientPin": true,
        "credentialMgmtPreview": true,
    },
    5: 1200_1,
    6: [1],
    7: 20,
    8: 128_0,
}
@szszszsz szszszsz added the bug Something isn't working label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant