This is a major lift into C++.
Much of the code is now building in C++, and I'm using C++23. A spot test seems to work. Now I can start to debride all the painful memory management quirks...
This commit is contained in:
30
src/auth.hh
Normal file
30
src/auth.hh
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "url.hh"
|
||||
|
||||
enum AuthParseHTTPAuthType_t { TYPENOTSET, BASIC, DIGEST };
|
||||
enum AuthParseDigestAlgorithm_t { ALGORITHMNOTSET, MD5, MD5SESS };
|
||||
enum AuthParseDigestQOP_t { QOPNOTSET, AUTH, AUTHINT };
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user