From f26b806199a9ec0eb72fa217f855c9a4cff78983 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 16 Sep 2022 10:35:37 +0300 Subject: digestauth: changed "slot used" detection logic --- src/microhttpd/digestauth.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 83ecbf5e..eb9f34d7 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c @@ -1465,12 +1465,10 @@ is_slot_available (const struct MHD_NonceNc *const nn, if (0 == nn->nonce[0]) return true; /* The slot is empty */ - if ((0 == memcmp (nn->nonce, new_nonce, new_nonce_len)) && - (0 == nn->nonce[new_nonce_len])) + if (0 == memcmp (nn->nonce, new_nonce, new_nonce_len)) { - /* The slot has the same nonce already, the same nonce was already generated - * and used, this slot cannot be used with the same nonce as it would - * just reset received 'nc' values. */ + /* The slot has the same nonce already. This nonce cannot be registered + * again as it would just clear 'nc' usage history. */ return false; } -- cgit v1.2.3