[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/04: digestauth: cosmetics
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/04: digestauth: cosmetics |
Date: |
Fri, 13 May 2022 14:19:54 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 3c63be9051816682ce18b77c4ba912bbfcf56469
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri May 13 15:07:32 2022 +0300
digestauth: cosmetics
---
src/microhttpd/digestauth.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index d870902e..3154088f 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -50,6 +50,12 @@
*/
#define REUSE_TIMEOUT 30
+/**
+ * The maximum value of artificial timestamp difference to avoid clashes.
+ * The value must be suitable for bitwise AND operation.
+ */
+#define DAUTH_JUMPBACK_MAX (0x7F)
+
/**
* 48 bit value in bytes
@@ -1048,7 +1054,8 @@ calculate_add_nonce_with_retry (struct MHD_Connection
*const connection,
base2 = _MHD_ROTL32 (base2, (((base4 >> 4) ^ base4) % 32));
base3 = ((uint16_t) (base2 >> 16)) ^ ((uint16_t) base2);
base4 = ((uint8_t) (base3 >> 8)) ^ ((uint8_t) base3);
- timestamp2 -= (base4 & 0x7f); /* Use up to 127 ms difference */
+ /* Use up to 127 ms difference */
+ timestamp2 -= (base4 & DAUTH_JUMPBACK_MAX);
if (timestamp1 == timestamp2)
timestamp2 -= 2;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.