mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 16:30:12 +02:00
Switch Random to SecureRandom
Someone may @Inject a Random at some point in the future where security matters, so always provide a secure one. Also, this shouldn't be in ConfigModule (it's not configuration) -- but that can be changed separately. We might want a larger refactor that has a utils module or similar to provide extremely generic things like random number generators. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=217602486
This commit is contained in:
parent
82252dfcd6
commit
8e67cc7cbb
1 changed files with 2 additions and 1 deletions
|
@ -33,6 +33,7 @@ import java.lang.annotation.Documented;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -1267,7 +1268,7 @@ public final class RegistryConfig {
|
|||
@Singleton
|
||||
@Provides
|
||||
public static Random provideRandom() {
|
||||
return new Random();
|
||||
return new SecureRandom();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue