From 5ff3346774d63906bdef1a3c9ad357fe955dcfc2 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 15 Apr 2009 12:49:39 +0000 Subject: [PATCH] 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 --- .../main/java/org/eclipse/jetty/http/security/Credential.java | 2 ++ .../jetty/security/authentication/DigestAuthenticator.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java index a85b8b476ef..36e222cf45e 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java @@ -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) diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java index c8e9daf15b2..88a368af197 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java @@ -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