Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
webconsole-4.2.10
-
None
Description
The following exception occurs, when you try to save the webconsole configuration from the web console config plugin:
java.lang.NullPointerException java.security.MessageDigest$Delegate(java.security.MessageDigest).update(byte[]) line: 293 java.security.MessageDigest$Delegate(java.security.MessageDigest).digest(byte[]) line: 368 org.apache.felix.webconsole.internal.servlet.Password.hashPassword(byte[], java.lang.String) line: 178 org.apache.felix.webconsole.internal.servlet.Password.hashPassword(java.lang.String, byte[]) line: 118 org.apache.felix.webconsole.internal.servlet.Password.hashPassword(java.lang.String) line: 77
The implementation obviously expects password to be always set.
However initially the configuration doesn't exist and when you create it with web console, the password is not set yet.
However, if you do not edit the password in the configuration dialog, it is set to a PASSWORD_PLACEHOLDER_VALUE = "unmodifed".
Then the following code becomes the reason of the problem, because of the incorrect assumption:
// assumption: config is not null and as a non-null password String property final String pwd = ( String ) config.get( OsgiManager.PROP_PASSWORD ); final String hashedPassword = Password.hashPassword( pwd );