diff --git a/src/lib.rs b/src/lib.rs index 4e3151f..a970651 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -91,18 +91,11 @@ const BASE64: b64::GeneralPurpose = b64::URL_SAFE_NO_PAD; type JsResult = Result; +#[derive(Default)] struct CustomKsf { argon: Argon2<'static>, } -impl Default for CustomKsf { - fn default() -> Self { - Self { - argon: Argon2::default(), - } - } -} - impl Ksf for CustomKsf { fn hash>( &self, @@ -131,10 +124,10 @@ fn build_argon2_ksf( return Ok(Some(CustomKsf { argon })); } - return Err(Error::Internal { + Err(Error::Internal { context: "Invalid keyStretchingFunctionConfig (argon2id) combination", error: InternalError::KsfError, - }); + }) } fn get_custom_ksf( diff --git a/tests/opaque.test.js b/tests/opaque.test.js index 08d77c6..2506126 100644 --- a/tests/opaque.test.js +++ b/tests/opaque.test.js @@ -482,7 +482,7 @@ describe("client.finishRegistration", () => { }, }); }).toThrow( - 'Internal error at "Invalid argon parameter combination"; Computing the key stretching function failed', + 'Internal error at "Invalid keyStretchingFunctionConfig (argon2id) combination"; Computing the key stretching function failed', ); }); @@ -669,7 +669,7 @@ describe("client.finishLogin", () => { }, }); }).toThrow( - 'Internal error at "Invalid argon parameter combination"; Computing the key stretching function failed', + 'Internal error at "Invalid keyStretchingFunctionConfig (argon2id) combination"; Computing the key stretching function failed', ); });