Nitrokey / fido-authenticator

FIDO authenticator Trussed app.
Apache License 2.0
4 stars 0 forks source link

Credential ID changed for old credentials #111

Closed robin-nitrokey closed 5 hours ago

robin-nitrokey commented 1 day ago

When calculating the credential ID for a non-discoverable credential that was generated with an older fido-authenticator version (e. g. v0.1.1-nitrokey.4 / NK3 firmware v1.4.0), the current implementation (v0.1.1-nitrokey.23 / v1.8.0-rc.1) leads to a different credential ID. This is caused by a changed serialization of FullCredential.

Input:

The deserialized credential is the same, but the serialized credential differs:

old: A3000201A700A1626964684A6F686E20446F6501A16269644301020302187B03F404260582014301020306F4024C000000000000000000000000
new: A3000201A700A16169684A6F686E20446F6501A161694301020302187B03F404260582014301020306F4024C000000000000000000000000
robin-nitrokey commented 1 day ago

This seems to be caused by https://github.com/Nitrokey/fido-authenticator/pull/59 which changed the serialization of the RP and user data.

For example, the RP with id = "John Doe":

  left: "A16169684A6F686E20446F65"
 right: "A1626964684A6F686E20446F65"

The problem is that we re-serialize the credential data for the credential ID calculation. This only occurs with credentials generated with older versions as we removed the unnecessary RP and user fields when serializing credentials in https://github.com/Nitrokey/fido-authenticator/pull/32.

Potential solutions:

robin-nitrokey commented 6 hours ago

For the record, it looks like all credentials generated with v1.5.0 or older are affected as v0.1.1-nitrokey.6 is the first tag with the shorter credential IDs.