Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Update AesKeyProducer.java (#4211)
Dieser Commit ist enthalten in:
Ursprung
3fa35b2cb9
Commit
6b67e43f84
@ -55,19 +55,20 @@ public final class AesKeyProducer implements KeyProducer {
|
||||
}
|
||||
|
||||
private SecureRandom secureRandom() throws NoSuchAlgorithmException {
|
||||
// use Windows-PRNG for windows (default impl is SHA1PRNG)
|
||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||
return SecureRandom.getInstance("Windows-PRNG");
|
||||
} else {
|
||||
try {
|
||||
try {
|
||||
// use Windows-PRNG for windows (default impl is SHA1PRNG)
|
||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||
return SecureRandom.getInstance("Windows-PRNG");
|
||||
} else {
|
||||
// NativePRNG (which should be the default on unix-systems) can still block your
|
||||
// system. Even though it isn't as bad as NativePRNGBlocking, we still try to
|
||||
// prevent that if possible
|
||||
return SecureRandom.getInstance("NativePRNGNonBlocking");
|
||||
} catch (NoSuchAlgorithmException ignored) {
|
||||
// at this point we just have to go with the default impl even if it blocks
|
||||
return new SecureRandom();
|
||||
|
||||
}
|
||||
} catch (NoSuchAlgorithmException ignored) {
|
||||
// Fall back to the default impl as we couldn't load any others
|
||||
return new SecureRandom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren