tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1548182 - /tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
Date Thu, 05 Dec 2013 16:07:40 GMT
Author: markt
Date: Thu Dec  5 16:07:40 2013
New Revision: 1548182

URL: http://svn.apache.org/r1548182
Log:
Additional fix for BZ 55839 required by DataSourceRealm

Modified:
    tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java?rev=1548182&r1=1548181&r2=1548182&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java Thu Dec  5 16:07:40 2013
@@ -295,12 +295,7 @@ public class DataSourceRealm extends Rea
         String dbCredentials = getPassword(dbConnection, username);
 
         // Validate the user's credentials
-        boolean validated = false;
-        if (hasMessageDigest()) {
-            // Hex hashes should be compared case-insensitive
-            validated = (digest(credentials).equalsIgnoreCase(dbCredentials));
-        } else
-            validated = (digest(credentials).equals(dbCredentials));
+        boolean validated = compareCredentials(credentials, dbCredentials);
 
         if (validated) {
             if (containerLog.isTraceEnabled())
@@ -318,8 +313,7 @@ public class DataSourceRealm extends Rea
         ArrayList<String> list = getRoles(dbConnection, username);
 
         // Create and return a suitable Principal for this user
-        return (new GenericPrincipal(username, credentials, list));
-
+        return new GenericPrincipal(username, credentials, list);
     }
 
 



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


Mime
View raw message