digestauth: use pre-calculated URI length to avoid stop at first binary zero

This commit is contained in:
Evgeny Grin (Karlson2k)
2022-06-23 12:42:43 +03:00
parent 2de47d2007
commit b41fedd52b
+4 -1
View File
@@ -929,6 +929,7 @@ calculate_nonce (uint64_t nonce_time,
const char *rnd,
size_t rnd_size,
const char *uri,
size_t uri_len,
const char *realm,
size_t realm_len,
struct DigestAlgorithm *da,
@@ -969,7 +970,7 @@ calculate_nonce (uint64_t nonce_time,
1);
digest_update (da,
(const unsigned char *) uri,
strlen (uri));
uri_len);
digest_update (da,
(const unsigned char *) ":",
1);
@@ -1079,6 +1080,7 @@ calculate_add_nonce (struct MHD_Connection *const connection,
daemon->digest_auth_random,
daemon->digest_auth_rand_size,
connection->url,
connection->url_len,
realm,
realm_len,
da,
@@ -1590,6 +1592,7 @@ digest_auth_check_all_inner (struct MHD_Connection *connection,
daemon->digest_auth_random,
daemon->digest_auth_rand_size,
connection->url,
connection->url_len,
realm,
realm_len,
da,