Commit Graph
4495 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 3c63be9051 digestauth: cosmetics 2022-05-13 15:18:49 +03:00
Evgeny Grin (Karlson2k) 58d1aef753 digestauth: fixed wrong results of client data check
Stale 'nonce' from client was reported as either 'INVALID_NONCE' or just
as 'MHD_NO'. Now it is always reported as 'INVALID_NONCE".

Unfortunately wrong 'nonce' is reported as 'INVALID_NONCE' as well and
it cannot be fixed with current API.
2022-05-13 15:18:48 +03:00
Evgeny Grin (Karlson2k) 0d78994dd1 test_set_panic: fixed compiler warnings 2022-05-12 18:56:34 +03:00
Evgeny Grin (Karlson2k) 05f582d4ad Fixed leaks of mutexes.
Leaks of mutexes may be unnoticeable on many platforms, where mutex
destroy actually is no-op.
* Fixed leak of mutexes if daemon creation failed;
* Fixed leak of the cleanup mutex with daemon closure when thread pool
  is used.
2022-05-12 16:41:28 +03:00
Evgeny Grin (Karlson2k) 1619fda1d7 Added asserts to check for non-master daemons only 2022-05-12 15:50:43 +03:00
Evgeny Grin (Karlson2k) 2590e0e891 MHD_set_connection_option(): reduced lock scope
Improved handling of setting the new connection timeout. Log function
is not called with lock held. Simplified logic, completely avoided
locking in thread-per-connection mode
2022-05-12 15:47:50 +03:00
Evgeny Grin (Karlson2k) c1a1826e8e Enforced no use of 'per_ip_connection_mutex' in slave daemons 2022-05-12 10:56:16 +03:00
Evgeny Grin (Karlson2k) 5ea2a8e68f Cosmetics for cd5ad7aaad 2022-05-12 10:54:08 +03:00
Evgeny Grin (Karlson2k) b9ed765cda Fixed compiler error introduced by cd5ad7aaad 2022-05-06 22:28:33 +03:00
Evgeny Grin (Karlson2k) f1e6de457d internal.h: fixed static function placement 2022-05-06 22:25:51 +03:00
Evgeny Grin (Karlson2k) cd5ad7aaad digestauth: always use master daemon only 2022-05-06 22:21:57 +03:00
Evgeny Grin (Karlson2k) c658010707 MHD_get_master(): moved to the header, simplified
There is no need to support more than one level of 'master' daemon.
2022-05-06 15:19:18 +03:00
Evgeny Grin (Karlson2k) 82ff096dd4 Added one more fallback for unique nonce generation 2022-05-06 15:15:56 +03:00
Evgeny Grin (Karlson2k) 4b3895dd4a digestauth: added check for valid nonce format in the nonce-nc map
This is required to prevent strlen() runaway.
2022-05-06 15:05:43 +03:00
Evgeny Grin (Karlson2k) 171e6d0591 mhd_bithelpers: fixed handling of zero bits rotate 2022-05-06 14:06:52 +03:00
Evgeny Grin (Karlson2k) 54afc7adb5 Added missing zero-out of nonce-nc map array 2022-05-06 13:40:24 +03:00
Evgeny Grin (Karlson2k) c55939891d digestauth: added two more asserts 2022-05-06 11:57:54 +03:00
Evgeny Grin (Karlson2k) 05a79fdb36 digestauth: fixed logic of free nonce-nc slot detection 2022-05-06 11:37:23 +03:00
Evgeny Grin (Karlson2k) 9f226932dc Fixed additional wrong (inverted) asserts 2022-05-05 15:49:30 +03:00
Evgeny Grin (Karlson2k) 1ed1fe5e9e base64: added input checking and fixed compiler warnings 2022-05-05 15:44:29 +03:00
Evgeny Grin (Karlson2k) 1c58c968ce Fixed wrong (inverted) asserts 2022-05-05 15:06:59 +03:00
Evgeny Grin (Karlson2k) 86f53a3dda daemon: muted compiler warning 2022-05-05 15:06:59 +03:00
Evgeny Grin (Karlson2k) a7aa1266e1 test_parse_cookies: added more checks 2022-05-05 14:55:45 +03:00
Evgeny Grin (Karlson2k) cc88b5a09d connection.c: fixed doxy 2022-05-04 19:25:32 +03:00
Evgeny Grin (Karlson2k) f50153e5cf configure: added 'debugger' build type
Suitable for walking the code with debugger.
2022-05-04 19:06:40 +03:00
Evgeny Grin (Karlson2k) 26a99d1882 configure: fixed copy-paste error introduced by 5e45bedae5 2022-05-04 18:39:05 +03:00
Evgeny Grin (Karlson2k) 968bb8f87c Updated .gitignore 2022-05-04 18:34:30 +03:00
Evgeny Grin (Karlson2k) 5e45bedae5 configure: use CPPFLAGS for _DEBUG macro
MHD_config.h is not used by some source files. CPPFLAGS force usage of
required assert() mode.
2022-05-04 18:32:33 +03:00
Evgeny Grin (Karlson2k) d32975f45b configure: added missing settings for debug builds 2022-05-04 17:10:11 +03:00
Evgeny Grin (Karlson2k) d031ea8c32 digestauth: re-used static function 2022-05-04 15:58:47 +03:00
Evgeny Grin (Karlson2k) f2aa7b8853 digestauth: added management of nonce-nc map array slots 2022-05-04 15:58:47 +03:00
Evgeny Grin (Karlson2k) 46554d2c55 digestauth: additional static function for code re-use 2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 6b722d2bff digestauth: additional macros for readability 2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 6224ac6264 digestauth: use mseconds for timestamp
The clash of nonces is lower with higher timestamp resolution
2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 5658583a88 digestauth: increased timestamp to 48 bits 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 6245c9a0a2 digestauth: added run-time checks for algo value 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) f7d878ed66 digestauth: additional assert 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 65300939cf digestauth: changed type of var 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) c38e0a30f8 digestauth: use 7 bit shift for fast "hash"
As only ASCII printable chars are used for "nonce", the highest bit
is always zero.
2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 338dba5d1d .gitignore: Updated 2022-05-04 15:47:35 +03:00
Evgeny Grin (Karlson2k) fe9ce5db47 internal.h: fixed doxy 2022-05-04 14:24:27 +03:00
Evgeny Grin (Karlson2k) 76b68f654f check_nonce_nc(): sorted checks according to probability
The code should be more readable and it should give very minor
performance improvement.
2022-05-01 17:07:43 +03:00
Evgeny Grin (Karlson2k) c0bb909f0a check_nonce_nc(): additionally improved readability, fixed comments 2022-05-01 16:57:58 +03:00
Evgeny Grin (Karlson2k) f473462465 check_nonce_nc(): fixed missing set of the bit for the old 'nc' value
When 'nc' values are increased sequentially, the bit for the old 'nc'
value was not set.
2022-05-01 16:44:53 +03:00
Evgeny Grin (Karlson2k) 8457dfc7b6 check_nonce_nc(): moved 'nc' overflow check out of mutex lock 2022-05-01 16:32:07 +03:00
Evgeny Grin (Karlson2k) a3527f080a check_nonce_nc(): improved readability, fixed comments 2022-05-01 16:08:17 +03:00
Evgeny Grin (Karlson2k) 628a28d607 check_nonce_nc(): simplified
If 'nc' is not valid, then 'nonce' is always stale as 'nonce' validity
has been checked already.
2022-05-01 16:08:17 +03:00
Evgeny Grin (Karlson2k) 303cc226ec struct MHD_NonceNc: improved doxy 2022-05-01 15:14:06 +03:00
Evgeny Grin (Karlson2k) d6db60e373 digestauth: when checking 'nc' reuse always check nonce match first
While the validity of nonce itself was already checked, it could be stale
nonce, so let's make sure that re-use of 'nc' is limited to the same
nonce only.
2022-05-01 15:04:45 +03:00
Evgeny Grin (Karlson2k) f84c4d60a4 microhttpd.h: fixed list of required types 2022-05-01 14:30:10 +03:00