You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2019/08/13 17:58:11 UTC

[GitHub] [guacamole-client] necouchman commented on a change in pull request #440: GUACAMOLE-774: Fix deprecation issue with Java 9 and up.

necouchman commented on a change in pull request #440: GUACAMOLE-774: Fix deprecation issue with Java 9 and up.
URL: https://github.com/apache/guacamole-client/pull/440#discussion_r313533842
 
 

 ##########
 File path: extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusAuthenticationProviderModule.java
 ##########
 @@ -71,11 +74,28 @@ public RadiusAuthenticationProviderModule(AuthenticationProvider authProvider)
                     || innerProtocol == RadiusAuthenticationProtocol.MSCHAPv1 
                     || innerProtocol == RadiusAuthenticationProtocol.MSCHAPv2) {
             
-            Security.addProvider(new Provider("MD4", 0.00, "MD4 for MSCHAPv1/2 Support") {
-                {
-                    this.put("MessageDigest.MD4", org.bouncycastle.jce.provider.JDKMessageDigest.MD4.class.getName());
-                }
-            });
+            try {
+                Provider md4Provider;
+                Constructor providerConstructor = Provider.class
+                        .getConstructor(String.class, String.class, String.class);
+                if (providerConstructor != null)
+                    md4Provider = (Provider) providerConstructor
+                            .newInstance("MD4", "0.00", "MD4 for MSCHAPv1/2 Support");
 
 Review comment:
   I'm not sure - details on that seem to be few and far between.  But maybe there's an easier way than this, even...
   ```
   try {
       MessageDigest.getInstance("MD4");
   }
   catch (NoSuchAlgorithmException e)
   {
       Security.addProvider(new BouncyCastleProvider());
   }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services