diff options
author | Helmut Grohne <helmut@subdivi.de> | 2008-10-14 13:57:14 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2008-10-14 13:57:14 +0200 |
commit | 79ac8a24be0513a64d0049763a412a9cfd16d9a4 (patch) | |
tree | 9743267464dd6da45ff1571ccf1577be78dd69d3 /wsgitools/digest.py | |
parent | bf0a9387e8d947b9f32d696731082da828059a15 (diff) | |
download | wsgitools-79ac8a24be0513a64d0049763a412a9cfd16d9a4.tar.gz |
small digest cleanup
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-x | wsgitools/digest.py | 12 |
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""" |