-
Notifications
You must be signed in to change notification settings - Fork 10
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
Reduce credential ID size #37
Comments
I think this means that we should make sure that the credential provided in |
Good spot! With AEAD we do not need RPID encoded, and the rest is not needed. Edit: this could improve working on the older Nextcloud instances - here a case, where we overflow exactly 1 byte on the derived key: |
I’ve drafted a PR against the Nitrokey fork because it has fixed some formatting issues and uses a newer Trussed version: Nitrokey#32. Please review there. I’ll backport it for the upstream repository once it is finalized, reviewed and approved. |
I have been tracking an issue with Nitrokey 3 and it seems this is the root cause.
After trial and error on a browser's console:
⇒ It appears it is built from the hostname. Which is problematic as hostnames can be very long. I checked with my Yubikey, and the rawId size is fixed. It looks like it computes a hash the fields instead. We are looking forward to this change, as this issue makes Nitrokeys unusable on most sites on our intranet (on-premise gitlab and nextcloud). Thanks for your work on it! |
Use references
@spectras This issue should be fixed for the Nitrokey 3 with v1.5.0-test.20231030. |
Thanks! I will get people to upgrade their firmware! |
It is still possible to overflow the credential ID when creating a non-discoverable credential, especially by providing a long RP ID. (The allowed maximum is 256, and the maximum credential ID length is 255.) Stripping some of the metadata was not enough to solve the problem. To improve this, I suggest the following changes:
Introduce a separate type for the stripped credential. Currently, we just set the stripped fields to
None
. This provides the potential for subtle bugs if we assume some field to be set that has been stripped. Therefore I suggest to introduce a newStrippedCredential
type that only includes the relevant fields.Flatten the serialized data structure. Currently, we have three nested levels:
Credential
→CredentialData
→PublicKeyCredentialRpEntity
. This adds unnecessary overhead.Remove unused fields. Having a separate type for stripped credentials makes it possible to identify the fields that are never used. Currently, these are:
rp_id: String<256>
creation_time: u32
use_counter: Option<bool>
hmac_secret: Option<bool>
rp_id
is obviously the most problematic one. It remains to be investigated if we really don’t need it or if this is a problem with the current implementation.The text was updated successfully, but these errors were encountered: