Use SecureRandom instead of Random (#15459)

Make sure that SecureRadom is used whenever the random number
is used for cryptographic operations, e.g. as nonce/salt.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-08-20 21:29:37 +02:00
committed by GitHub
parent e86998000e
commit 95ac2eb80b
7 changed files with 14 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.security.SecureRandom;
import java.util.Random;
import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -132,7 +133,7 @@ public class Ethm1Module extends SatelModule {
} catch (Exception e) {
throw new IOException("General encryption failure", e);
}
this.rand = new Random();
this.rand = new SecureRandom();
this.idS = 0;
this.idR = 0;
this.rollingCounter = 0;