GNU libmicrohttpd 1.0.1
Loading...
Searching...
No Matches
gen_auth.c File Reference

HTTP authorisation general functions. More...

#include "gen_auth.h"
#include "internal.h"
#include "connection.h"
#include "mhd_str.h"
#include "mhd_assert.h"
Include dependency graph for gen_auth.c:

Go to the source code of this file.

Enumerations

enum  MHD_AuthType {
  MHD_AUTHTYPE_NONE = 0 , MHD_AUTHTYPE_BASIC , MHD_AUTHTYPE_DIGEST , MHD_AUTHTYPE_UNKNOWN ,
  MHD_AUTHTYPE_INVALID
}

Functions

static bool find_auth_rq_header_ (const struct MHD_Connection *c, enum MHD_AuthType type, struct _MHD_str_w_len *auth_value)

Detailed Description

HTTP authorisation general functions.

Author
Karlson2k (Evgeny Grin)

Definition in file gen_auth.c.

Enumeration Type Documentation

◆ MHD_AuthType

Type of authorisation

Enumerator
MHD_AUTHTYPE_NONE 

No authorisation, unused

MHD_AUTHTYPE_BASIC 

Basic Authorisation, RFC 7617

MHD_AUTHTYPE_DIGEST 

Digest Authorisation, RFC 7616

MHD_AUTHTYPE_UNKNOWN 

Unknown/Unsupported authorisation type, unused

MHD_AUTHTYPE_INVALID 

Wrong/broken authorisation header, unused

Definition at line 46 of file gen_auth.c.

Function Documentation

◆ find_auth_rq_header_()

bool find_auth_rq_header_ ( const struct MHD_Connection * c,
enum MHD_AuthType type,
struct _MHD_str_w_len * auth_value )
static

Find required "Authorization" request header

Parameters
cthe connection with request
typethe type of the authorisation: basic or digest
[out]auth_valuewill be set to the remaining of header value after authorisation token (after "Basic " or "Digest ")
Returns
true if requested header is found, false otherwise

Definition at line 65 of file gen_auth.c.

References _MHD_AUTH_BASIC_BASE, _MHD_AUTH_DIGEST_BASE, MHD_HTTP_Req_Header::header, MHD_HTTP_Req_Header::header_size, MHD_Request::headers_received, MHD_HTTP_Req_Header::kind, _MHD_str_w_len::len, mhd_assert, MHD_AUTHTYPE_BASIC, MHD_AUTHTYPE_DIGEST, MHD_CONNECTION_HEADERS_PROCESSED, MHD_HEADER_KIND, MHD_HTTP_HEADER_AUTHORIZATION, MHD_STATICSTR_LEN_, MHD_str_equal_caseless_bin_n_(), MHD_HTTP_Req_Header::next, NULL, MHD_Connection::rq, MHD_Connection::state, _MHD_str_w_len::str, MHD_HTTP_Req_Header::value, and MHD_HTTP_Req_Header::value_size.

Here is the call graph for this function: