aboutsummaryrefslogtreecommitdiff
path: root/src/auth.h
diff options
context:
space:
mode:
authorJustus Winter, corvid <devnull@localhost>2011-09-29 16:21:28 +0000
committerJustus Winter, corvid <devnull@localhost>2011-09-29 16:21:28 +0000
commit8dac04451d23627af7be3b50ca13a9d882ac4ad6 (patch)
treeb2c946ec1101a8ca8da6cfd74de950b562c9c6e9 /src/auth.h
parentc4f7c7f2e6b9d028033040a83a39cfc3decdedd6 (diff)
rest of digest authentication
Justus contributed the original patch in April 2009. I read RFCs, fixed bugs, restructured, tested.
Diffstat (limited to 'src/auth.h')
-rw-r--r--src/auth.h23
1 files changed, 22 insertions, 1 deletions
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);