Commit fbb9b66c authored by Matt Tucker's avatar Matt Tucker Committed by matt

Updated version, fixed creating new user accounts after intiail install (JM-636).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3746 b35dd754-fafc-0310-a699-88a17e54d16e
parent b89046c2
...@@ -281,7 +281,7 @@ public class XMPPServer { ...@@ -281,7 +281,7 @@ public class XMPPServer {
name = JiveGlobals.getProperty("xmpp.domain", "127.0.0.1").toLowerCase(); name = JiveGlobals.getProperty("xmpp.domain", "127.0.0.1").toLowerCase();
version = new Version(2, 6, 0, Version.ReleaseStatus.Release, -1); version = new Version(2, 6, 1, Version.ReleaseStatus.Release, -1);
if ("true".equals(JiveGlobals.getXMLProperty("setup"))) { if ("true".equals(JiveGlobals.getXMLProperty("setup"))) {
setupMode = false; setupMode = false;
} }
......
...@@ -75,6 +75,11 @@ public class DefaultUserProvider implements UserProvider { ...@@ -75,6 +75,11 @@ public class DefaultUserProvider implements UserProvider {
if (keyString == null) { if (keyString == null) {
keyString = StringUtils.randomString(15); keyString = StringUtils.randomString(15);
JiveGlobals.setProperty("passwordKey", keyString); JiveGlobals.setProperty("passwordKey", keyString);
// Check to make sure that setting the property worked. It won't work,
// for example, when in setup mode.
if (!keyString.equals(JiveGlobals.getProperty("passwordKey"))) {
return null;
}
} }
cipher = new Blowfish(keyString); cipher = new Blowfish(keyString);
} }
...@@ -133,9 +138,12 @@ public class DefaultUserProvider implements UserProvider { ...@@ -133,9 +138,12 @@ public class DefaultUserProvider implements UserProvider {
boolean usePlainPassword = JiveGlobals.getBooleanProperty("user.usePlainPassword"); boolean usePlainPassword = JiveGlobals.getBooleanProperty("user.usePlainPassword");
String encryptedPassword = null; String encryptedPassword = null;
if (!usePlainPassword) { if (!usePlainPassword) {
encryptedPassword = getCipher().encryptString(password); Blowfish cipher = getCipher();
// Set password to null so that it's inserted that way. if (cipher != null) {
password = null; encryptedPassword = cipher.encryptString(password);
// Set password to null so that it's inserted that way.
password = null;
}
} }
Date now = new Date(); Date now = new Date();
...@@ -429,11 +437,12 @@ public class DefaultUserProvider implements UserProvider { ...@@ -429,11 +437,12 @@ public class DefaultUserProvider implements UserProvider {
String plainText = rs.getString(1); String plainText = rs.getString(1);
String encrypted = rs.getString(2); String encrypted = rs.getString(2);
if (encrypted != null) { if (encrypted != null) {
return getCipher().decryptString(encrypted); Blowfish cipher = getCipher();
} if (cipher != null) {
else { return cipher.decryptString(encrypted);
return plainText; }
} }
return plainText;
} }
catch (SQLException sqle) { catch (SQLException sqle) {
throw new UserNotFoundException(sqle); throw new UserNotFoundException(sqle);
...@@ -456,9 +465,12 @@ public class DefaultUserProvider implements UserProvider { ...@@ -456,9 +465,12 @@ public class DefaultUserProvider implements UserProvider {
boolean usePlainPassword = JiveGlobals.getBooleanProperty("user.usePlainPassword"); boolean usePlainPassword = JiveGlobals.getBooleanProperty("user.usePlainPassword");
String encryptedPassword = null; String encryptedPassword = null;
if (!usePlainPassword) { if (!usePlainPassword) {
encryptedPassword = getCipher().encryptString(password); Blowfish cipher = getCipher();
// Set password to null so that it's inserted that way. if (cipher != null) {
password = null; encryptedPassword = cipher.encryptString(password);
// Set password to null so that it's inserted that way.
password = null;
}
} }
Connection con = null; Connection con = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment