You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ff...@apache.org on 2013/12/10 08:45:47 UTC

svn commit: r1549775 - in /karaf/branches/karaf-2.3.x/jaas/modules/src/main: java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java resources/OSGI-INF/blueprint/karaf-jaas-module.xml

Author: ffang
Date: Tue Dec 10 07:45:46 2013
New Revision: 1549775

URL: http://svn.apache.org/r1549775
Log:
[KARAF-2622]shouldn't encrypt public key for PublickeyLoginModule

Modified:
    karaf/branches/karaf-2.3.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
    karaf/branches/karaf-2.3.x/jaas/modules/src/main/resources/OSGI-INF/blueprint/karaf-jaas-module.xml

Modified: karaf/branches/karaf-2.3.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java?rev=1549775&r1=1549774&r2=1549775&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java (original)
+++ karaf/branches/karaf-2.3.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyLoginModule.java Tue Dec 10 07:45:46 2013
@@ -108,40 +108,8 @@ public class PublickeyLoginModule extend
         String[] infos = userInfos.split(",");
         String storedKey = infos[0];
 
-        // check if the stored password is flagged as encrypted
-        String encryptedKey = getEncryptedPassword(storedKey);
-        if (!storedKey.equals(encryptedKey)) {
-            if (debug) {
-                LOG.debug("The key isn't flagged as encrypted, encrypt it.");
-            }
-            if (debug) {
-                LOG.debug("Rebuild the user informations string.");
-            }
-            userInfos = encryptedKey + ",";
-            for (int i = 2; i < infos.length; i++) {
-                if (i == (infos.length - 1)) {
-                    userInfos = userInfos + infos[i];
-                } else {
-                    userInfos = userInfos + infos[i] + ",";
-                }
-            }
-            if (debug) {
-                LOG.debug("Push back the user informations in the users properties.");
-            }
-            users.put(user, userInfos);
-            try {
-                if (debug) {
-                    LOG.debug("Store the users properties file.");
-                }
-                users.save();
-            } catch (IOException ioe) {
-                LOG.warn("Unable to write user properties file " + f, ioe);
-            }
-            storedKey = encryptedKey;
-        }
-
         // check the provided password
-        if (!checkPassword(getString(key), storedKey)) {
+        if (!getString(key).equals(storedKey)) {
             if (!this.detailedLoginExcepion) {
                 throw new FailedLoginException("login failed");
             } else {

Modified: karaf/branches/karaf-2.3.x/jaas/modules/src/main/resources/OSGI-INF/blueprint/karaf-jaas-module.xml
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/jaas/modules/src/main/resources/OSGI-INF/blueprint/karaf-jaas-module.xml?rev=1549775&r1=1549774&r2=1549775&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/jaas/modules/src/main/resources/OSGI-INF/blueprint/karaf-jaas-module.xml (original)
+++ karaf/branches/karaf-2.3.x/jaas/modules/src/main/resources/OSGI-INF/blueprint/karaf-jaas-module.xml Tue Dec 10 07:45:46 2013
@@ -56,12 +56,6 @@
         <jaas:module className="org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule" flags="sufficient">
             users = $[karaf.base]/etc/keys.properties
             detailed.login.exception = ${detailed.login.exception}
-            encryption.name = ${encryption.name}
-            encryption.enabled = ${encryption.enabled}
-            encryption.prefix = ${encryption.prefix}
-            encryption.suffix = ${encryption.suffix}
-            encryption.algorithm = ${encryption.algorithm}
-            encryption.encoding = ${encryption.encoding}
         </jaas:module>
     </jaas:config>