~ubuntu-branches/debian/jessie/cherrypy3/jessie

« back to all changes in this revision

Viewing changes to cherrypy/lib/httpauth.py

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-08-15 14:52:43 UTC
  • mfrom: (6.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090815145243-ydtmn7e0vejt4r3l
* New upstream release (Closes: #528473)
* debian/rules:
- use the quilt make include file instead of using custom code; should
  make the package convertable to the new quilt source format
  (Closes: #538677)
* debian/control:
- updated Standards-Version with no changes
* debian/python-cherrypy3.links:
- fix link to point to the new place where python-support installs files

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
           "calculateNonce", "SUPPORTED_QOP")
60
60
 
61
61
################################################################################
62
 
import md5
 
62
 
 
63
try:
 
64
    # Python 2.5+
 
65
    from hashlib import md5
 
66
except ImportError:
 
67
    from md5 import new as md5
 
68
 
63
69
import time
64
70
import base64
65
71
import urllib2
76
82
# doAuth
77
83
#
78
84
DIGEST_AUTH_ENCODERS = {
79
 
    MD5: lambda val: md5.new (val).hexdigest (),
80
 
    MD5_SESS: lambda val: md5.new (val).hexdigest (),
81
 
#    SHA: lambda val: sha.new (val).hexdigest (),
 
85
    MD5: lambda val: md5(val).hexdigest(),
 
86
    MD5_SESS: lambda val: md5(val).hexdigest(),
 
87
#    SHA: lambda val: sha(val).hexdigest(),
82
88
}
83
89
 
84
90
def calculateNonce (realm, algorithm = MD5):