gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (a4b7990e -> c101b159)


From: gnunet
Subject: [libmicrohttpd] branch master updated (a4b7990e -> c101b159)
Date: Wed, 13 Sep 2023 16:12:03 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from a4b7990e W32 VS project: corrected compiler settings
     new 49942a4a W32 VS: really muted run-time warnings about data truncation
     new bb80be69 daemon: unified check for debug macros
     new c101b159 Fixed debug build without TLS support

The 3 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/mhd_options.h              | 9 +++++++++
 src/microhttpd/daemon.c                | 4 ++--
 src/microhttpd/digestauth.c            | 8 ++++++++
 src/microhttpd/md5.c                   | 5 +++++
 src/microhttpd/mhd_bithelpers.h        | 2 ++
 src/microhttpd/mhd_str.c               | 7 +++++++
 src/microhttpd/response.c              | 6 +++---
 src/microhttpd/sha256.c                | 5 +++++
 src/microhttpd/sha512_256.c            | 5 +++++
 w32/common/common-build-settings.props | 1 -
 10 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/src/include/mhd_options.h b/src/include/mhd_options.h
index faefd328..f5334e1d 100644
--- a/src/include/mhd_options.h
+++ b/src/include/mhd_options.h
@@ -172,6 +172,15 @@
 #endif /* ! (MHD_ASAN_ACTIVE && HAVE_SANITIZER_ASAN_INTERFACE_H &&
            (FUNC_ATTR_PTRCOMPARE_WORKS || FUNC_ATTR_NOSANITIZE_WORKS))   */
 
+#ifndef _MSC_FULL_VER
+#  define MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_ /* empty */
+#  define MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_ /* empty */
+#else  /* _MSC_FULL_VER */
+#  define MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_ \
+   __pragma(runtime_checks("c", off))
+#  define MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_ \
+   __pragma(runtime_checks("c", restore))
+#endif /* _MSC_FULL_VER */
 
 /**
  * Automatic string with the name of the current function
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 23f06baa..209a6f86 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -7264,12 +7264,12 @@ MHD_start_daemon_va (unsigned int flags,
            || (NULL != daemon->notify_connection)) )
     *pflags |= MHD_USE_ITC; /* requires ITC */
 
-#ifndef NDEBUG
+#ifdef _DEBUG
 #ifdef HAVE_MESSAGES
   MHD_DLOG (daemon,
             _ ("Using debug build of libmicrohttpd.\n") );
 #endif /* HAVE_MESSAGES */
