diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-23 12:15:03 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-23 12:42:43 +0300 |
commit | b41fedd52bfaa1e13f796a94d5e1b0be811ee0b4 (patch) | |
tree | 9afd8da05545d64dc83dd85c2b8d25844fd34e59 | |
parent | 2de47d2007c7708e74ceefe689b848c23c459c8e (diff) | |
download | libmicrohttpd-b41fedd52bfaa1e13f796a94d5e1b0be811ee0b4.tar.gz libmicrohttpd-b41fedd52bfaa1e13f796a94d5e1b0be811ee0b4.zip |
digestauth: use pre-calculated URI length to avoid stop at first binary zero
-rw-r--r-- | src/microhttpd/digestauth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 41a016df..6094ac7d 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -929,6 +929,7 @@ calculate_nonce (uint64_t nonce_time, | |||
929 | const char *rnd, | 929 | const char *rnd, |
930 | size_t rnd_size, | 930 | size_t rnd_size, |
931 | const char *uri, | 931 | const char *uri, |
932 | size_t uri_len, | ||
932 | const char *realm, | 933 | const char *realm, |
933 | size_t realm_len, | 934 | size_t realm_len, |
934 | struct DigestAlgorithm *da, | 935 | struct DigestAlgorithm *da, |
@@ -969,7 +970,7 @@ calculate_nonce (uint64_t nonce_time, | |||
969 | 1); | 970 | 1); |
970 | digest_update (da, | 971 | digest_update (da, |
971 | (const unsigned char *) uri, | 972 | (const unsigned char *) uri, |
972 | strlen (uri)); | 973 | uri_len); |
973 | digest_update (da, | 974 | digest_update (da, |
974 | (const unsigned char *) ":", | 975 | (const unsigned char *) ":", |
975 | 1); | 976 | 1); |
@@ -1079,6 +1080,7 @@ calculate_add_nonce (struct MHD_Connection *const connection, | |||
1079 | daemon->digest_auth_random, | 1080 | daemon->digest_auth_random, |
1080 | daemon->digest_auth_rand_size, | 1081 | daemon->digest_auth_rand_size, |
1081 | connection->url, | 1082 | connection->url, |
1083 | connection->url_len, | ||
1082 | realm, | 1084 | realm, |
1083 | realm_len, | 1085 | realm_len, |
1084 | da, | 1086 | da, |
@@ -1590,6 +1592,7 @@ digest_auth_check_all_inner (struct MHD_Connection *connection, | |||
1590 | daemon->digest_auth_random, | 1592 | daemon->digest_auth_random, |
1591 | daemon->digest_auth_rand_size, | 1593 | daemon->digest_auth_rand_size, |
1592 | connection->url, | 1594 | connection->url, |
1595 | connection->url_len, | ||
1593 | realm, | 1596 | realm, |
1594 | realm_len, | 1597 | realm_len, |
1595 | da, | 1598 | da, |