commit 3b898eaea7eae514f1f0496499bc26a4fdd10d41
parent fc353cf059bfce43b131816a30d8e6e13dca58ab
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 28 Jul 2026 10:53:07 +0200
fix another issue with INVALID enum check where masking did not work because INVALID is zero
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
@@ -2641,6 +2641,10 @@ digest_auth_check_all_inner (struct MHD_Connection *connection,
if (((unsigned int) c_qop) !=
(((unsigned int) c_qop) & ((unsigned int) mqop)))
return MHD_DAUTH_WRONG_QOP;
+ /* The numeric value of #MHD_DIGEST_AUTH_QOP_INVALID is zero, therefore
+ the bitmask check above passes it for any 'mqop' value. */
+ if (MHD_DIGEST_AUTH_QOP_INVALID == c_qop)
+ return MHD_DAUTH_WRONG_QOP;
if (0 != (((unsigned int) c_qop) & MHD_DIGEST_AUTH_QOP_AUTH_INT))
{
#ifdef HAVE_MESSAGES