aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/digestauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r--src/microhttpd/digestauth.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index eddfa937..bfedccf8 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1380,6 +1380,16 @@ calculate_nonce (uint64_t nonce_time,
1380 rnd_size); 1380 rnd_size);
1381 digest_update_with_colon (da); 1381 digest_update_with_colon (da);
1382 } 1382 }
1383 if ( (MHD_DAUTH_BIND_NONCE_NONE == bind_options) &&
1384 (0 != saddr_size) )
1385 {
1386 /* Use full client address including source port to make unique nonces
1387 * for requests received exactly at the same time */
1388 digest_update (da,
1389 saddr,
1390 saddr_size);
1391 digest_update_with_colon (da);
1392 }
1383 if ( (0 != (bind_options & MHD_DAUTH_BIND_NONCE_CLIENT_IP)) && 1393 if ( (0 != (bind_options & MHD_DAUTH_BIND_NONCE_CLIENT_IP)) &&
1384 (0 != saddr_size) ) 1394 (0 != saddr_size) )
1385 { 1395 {
@@ -1395,7 +1405,8 @@ calculate_nonce (uint64_t nonce_time,
1395#endif /* HAVE_INET6 */ 1405#endif /* HAVE_INET6 */
1396 digest_update_with_colon (da); 1406 digest_update_with_colon (da);
1397 } 1407 }
1398 if (0 != (bind_options & MHD_DAUTH_BIND_NONCE_URI)) 1408 if ( (MHD_DAUTH_BIND_NONCE_NONE == bind_options) ||
1409 (0 != (bind_options & MHD_DAUTH_BIND_NONCE_URI)))
1399 { 1410 {
1400 if (MHD_HTTP_MTHD_OTHER != mthd_e) 1411 if (MHD_HTTP_MTHD_OTHER != mthd_e)
1401 { 1412 {
@@ -1410,7 +1421,10 @@ calculate_nonce (uint64_t nonce_time,
1410 } 1421 }
1411 else 1422 else
1412 digest_update_str (da, method); 1423 digest_update_str (da, method);
1424 }
1413 1425
1426 if (0 != (bind_options & MHD_DAUTH_BIND_NONCE_URI))
1427 {
1414 digest_update_with_colon (da); 1428 digest_update_with_colon (da);
1415 1429
1416 digest_update (da, 1430 digest_update (da,
@@ -1435,7 +1449,8 @@ calculate_nonce (uint64_t nonce_time,
1435 } 1449 }
1436 digest_update_with_colon (da); 1450 digest_update_with_colon (da);
1437 } 1451 }
1438 if (0 != (bind_options & MHD_DAUTH_BIND_NONCE_REALM)) 1452 if ( (MHD_DAUTH_BIND_NONCE_NONE == bind_options) ||
1453 (0 != (bind_options & MHD_DAUTH_BIND_NONCE_REALM)))
1439 { 1454 {
1440 digest_update (da, 1455 digest_update (da,
1441 realm, 1456 realm,