Skip to content

Commit

Permalink
SecureRandom in JavaCryptoRandom is not seeded
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 26, 2024
1 parent 55155fb commit 7a54fa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<action dev="ggregory" type="fix" due-to="Gary Gregory">StreamInput.StreamInput(InputStream, int) now throws NullPointerException on null input.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">ChannelOutput.ChannelOutput(WritableByteChannel) now throws NullPointerException on null input.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">StreamOutput.StreamOutput(OutputStream, int) now throws NullPointerException on null input.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">SecureRandom in JavaCryptoRandom is not seeded.</action>
<!-- UPDATE -->
<action type="update" dev="sebb" due-to="Ludovic Henry">Dockerfile: Bump maven to 3.8.8 (previous no longer online)</action>
<action type="update" dev="sebb">Tests: show details of crypt library actually loaded</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public JavaCryptoRandom(final Properties properties) {
} catch (final NoSuchAlgorithmException e) {
tmp = new SecureRandom();
}
// Seed the SecureRandom by calling nextBytes(byte[])
tmp.nextBytes(new byte[8]);
instance = tmp;
}

Expand Down

0 comments on commit 7a54fa3

Please sign in to comment.