gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated: -fix bogus assert, use proper lib


From: gnunet
Subject: [libmicrohttpd] branch master updated: -fix bogus assert, use proper libgcrypt type
Date: Mon, 17 Apr 2023 10:55:28 +0200

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new eeb41662 -fix bogus assert, use proper libgcrypt type
eeb41662 is described below

commit eeb4166266659b3aa9134c70200478d1b9ab52ff
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Apr 17 10:55:22 2023 +0200

    -fix bogus assert, use proper libgcrypt type
---
 src/microhttpd/md5_ext.c | 8 ++++----
 src/microhttpd/md5_ext.h | 7 ++-----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/microhttpd/md5_ext.c b/src/microhttpd/md5_ext.c
index 799ff8e9..a5de6c22 100644
--- a/src/microhttpd/md5_ext.c
+++ b/src/microhttpd/md5_ext.c
@@ -22,8 +22,6 @@
  * @brief  Wrapper for MD5 calculation performed by TLS library
  * @author Karlson2k (Evgeny Grin)
  */
-
-#include <gnutls/crypto.h>
 #include "md5_ext.h"
 #include "mhd_assert.h"
 
@@ -39,14 +37,16 @@ void
 MHD_MD5_init_one_time (struct Md5CtxExt *ctx)
 {
   ctx->handle = NULL;
-  ctx->ext_error = gnutls_hash_init (&ctx->handle, GNUTLS_DIG_MD5);
+  ctx->ext_error = gnutls_hash_init (&ctx->handle,
+                                     GNUTLS_DIG_MD5);
   if ((0 != ctx->ext_error) && (NULL != ctx->handle))
   {
     gnutls_free (ctx->handle);
     ctx->handle = NULL;
   }
   else
-    mhd_assert (NULL != ctx->handle);
+    mhd_assert ( (NULL != ctx->handle) ||
+                 (0 != ctx->ext_error) );
 }
 
 
diff --git a/src/microhttpd/md5_ext.h b/src/microhttpd/md5_ext.h
index b7437c03..435991c1 100644
--- a/src/microhttpd/md5_ext.h
+++ b/src/microhttpd/md5_ext.h
@@ -16,13 +16,11 @@
      License along with GNU libmicrohttpd.
      If not, see <http://www.gnu.org/licenses/>.
 */
-
 /**
  * @file microhttpd/md5_ext.h
  * @brief  Wrapper declarations for MD5 calculation performed by TLS library
  * @author Karlson2k (Evgeny Grin)
  */
-
 #ifndef MHD_MD5_EXT_H
 #define MHD_MD5_EXT_H 1
 
@@ -31,6 +29,7 @@
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>  /* for size_t */
 #endif /* HAVE_STDDEF_H */
+#include <gnutls/crypto.h>
 
 /**
  * Size of MD5 resulting digest in bytes
@@ -38,8 +37,6 @@
  */
 #define MD5_DIGEST_SIZE (16)
 
-/* Actual declaration is in GnuTLS lib header */
-struct hash_hd_st;
 
 /**
  * Indicates that struct Md5CtxExt has 'ext_error'
@@ -51,7 +48,7 @@ struct hash_hd_st;
  */
 struct Md5CtxExt
 {
-  struct hash_hd_st *handle; /**< Hash calculation handle */
+  gnutls_hash_hd_t handle; /**< Hash calculation handle */
   int ext_error; /**< Non-zero if external error occurs during init or hashing 
*/
 };
 

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