Mercurial > pidgin
diff src/cipher.h @ 12382:cfc808463763
[gaim-migrate @ 14688]
Reimplement HTTP Digest Authentication (RFC 2617) as part of the Cipher API
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Wed, 07 Dec 2005 04:50:36 +0000 |
| parents | fc464a0abccc |
| children | 4e045668b9d0 |
line wrap: on
line diff
--- a/src/cipher.h Wed Dec 07 01:47:31 2005 +0000 +++ b/src/cipher.h Wed Dec 07 04:50:36 2005 +0000 @@ -386,6 +386,49 @@ */ gpointer gaim_cipher_context_get_data(GaimCipherContext *context); +/** + * Calculates a session key for HTTP Digest authentation + * + * See RFC 2617 for more information. + * + * @param algorithm The hash algorithm to use + * @param username The username provided by the user + * @param realm The authentication realm provided by the server + * @param password The password provided by the user + * @param nonce The nonce provided by the server + * @param client_nonce The nonce provided by the client + * + * @return The session key, or @c NULL if an error occurred. + */ +gchar *gaim_cipher_http_digest_calculate_session_key( + const gchar *algorithm, const gchar *username, + const gchar *realm, const gchar *password, + const gchar *nonce, const gchar *client_nonce); + +/** Calculate a response for HTTP Digest authentication + * + * See RFC 2617 for more information. + * + * @param algorithm The hash algorithm to use + * @param method The HTTP method in use + * @param digest_uri The URI from the initial request + * @param qop The "quality of protection" + * @param hashed_entity The hashed entity body + * @param hashed_entity_len The length of the data in @a hashed_entity + * @param nonce The nonce provided by the server + * @param nonce_count The nonce count + * @param client_nonce The nonce provided by the client + * @param session_key The session key from gaim_cipher_http_digest_calculate_session_key() + * + * @return The hashed response, or @c NULL if an error occurred. + */ +gchar *gaim_cipher_http_digest_calculate_response( + const gchar *algorithm, const gchar *method, + const gchar *digest_uri, const gchar *qop, + const gchar *hashed_entity, size_t hashed_entity_len, + const gchar *nonce, const gchar *nonce_count, + const gchar *client_nonce, const gchar *session_key); + /*@}*/ #ifdef __cplusplus
