diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/microhttpd.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index cff084ed..cdbde609 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -294,6 +294,12 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG | |||
294 | 294 | ||
295 | 295 | ||
296 | /** | 296 | /** |
297 | * Length of the binary output of the MD5 hash function. | ||
298 | */ | ||
299 | #define MHD_MD5_DIGEST_SIZE 16 | ||
300 | |||
301 | |||
302 | /** | ||
297 | * @defgroup httpcode HTTP response codes. | 303 | * @defgroup httpcode HTTP response codes. |
298 | * These are the status codes defined for HTTP responses. | 304 | * These are the status codes defined for HTTP responses. |
299 | * @{ | 305 | * @{ |
@@ -3144,10 +3150,32 @@ MHD_free (void *ptr); | |||
3144 | */ | 3150 | */ |
3145 | _MHD_EXTERN int | 3151 | _MHD_EXTERN int |
3146 | MHD_digest_auth_check (struct MHD_Connection *connection, | 3152 | MHD_digest_auth_check (struct MHD_Connection *connection, |
3147 | const char *realm, | 3153 | const char *realm, |
3148 | const char *username, | 3154 | const char *username, |
3149 | const char *password, | 3155 | const char *password, |
3150 | unsigned int nonce_timeout); | 3156 | unsigned int nonce_timeout); |
3157 | |||
3158 | /** | ||
3159 | * Authenticates the authorization header sent by the client | ||
3160 | * | ||
3161 | * @param connection The MHD connection structure | ||
3162 | * @param realm The realm presented to the client | ||
3163 | * @param username The username needs to be authenticated | ||
3164 | * @param digest An `unsigned char *' pointer to the binary MD5 sum | ||
3165 | * for the precalculated hash value "username:realm:password" | ||
3166 | * of #MHD_MD5_DIGEST_SIZE bytes | ||
3167 | * @param nonce_timeout The amount of time for a nonce to be | ||
3168 | * invalid in seconds | ||
3169 | * @return #MHD_YES if authenticated, #MHD_NO if not, | ||
3170 | * #MHD_INVALID_NONCE if nonce is invalid | ||
3171 | * @ingroup authentication | ||
3172 | */ | ||
3173 | _MHD_EXTERN int | ||
3174 | MHD_digest_auth_check_digest (struct MHD_Connection *connection, | ||
3175 | const char *realm, | ||
3176 | const char *username, | ||
3177 | const uint8_t digest[MHD_MD5_DIGEST_SIZE], | ||
3178 | unsigned int nonce_timeout); | ||
3151 | 3179 | ||
3152 | 3180 | ||
3153 | /** | 3181 | /** |