~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-12 07:53:55 UTC
  • mfrom: (5849.1.3 use-sha-string)
  • Revision ID: pqm@pqm.ubuntu.com-20110512075355-oukrddgzhx2xkkfi
(jelmer) Use osutils.sha_string / osutils.sha_strings in a couple more
 places. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

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