From 8dac04451d23627af7be3b50ca13a9d882ac4ad6 Mon Sep 17 00:00:00 2001 From: "Justus Winter, corvid" Date: Thu, 29 Sep 2011 16:21:28 +0000 Subject: rest of digest authentication Justus contributed the original patch in April 2009. I read RFCs, fixed bugs, restructured, tested. --- src/auth.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/auth.h') diff --git a/src/auth.h b/src/auth.h index 5f96f642..f78eb59b 100644 --- a/src/auth.h +++ b/src/auth.h @@ -7,8 +7,29 @@ extern "C" { #include "url.h" +enum AuthParseHTTPAuthType_t { TYPENOTSET, BASIC, DIGEST }; +enum AuthParseDigestAlgorithm_t { ALGORITHMNOTSET, MD5, MD5SESS }; +enum AuthParseDigestQOP_t { QOPNOTSET, AUTH, AUTHINT }; -const char *a_Auth_get_auth_str(const DilloUrl *request_url); +typedef struct { + enum AuthParseHTTPAuthType_t type; + char *name; + Dlist *paths; /* stripped of any trailing '/', so the root path is "" */ + char *authorization; /* BASIC: the authorization request header */ + /* DIGEST: the hexdigest of A1 */ + /* digest state ahead */ + char *username; + char *cnonce; + unsigned int nonce_count; + char *nonce; + char *opaque; + enum AuthParseDigestAlgorithm_t algorithm; + char *domain; /* NOT USED */ + enum AuthParseDigestQOP_t qop; +} AuthRealm_t; + + +char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri); int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url); void a_Auth_init(void); -- cgit v1.2.3