

def _computeDigestResponse(auth_map, password, method='GET', A1=None, **kwargs):
    '\n    Generates a response respecting the algorithm defined in RFC 2617\n    '
    params = auth_map
    algorithm = params.get('algorithm', MD5)
    H = DIGEST_AUTH_ENCODERS[algorithm]
    KD = (lambda secret, data: H(((secret + ':') + data)))
    qop = params.get('qop', None)
    H_A2 = H(_A2(params, method, kwargs))
    if ((algorithm == MD5_SESS) and (A1 is not None)):
        H_A1 = H(A1)
    else:
        H_A1 = H(_A1(params, password))
    if (qop in ('auth', 'auth-int')):
        request = ('%s:%s:%s:%s:%s' % (params['nonce'], params['nc'], params['cnonce'], params['qop'], H_A2))
    elif (qop is None):
        request = ('%s:%s' % (params['nonce'], H_A2))
    return KD(H_A1, request)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/cherrypy/cherrypy/lib/httpauth.py _computeDigestResponse/original