-
Notifications
You must be signed in to change notification settings - Fork 159
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
Fix javadoc and parameter name and add warning to FHIRUtil.getRandomKey #1394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
keyGen.init(256); | ||
return Base64.getEncoder().encodeToString(keyGen.generateKey().getEncoded()); | ||
} catch (NoSuchAlgorithmException e) { | ||
log.warning("Algorithm '" + algorithm + "' is not supported; using SecureRandom instead"); | ||
byte[] buffer = new byte[32]; | ||
RANDOM.setSeed(System.currentTimeMillis()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not related to this change, but why are we seeding here? Potential OWASP because currentTimeMillis isn't sufficiently random.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering the same thing, which is why i added the warning...i'm not even sure it should fallback to SecureRandom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be in FHIRUtil -- it should go into bulkdata, and be hidden away.
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com