gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 05/05: Updated docs, test, and example to use correct di


From: gnunet
Subject: [libmicrohttpd] 05/05: Updated docs, test, and example to use correct digest auth API
Date: Thu, 27 Jan 2022 17:18:26 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 1a7e4a5a5be438726de9e9c9a55e23c021b62d47
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Jan 27 19:13:37 2022 +0300

    Updated docs, test, and example to use correct digest auth API
---
 doc/libmicrohttpd.texi                        |  2 +-
 src/examples/digest_auth_example.c            | 20 +++++++++++---------
 src/testcurl/test_digestauth_sha256.c         |  2 +-
 src/testcurl/test_digestauth_with_arguments.c | 22 ++++++++++++----------
 4 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
index 46eed3b0..dfe8a686 100644
--- a/doc/libmicrohttpd.texi
+++ b/doc/libmicrohttpd.texi
@@ -3332,7 +3332,7 @@ ahc_echo (void *cls,
                                password,
                                300,
                                 MHD_DIGEST_ALG_SHA256);
-  free(username);
+  MHD_free(username);
   if ( (ret == MHD_INVALID_NONCE) ||
        (ret == MHD_NO) )
     @{
diff --git a/src/examples/digest_auth_example.c 
b/src/examples/digest_auth_example.c
index ea3da19a..68d13c84 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -70,10 +70,11 @@ ahc_echo (void *cls,
     response = MHD_create_response_from_buffer (strlen (DENIED),
                                                 DENIED,
                                                 MHD_RESPMEM_PERSISTENT);
-    ret = MHD_queue_auth_fail_response (connection, realm,
-                                        MY_OPAQUE_STR,
-                                        response,
-                                        MHD_NO);
+    ret = MHD_queue_auth_fail_response2 (connection, realm,
+                                         MY_OPAQUE_STR,
+                                         response,
+                                         MHD_NO,
+                                         MHD_DIGEST_ALG_MD5);
     MHD_destroy_response (response);
     return ret;
   }
@@ -90,11 +91,12 @@ ahc_echo (void *cls,
                                                 MHD_RESPMEM_PERSISTENT);
     if (NULL == response)
       return MHD_NO;
-    ret = MHD_queue_auth_fail_response (connection, realm,
-                                        MY_OPAQUE_STR,
-                                        response,
-                                        (res == MHD_INVALID_NONCE) ? MHD_YES :
-                                        MHD_NO);
+    ret = MHD_queue_auth_fail_response2 (connection, realm,
+                                         MY_OPAQUE_STR,
+                                         response,
+                                         (res == MHD_INVALID_NONCE) ? MHD_YES :
+                                         MHD_NO,
+                                         MHD_DIGEST_ALG_MD5);
     MHD_destroy_response (response);
     return ret;
   }
diff --git a/src/testcurl/test_digestauth_sha256.c 
b/src/testcurl/test_digestauth_sha256.c
index fff3a1d7..f6df664e 100644
--- a/src/testcurl/test_digestauth_sha256.c
+++ b/src/testcurl/test_digestauth_sha256.c
@@ -129,7 +129,7 @@ ahc_echo (void *cls,
                                   password,
                                   300,
                                   MHD_DIGEST_ALG_SHA256);
-  free (username);
+  MHD_free (username);
   if ( (ret_i == MHD_INVALID_NONCE) ||
        (ret_i == MHD_NO) )
   {
diff --git a/src/testcurl/test_digestauth_with_arguments.c 
b/src/testcurl/test_digestauth_with_arguments.c
index 91f2dd67..ac1aed56 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -107,10 +107,11 @@ ahc_echo (void *cls,
     response = MHD_create_response_from_buffer (strlen (DENIED),
                                                 DENIED,
                                                 MHD_RESPMEM_PERSISTENT);
-    ret = MHD_queue_auth_fail_response (connection, realm,
-                                        MY_OPAQUE,
-                                        response,
-                                        MHD_NO);
+    ret = MHD_queue_auth_fail_response2 (connection, realm,
+                                         MY_OPAQUE,
+                                         response,
+                                         MHD_NO,
+                                         MHD_DIGEST_ALG_MD5);
     MHD_destroy_response (response);
     return ret;
   }
@@ -118,7 +119,7 @@ ahc_echo (void *cls,
                                  username,
                                  password,
                                  300);
-  free (username);
+  MHD_free (username);
   if ( (ret_i == MHD_INVALID_NONCE) ||
        (ret_i == MHD_NO) )
   {
@@ -127,11 +128,12 @@ ahc_echo (void *cls,
                                                 MHD_RESPMEM_PERSISTENT);
     if (NULL == response)
       return MHD_NO;
-    ret = MHD_queue_auth_fail_response (connection, realm,
-                                        MY_OPAQUE,
-                                        response,
-                                        (ret_i == MHD_INVALID_NONCE) ?
-                                        MHD_YES : MHD_NO);
+    ret = MHD_queue_auth_fail_response2 (connection, realm,
+                                         MY_OPAQUE,
+                                         response,
+                                         (ret_i == MHD_INVALID_NONCE) ?
+                                         MHD_YES : MHD_NO,
+                                         MHD_DIGEST_ALG_MD5);
     MHD_destroy_response (response);
     return ret;
   }

-- 
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]