GNU libmicrohttpd 1.0.0
Loading...
Searching...
No Matches
MHD_DigestAuthInfo Struct Reference

#include <microhttpd.h>

Data Fields

enum MHD_DigestAuthAlgo3 algo3
 
enum MHD_DigestAuthUsernameType uname_type
 
charusername
 
size_t username_len
 
charuserhash_hex
 
size_t userhash_hex_len
 
uint8_tuserhash_bin
 
charopaque
 
size_t opaque_len
 
charrealm
 
size_t realm_len
 
enum MHD_DigestAuthQOP qop
 
size_t cnonce_len
 
uint32_t nc
 

Detailed Description

Information from Digest Authorization client's header.

All buffers pointed by any struct members are freed when MHD_free() is called for pointer to this structure.

Application may modify buffers as needed until MHD_free() is called for pointer to this structure

Note
Available since MHD_VERSION 0x00097701

Definition at line 5199 of file microhttpd.h.

Field Documentation

◆ algo3

enum MHD_DigestAuthAlgo3 MHD_DigestAuthInfo::algo3

The algorithm as defined by client. Set automatically to MD5 if not specified by client.

Warning
Do not be confused with MHD_DigestAuthAlgorithm, which uses other values!

Definition at line 5207 of file microhttpd.h.

◆ cnonce_len

size_t MHD_DigestAuthInfo::cnonce_len

The length of the 'cnonce' parameter value, including possible backslash-escape characters. 'cnonce' is used in hash calculation, which is CPU-intensive procedure. An application may want to reject too large cnonces to limit the CPU load. A few kilobytes is a reasonable limit, typically cnonce is just 32-160 characters long.

Definition at line 5308 of file microhttpd.h.

◆ nc

uint32_t MHD_DigestAuthInfo::nc

The nc parameter value. Can be used by application to limit the number of nonce re-uses. If nc is higher than application wants to allow, then "auth required" response with 'stale=true' could be used to force client to retry with the fresh 'nonce'. If not specified by client or does not have hexadecimal digits only, the value is MHD_DIGEST_AUTH_INVALID_NC_VALUE.

Definition at line 5319 of file microhttpd.h.

◆ opaque

char* MHD_DigestAuthInfo::opaque

The 'opaque' parameter value, as specified by client. NULL if not specified by client. The buffer pointed by the opaque becomes invalid when the pointer to the structure is freed by MHD_free().

Definition at line 5273 of file microhttpd.h.

◆ opaque_len

size_t MHD_DigestAuthInfo::opaque_len

The length of the opaque. When the opaque is NULL, this member is always zero.

Definition at line 5279 of file microhttpd.h.

◆ qop

enum MHD_DigestAuthQOP MHD_DigestAuthInfo::qop

The 'qop' parameter value.

Definition at line 5298 of file microhttpd.h.

◆ realm

char* MHD_DigestAuthInfo::realm

The 'realm' parameter value, as specified by client. NULL if not specified by client. The buffer pointed by the realm becomes invalid when the pointer to the structure is freed by MHD_free().

Definition at line 5287 of file microhttpd.h.

◆ realm_len

size_t MHD_DigestAuthInfo::realm_len

The length of the realm. When the realm is NULL, this member is always zero.

Definition at line 5293 of file microhttpd.h.

◆ uname_type

enum MHD_DigestAuthUsernameType MHD_DigestAuthInfo::uname_type

The type of username used by client.

Definition at line 5212 of file microhttpd.h.

Referenced by MHD_digest_auth_get_request_info3().

◆ userhash_bin

uint8_t* MHD_DigestAuthInfo::userhash_bin

The userhash decoded to binary form. Used only if username type is userhash, always NULL otherwise. When not NULL, this points to binary sequence userhash_hex_len /2 bytes long. The valid size should be #MHD_digest_get_hash_size(algo3) bytes. The buffer pointed by the userhash_bin becomes invalid when the pointer to the structure is freed by MHD_free().

Warning
This is a binary data, no zero termination.
To avoid buffer overruns, always check the size of the data before use, because userhash_bin can point even to zero-sized data.
See also
MHD_digest_auth_calc_userhash()

Definition at line 5265 of file microhttpd.h.

◆ userhash_hex

char* MHD_DigestAuthInfo::userhash_hex

The userhash string. Valid only if username type is userhash. This is unqoted string without decoding of the hexadecimal digits (as provided by the client). The buffer pointed by the userhash_hex becomes invalid when the pointer to the structure is freed by MHD_free().

See also
MHD_digest_auth_calc_userhash_hex()

Definition at line 5242 of file microhttpd.h.

◆ userhash_hex_len

size_t MHD_DigestAuthInfo::userhash_hex_len

The length of the userhash_hex in characters. The valid size should be #MHD_digest_get_hash_size(algo3) * 2 characters. When the userhash_hex is NULL, this member is always zero.

Definition at line 5249 of file microhttpd.h.

◆ username

char* MHD_DigestAuthInfo::username

The username string. Used only if username type is standard or extended, always NULL otherwise. If extended notation is used, this string is pct-decoded string with charset and language tag removed (i.e. it is original username extracted from the extended notation). When userhash is used by the client, this member is NULL and userhash_hex and userhash_bin are set. The buffer pointed by the username becomes invalid when the pointer to the structure is freed by MHD_free().

Definition at line 5225 of file microhttpd.h.

◆ username_len

size_t MHD_DigestAuthInfo::username_len

The length of the username. When the username is NULL, this member is always zero.

Definition at line 5231 of file microhttpd.h.


The documentation for this struct was generated from the following file: