Uses SecureRandom - Fix issue #32

This commit is contained in:
Thomas 2020-12-09 16:20:49 +01:00
parent a9e72c0cb3
commit 91682ed3b1
1 changed files with 2 additions and 2 deletions

View File

@ -41,6 +41,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.security.SecureRandom;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -53,7 +54,6 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Random;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;
@ -268,7 +268,7 @@ public class NetworkManager {
packages.retainAll(handles.keySet()); packages.retainAll(handles.keySet());
// Add some random packages to avoid tracking // Add some random packages to avoid tracking
Random rand = new Random(Thread.currentThread().getId()); SecureRandom rand = new SecureRandom();
int alea = rand.nextInt(120) % 10 + 11; int alea = rand.nextInt(120) % 10 + 11;
for (int i = 0; i < alea; i++) { for (int i = 0; i < alea; i++) {
int val = rand.nextInt(applications.length()); int val = rand.nextInt(applications.length());