tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Dunne" <barrydu...@hotmail.com>
Subject Re: [PATCH] Digest Authentication
Date Tue, 29 Jul 2003 12:20:11 GMT
carlos.quiroz-castro@nokia.com wrote:

>Here I attach a patch for DigestAuthentication.java that should fix the 
>problems with DIGEST authentication.
>
>-                // in some cases qop has quotes, and in some not. We'll 
>support both
>-                if (currentTokenValue.startsWith("\"") && 
>currentTokenValue.endsWith("\"")) {
>-                  qop = removeQuotes(currentTokenValue);
>-                } else {
>-                  qop = currentTokenValue;
>-                }


It appears that qop is not the only problem, the sun java plug-in (v1.4.1) 
sends the nc value quoted.
This prevents applets logging in.

It might be worth leaving  qop = removeQuotes(currentTokenValue);
change the nc line to call removeQuotes, i.e.  nc = 
removeQuotes(currentTokenValue);
and add a test to the start of removeQuotes method as follows:

    protected static String removeQuotes(String quotedString) {
        if ((!quotedString.startsWith("\"")) || 
(!quotedString.endsWith("\"")))
            return quotedString;
        if (quotedString.length() > 2) {
            return quotedString.substring(1, quotedString.length() - 1);
        } else {
            return new String();
        }
    }

This would prevent the same problem happening on any of the digest fields.

Barry.

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message