41#define EACCES_USERNAME __einfo_error ( EINFO_EACCES_USERNAME )
42#define EINFO_EACCES_USERNAME \
43 __einfo_uniqify ( EINFO_EACCES, 0x01, \
44 "No username available for Basic authentication" )
76 DBGC ( http,
"HTTP %p has no username for Basic "
77 "authentication\n", http );
95 char *buf,
size_t len ) {
99 char user_pw[ user_pw_len + 1 ];
106 snprintf ( user_pw,
sizeof ( user_pw ),
"%s:%s",
#define NULL
NULL pointer (VOID *)
#define assert(condition)
Assert a condition at run-time.
size_t base64_encode(const void *raw, size_t raw_len, char *data, size_t len)
Base64-encode data.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define REQUIRE_OBJECT(object)
Require an object.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define REQUIRING_SYMBOL(symbol)
Specify the file's requiring symbol.
Hyper Text Transport Protocol.
@ HTTP_RESPONSE_RETRY
Transaction may be retried on failure.
#define __http_authentication
Declare an HTTP authentication scheme.
static int http_basic_authenticate(struct http_transaction *http)
Perform HTTP Basic authentication.
static int http_format_basic_auth(struct http_transaction *http, char *buf, size_t len)
Construct HTTP "Authorization" header for Basic authentication.
static int http_parse_basic_auth(struct http_transaction *http, char *line __unused)
Parse HTTP "WWW-Authenticate" header for Basic authentication.
size_t strlen(const char *src)
Get length of string.
An HTTP authentication scheme.
HTTP request Basic authentication descriptor.
const char * username
Username.
const char * password
Password.
struct http_authentication * auth
Authentication scheme (if any)
struct http_request_auth_basic basic
Basic authentication descriptor.
struct http_request_auth auth
Authentication descriptor.
struct http_response response
Response.
struct uri * uri
Request URI.
struct http_request request
Request.
const char * user
User name.
const char * password
Password.
Uniform Resource Identifiers.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.