Expose digest auth checking functions

PUBLISHED_FROM=1bfc6e332f56b68eb6155bb729a97a0d8d5a316c
This commit is contained in:
Dmitry Frank authored and Cesanta Bot committed 2017-11-28 10:05:36 +00:00
1 parent cf8d0a25aa
commit 9ab6d084df
5 files changed
+54 -10

No files matched your search

+8 -10
View File
@@ -7363,10 +7363,9 @@ int mg_check_digest_auth(struct mg_str method, struct mg_str uri,
return 0;
}
static int mg_http_is_authorized(struct http_message *hm, struct mg_str path,
int is_directory, const char *domain,
const char *passwords_file,
int is_global_pass_file) {
int mg_http_is_authorized(struct http_message *hm, struct mg_str path,
int is_directory, const char *domain,
const char *passwords_file, int is_global_pass_file) {
char buf[MG_MAX_PATH];
const char *p;
FILE *fp;
@@ -7399,10 +7398,9 @@ static int mg_http_is_authorized(struct http_message *hm, struct mg_str path,
return authorized;
}
#else
static int mg_http_is_authorized(struct http_message *hm,
const struct mg_str path, int is_directory,
const char *domain, const char *passwords_file,
int is_global_pass_file) {
int mg_http_is_authorized(struct http_message *hm, const struct mg_str path,
int is_directory, const char *domain,
const char *passwords_file, int is_global_pass_file) {
(void) hm;
(void) path;
(void) is_directory;
@@ -7942,8 +7940,8 @@ MG_INTERNAL int mg_is_not_modified(struct http_message *hm, cs_stat_t *st) {
}
}
static void mg_http_send_digest_auth_request(struct mg_connection *c,
const char *domain) {
void mg_http_send_digest_auth_request(struct mg_connection *c,
const char *domain) {
mg_printf(c,
"HTTP/1.1 401 Unauthorized\r\n"
"WWW-Authenticate: Digest qop=\"auth\", "