more API simplifications
This commit is contained in:
parent
35fc26f378
commit
97f597d89d
6 changed files with 34 additions and 55 deletions
|
|
@ -22,7 +22,7 @@ pub fn generate_nonce() -> Result<String, ErrorStack> {
|
|||
/// A trait which defines the needed methods for SCRAM.
|
||||
pub trait ScramProvider {
|
||||
/// The kind of secret this `ScramProvider` requires.
|
||||
type SecretKind: secret::SecretKind;
|
||||
type Secret: secret::Secret;
|
||||
|
||||
/// The name of the hash function.
|
||||
fn name() -> &'static str;
|
||||
|
|
@ -42,7 +42,7 @@ pub struct Sha1;
|
|||
|
||||
impl ScramProvider for Sha1 {
|
||||
// TODO: look at all these unwraps
|
||||
type SecretKind = secret::Pbkdf2Sha1;
|
||||
type Secret = secret::Pbkdf2Sha1;
|
||||
|
||||
fn name() -> &'static str {
|
||||
"SHA-1"
|
||||
|
|
@ -105,7 +105,7 @@ pub struct Sha256;
|
|||
|
||||
impl ScramProvider for Sha256 {
|
||||
// TODO: look at all these unwraps
|
||||
type SecretKind = secret::Pbkdf2Sha256;
|
||||
type Secret = secret::Pbkdf2Sha256;
|
||||
|
||||
fn name() -> &'static str {
|
||||
"SHA-256"
|
||||
|
|
|
|||
Loading…
Reference in a new issue