aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-08-14 14:23:02 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-08-15 16:21:44 +0300
commit0d85695349b526afc897f770902e65672f3628e7 (patch)
tree7978f29b2c8cca271430001a174aab410ce53947
parent067b6234073ee0c08d1b3d3c1022f8b4c8417a0d (diff)
downloadlibmicrohttpd-0d85695349b526afc897f770902e65672f3628e7.tar.gz
libmicrohttpd-0d85695349b526afc897f770902e65672f3628e7.zip
digestauth: add log warning for empty random data
-rw-r--r--src/microhttpd/digestauth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index b7a32bf0..3dd29d20 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1544,6 +1544,15 @@ calculate_add_nonce_with_retry (struct MHD_Connection *const connection,
1544 const uint64_t timestamp1 = MHD_monotonic_msec_counter (); 1544 const uint64_t timestamp1 = MHD_monotonic_msec_counter ();
1545 const size_t realm_len = strlen (realm); 1545 const size_t realm_len = strlen (realm);
1546 1546
1547#ifdef HAVE_MESSAGES
1548 if (0 == MHD_get_master (connection->daemon)->digest_auth_rand_size)
1549 MHD_DLOG (connection->daemon,
1550 _ ("Random value was not initialised by " \
1551 "MHD_OPTION_DIGEST_AUTH_RANDOM or " \
1552 "MHD_OPTION_DIGEST_AUTH_RANDOM_COPY, generated nonces " \
1553 "are predictable.\n"));
1554#endif
1555
1547 if (! calculate_add_nonce (connection, timestamp1, realm, realm_len, da, 1556 if (! calculate_add_nonce (connection, timestamp1, realm, realm_len, da,
1548 nonce)) 1557 nonce))
1549 { 1558 {