diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-02-08 14:09:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-02-08 14:09:04 +0000 |
commit | 5ae9cc7f06276fe004b13d2138fbb70ecb2f4365 (patch) | |
tree | d6a17f6ab83d10f7b5e114a66aa5bad09c83d24a /src/microhttpd/digestauth.c | |
parent | a4e4998a2994619eb5fcb75b623e882f775906d9 (diff) | |
download | libmicrohttpd-5ae9cc7f06276fe004b13d2138fbb70ecb2f4365.tar.gz libmicrohttpd-5ae9cc7f06276fe004b13d2138fbb70ecb2f4365.zip |
size_t vs. int fixes by Evgeny Grin, plus some additional fixes by CG
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 87a2570e..3250b1a8 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -201,7 +201,7 @@ digest_calc_response (const char *ha1, | |||
201 | * @param key key to look up in data | 201 | * @param key key to look up in data |
202 | * @return size of the located value, 0 if otherwise | 202 | * @return size of the located value, 0 if otherwise |
203 | */ | 203 | */ |
204 | static int | 204 | static size_t |
205 | lookup_sub_value (char *dest, | 205 | lookup_sub_value (char *dest, |
206 | size_t size, | 206 | size_t size, |
207 | const char *data, | 207 | const char *data, |
@@ -381,7 +381,7 @@ MHD_digest_auth_get_username(struct MHD_Connection *connection) | |||
381 | * @param nonce_time The amount of time in seconds for a nonce to be invalid | 381 | * @param nonce_time The amount of time in seconds for a nonce to be invalid |
382 | * @param method HTTP method | 382 | * @param method HTTP method |
383 | * @param rnd A pointer to a character array for the random seed | 383 | * @param rnd A pointer to a character array for the random seed |
384 | * @param rnd_size The size of the random seed array | 384 | * @param rnd_size The size of the random seed array @a rnd |
385 | * @param uri HTTP URI (in MHD, without the arguments ("?k=v") | 385 | * @param uri HTTP URI (in MHD, without the arguments ("?k=v") |
386 | * @param realm A string of characters that describes the realm of auth. | 386 | * @param realm A string of characters that describes the realm of auth. |
387 | * @param nonce A pointer to a character array for the nonce to put in | 387 | * @param nonce A pointer to a character array for the nonce to put in |
@@ -390,7 +390,7 @@ static void | |||
390 | calculate_nonce (uint32_t nonce_time, | 390 | calculate_nonce (uint32_t nonce_time, |
391 | const char *method, | 391 | const char *method, |
392 | const char *rnd, | 392 | const char *rnd, |
393 | unsigned int rnd_size, | 393 | size_t rnd_size, |
394 | const char *uri, | 394 | const char *uri, |
395 | const char *realm, | 395 | const char *realm, |
396 | char *nonce) | 396 | char *nonce) |
@@ -407,14 +407,14 @@ calculate_nonce (uint32_t nonce_time, | |||
407 | timestamp[3] = (nonce_time & 0x000000ff); | 407 | timestamp[3] = (nonce_time & 0x000000ff); |
408 | MD5Update (&md5, timestamp, 4); | 408 | MD5Update (&md5, timestamp, 4); |
409 | MD5Update (&md5, ":", 1); | 409 | MD5Update (&md5, ":", 1); |
410 | MD5Update (&md5, method, strlen(method)); | 410 | MD5Update (&md5, method, strlen (method)); |
411 | MD5Update (&md5, ":", 1); | 411 | MD5Update (&md5, ":", 1); |
412 | if (rnd_size > 0) | 412 | if (rnd_size > 0) |
413 | MD5Update (&md5, rnd, rnd_size); | 413 | MD5Update (&md5, rnd, rnd_size); |
414 | MD5Update (&md5, ":", 1); | 414 | MD5Update (&md5, ":", 1); |
415 | MD5Update (&md5, uri, strlen(uri)); | 415 | MD5Update (&md5, uri, strlen (uri)); |
416 | MD5Update (&md5, ":", 1); | 416 | MD5Update (&md5, ":", 1); |
417 | MD5Update (&md5, realm, strlen(realm)); | 417 | MD5Update (&md5, realm, strlen (realm)); |
418 | MD5Final (tmpnonce, &md5); | 418 | MD5Final (tmpnonce, &md5); |
419 | cvthex (tmpnonce, sizeof (tmpnonce), nonce); | 419 | cvthex (tmpnonce, sizeof (tmpnonce), nonce); |
420 | cvthex (timestamp, 4, timestamphex); | 420 | cvthex (timestamp, 4, timestamphex); |
@@ -429,8 +429,8 @@ calculate_nonce (uint32_t nonce_time, | |||
429 | * @param connection the connection | 429 | * @param connection the connection |
430 | * @param key the key | 430 | * @param key the key |
431 | * @param value the value, can be NULL | 431 | * @param value the value, can be NULL |
432 | * @return MHD_YES if the key-value pair is in the headers, | 432 | * @return #MHD_YES if the key-value pair is in the headers, |
433 | * MHD_NO if not | 433 | * #MHD_NO if not |
434 | */ | 434 | */ |
435 | static int | 435 | static int |
436 | test_header (struct MHD_Connection *connection, | 436 | test_header (struct MHD_Connection *connection, |