summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-06-24 13:47:43 -0700
committerJesse Wilson <jessewilson@google.com>2011-06-24 13:47:43 -0700
commitecb99be7d30d406868ec50c90be6e12a332c6c2d (patch)
tree58368615dd772f2b250a5160b0b4a4ca759d4123
parent61cfd01713e62f4997e3937886c887eaa6603c69 (diff)
downloadexternal_apache-http-ecb99be7d30d406868ec50c90be6e12a332c6c2d.zip
external_apache-http-ecb99be7d30d406868ec50c90be6e12a332c6c2d.tar.gz
external_apache-http-ecb99be7d30d406868ec50c90be6e12a332c6c2d.tar.bz2
Ignore case on digest algorithms.
Change-Id: If80c5f6ecca609abdb3b274e00b8ea8a75248f23 http://code.google.com/p/android/issues/detail?id=16051
-rw-r--r--src/org/apache/http/impl/auth/DigestScheme.java4
1 files 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)));