From: Ian Cordasco Date: Tue, 20 Jan 2015 00:50:50 +0000 (-0600) Subject: Move noncebit to the only place it is used X-Git-Tag: v2.5.2~13^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=677bbe30d7b26b006d8b38107e1db9cbd429ac2f;p=services%2Fpython-requests.git Move noncebit to the only place it is used Since we only allow for "auth" qop-value, hardcode it Fixes #2408 --- diff --git a/requests/auth.py b/requests/auth.py index b950181..d1c4825 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -124,13 +124,15 @@ class HTTPDigestAuth(AuthBase): s += os.urandom(8) cnonce = (hashlib.sha1(s).hexdigest()[:16]) - noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, HA2) if _algorithm == 'MD5-SESS': HA1 = hash_utf8('%s:%s:%s' % (HA1, nonce, cnonce)) if qop is None: respdig = KD(HA1, "%s:%s" % (nonce, HA2)) elif qop == 'auth' or 'auth' in qop.split(','): + noncebit = "%s:%s:%s:%s:%s" % ( + nonce, ncvalue, cnonce, 'auth', HA2 + ) respdig = KD(HA1, noncebit) else: # XXX handle auth-int.