Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hasher.validateSalt(salt) is underutilized #233

Closed
pogren opened this issue May 2, 2022 · 0 comments · Fixed by #237
Closed

Hasher.validateSalt(salt) is underutilized #233

pogren opened this issue May 2, 2022 · 0 comments · Fixed by #237
Labels
bug Something isn't working

Comments

@pogren
Copy link
Member

pogren commented May 2, 2022

Describe the bug
The various impls of Hasher (e.g. HashCodeHasher and ModHashCodeHasher) have constructors that take salt parameters that aren't validated. So you can do something like:

ModHashCodeHasher hasher = new ModHashCodeHasher(200, "42");

but you can't subsequently call

hasher.setSalt("42");

because that calls

Hasher.validateSalt("42");

which returns false.

Seems like this is inconsistent and should be remedied by having constructors that take a salt value call the validateSalt method.

System information:

  • Tribuo Version: 4.2.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant