[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 09/12: digestauth: additional macros for readability
From: |
gnunet |
Subject: |
[libmicrohttpd] 09/12: digestauth: additional macros for readability |
Date: |
Wed, 04 May 2022 14:59:43 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 6b722d2bff48640ac266d13f20c88f9c1d5c78dd
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon May 2 14:43:09 2022 +0300
digestauth: additional macros for readability
---
src/microhttpd/digestauth.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 33bec588..8f5abedd 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -54,13 +54,19 @@
((value) & ((UINT64_C(1) << (TIMESTAMP_BIN_SIZE * 8)) - 1))
+/**
+ * The printed timestamp size in chars
+ */
+#define TIMESTAMP_CHARS_LEN (TIMESTAMP_BIN_SIZE * 2)
+
+
/**
* Standard server nonce length, not including terminating null,
*
* @param digest_size digest size
*/
#define NONCE_STD_LEN(digest_size) \
- ((digest_size) * 2 + TIMESTAMP_BIN_SIZE * 2)
+ ((digest_size) * 2 + TIMESTAMP_CHARS_LEN)
/**
@@ -1006,9 +1012,9 @@ digest_auth_check_all (struct MHD_Connection *connection,
header value. */
return MHD_NO;
}
- if (TIMESTAMP_BIN_SIZE * 2 !=
- MHD_strx_to_uint64_n_ (nonce + len - TIMESTAMP_BIN_SIZE * 2,
- TIMESTAMP_BIN_SIZE * 2,
+ if (TIMESTAMP_CHARS_LEN !=
+ MHD_strx_to_uint64_n_ (nonce + len - TIMESTAMP_CHARS_LEN,
+ TIMESTAMP_CHARS_LEN,
&nonce_time))
{
#ifdef HAVE_MESSAGES
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (76b68f65 -> d031ea8c), gnunet, 2022/05/04
- [libmicrohttpd] 04/12: digestauth: changed type of var, gnunet, 2022/05/04
- [libmicrohttpd] 01/12: internal.h: fixed doxy, gnunet, 2022/05/04
- [libmicrohttpd] 02/12: .gitignore: Updated, gnunet, 2022/05/04
- [libmicrohttpd] 05/12: digestauth: additional assert, gnunet, 2022/05/04
- [libmicrohttpd] 08/12: digestauth: use mseconds for timestamp, gnunet, 2022/05/04
- [libmicrohttpd] 09/12: digestauth: additional macros for readability,
gnunet <=
- [libmicrohttpd] 07/12: digestauth: increased timestamp to 48 bits, gnunet, 2022/05/04
- [libmicrohttpd] 06/12: digestauth: added run-time checks for algo value, gnunet, 2022/05/04
- [libmicrohttpd] 11/12: digestauth: added management of nonce-nc map array slots, gnunet, 2022/05/04
- [libmicrohttpd] 03/12: digestauth: use 7 bit shift for fast "hash", gnunet, 2022/05/04
- [libmicrohttpd] 10/12: digestauth: additional static function for code re-use, gnunet, 2022/05/04
- [libmicrohttpd] 12/12: digestauth: re-used static function, gnunet, 2022/05/04