-#endif /* ! NDEBUG */
+#endif /* _DEBUG */
 
   if ( (0 != (*pflags & MHD_USE_ITC))
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 85a46260..4eeff3ca 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -764,6 +764,8 @@ get_nonce_timestamp (const char *const nonce,
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
 /**
  * Super-fast xor-based "hash" function
  *
@@ -791,6 +793,8 @@ fast_simple_hash (const uint8_t *data,
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
+
 /**
  * Get index of the nonce in the nonce-nc map array.
  *
@@ -1756,6 +1760,8 @@ calculate_add_nonce (struct MHD_Connection *const 
connection,
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
 /**
  * Calculate the server nonce so that it mitigates replay attacks and add
  * the new nonce to the nonce-nc map array.
@@ -1859,6 +1865,8 @@ calculate_add_nonce_with_retry (struct MHD_Connection 
*const connection,
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
+
 /**
  * Calculate userdigest, return it as binary data.
  *
diff --git a/src/microhttpd/md5.c b/src/microhttpd/md5.c
index 609ed50f..911fc364 100644
--- a/src/microhttpd/md5.c
+++ b/src/microhttpd/md5.c
@@ -54,6 +54,8 @@ MHD_MD5_init (struct Md5Ctx *ctx)
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
 /**
  * Base of MD5 transformation.
  * Gets full 64 bytes block of data and updates hash values;
@@ -544,3 +546,6 @@ MHD_MD5_finish (struct Md5Ctx *ctx,
   /* Erase potentially sensitive data. */
   memset (ctx, 0, sizeof(struct Md5Ctx));
 }
+
+
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h
index 94f4e1ab..8c2e7eca 100644
--- a/src/microhttpd/mhd_bithelpers.h
+++ b/src/microhttpd/mhd_bithelpers.h
@@ -45,6 +45,7 @@
 #  define _MHD_has_builtin_dummy 1
 #endif
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
 
 #ifdef MHD_HAVE___BUILTIN_BSWAP32
 #define _MHD_BYTES_SWAP32(value32)  \
@@ -388,6 +389,7 @@ _MHD_ROTR64 (uint64_t value64, int bits)
 
 #endif /* ! __builtin_rotateright64 */
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
 
 #ifdef _MHD_has_builtin_dummy
 /* Remove macro function replacement to avoid misdetection in files which
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 402cd0bc..8943b46e 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -2259,6 +2259,10 @@ base64_char_to_value_ (uint8_t c)
 
 #endif /* MHD_BASE64_FUNC_VERSION == 1 */
 
+
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
+
 size_t
 MHD_base64_to_bin_n (const char *base64,
                      size_t base64_len,
@@ -2428,6 +2432,9 @@ MHD_base64_to_bin_n (const char *base64,
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
+
+
 #undef MHD_base64_map_type_
 
 #endif /* BAUTH_SUPPORT */
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index c594d4f7..8cd540b1 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -1933,9 +1933,9 @@ enum MHD_Result
 MHD_response_execute_upgrade_ (struct MHD_Response *response,
                                struct MHD_Connection *connection)
 {
-#ifdef HTTPS_SUPPORT
-  struct MHD_Daemon *daemon = connection->daemon;
-#endif /* HTTPS_SUPPORT */
+#if defined(HTTPS_SUPPORT) || defined(_DEBUG)
+  struct MHD_Daemon *const daemon = connection->daemon;
+#endif /* HTTPS_SUPPORT || _DEBUG */
   struct MHD_UpgradeResponseHandle *urh;
   size_t rbo;
 
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index 2f9edf6a..917bb22b 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -58,6 +58,8 @@ MHD_SHA256_init (struct Sha256Ctx *ctx)
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
 /**
  * Base of SHA-256 transformation.
  * Gets full 64 bytes block of data and updates hash values;
@@ -558,3 +560,6 @@ MHD_SHA256_finish (struct Sha256Ctx *ctx,
   /* Erase potentially sensitive data. */
   memset (ctx, 0, sizeof(struct Sha256Ctx));
 }
+
+
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
diff --git a/src/microhttpd/sha512_256.c b/src/microhttpd/sha512_256.c
index b7682b28..1e00e5d9 100644
--- a/src/microhttpd/sha512_256.c
+++ b/src/microhttpd/sha512_256.c
@@ -58,6 +58,8 @@ MHD_SHA512_256_init (struct Sha512_256Ctx *ctx)
 }
 
 
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_DISABLE_
+
 /**
  * Base of SHA-512/256 transformation.
  * Gets full 128 bytes block of data and updates hash values;
@@ -627,3 +629,6 @@ MHD_SHA512_256_finish (struct Sha512_256Ctx *ctx,
   /* Erase potentially sensitive data. */
   memset (ctx, 0, sizeof(struct Sha512_256Ctx));
 }
+
+
+MHD_DATA_TRUNCATION_RUNTIME_CHECK_RESTORE_
diff --git a/w32/common/common-build-settings.props 
b/w32/common/common-build-settings.props
index a318184f..9d79bfeb 100644
--- a/w32/common/common-build-settings.props
+++ b/w32/common/common-build-settings.props
@@ -92,7 +92,6 @@
   <ItemDefinitionGroup Condition="'$(UseDebugLibraries)'=='true'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <SmallerTypeCheck>true</SmallerTypeCheck>
       
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <ResourceCompile>

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