| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/cred/ |
Upload File : |
ó
[³XMc @ sY d Z d d l m Z m Z i e d 6e d 6e d 6Z d d „ Z d „ Z d „ Z d S(
s^
Calculations for HTTP Digest authentication.
@see: U{http://www.faqs.org/rfcs/rfc2617.html}
iÿÿÿÿ( t md5t sha1R s md5-sesst shac C s | r' | s | s | r' t d ƒ ‚ n | d k r t | ƒ } | j | ƒ | j d ƒ | j | ƒ | j d ƒ | j | ƒ | j ƒ } n | j d ƒ } | d k rt | ƒ } | j | ƒ | j d ƒ | j | ƒ | j d ƒ | j | ƒ | j ƒ } n | j d ƒ S( s:
Compute H(A1) from RFC 2617.
@param pszAlg: The name of the algorithm to use to calculate the digest.
Currently supported are md5, md5-sess, and sha.
@param pszUserName: The username
@param pszRealm: The realm
@param pszPassword: The password
@param pszNonce: The nonce
@param pszCNonce: The cnonce
@param preHA1: If available this is a str containing a previously
calculated H(A1) as a hex string. If this is given then the values for
pszUserName, pszRealm, and pszPassword must be C{None} and are ignored.
sP preHA1 is incompatible with the pszUserName, pszRealm, and pszPassword argumentst :t hexs md5-sessN( t TypeErrort Nonet
algorithmst updatet digestt decodet encode( t pszAlgt pszUserNamet pszRealmt pszPasswordt pszNoncet pszCNoncet preHA1t mt HA1( ( s8 /usr/lib/python2.7/dist-packages/twisted/cred/_digest.pyt calcHA1! s(
c C sp t | ƒ } | j | ƒ | j d ƒ | j | ƒ | d k r] | j d ƒ | j | ƒ n | j ƒ j d ƒ S( s÷
Compute H(A2) from RFC 2617.
@param pszAlg: The name of the algorithm to use to calculate the digest.
Currently supported are md5, md5-sess, and sha.
@param pszMethod: The request method.
@param pszDigestUri: The request URI.
@param pszQop: The Quality-of-Protection value.
@param pszHEntity: The hash of the entity body or C{None} if C{pszQop} is
not C{'auth-int'}.
@return: The hash of the A2 value for the calculation of the response
digest.
R s auth-intR ( R R R R ( t algot pszMethodt pszDigestUrit pszQopt
pszHEntityR ( ( s8 /usr/lib/python2.7/dist-packages/twisted/cred/_digest.pyt calcHA2P s
c C sÄ t | ƒ } | j | ƒ | j d ƒ | j | ƒ | j d ƒ | rž | rž | j | ƒ | j d ƒ | j | ƒ | j d ƒ | j | ƒ | j d ƒ n | j | ƒ | j ƒ j d ƒ } | S( s
Compute the digest for the given parameters.
@param HA1: The H(A1) value, as computed by L{calcHA1}.
@param HA2: The H(A2) value, as computed by L{calcHA2}.
@param pszNonce: The challenge nonce.
@param pszNonceCount: The (client) nonce count value for this response.
@param pszCNonce: The client nonce.
@param pszQop: The Quality-of-Protection value.
R R ( R R R R ( R t HA2R R t
pszNonceCountR R R t respHash( ( s8 /usr/lib/python2.7/dist-packages/twisted/cred/_digest.pyt calcResponseh s
N( t __doc__t twisted.python.hashlibR R R R R R R ( ( ( s8 /usr/lib/python2.7/dist-packages/twisted/cred/_digest.pyt <module> s
.