Commit f3ba51ee authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed security hole. Send hashed password to the browser. JM-817

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5143 b35dd754-fafc-0310-a699-88a17e54d16e
parent dfd5005b
...@@ -49,7 +49,19 @@ ...@@ -49,7 +49,19 @@
service.setPort(25); service.setPort(25);
} }
service.setUsername(username); service.setUsername(username);
service.setPassword(password); // Get hash values of existing password and new one
String existingHashPassword = "";
String newHashPassword = "";
if (service.getPassword() != null) {
existingHashPassword = StringUtils.hash(service.getPassword());
}
if (password != null) {
newHashPassword = StringUtils.hash(password);
}
// Change password if hash values are different
if (!existingHashPassword.equals(newHashPassword)) {
service.setPassword(password);
}
service.setDebugEnabled(debug); service.setDebugEnabled(debug);
service.setSSLEnabled(ssl); service.setSSLEnabled(ssl);
...@@ -176,7 +188,7 @@ ...@@ -176,7 +188,7 @@
<fmt:message key="system.email.server_password" />: <fmt:message key="system.email.server_password" />:
</td> </td>
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="password" name="server_password" value="<%= (password != null) ? password : "" %>" size="40" maxlength="150"> <input type="password" name="server_password" value="<%= (password != null) ? StringUtils.hash(password) : "" %>" size="40" maxlength="150">
</td> </td>
</tr> </tr>
......
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