diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-18 12:08:22 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-20 13:12:21 +0300 |
commit | efaa0a6226f7be70f3d7c71f5c4394f2d2306993 (patch) | |
tree | ca0cfdd9709fe6f3202ef9fa6c3c743084f3f677 /src/microhttpd/digestauth.c | |
parent | 223013b2e70dfcf4f2fe529224fec10ee5272aa2 (diff) | |
download | libmicrohttpd-efaa0a6226f7be70f3d7c71f5c4394f2d2306993.tar.gz libmicrohttpd-efaa0a6226f7be70f3d7c71f5c4394f2d2306993.zip |
Created digestauth.h header
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index cda8b478..a560f2a6 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -25,6 +25,7 @@ | |||
25 | * @author Christian Grothoff (RFC 7616 support) | 25 | * @author Christian Grothoff (RFC 7616 support) |
26 | * @author Karlson2k (Evgeny Grin) | 26 | * @author Karlson2k (Evgeny Grin) |
27 | */ | 27 | */ |
28 | #include "digestauth.h" | ||
28 | #include "platform.h" | 29 | #include "platform.h" |
29 | #include "mhd_limits.h" | 30 | #include "mhd_limits.h" |
30 | #include "internal.h" | 31 | #include "internal.h" |
@@ -119,12 +120,6 @@ | |||
119 | #define VLA_CHECK_LEN_DIGEST(n) \ | 120 | #define VLA_CHECK_LEN_DIGEST(n) \ |
120 | do { if ((n) > MAX_DIGEST) MHD_PANIC (_ ("VLA too big.\n")); } while (0) | 121 | do { if ((n) > MAX_DIGEST) MHD_PANIC (_ ("VLA too big.\n")); } while (0) |
121 | 122 | ||
122 | |||
123 | /** | ||
124 | * Beginning string for any valid Digest authentication header. | ||
125 | */ | ||
126 | #define _BASE "Digest " | ||
127 | |||
128 | /** | 123 | /** |
129 | * Maximum length of a username for digest authentication. | 124 | * Maximum length of a username for digest authentication. |
130 | */ | 125 | */ |
@@ -794,10 +789,10 @@ MHD_digest_auth_get_username (struct MHD_Connection *connection) | |||
794 | NULL)) | 789 | NULL)) |
795 | return NULL; | 790 | return NULL; |
796 | if (0 != strncmp (header, | 791 | if (0 != strncmp (header, |
797 | _BASE, | 792 | _MHD_AUTH_DIGEST_BASE, |
798 | MHD_STATICSTR_LEN_ (_BASE))) | 793 | MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE))) |
799 | return NULL; | 794 | return NULL; |
800 | header += MHD_STATICSTR_LEN_ (_BASE); | 795 | header += MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE); |
801 | if (0 == lookup_sub_value (user, | 796 | if (0 == lookup_sub_value (user, |
802 | sizeof (user), | 797 | sizeof (user), |
803 | header, | 798 | header, |
@@ -1244,10 +1239,10 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
1244 | NULL)) | 1239 | NULL)) |
1245 | return MHD_DAUTH_WRONG_HEADER; | 1240 | return MHD_DAUTH_WRONG_HEADER; |
1246 | if (0 != strncmp (header, | 1241 | if (0 != strncmp (header, |
1247 | _BASE, | 1242 | _MHD_AUTH_DIGEST_BASE, |
1248 | MHD_STATICSTR_LEN_ (_BASE))) | 1243 | MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE))) |
1249 | return MHD_DAUTH_WRONG_HEADER; | 1244 | return MHD_DAUTH_WRONG_HEADER; |
1250 | header += MHD_STATICSTR_LEN_ (_BASE); | 1245 | header += MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE); |
1251 | left = strlen (header); | 1246 | left = strlen (header); |
1252 | 1247 | ||
1253 | if (1) | 1248 | if (1) |