Skip to content

Support pepper in Password4j encoders#19102

Open
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-18299
Open

Support pepper in Password4j encoders#19102
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-18299

Conversation

@therepanic
Copy link
Copy Markdown
Contributor

Currently, we can't forward pepper unless we encounter an anti-pattern and implement our own encoder.

To solve this problem, we need to provide pepper support out of the box, specifically in Password4jPasswordEncoder and all its subclasses, as well as BalloonHashingPassword4jPasswordEncoder and Pbkdf2Password4jPasswordEncoder, which aren't direct implementations of Password4jPasswordEncoder but also use password4j and require pepper support.

Closes: gh-18299

Currently, we can't forward pepper unless we encounter an anti-pattern
and implement our own encoder.

To solve this problem, we need to provide pepper support out of the box,
specifically in `Password4jPasswordEncoder` and all its subclasses, as
well as `BalloonHashingPassword4jPasswordEncoder` and
`Pbkdf2Password4jPasswordEncoder`, which aren't direct implementations of
`Password4jPasswordEncoder` but also use `password4j` and require pepper
support.

Closes: spring-projectsgh-18299

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Comment on lines 59 to +71
@@ -66,7 +68,20 @@ public BcryptPassword4jPasswordEncoder() {
* @throws IllegalArgumentException if bcryptFunction is null
*/
public BcryptPassword4jPasswordEncoder(BcryptFunction bcryptFunction) {
super(bcryptFunction);
this(bcryptFunction, null);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i guess this is ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting of shared secret (pepper) for password storage

2 participants