You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "tomaswolf (via GitHub)" <gi...@apache.org> on 2024/09/02 15:38:04 UTC

Re: [PR] Add option to be able to use BCFIPS when BC is blocked in a FIPS environment [mina-sshd]

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-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org