Skip to content

Bind Keys to Purpose #7

Description

@paragonie-security

const uint8_t key[paseto_v2_LOCAL_KEYBYTES],

const uint8_t key[paseto_v2_LOCAL_KEYBYTES],

See https://github.com/paseto-standard/paseto-spec/blob/master/docs/02-Implementation-Guide/03-Algorithm-Lucidity.md

Right now, byte arrays are accepted by this API. There's no mechanism to prevent a user from using a v2 public key as a v2 local key.

It may also be a good idea to bind keys to a version, in case you want to support v4 tokens too.

Activity

  1. minus7 commented on Aug 5, 2021

    @minus7
    Member

    Ack, although I don't have time to work on this at the moment. Patches welcome.

    The simplest implementation would probably be a struct type per key type (local/public/secret) that includes the version or even a type per version. Key loaders can then also implement PASERK formats linked in the guide and do away with the pretty arbitrary formats used now.

    Changing this will break the API and thus be something for a 2.0 release.

  2. paragonie-security commented on Aug 6, 2021

    @paragonie-security
    Author

    Thanks for your timely response. We'll look into sending a PR (the code delta between V2 and V4 isn't significant with libsodium).

  3. paragonie-security commented on Aug 6, 2021

    @paragonie-security
    Author

    We drafted a PR in #8 that should solve this issue.

    If accepted, we intend to follow-up with a PASETO V4 implementation soon after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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