diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-16 10:35:37 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-25 18:39:44 +0300 |
commit | f26b806199a9ec0eb72fa217f855c9a4cff78983 (patch) | |
tree | c632a9e97a340190296ec8df77f390a2903d1abb | |
parent | c51718523db385aaeddb137fc92b4d30e64dff33 (diff) | |
download | libmicrohttpd-f26b806199a9ec0eb72fa217f855c9a4cff78983.tar.gz libmicrohttpd-f26b806199a9ec0eb72fa217f855c9a4cff78983.zip |
digestauth: changed "slot used" detection logic
-rw-r--r-- | src/microhttpd/digestauth.c | 8 |
1 files 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, | |||
1465 | if (0 == nn->nonce[0]) | 1465 | if (0 == nn->nonce[0]) |
1466 | return true; /* The slot is empty */ | 1466 | return true; /* The slot is empty */ |
1467 | 1467 | ||
1468 | if ((0 == memcmp (nn->nonce, new_nonce, new_nonce_len)) && | 1468 | if (0 == memcmp (nn->nonce, new_nonce, new_nonce_len)) |
1469 | (0 == nn->nonce[new_nonce_len])) | ||
1470 | { | 1469 | { |
1471 | /* The slot has the same nonce already, the same nonce was already generated | 1470 | /* The slot has the same nonce already. This nonce cannot be registered |
1472 | * and used, this slot cannot be used with the same nonce as it would | 1471 | * again as it would just clear 'nc' usage history. */ |
1473 | * just reset received 'nc' values. */ | ||
1474 | return false; | 1472 | return false; |
1475 | } | 1473 | } |
1476 | 1474 | ||