diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-08-27 09:43:09 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-08-27 09:43:09 +0000 |
commit | 70f7ad46ebc58f18599be8356751edda162ff435 (patch) | |
tree | 14f578c741051bb3b0ca660bd2e7e0903a086128 /src/microhttpd/digestauth.c | |
parent | 0d2688a98bfc4f32b393fc581ec04e97d9b11449 (diff) | |
download | libmicrohttpd-70f7ad46ebc58f18599be8356751edda162ff435.tar.gz libmicrohttpd-70f7ad46ebc58f18599be8356751edda162ff435.zip |
Reimplement monotonic clock with wide range of platforms support
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index e69f58aa..32ef79ef 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <limits.h> | 26 | #include <limits.h> |
27 | #include "internal.h" | 27 | #include "internal.h" |
28 | #include "md5.h" | 28 | #include "md5.h" |
29 | #include "mhd_mono_clock.h" | ||
29 | 30 | ||
30 | #if defined(_WIN32) && defined(MHD_W32_MUTEX_) | 31 | #if defined(_WIN32) && defined(MHD_W32_MUTEX_) |
31 | #ifndef WIN32_LEAN_AND_MEAN | 32 | #ifndef WIN32_LEAN_AND_MEAN |
@@ -643,7 +644,7 @@ MHD_digest_auth_check (struct MHD_Connection *connection, | |||
643 | } | 644 | } |
644 | /* 8 = 4 hexadecimal numbers for the timestamp */ | 645 | /* 8 = 4 hexadecimal numbers for the timestamp */ |
645 | nonce_time = strtoul (nonce + len - 8, (char **)NULL, 16); | 646 | nonce_time = strtoul (nonce + len - 8, (char **)NULL, 16); |
646 | t = (uint32_t) MHD_monotonic_time(); | 647 | t = (uint32_t) MHD_monotonic_sec_counter(); |
647 | /* | 648 | /* |
648 | * First level vetting for the nonce validity: if the timestamp | 649 | * First level vetting for the nonce validity: if the timestamp |
649 | * attached to the nonce exceeds `nonce_timeout', then the nonce is | 650 | * attached to the nonce exceeds `nonce_timeout', then the nonce is |
@@ -820,7 +821,7 @@ MHD_queue_auth_fail_response (struct MHD_Connection *connection, | |||
820 | char nonce[HASH_MD5_HEX_LEN + 9]; | 821 | char nonce[HASH_MD5_HEX_LEN + 9]; |
821 | 822 | ||
822 | /* Generating the server nonce */ | 823 | /* Generating the server nonce */ |
823 | calculate_nonce ((uint32_t) MHD_monotonic_time(), | 824 | calculate_nonce ((uint32_t) MHD_monotonic_sec_counter(), |
824 | connection->method, | 825 | connection->method, |
825 | connection->daemon->digest_auth_random, | 826 | connection->daemon->digest_auth_random, |
826 | connection->daemon->digest_auth_rand_size, | 827 | connection->daemon->digest_auth_rand_size, |