gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 09/15: test_digestauth2: test the new option


From: gnunet
Subject: [libmicrohttpd] 09/15: test_digestauth2: test the new option
Date: Sat, 30 Jul 2022 21:29:31 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 0b70234172886f76f4f9ba4463400b9e8f1fae02
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jul 26 20:59:51 2022 +0300

    test_digestauth2: test the new option
---
 src/testcurl/test_digestauth2.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/testcurl/test_digestauth2.c b/src/testcurl/test_digestauth2.c
index c00dd1b1..7951546c 100644
--- a/src/testcurl/test_digestauth2.c
+++ b/src/testcurl/test_digestauth2.c
@@ -979,31 +979,35 @@ testDigestAuth (void)
 {
   struct MHD_Daemon *d;
   uint16_t port;
-  uint8_t salt[8];
   struct CBC cbc;
   char buf[2048];
   CURL *c;
   int failed = 0;
 
-  if (! gen_good_rnd (salt, sizeof(salt)))
-  {
-    fprintf (stderr, "WARNING: the random buffer (used as salt value) is not "
-             "initialised completely, nonce generation may be "
-             "predictable in this test.\n");
-    fflush (stderr);
-  }
-
   if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
     port = 0;
   else
     port = 4210;
 
-  d = MHD_start_daemon (MHD_USE_ERROR_LOG,
-                        port, NULL, NULL,
-                        &ahc_echo, NULL,
-                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof (salt), salt,
-                        MHD_OPTION_NONCE_NC_SIZE, 300,
-                        MHD_OPTION_END);
+  if (1)
+  {
+    uint8_t salt[8]; /* Use local variable to test MHD "copy" function */
+    if (! gen_good_rnd (salt, sizeof(salt)))
+    {
+      fprintf (stderr, "WARNING: the random buffer (used as salt value) is not 
"
+               "initialised completely, nonce generation may be "
+               "predictable in this test.\n");
+      fflush (stderr);
+    }
+
+    d = MHD_start_daemon (MHD_USE_ERROR_LOG,
+                          port, NULL, NULL,
+                          &ahc_echo, NULL,
+                          MHD_OPTION_DIGEST_AUTH_RANDOM_COPY,
+                          sizeof (salt), salt,
+                          MHD_OPTION_NONCE_NC_SIZE, 300,
+                          MHD_OPTION_END);
+  }
   if (d == NULL)
     return 1;
   if (0 == port)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]