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

ELY-2731 Use SecureRandom instead of ThreadLocalRandom #2119

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

TomasHofman
Copy link
Contributor

@@ -0,0 +1,15 @@
package org.wildfly.security.password.impl;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing a copyright header.

}

static int convertBytesToInt(byte[] saltBytes) {
if (saltBytes.length != 4) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do something here to use an Assert from wildfly-common?

Having an exception makes me feel this needs to be moved to a message / logger class but TBH as a method internal to this class we know it is unlikely to be anything other than 4 in length so an Assert call sounds safer to protect for the future.

*
* @return a byte array representing the random salt
*/
public static int generateRandomSaltInt() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know the original was public but maybe reduce the visibility here as only used within this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants