From ecb99be7d30d406868ec50c90be6e12a332c6c2d Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Fri, 24 Jun 2011 13:47:43 -0700 Subject: Ignore case on digest algorithms. Change-Id: If80c5f6ecca609abdb3b274e00b8ea8a75248f23 http://code.google.com/p/android/issues/detail?id=16051 --- src/org/apache/http/impl/auth/DigestScheme.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/apache/http/impl/auth/DigestScheme.java b/src/org/apache/http/impl/auth/DigestScheme.java index 803807b..cae05ee 100644 --- a/src/org/apache/http/impl/auth/DigestScheme.java +++ b/src/org/apache/http/impl/auth/DigestScheme.java @@ -304,7 +304,7 @@ public class DigestScheme extends RFC2617Scheme { String a1 = tmp.toString(); //a1 is suitable for MD5 algorithm - if(algorithm.equals("MD5-sess")) { + if(algorithm.equalsIgnoreCase("MD5-sess")) { // android-changed: ignore case // H( unq(username-value) ":" unq(realm-value) ":" passwd ) // ":" unq(nonce-value) // ":" unq(cnonce-value) @@ -319,7 +319,7 @@ public class DigestScheme extends RFC2617Scheme { tmp3.append(':'); tmp3.append(cnonce); a1 = tmp3.toString(); - } else if (!algorithm.equals("MD5")) { + } else if (!algorithm.equalsIgnoreCase("MD5")) { // android-changed: ignore case throw new AuthenticationException("Unhandled algorithm " + algorithm + " requested"); } String md5a1 = encode(md5Helper.digest(EncodingUtils.getBytes(a1, charset))); -- cgit v1.1