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

Fix javadoc and parameter name and add warning to FHIRUtil.getRandomKey #1394

Merged
merged 2 commits into from
Jul 31, 2020

Conversation

lmsurpre
Copy link
Member

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

@lmsurpre lmsurpre requested review from punktilious and JohnTimm July 31, 2020 19:03
Copy link
Collaborator

@JohnTimm JohnTimm left a 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());
Copy link
Collaborator

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.

Copy link
Member Author

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

Copy link
Contributor

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>
Copy link
Collaborator

@punktilious punktilious left a comment

Choose a reason for hiding this comment

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

LGTM

@lmsurpre lmsurpre merged commit 07e2704 into lee-master-2 Jul 31, 2020
@lmsurpre lmsurpre deleted the lee-master-3 branch July 31, 2020 20:05
Sign up for free to 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.

4 participants