Skip to content

Commit

Permalink
chore(plc4j/profinet): Replaced the insecure usage of Random with Sec…
Browse files Browse the repository at this point in the history
…ureRandom.
  • Loading branch information
chrisdutz committed Jul 14, 2023
1 parent d28bfe3 commit 05ec3da
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.slf4j.LoggerFactory;

import java.net.InetSocketAddress;
import java.security.SecureRandom;
import java.util.*;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -574,7 +575,7 @@ public CompletableFuture<PlcSubscriptionResponse> subscribe(PlcSubscriptionReque
(short) 0,
request
);
Random rand = new Random();
SecureRandom rand = new SecureRandom();
// Serialize it to a byte-payload
Ethernet_FramePayload_IPv4 udpFrame = new Ethernet_FramePayload_IPv4(
rand.nextInt(65536),
Expand Down

0 comments on commit 05ec3da

Please sign in to comment.