From efaa0a6226f7be70f3d7c71f5c4394f2d2306993 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Wed, 18 May 2022 12:08:22 +0300 Subject: Created digestauth.h header --- src/microhttpd/digestauth.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/microhttpd/digestauth.c') 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 @@ * @author Christian Grothoff (RFC 7616 support) * @author Karlson2k (Evgeny Grin) */ +#include "digestauth.h" #include "platform.h" #include "mhd_limits.h" #include "internal.h" @@ -119,12 +120,6 @@ #define VLA_CHECK_LEN_DIGEST(n) \ do { if ((n) > MAX_DIGEST) MHD_PANIC (_ ("VLA too big.\n")); } while (0) - -/** - * Beginning string for any valid Digest authentication header. - */ -#define _BASE "Digest " - /** * Maximum length of a username for digest authentication. */ @@ -794,10 +789,10 @@ MHD_digest_auth_get_username (struct MHD_Connection *connection) NULL)) return NULL; if (0 != strncmp (header, - _BASE, - MHD_STATICSTR_LEN_ (_BASE))) + _MHD_AUTH_DIGEST_BASE, + MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE))) return NULL; - header += MHD_STATICSTR_LEN_ (_BASE); + header += MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE); if (0 == lookup_sub_value (user, sizeof (user), header, @@ -1244,10 +1239,10 @@ digest_auth_check_all (struct MHD_Connection *connection, NULL)) return MHD_DAUTH_WRONG_HEADER; if (0 != strncmp (header, - _BASE, - MHD_STATICSTR_LEN_ (_BASE))) + _MHD_AUTH_DIGEST_BASE, + MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE))) return MHD_DAUTH_WRONG_HEADER; - header += MHD_STATICSTR_LEN_ (_BASE); + header += MHD_STATICSTR_LEN_ (_MHD_AUTH_DIGEST_BASE); left = strlen (header); if (1) -- cgit v1.2.3