diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-11 18:39:46 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-11 18:42:18 +0300 |
commit | 8318f56ebc0085f1319f29862b74b65304894afe (patch) | |
tree | f33a4c735f372bc36234f13a12e6c80cc9349ec8 /src/microhttpd/internal.h | |
parent | 9fa5a3b990f93b94557bc2f52aaff8db241702a7 (diff) | |
download | libmicrohttpd-8318f56ebc0085f1319f29862b74b65304894afe.tar.gz libmicrohttpd-8318f56ebc0085f1319f29862b74b65304894afe.zip |
digestauth: added support for SHA-512/256, made MD5 and SHA-256 optional
Give more flexibility for custom builds: MD5, SHA-256 and SHA-512/256
may be disabled individually.
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r-- | src/microhttpd/internal.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 3fa773a7..adb69b32 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -250,11 +250,15 @@ enum MHD_ConnectionEventLoopInfo | |||
250 | /** | 250 | /** |
251 | * The maximum size of MHD-generated nonce when printed with hexadecimal chars. | 251 | * The maximum size of MHD-generated nonce when printed with hexadecimal chars. |
252 | * | 252 | * |
253 | * This is equal to "(32 bytes for SHA-256 nonce plus 6 bytes for timestamp) | 253 | * This is equal to "(32 bytes for SHA-256 (or SHA-512/256) nonce plus 6 bytes |
254 | * multiplied by two hex chars per byte". | 254 | * for timestamp) multiplied by two hex chars per byte". |
255 | * Please keep it in sync with digestauth.c | 255 | * Please keep it in sync with digestauth.c |
256 | */ | 256 | */ |
257 | #if defined(MHD_SHA256_SUPPORT) || defined(MHD_SHA512_256_SUPPORT) | ||
257 | #define MAX_DIGEST_NONCE_LENGTH ((32 + 6) * 2) | 258 | #define MAX_DIGEST_NONCE_LENGTH ((32 + 6) * 2) |
259 | #else /* !MHD_SHA256_SUPPORT && !MHD_SHA512_256_SUPPORT */ | ||
260 | #define MAX_DIGEST_NONCE_LENGTH ((16 + 6) * 2) | ||
261 | #endif /* !MHD_SHA256_SUPPORT && !MHD_SHA512_256_SUPPORT */ | ||
258 | 262 | ||
259 | /** | 263 | /** |
260 | * A structure representing the internal holder of the | 264 | * A structure representing the internal holder of the |
@@ -280,7 +284,7 @@ struct MHD_NonceNc | |||
280 | uint64_t nmask; | 284 | uint64_t nmask; |
281 | 285 | ||
282 | /** | 286 | /** |
283 | * Nonce value: | 287 | * Nonce value |
284 | */ | 288 | */ |
285 | char nonce[MAX_DIGEST_NONCE_LENGTH + 1]; | 289 | char nonce[MAX_DIGEST_NONCE_LENGTH + 1]; |
286 | 290 | ||