Skip to content

password-hash: Fix invalid operator in the SaltString struct constructor - #1246

Merged
tarcieri merged 1 commit into
RustCrypto:masterfrom
FssAy:master
Feb 17, 2023
Merged

password-hash: Fix invalid operator in the SaltString struct constructor#1246
tarcieri merged 1 commit into
RustCrypto:masterfrom
FssAy:master

Conversation

@FssAy

Copy link
Copy Markdown
Contributor

I am not 100% sure, but I think the length of provided string s should be lower or equal to the MAX_LENGTH.

When implementing some algorithm that required 64 bytes long salt I couldn't make a new SaltString structure due to this issue and simple change from < to the <= operator fixed it. What is more, function Salt::new allows for the s string to be exactly 64 bytes (MAX_LENGTH) long.

I did not find any opened or closed issues related to this matter, so that's why I am not sure if it is a bug or a feature.

Allow the length of `s` to be exactly the same amount as `MAX_LENGTH` value.

@tarcieritarcieri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tarcieri
tarcieri merged commit bf9cf0f into RustCrypto:masterFeb 17, 2023
@tarcieritarcieri mentioned this pull request Mar 4, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@FssAy@tarcieri