gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (1a7e4a5a -> d41ebab2)


From: gnunet
Subject: [libmicrohttpd] branch master updated (1a7e4a5a -> d41ebab2)
Date: Thu, 27 Jan 2022 18:31:41 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 1a7e4a5a Updated docs, test, and example to use correct digest auth API
     new 63b63330 Updated doxy; explicitly tolerated NULL in MHD_queue*_auth*()
     new d41ebab2 Fixed code style in basicauth.c

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/include/microhttpd.h    | 10 +++++-----
 src/microhttpd/basicauth.c  |  9 ++++++---
 src/microhttpd/connection.c |  4 ++--
 src/microhttpd/digestauth.c |  7 ++++++-
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 23ce06c7..42409403 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -3226,8 +3226,8 @@ MHD_lookup_connection_value_n (struct MHD_Connection 
*connection,
  *
  * @param connection the connection identifying the client
  * @param status_code HTTP status code (i.e. #MHD_HTTP_OK)
- * @param response response to transmit
- * @return #MHD_NO on error (i.e. reply already sent),
+ * @param response response to transmit, the NULL is tolerated
+ * @return #MHD_NO on error (reply already sent, response is NULL),
  *         #MHD_YES on success or if message has been queued
  * @ingroup response
  * @sa #MHD_AccessHandlerCallback
@@ -4226,7 +4226,7 @@ MHD_digest_auth_check_digest (struct MHD_Connection 
*connection,
  * @param opaque string to user for opaque value
  * @param response reply to send; should contain the "access denied"
  *        body; note that this function will set the "WWW Authenticate"
- *        header and that the caller should not do this
+ *        header and that the caller should not do this; the NULL is tolerated
  * @param signal_stale #MHD_YES if the nonce is invalid to add
  *      'stale=true' to the authentication header
  * @param algo digest algorithm to use
@@ -4253,7 +4253,7 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
  * @param opaque string to user for opaque value
  * @param response reply to send; should contain the "access denied"
  *        body; note that this function will set the "WWW Authenticate"
- *        header and that the caller should not do this
+ *        header and that the caller should not do this; the NULL is tolerated
  * @param signal_stale #MHD_YES if the nonce is invalid to add
  *      'stale=true' to the authentication header
  * @return #MHD_YES on success, #MHD_NO otherwise
@@ -4290,7 +4290,7 @@ MHD_basic_auth_get_username_password (struct 
MHD_Connection *connection,
  *
  * @param connection The MHD connection structure
  * @param realm the realm presented to the client
- * @param response response object to modify and queue
+ * @param response response object to modify and queue; the NULL is tolerated
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  */
diff --git a/src/microhttpd/basicauth.c b/src/microhttpd/basicauth.c
index d39019f5..b6d88ba3 100644
--- a/src/microhttpd/basicauth.c
+++ b/src/microhttpd/basicauth.c
@@ -45,7 +45,7 @@
  */
 char *
 MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
-                                      char**password)
+                                      char **password)
 {
   const char *header;
   char *decode;
@@ -109,14 +109,14 @@ MHD_basic_auth_get_username_password (struct 
MHD_Connection *connection,
 
 
 /**
- * Queues a response to request basic authentication from the client.
+ * Queues a response to request basic authentication from the client
  * The given response object is expected to include the payload for
  * the response; the "WWW-Authenticate" header will be added and the
  * response queued with the 'UNAUTHORIZED' status code.
  *
  * @param connection The MHD connection structure
  * @param realm the realm presented to the client
- * @param response response object to modify and queue
+ * @param response response object to modify and queue; the NULL is tolerated
  * @return #MHD_YES on success, #MHD_NO otherwise
  * @ingroup authentication
  */
@@ -130,6 +130,9 @@ MHD_queue_basic_auth_fail_response (struct MHD_Connection 
*connection,
   size_t hlen = strlen (realm) + strlen ("Basic realm=\"\"") + 1;
   char *header;
 
+  if (NULL == response)
+    return MHD_NO;
+
   header = (char *) malloc (hlen);
   if (NULL == header)
   {
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 21c4d338..f6a871c0 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -5084,8 +5084,8 @@ MHD_set_connection_option (struct MHD_Connection 
*connection,
  *
  * @param connection the connection identifying the client
  * @param status_code HTTP status code (i.e. #MHD_HTTP_OK)
- * @param response response to transmit
- * @return #MHD_NO on error (i.e. reply already sent),
+ * @param response response to transmit, the NULL is tolerated
+ * @return #MHD_NO on error (reply already sent, response is NULL),
  *         #MHD_YES on success or if message has been queued
  * @ingroup response
  * @sa #MHD_AccessHandlerCallback
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index a1b7bcf4..e0a26b30 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1326,11 +1326,12 @@ MHD_digest_auth_check_digest (struct MHD_Connection 
*connection,
  * @param opaque string to user for opaque value
  * @param response reply to send; should contain the "access denied"
  *        body; note that this function will set the "WWW Authenticate"
- *        header and that the caller should not do this
+ *        header and that the caller should not do this; the NULL is tolerated
  * @param signal_stale #MHD_YES if the nonce is invalid to add
  *      'stale=true' to the authentication header
  * @param algo digest algorithm to use
  * @return #MHD_YES on success, #MHD_NO otherwise
+ * @note Available since #MHD_VERSION 0x00096200
  * @ingroup authentication
  */
 enum MHD_Result
@@ -1345,6 +1346,10 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection 
*connection,
   int hlen;
   SETUP_DA (algo, da);
 
+  if (NULL == response)
+    return MHD_NO;
+
+  if (1)
   {
     char nonce[NONCE_STD_LEN (VLA_ARRAY_LEN_DIGEST (da.digest_size)) + 1];
 

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