better char[] credential support

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@152 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-04-15 12:49:39 +00:00
parent 3a129bb90f
commit 5ff3346774
2 changed files with 4 additions and 0 deletions

View File

@ -132,6 +132,8 @@ public abstract class Credential
{
byte[] digest = null;
if (credentials instanceof char[])
credentials=new String((char[])credentials);
if (credentials instanceof Password || credentials instanceof String)
{
synchronized (__md5Lock)

View File

@ -266,6 +266,8 @@ public class DigestAuthenticator extends LoginAuthenticator
/* ------------------------------------------------------------ */
public boolean check(Object credentials)
{
if (credentials instanceof char[])
credentials=new String((char[])credentials);
String password = (credentials instanceof String) ? (String) credentials : credentials.toString();
try