Module digest_md5
source code
DIGEST-MD5 authentication mechanism for PyXMPP SASL implementation.
- Normative reference:
- 
    | str |  | 
    | str | 
        
          | _quote(s) Prepare a string for quoting for DIGEST-MD5 challenge or response.
 | source code |  | 
    | str |  | 
    | str |  | 
    | str |  | 
    | str |  | 
    | str |  | 
    |  | __revision__ = '$Id: digest_md5.py 683 2008-12-05 18:25:45Z ja... | 
    |  | quote_re = re.compile(r'(?<!\\)\\(.)') | 
    |  | _param_re = re.compile(r'^(?P<var>[^=]+)=(?P<val>("(([^"\\]+)|... | 
    |  | __package__ = 'pyxmpp.sasl' | 
Imports:
  b2a_hex,
  re,
  logging,
  hashlib,
  md5,
  md5_factory,
  ClientAuthenticator,
  ServerAuthenticator,
  Response,
  Challenge,
  Success,
  Failure,
  to_utf8,
  from_utf8
| Unquote quoted value from DIGEST-MD5 challenge or response. If sdoesn't start or doesn't end with '"' then return it unchanged,
remove the quotes and escape backslashes otherwise. 
    Parameters:
        s(str) - a quoted string.Returns: strthe unquoted string. | 
 
| Prepare a string for quoting for DIGEST-MD5 challenge or response. Don't add the quotes, only escape '"' and "" with backslashes. 
    Parameters:Returns: strswith '"' and "" escaped using "". | 
 
| H function of the DIGEST-MD5 algorithm (MD5 sum). 
    Parameters:Returns: strMD5 sum of the string. | 
 
| KD function of the DIGEST-MD5 algorithm. 
    Parameters:
        k(str) - a string.s(str) - a string.Returns: strMD5 sum of the strings joined with ':'. | 
 
| Compute MD5 sum of username:realm:password. 
    Parameters:
        username(str) - a username.realm(str) - a realm.passwd(str) - a password.Returns: strthe MD5 sum of the parameters joined with ':'. | 
 
| 
  Compute DIGEST-MD5 response value.| _compute_response(urp_hash,
        nonce,
        cnonce,
        nonce_count,
        authzid,
        digest_uri)
   | source code |  
    Parameters:
        urp_hash(str) - MD5 sum of username:realm:password.nonce(str) - nonce value from a server challenge.cnonce- cnonce value from the client response.nonce_count(int) - nonce count value.authzid(str) - authorization id.digest_uri(str) - digest-uri value.Returns: strthe computed response value. | 
 
| 
  Compute DIGEST-MD5 rspauth value.| _compute_response_auth(urp_hash,
        nonce,
        cnonce,
        nonce_count,
        authzid,
        digest_uri)
   | source code |  
    Parameters:
        urp_hash(str) - MD5 sum of username:realm:password.nonce(str) - nonce value from a server challenge.cnonce- cnonce value from the client response.nonce_count(int) - nonce count value.authzid(str) - authorization id.digest_uri(str) - digest-uri value.Returns: strthe computed rspauth value. | 
 
| __revision__
   
    Value:| 
'$Id: digest_md5.py 683 2008-12-05 18:25:45Z jajcus $' | 
 | 
 
| _param_re
   
    Value:| 
re.compile(r'^(?P<var>[^=]+)=(?P<val>("(([^"\\]+)|(\\")|(\\\\))+")|([^ ", ]+))(\s*,\s*(?P<rest>.*))?$') | 
 |