Skip to content

Commit 6fdb63d

Browse files
author
afelisatti
committed
AsyncHttpClient#874: Adding support for MD5-sess algorithm in digest authentication.
1 parent 25002d5 commit 6fdb63d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/ning/http/client/Realm.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,16 @@ private void newResponse() throws UnsupportedEncodingException {
566566
.toString().getBytes("ISO-8859-1"));
567567
byte[] ha1 = md.digest();
568568

569+
if ("MD5-sess".equals(algorithm)) {
570+
md.update(new StringBuilder(toBase16(ha1))
571+
.append(":")
572+
.append(nonce)
573+
.append(":")
574+
.append(cnonce)
575+
.toString().getBytes("ISO-8859-1"));
576+
ha1 = md.digest();
577+
}
578+
569579
md.reset();
570580

571581
//HA2 if qop is auth-int is methodName:url:md5(entityBody)

0 commit comments

Comments
 (0)