mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-774: Deal with deprecated Provider constructor.
This commit is contained in:
@@ -20,9 +20,12 @@
|
|||||||
package org.apache.guacamole.auth.radius;
|
package org.apache.guacamole.auth.radius;
|
||||||
|
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
|
import org.apache.guacamole.GuacamoleServerException;
|
||||||
import org.apache.guacamole.auth.radius.conf.ConfigurationService;
|
import org.apache.guacamole.auth.radius.conf.ConfigurationService;
|
||||||
import org.apache.guacamole.auth.radius.conf.RadiusAuthenticationProtocol;
|
import org.apache.guacamole.auth.radius.conf.RadiusAuthenticationProtocol;
|
||||||
import org.apache.guacamole.auth.radius.conf.RadiusGuacamoleProperties;
|
import org.apache.guacamole.auth.radius.conf.RadiusGuacamoleProperties;
|
||||||
@@ -57,7 +60,6 @@ public class RadiusAuthenticationProviderModule extends AbstractModule {
|
|||||||
* If an error occurs while retrieving the Guacamole server
|
* If an error occurs while retrieving the Guacamole server
|
||||||
* environment.
|
* environment.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public RadiusAuthenticationProviderModule(AuthenticationProvider authProvider)
|
public RadiusAuthenticationProviderModule(AuthenticationProvider authProvider)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
|
|
||||||
@@ -72,11 +74,28 @@ public class RadiusAuthenticationProviderModule extends AbstractModule {
|
|||||||
|| innerProtocol == RadiusAuthenticationProtocol.MSCHAPv1
|
|| innerProtocol == RadiusAuthenticationProtocol.MSCHAPv1
|
||||||
|| innerProtocol == RadiusAuthenticationProtocol.MSCHAPv2) {
|
|| innerProtocol == RadiusAuthenticationProtocol.MSCHAPv2) {
|
||||||
|
|
||||||
Security.addProvider(new Provider("MD4", 0.00, "MD4 for MSCHAPv1/2 Support") {
|
try {
|
||||||
{
|
Provider md4Provider;
|
||||||
this.put("MessageDigest.MD4", org.bouncycastle.jce.provider.JDKMessageDigest.MD4.class.getName());
|
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");
|
||||||
|
else
|
||||||
|
md4Provider = (Provider) Provider.class
|
||||||
|
.getConstructor(String.class, Double.class, String.class)
|
||||||
|
.newInstance("MD4", 0.00, "MD4 for MSCHAPv1/2 Support");
|
||||||
|
|
||||||
|
assert(md4Provider != null);
|
||||||
|
md4Provider.put("MessageDigest.MD4", org.bouncycastle.jce.provider.JDKMessageDigest.MD4.class.getName());
|
||||||
|
Security.addProvider(md4Provider);
|
||||||
|
}
|
||||||
|
catch (IllegalAccessException
|
||||||
|
| InstantiationException
|
||||||
|
| InvocationTargetException
|
||||||
|
| NoSuchMethodException e) {
|
||||||
|
throw new GuacamoleServerException("Unable to load MD4 support.", e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user