~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-11 14:26:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5852.
  • Revision ID: jelmer@samba.org-20110511142641-wbx6svyykkgtq24u
Use osutils.sha_string() when possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1402
1402
    if algorithm == 'MD5':
1403
1403
        H = lambda x: osutils.md5(x).hexdigest()
1404
1404
    elif algorithm == 'SHA':
1405
 
        H = lambda x: osutils.sha(x).hexdigest()
 
1405
        H = lambda x: osutils.sha_string(x)
1406
1406
    if H is not None:
1407
1407
        KD = lambda secret, data: H("%s:%s" % (secret, data))
1408
1408
    return H, KD
1411
1411
def get_new_cnonce(nonce, nonce_count):
1412
1412
    raw = '%s:%d:%s:%s' % (nonce, nonce_count, time.ctime(),
1413
1413
                           urllib2.randombytes(8))
1414
 
    return osutils.sha(raw).hexdigest()[:16]
 
1414
    return osutils.sha_string(raw)[:16]
1415
1415
 
1416
1416
 
1417
1417
class DigestAuthHandler(AbstractAuthHandler):