mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Fixed MD5 auth
This commit is contained in:
@@ -94,8 +94,7 @@ public class BasicLogin extends HttpServlet {
|
||||
if (info != null) {
|
||||
|
||||
// Validate username and password
|
||||
if (info.getAuthorizedUsername().equals(username)
|
||||
&& info.getAuthorizedPassword().equals(password)) {
|
||||
if (info.validate(username, password)) {
|
||||
|
||||
// Store authorized configuration
|
||||
HttpSession session = req.getSession(true);
|
||||
|
@@ -40,14 +40,6 @@ public class BasicUserMappingContentHandler extends DefaultHandler {
|
||||
this.auth_encoding = auth_encoding;
|
||||
}
|
||||
|
||||
public String getAuthorizedUsername() {
|
||||
return auth_username;
|
||||
}
|
||||
|
||||
public String getAuthorizedPassword() {
|
||||
return auth_password;
|
||||
}
|
||||
|
||||
private static final char HEX_CHARS[] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
|
||||
@@ -87,7 +79,7 @@ public class BasicUserMappingContentHandler extends DefaultHandler {
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance("MD5");
|
||||
String hashedPassword = getHexString(digest.digest(password.getBytes()));
|
||||
return hashedPassword.equals(auth_password);
|
||||
return hashedPassword.equals(auth_password.toUpperCase());
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
throw new UnsupportedOperationException("Unexpected lack of MD5 support.", e);
|
||||
@@ -137,7 +129,7 @@ public class BasicUserMappingContentHandler extends DefaultHandler {
|
||||
|
||||
// Finalize mapping for this user
|
||||
authMapping.put(
|
||||
current.getAuthorizedUsername(),
|
||||
current.auth_username,
|
||||
current
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user