tomaswolf commented on code in PR #589: URL: https://github.com/apache/mina-sshd/pull/589#discussion_r1741077852
########## sshd-common/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java: ########## @@ -559,16 +560,10 @@ public static Decryptor getBouncycastleEncryptedPrivateKeyInfoDecryptor() { * {@link JceRandomFactory} one */ public static RandomFactory getRandomFactory() { - String factoryClassName = System.getProperty(PROP_RANDOM_FACTORY_CLASS); - if (factoryClassName != null) { - try { - return ThreadUtils.createDefaultInstance(SecurityUtils.class, RandomFactory.class, - factoryClassName); - } catch (ReflectiveOperationException e) { - throw new IllegalArgumentException("instance of " + factoryClassName + " cannot be created"); - } + RandomFactory randomFactory = ServiceLoader.load(RandomFactory.class).iterator().next(); Review Comment: This will need to handle the case that no such service is available. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org