diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-07 20:23:18 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-07 20:23:18 +0300 |
commit | abe138ee3aaadea496fbdddd23d79fbe40113171 (patch) | |
tree | a9a416f24726560435e4f66fc0caa44222e02d7a /src/microhttpd/internal.h | |
parent | 2d551c422da896190f2278eff11955dfb439f658 (diff) | |
download | libmicrohttpd-abe138ee3aaadea496fbdddd23d79fbe40113171.tar.gz libmicrohttpd-abe138ee3aaadea496fbdddd23d79fbe40113171.zip |
Fixed wrong usage of maximum client nonce size as maximum size of server nonce
This also saves some RAM for nonce-nc map array
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r-- | src/microhttpd/internal.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 4f03b8fc..92fa932b 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -240,8 +240,16 @@ enum MHD_ConnectionEventLoopInfo | |||
240 | * (already) takes more (see Mantis #1633), so we've increased the | 240 | * (already) takes more (see Mantis #1633), so we've increased the |
241 | * value to support something longer... | 241 | * value to support something longer... |
242 | */ | 242 | */ |
243 | #define MAX_NONCE_LENGTH 129 | 243 | #define MAX_CLIENT_NONCE_LENGTH 129 |
244 | 244 | ||
245 | /** | ||
246 | * The maximum size of MHD-generated nonce when printed with hexadecimal chars. | ||
247 | * | ||
248 | * This is equal to "(32 bytes for SHA-256 nonce plus 6 bytes for timestamp) | ||
249 | * multiplied by two hex chars per byte". | ||
250 | * Please keep it in sync with digestauth.c | ||
251 | */ | ||
252 | #define MAX_DIGEST_NONCE_LENGTH ((32 + 6) * 2) | ||
245 | 253 | ||
246 | /** | 254 | /** |
247 | * A structure representing the internal holder of the | 255 | * A structure representing the internal holder of the |
@@ -269,7 +277,7 @@ struct MHD_NonceNc | |||
269 | /** | 277 | /** |
270 | * Nonce value: | 278 | * Nonce value: |
271 | */ | 279 | */ |
272 | char nonce[MAX_NONCE_LENGTH + 1]; | 280 | char nonce[MAX_DIGEST_NONCE_LENGTH + 1]; |
273 | 281 | ||
274 | }; | 282 | }; |
275 | 283 | ||