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:
@@ -24,6 +24,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
@@ -45,7 +46,7 @@ import org.slf4j.Logger;
|
||||
@NonNullByDefault
|
||||
public class CloudUtil {
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
private static final Random RANDOM = new SecureRandom();
|
||||
|
||||
/**
|
||||
* Saves the Xiaomi cloud device info with tokens to file
|
||||
|
||||
Reference in New Issue
Block a user