Skip to content

AuthPin forces conversions that can leak secret #353

Description

@simo5

I have not experimented much with AuthPin but it is defined as SecretString, instead of just SecretBox, and this force callers that have a Vec into leaking conversion to a String.

Cryptoki never cares for using the pin as a string, all it does is to extract the String pointer as a *mut u8 to pass it to the pkcs11 token.

A better way to deal with AuthPin would be to make a trait and a default implementation.

The default implementation can probably use &str or String, but the trait would allow developers that already have a way to safely manage secret data to just return a slice of [u8] when needed.

Activity

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