diff options
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/http.h | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/src/include/ipxe/http.h b/src/include/ipxe/http.h index a0dff7d0..0f42a22e 100644 --- a/src/include/ipxe/http.h +++ b/src/include/ipxe/http.h @@ -150,14 +150,18 @@ struct http_request_content { size_t len; }; -/** HTTP request authentication descriptor */ -struct http_request_auth { - /** Authentication scheme (if any) */ - struct http_authentication *auth; +/** HTTP request Basic authentication descriptor */ +struct http_request_auth_basic { /** Username */ const char *username; /** Password */ const char *password; +}; + +/** HTTP request Digest authentication descriptor */ +struct http_request_auth_digest { + /** Username */ + const char *username; /** Quality of protection */ const char *qop; /** Algorithm */ @@ -168,6 +172,19 @@ struct http_request_auth { char response[ HTTP_DIGEST_RESPONSE_LEN + 1 /* NUL */ ]; }; +/** HTTP request authentication descriptor */ +struct http_request_auth { + /** Authentication scheme (if any) */ + struct http_authentication *auth; + /** Per-scheme information */ + union { + /** Basic authentication descriptor */ + struct http_request_auth_basic basic; + /** Digest authentication descriptor */ + struct http_request_auth_digest digest; + }; +}; + /** An HTTP request * * This represents a single request to be sent to a server, including @@ -235,10 +252,12 @@ struct http_response_content { struct http_content_encoding *encoding; }; -/** HTTP response authorization descriptor */ -struct http_response_auth { - /** Authentication scheme (if any) */ - struct http_authentication *auth; +/** HTTP response Basic authorization descriptor */ +struct http_response_auth_basic { +}; + +/** HTTP response Digest authorization descriptor */ +struct http_response_auth_digest { /** Realm */ const char *realm; /** Quality of protection */ @@ -251,6 +270,19 @@ struct http_response_auth { const char *opaque; }; +/** HTTP response authorization descriptor */ +struct http_response_auth { + /** Authentication scheme (if any) */ + struct http_authentication *auth; + /** Per-scheme information */ + union { + /** Basic authorization descriptor */ + struct http_response_auth_basic basic; + /** Digest authorization descriptor */ + struct http_response_auth_digest digest; + }; +}; + /** An HTTP response * * This represents a single response received from the server, @@ -461,6 +493,13 @@ struct http_content_encoding { struct http_authentication { /** Name (e.g. "Digest") */ const char *name; + /** Parse remaining "WWW-Authenticate" header line + * + * @v http HTTP transaction + * @v line Remaining header line + * @ret rc Return status code + */ + int ( * parse ) ( struct http_transaction *http, char *line ); /** Perform authentication * * @v http HTTP transaction |