Skip to content

Reduce credential ID size #37

@robin-nitrokey

Description

@robin-nitrokey

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:

  1. 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 new StrippedCredential type that only includes the relevant fields.

  2. Flatten the serialized data structure. Currently, we have three nested levels: CredentialCredentialDataPublicKeyCredentialRpEntity. This adds unnecessary overhead.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions