summaryrefslogtreecommitdiff
path: root/wsgitools/digest.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2008-10-14 13:57:14 +0200
committerHelmut Grohne <helmut@subdivi.de>2008-10-14 13:57:14 +0200
commit79ac8a24be0513a64d0049763a412a9cfd16d9a4 (patch)
tree9743267464dd6da45ff1571ccf1577be78dd69d3 /wsgitools/digest.py
parentbf0a9387e8d947b9f32d696731082da828059a15 (diff)
downloadwsgitools-79ac8a24be0513a64d0049763a412a9cfd16d9a4.tar.gz
small digest cleanup
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-xwsgitools/digest.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index 1339fbb..d85ea39 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -433,19 +433,17 @@ class AuthDigestMiddleware:
a1h = self.gentoken(username, algo)
if a1h is None:
raise ValueError
- a2 = "%s:%s" % (reqmethod, uri)
- a2h = self.algorithms[algo](a2)
+ a2h = self.algorithms[algo]("%s:%s" % (reqmethod, uri))
qop = credentials.get("qop", None)
if qop is None:
dig = ":".join((a1h, nonce, a2h))
else:
- nc = credentials["nc"] # raises KeyError
- cnonce = credentials["cnonce"] # raises KeyError
if qop != "auth":
return ValueError
- dig = ":".join((a1h, nonce, nc, cnonce, qop, a2h))
- digh = self.algorithms[algo](dig)
- return digh
+ # raises KeyError
+ dig = ":".join((a1h, nonce, credentials["nc"],
+ credentials["cnonce"], qop, a2h))
+ return self.algorithms[algo](dig)
def authorization_required(self, environ, start_response, stale=False):
"""internal method implementing wsgi interface, serving 401 page"""