Skip to content
Myr

Merge pull request #2415 from sigmavirus24/bug/2408

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Move noncebit to the only place it is used

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 2f7f6a5, 677bbe3 · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:requests/auth.py+3 added-1 removed
122 unmodified lines
123 s += time.ctime().encode('utf-8')124 s += os.urandom(8)125126 cnonce = (hashlib.sha1(s).hexdigest()[:16])127 noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, HA2)127 if _algorithm == 'MD5-SESS':128 HA1 = hash_utf8('%s:%s:%s' % (HA1, nonce, cnonce))129130 if qop is None:131 respdig = KD(HA1, "%s:%s" % (nonce, HA2))132 elif qop == 'auth' or 'auth' in qop.split(','):133 noncebit = "%s:%s:%s:%s:%s" % (134 nonce, ncvalue, cnonce, 'auth', HA2135 )136 respdig = KD(HA1, noncebit)137 else:138 # XXX handle auth-int.139 return None
72 unmodified lines