diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-02 14:43:09 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-04 15:47:37 +0300 |
commit | 6b722d2bff48640ac266d13f20c88f9c1d5c78dd (patch) | |
tree | 36253838daabeb0126e0339c36de789e918f197f /src/microhttpd/digestauth.c | |
parent | 6224ac6264f0f582af7584696ae6081cfa84237a (diff) | |
download | libmicrohttpd-6b722d2bff48640ac266d13f20c88f9c1d5c78dd.tar.gz libmicrohttpd-6b722d2bff48640ac266d13f20c88f9c1d5c78dd.zip |
digestauth: additional macros for readability
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 14 |
1 files 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 | |||
@@ -55,12 +55,18 @@ | |||
55 | 55 | ||
56 | 56 | ||
57 | /** | 57 | /** |
58 | * The printed timestamp size in chars | ||
59 | */ | ||
60 | #define TIMESTAMP_CHARS_LEN (TIMESTAMP_BIN_SIZE * 2) | ||
61 | |||
62 | |||
63 | /** | ||
58 | * Standard server nonce length, not including terminating null, | 64 | * Standard server nonce length, not including terminating null, |
59 | * | 65 | * |
60 | * @param digest_size digest size | 66 | * @param digest_size digest size |
61 | */ | 67 | */ |
62 | #define NONCE_STD_LEN(digest_size) \ | 68 | #define NONCE_STD_LEN(digest_size) \ |
63 | ((digest_size) * 2 + TIMESTAMP_BIN_SIZE * 2) | 69 | ((digest_size) * 2 + TIMESTAMP_CHARS_LEN) |
64 | 70 | ||
65 | 71 | ||
66 | /** | 72 | /** |
@@ -1006,9 +1012,9 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
1006 | header value. */ | 1012 | header value. */ |
1007 | return MHD_NO; | 1013 | return MHD_NO; |
1008 | } | 1014 | } |
1009 | if (TIMESTAMP_BIN_SIZE * 2 != | 1015 | if (TIMESTAMP_CHARS_LEN != |
1010 | MHD_strx_to_uint64_n_ (nonce + len - TIMESTAMP_BIN_SIZE * 2, | 1016 | MHD_strx_to_uint64_n_ (nonce + len - TIMESTAMP_CHARS_LEN, |
1011 | TIMESTAMP_BIN_SIZE * 2, | 1017 | TIMESTAMP_CHARS_LEN, |
1012 | &nonce_time)) | 1018 | &nonce_time)) |
1013 | { | 1019 | { |
1014 | #ifdef HAVE_MESSAGES | 1020 | #ifdef HAVE_MESSAGES |