[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 12/15: microhttpd.h: added special enum for hash types
From: |
gnunet |
Subject: |
[libmicrohttpd] 12/15: microhttpd.h: added special enum for hash types |
Date: |
Tue, 19 Jul 2022 16:51:20 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit f826bbca441828e7b1928f425f4777951290e7c7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jul 19 17:40:38 2022 +0300
microhttpd.h: added special enum for hash types
---
src/include/microhttpd.h | 52 +++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 45 insertions(+), 7 deletions(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index e8e4da07..a0b48506 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -96,7 +96,7 @@ extern "C"
* they are parsed as decimal numbers.
* Example: 0x01093001 = 1.9.30-1.
*/
-#define MHD_VERSION 0x00097519
+#define MHD_VERSION 0x00097520
/* If generic headers don't work on your platform, include headers
which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t',
@@ -4334,6 +4334,44 @@ MHD_destroy_post_processor (struct MHD_PostProcessor
*pp);
*/
#define MHD_INVALID_NONCE -1
+/**
+ * Base type of hash calculation.
+ * Used as part of #MHD_DigestAuthAlgo3 values.
+ *
+ * @warning Not used directly by MHD API.
+ * @note Available since #MHD_VERSION 0x00097520
+ */
+enum MHD_DigestBaseAlgo
+{
+ /**
+ * Invalid hash algorithm value
+ */
+ MHD_DIGEST_BASE_ALGO_INVALID = 0,
+ /**
+ * MD5 hash algorithm.
+ * As specified by RFC1321
+ */
+ MHD_DIGEST_BASE_ALGO_MD5 = (1 << 0),
+ /**
+ * SHA-256 has algorithm.
+ * As specified by FIPS PUB 180-4
+ */
+ MHD_DIGEST_BASE_ALGO_SHA256 = (1 << 1),
+ /**
+ * SHA-512/256 has algorithm.
+ * Not supported for calculations, only supported for parsing of
+ * client's authorisation headers.
+ */
+ MHD_DIGEST_BASE_ALGO_SHA512_256 = (1 << 2)
+};
+
+/**
+ * The flag indicating digest calculation types,
+ * like 'MD5' or 'SHA-256'.
+ * @note Available since #MHD_VERSION 0x00097519
+ */
+#define MHD_DIGEST_AUTH_ALGO3_NON_SESSION (1 << 6)
+
/**
* The flag indicating non-session algorithm types,
* like 'MD5' or 'SHA-256'.
@@ -4366,36 +4404,36 @@ enum MHD_DigestAuthAlgo3
* The 'MD5' algorithm.
*/
MHD_DIGEST_AUTH_ALGO3_MD5 =
- (1 << 0) | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
+ MHD_DIGEST_BASE_ALGO_MD5 | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
/**
* The 'MD5-sess' algorithm.
* Not supported by MHD.
*/
MHD_DIGEST_AUTH_ALGO3_MD5_SESSION =
- (1 << 0) | MHD_DIGEST_AUTH_ALGO3_SESSION,
+ MHD_DIGEST_BASE_ALGO_MD5 | MHD_DIGEST_AUTH_ALGO3_SESSION,
/**
* The 'SHA-256' algorithm.
*/
MHD_DIGEST_AUTH_ALGO3_SHA256 =
- (1 << 1) | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
+ MHD_DIGEST_BASE_ALGO_SHA256 | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
/**
* The 'SHA-256-sess' algorithm.
* Not supported by MHD.
*/
MHD_DIGEST_AUTH_ALGO3_SHA256_SESSION =
- (1 << 1) | MHD_DIGEST_AUTH_ALGO3_SESSION,
+ MHD_DIGEST_BASE_ALGO_SHA256 | MHD_DIGEST_AUTH_ALGO3_SESSION,
/**
* The 'SHA-512-256' (SHA-512/256) algorithm.
* Not supported by MHD.
*/
MHD_DIGEST_AUTH_ALGO3_SHA512_256 =
- (1 << 2) | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
+ MHD_DIGEST_BASE_ALGO_SHA512_256 | MHD_DIGEST_AUTH_ALGO3_NON_SESSION,
/**
* The 'SHA-512-256-sess' (SHA-512/256 session) algorithm.
* Not supported by MHD.
*/
MHD_DIGEST_AUTH_ALGO3_SHA512_256_SESSION =
- (1 << 2) | MHD_DIGEST_AUTH_ALGO3_SESSION,
+ MHD_DIGEST_BASE_ALGO_SHA512_256 | MHD_DIGEST_AUTH_ALGO3_SESSION,
/**
* Any non-session algorithm, MHD will choose.
*/
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (d629ada1 -> 76b5b195), gnunet, 2022/07/19
- [libmicrohttpd] 03/15: Use new functions for decode request URLs, gnunet, 2022/07/19
- [libmicrohttpd] 01/15: mhd_str: added functions for percent-decoding, gnunet, 2022/07/19
- [libmicrohttpd] 02/15: Added tests for percent-decoding functions, gnunet, 2022/07/19
- [libmicrohttpd] 05/15: Added tests for hex <-> binary functions, gnunet, 2022/07/19
- [libmicrohttpd] 12/15: microhttpd.h: added special enum for hash types,
gnunet <=
- [libmicrohttpd] 04/15: mhd_str: added MHD_hex_to_bin() internal function, gnunet, 2022/07/19
- [libmicrohttpd] 09/15: Digest: check whether all required parameters are present before doing heavy calculations, gnunet, 2022/07/19
- [libmicrohttpd] 06/15: mhd_str: added macros for simple comparison against static strings, gnunet, 2022/07/19
- [libmicrohttpd] 08/15: Digest: use binary zero to separate get params in digest, gnunet, 2022/07/19
- [libmicrohttpd] 07/15: Added new functions MHD_digest_auth_get_request_info3() and MHD_digest_auth_get_username3(), gnunet, 2022/07/19
- [libmicrohttpd] 15/15: microhttpd.h: formatted some deprecation warnings, gnunet, 2022/07/19
- [libmicrohttpd] 10/15: Digest: moved URI match check to separate function, avoid one memcpy(), gnunet, 2022/07/19
- [libmicrohttpd] 11/15: digest_auth_check: mostly rewritten, simplified, optimised, gnunet, 2022/07/19
- [libmicrohttpd] 13/15: digest: small internal refactoring to clarify used hash type, gnunet, 2022/07/19
- [libmicrohttpd] 14/15: digest_auth_check(): check and report wrong algorithm, gnunet, 2022/07/19