Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikgraf committed Oct 25, 2024
1 parent ad176cc commit 8e9bc35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,11 @@ const BASE64: b64::GeneralPurpose = b64::URL_SAFE_NO_PAD;

type JsResult<T> = Result<T, Error>;

#[derive(Default)]
struct CustomKsf {
argon: Argon2<'static>,
}

impl Default for CustomKsf {
fn default() -> Self {
Self {
argon: Argon2::default(),
}
}
}

impl Ksf for CustomKsf {
fn hash<L: ArrayLength<u8>>(
&self,
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions tests/opaque.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});

Expand Down Expand Up @@ -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',
);
});

Expand Down

0 comments on commit 8e9bc35

Please sign in to comment.