Skip to content

AuthPin forces conversions that can leak secret #353

@simo5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions