Database

Trait Database 

Source
pub trait Database {
    type PasswordVerifier;

    // Required methods
    fn lookup_verifier(
        &self,
        username: &[u8],
    ) -> Option<(Self::PasswordVerifier, SaltString, ParamsString)>;
    fn store_verifier(
        &mut self,
        username: &[u8],
        salt: SaltString,
        uad: Option<&[u8]>,
        verifier: Self::PasswordVerifier,
        params: ParamsString,
    );
}
Expand description

trait for AuCPace to use to abstract over the storage and retrieval of verifiers

Required Associated Types§

Source

type PasswordVerifier

The type of password verifier stored in the database

Required Methods§

Source

fn lookup_verifier( &self, username: &[u8], ) -> Option<(Self::PasswordVerifier, SaltString, ParamsString)>

perform LookupW, returning the password verifier W, if it exists.

§Arguments:

username: the user the lookup the verifier for

§Return:

(password verifier, salt, sigma) where password verifier is the verifier stored for the given user salt is the salt used when hashing the password sigma is the parameters used by the the PBKDF when hashing the user’s password

Source

fn store_verifier( &mut self, username: &[u8], salt: SaltString, uad: Option<&[u8]>, verifier: Self::PasswordVerifier, params: ParamsString, )

store a username, salt, verifier and hash parameters to the database. This function should allow for overwriting users credentials if they exist. This is required for password changes and should only be performed once the user has negotiated a full session key.

§Arguments:
  • username: The name of the user who is storing a verifier
  • salt: The salt used when creating the verifier
  • uad: Optional - User Attached Data - “represents application data associated with this specific user account, e.g. specifying the granted authorization level on the server.”
  • verifier: The password verifier for the given user
  • params: The parameters used when hashing the password into the verifier - It is called sigma in the protocol defionition

Implementors§