[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/19: digest_auth_check(): reduced scope of one-time va
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/19: digest_auth_check(): reduced scope of one-time variable |
Date: |
Thu, 28 Jul 2022 06:26:08 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c024f7c8adeb98604c64a23cc30bf36e2df1f934
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Jul 21 15:16:02 2022 +0300
digest_auth_check(): reduced scope of one-time variable
---
src/microhttpd/digestauth.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 4bb67f11..e8983d62 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1933,7 +1933,6 @@ digest_auth_check_all_inner (struct MHD_Connection
*connection,
const char *hentity = NULL; /* "auth-int" is not supported */
#endif
uint64_t nonce_time;
- uint64_t t;
uint64_t nci;
const struct MHD_RqDAuth *params;
/**
@@ -2112,14 +2111,20 @@ digest_auth_check_all_inner (struct MHD_Connection
*connection,
#endif
return MHD_DAUTH_NONCE_WRONG;
}
- t = MHD_monotonic_msec_counter ();
- /*
- * First level vetting for the nonce validity: if the timestamp
- * attached to the nonce exceeds `nonce_timeout', then the nonce is
- * invalid.
- */
- if (TRIM_TO_TIMESTAMP (t - nonce_time) > (nonce_timeout * 1000))
- return MHD_DAUTH_NONCE_STALE; /* too old */
+
+ if (1)
+ {
+ uint64_t t;
+
+ t = MHD_monotonic_msec_counter ();
+ /*
+ * First level vetting for the nonce validity: if the timestamp
+ * attached to the nonce exceeds `nonce_timeout', then the nonce is
+ * invalid.
+ */
+ if (TRIM_TO_TIMESTAMP (t - nonce_time) > (nonce_timeout * 1000))
+ return MHD_DAUTH_NONCE_STALE; /* too old */
+ }
if (1)
{
enum MHD_CheckNonceNC_ nonce_nc_check;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (22796735 -> 2949c070), gnunet, 2022/07/28
- [libmicrohttpd] 03/19: gen_auth: cosmetics, gnunet, 2022/07/28
- [libmicrohttpd] 04/19: digest_auth_check(): reduced scope of one-time variable,
gnunet <=
- [libmicrohttpd] 06/19: digest_auth_check(): added check for too large realm value, gnunet, 2022/07/28
- [libmicrohttpd] 02/19: gen_auth: fixed detection of userhash in Digest Auth requests, gnunet, 2022/07/28
- [libmicrohttpd] 07/19: Updated doxy for old Digest Auth API function, gnunet, 2022/07/28
- [libmicrohttpd] 10/19: test_digestauth_emu_ext: cosmetics, additional check, gnunet, 2022/07/28
- [libmicrohttpd] 11/19: tests_digestauth*: added workarounds for libcurl bug, gnunet, 2022/07/28
- [libmicrohttpd] 01/19: digestauth: fixed copy-paste error in request algo parsing, gnunet, 2022/07/28
- [libmicrohttpd] 08/19: digestauth: term correction in comment, gnunet, 2022/07/28
- [libmicrohttpd] 05/19: digest_auth_check(): added support for userhash, gnunet, 2022/07/28
- [libmicrohttpd] 09/19: test_digestauth{,_sha256,_with_aguments}: moved back to Digest Auth APIv2, gnunet, 2022/07/28
- [libmicrohttpd] 14/19: MHD_add_response_entry(): refactoring + added internal function, gnunet, 2022/07/28