Skip to content

Commit 3c85b86

Browse files
Always use JCERandom as the default RNG (#606)
The current implementation relies on `VMPCRandomGenerator` for random number generation if BouncyCastle is registered, otherwise it falls back to `SecureRandom`. Nowadays, `SecureRandom` should always be the best available option, whereas `VMPCRandomGenerator` [has known weaknesses](https://books.google.de/books?id=niO6BQAAQBAJ&pg=PA140&lpg=PA140&dq=vmpc+prng&source=bl&ots=QAdZJOT607&sig=ACfU3U0Edqlpm08iRZJLxeWGQNwNQz7WsQ&hl=en&sa=X&ved=2ahUKEwjd2Zyr9pfqAhXWMMAKHT70AioQ6AEwDnoECAoQAQ#v=onepage&q=vmpc%20prng&f=false).
1 parent 2ca0fa4 commit 3c85b86

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/net/schmizz/sshj/DefaultConfig.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ protected void initKeyAlgorithms() {
146146
}
147147

148148
protected void initRandomFactory(boolean bouncyCastleRegistered) {
149-
setRandomFactory(new SingletonRandomFactory(bouncyCastleRegistered
150-
? new BouncyCastleRandom.Factory() : new JCERandom.Factory()));
149+
setRandomFactory(new SingletonRandomFactory(new JCERandom.Factory()));
151150
}
152151

153152
protected void initFileKeyProviderFactories(boolean bouncyCastleRegistered) {

0 commit comments

Comments
 (0)