Commit Graph
831 Commits
Author SHA1 Message Date
+3 a9145f9d38 FCMP++/Carrot mega commit [9/14/26]
Co-authored-by: jeffro256 <jeffro256@tutanota.com>
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
Co-authored-by: Lee *!* Clagett <code@leeclagett.com>
Co-authored-by: SyntheticBird45 <someoneelse.is_on.github.rio7x@simplelogin.com>
Co-authored-by: jeetrex17 <jeetrex@tutamail.com>
Co-authored-by: UkoeHB <ukoehb@users.noreply.github.com>
Co-authored-by: MrCyjaneK
Co-authored-by: tobtoht
Co-authored-by: selsta
Co-authored-by: Thomas <thomas.giudici@proton.me>
Co-authored-by: navidR
Co-authored-by: Boog900 <boog900@tutanota.com>
2026-09-17 18:33:24 -07:00
selsta 90753611a7 epee: prevent log injection from malformed HTTP headers 2026-09-09 22:23:06 +02:00
tobtoht b30a99386d Merge pull request #11207
1f58e91 epee, common: pass unsigned char to <cctype> functions (pucedoteth)

ACKs: jpk68, Ap4sh, selsta
2026-09-09 20:08:18 +00:00
jeffro256 c7a2d4f66a crypto: reduce crypto.h header weight 2026-09-07 21:32:29 -05:00
pucedoteth 1f58e91d60 epee, common: pass unsigned char to <cctype> functions
The <cctype> functions require their argument to be representable as
unsigned char or to equal EOF. char is signed on the platforms Monero
targets, so every byte >= 0x80 reaches them negative, which is undefined
behaviour.

All six call sites take bytes that come from outside the process:

  hex_to_dec_2bytes()     percent-escapes in a payment URI
  http_client.h           the status line of an HTTP response
  updates.cpp             the hash field of a DNS update record

glibc and the macOS libc happen to tolerate -128..-1 because their tables
carry padding below zero, so this is quiet in practice on those, but it is
still out of contract and other libcs index without that cushion.

Cast to unsigned char at each call. The conversion is behaviour-preserving
for the ASCII these actually test: for a byte such as 0xC3, toupper()
returns it unchanged in the C locale, it narrows back to char, memchr()
misses it in the hex table, and hex_to_dec_2bytes() falls through to the
existing literal "%XY" output exactly as before.

epee::misc_utils::parse::isdigit/isalpha/isspace are separate char-taking
helpers and are already well defined, so they are untouched, as is
is_base64(), which already takes unsigned char.
2026-08-29 04:38:57 +02:00
tobtoht 52a2323743 Merge pull request #11167
f7d27f0 wallet: encode equals signs in URIs (Samy)

ACKs: jpk68, selsta
2026-08-27 17:59:29 +00:00
tobtoht 833c91e5db Merge pull request #11134
5066fd0 wallet2: abort in-flight daemon request on shutdown (woodser)

ACKs: amin404ala*, thomasbuilds, selsta
2026-08-26 07:33:16 +00:00
tobtoht 95c12d72e9 Merge pull request #11148
7a3bd6c epee: prevent JSON parser log injection (selsta)

ACKs: tobtoht*, jpk68
2026-08-25 16:38:06 +00:00
woodser 5066fd05f1 wallet2: abort in-flight daemon request on shutdown 2026-08-25 07:11:53 -04:00
tobtoht a6b67c94cd Merge pull request #11137
6f82bac Fix two separate data races in async levin commands (Lee Clagett)

ACKs: thomasbuilds, jpk68, selsta
2026-08-23 20:16:47 +00:00
tobtoht bc933f920f Merge pull request #8540
7a8642e Update levin async callbacks for C++14 (Lee *!* Clagett)

ACKs: jpk68, jeffro256, selsta
2026-08-23 07:42:48 +00:00
tobtoht 061c061673 Merge pull request #11127
c2aaa40 epee: parse HTTP methods case-sensitively (Samy)

ACKs: redsh4de, jpk68, SyntheticBird45
2026-08-23 07:41:55 +00:00
Lee *!* Clagett 7a8642eb1a Update levin async callbacks for C++14 2026-08-21 17:42:09 -04:00
Samy f7d27f05dd wallet: encode equals signs in URIs
The URI parser treats '=' as the parameter delimiter, so leaving it raw in text fields makes make_uri output fail to parse
2026-08-21 13:50:55 +02:00
selsta 7a3bd6c68d epee: prevent JSON parser log injection 2026-08-19 22:27:22 +02:00
tobtoht 31268f0eb2 Merge pull request #11103
6d3abd3 epee: validate Levin response command before buffering (selsta)

ACKs: jpk68, vtnerd
2026-08-19 11:24:19 +00:00
Lee Clagett 6f82bacbb9 Fix two separate data races in async levin commands 2026-08-17 20:56:25 -04:00
tobtoht cd701600df Merge pull request #11082
7e0c68b p2p: don't reset timeout timer for handshakes (j-berman)

ACKs: jpk68, selsta, vtnerd
2026-08-17 17:25:42 +00:00
tobtoht f18ea5a8c7 Merge pull request #11066
0bf3e67 epee: replace some fragile code (jpk68)

ACKs: selsta, SNeedlewoods
2026-08-17 09:19:06 +00:00
Samy c2aaa4057d epee: parse HTTP methods case-sensitively 2026-08-16 18:44:03 +02:00
tobtoht fcd62c20d7 Merge pull request #11057
fccaccb src: fix issues found through static analysis (jpk68)

ACKs: jeffro256, SNeedlewoods
2026-08-11 21:21:49 +00:00
j-berman 7e0c68b422 p2p: don't reset timeout timer for handshakes
The handshake timeout should just be an absolute timeout, we don't
care about partial messages received during the handshake.
2026-08-10 20:06:54 -07:00
j-berman e8718e6592 p2p: use a bool for send()
Identified by @selsta

Callers can otherwise misinterpret int -1 as truthy success,
e.g. see make_payload_send_txs
2026-08-10 11:01:06 -07:00
jpk68 0bf3e67162 epee: replace some fragile code 2026-08-09 15:48:14 -04:00
selsta 6d3abd38fa epee: validate Levin response command before buffering 2026-08-08 15:54:40 +02:00
Samy 6d3a705194 epee: fix peak upload speed accounting 2026-08-07 20:34:47 +02:00
jpk68 fccaccbc8e src: fix issues found through static analysis 2026-08-05 21:45:36 -04:00
Lee Clagett b8028e31ad Change p2p connection map from raw pointers to weak_ptrs 2026-08-05 15:00:34 -04:00
tobtoht e8dd781e19 Merge pull request #10812
44493be p2p, rpc: group public IPv6 connection limits by /64 (selsta)

ACKs: plowsof*, tobtoht
2026-08-01 16:12:29 +00:00
selsta 44493becb7 p2p, rpc: group public IPv6 connection limits by /64 2026-08-01 17:23:05 +02:00
tobtoht 42f566231a Merge pull request #10980
1bae55a p2p: stop buffered dispatch after fatal notifications (selsta)

ACKs: jpk68*, SChernykh
2026-08-01 15:20:17 +00:00
selsta 9268681a6f p2p: reject IPv4-mapped IPv6 peers 2026-07-31 00:45:08 +02:00
tobtoht 43fd7fb8dd Merge pull request #10747
d2e6f9b p2p: fix IPv4 subnet arithmetic (Ap4sh)

ACKs: selsta, jpk68
2026-07-30 21:27:32 +00:00
Lee Clagett e123147542 Fix stall issues with p2p 2026-07-29 10:28:29 -04:00
selsta 1bae55aef1 p2p: stop buffered dispatch after fatal notifications 2026-07-27 19:33:24 +02:00
tobtoht e00908bc49 Merge pull request #10921
edea850 general: replace auto_scope_leave_caller with scope_guard (jeffro256)

ACKs: selsta, tobtoht
2026-07-22 16:31:31 +00:00
tobtoht c821e75318 Merge pull request #10169
0c9956a functional_tests: Python epee binary lib and test `/get_blocks.bin` (jeffro256)

ACKs: selsta, plowsof
2026-07-20 18:34:10 +00:00
tobtoht 3ed8ffb56b Merge pull request #10842
fa91ae4 common: remove dead code (Thomas)
8701fc9 blockchain_db: remove unused MDB_val_copy specializations (Thomas)
00d21ee epee: remove dead code (Thomas)

ACKs: selsta, jpk68
2026-07-20 09:09:49 +00:00
tobtoht ff17d7f7ba Merge pull request #10905
d436311 epee: avoid bad_weak_ptr during connection teardown (selsta)

ACKs: vtnerd, SChernykh
2026-07-20 09:01:13 +00:00
jeffro256andselsta 0c9956af80 functional_tests: Python epee binary lib and test /get_blocks.bin
Co-authored-by: selsta <selsta@sent.at>
2026-07-17 22:35:43 -05:00
jeffro256 edea8505db general: replace auto_scope_leave_caller with scope_guard
And replace unused inclusions of misc_language.h
2026-07-15 19:54:58 -05:00
tobtoht ea379f8f76 Merge pull request #10877
6308971 epee: narrow included asio headers (jpk68)

ACKs: jeffro256, selsta
2026-07-15 17:18:29 +00:00
selsta d4363111b9 epee: avoid bad_weak_ptr during connection teardown
foreach_connection() can race with connection destruction while the
protocol handler remains in the raw-pointer map. Use the non-throwing
weak_from_this().lock() in add_ref() and treat expired connections as
unavailable.

This is an interim mitigation pending the broader connection lifetime
fix in PR 7345.
2026-07-11 16:22:25 +02:00
tobtoht d6aa5ce38f Merge pull request #10851
7eb70c7 chore: remove msvc remnants (jpk68)

ACKs: selsta, tobtoht
2026-07-08 09:26:40 +00:00
tobtoht 381fce8dde Merge pull request #10828
fecef76 Fix spelling typos in comments and string literals (Thomas)

ACKs: tobtoht, selsta
2026-07-02 13:18:56 +00:00
Ap4sh d2e6f9bb57 p2p: fix IPv4 subnet arithmetic 2026-06-30 20:40:44 +02:00
Thomas 00d21ee75e epee: remove dead code
Each symbol below has no references anywhere in the tree (src/, contrib/,
tests/); the full build still links cleanly. Per-symbol history is given so the
"why is this unused" is auditable (hashes are ancestors of HEAD).

net/connection_basic (all four lost their last caller in the 2022 connection
rewrite, 3be1dbd09 "connection: fix implementation"):
- to_string(t_connection_type): unused free function. Added 9bfa593ee (2015)
  to print a connection's type in a debug log; 3be1dbd09 (2022) switched that
  log line to std::to_string on the enum, orphaning this overload.
- do_send_handler_write / do_send_handler_write_from_queue: trace-only stubs
  added eabb51960 (2015) on the TCP send path; their calls in do_send_chunk /
  the write-completion handler were deleted by 3be1dbd09 (2022). The real send
  path is connection<T>::start_write().
- sleep_before_packet: outbound rate-limit sleep added eabb51960 (2015);
  callers were thinned over time (cf5f62361, 2017) and the last removed by
  3be1dbd09 (2022). Rate-limiting now lives in connection<T>::start_write()
  via the global out-throttle.

net/levin_base:
- struct bucket_head: legacy levin packet header from the 2014 epee import,
  superseded by bucket_head2 (the wire header, `using header = bucket_head2`).
  Its last use went away with the old levin_protocol_handler in 0c545f614
  (2024, "epee/test: remove levin_protocol_handler and core_proxy tests").
- LEVIN_PROTOCOL_VER_0: dead on arrival - present since the 2014 import, never
  referenced (the code uses LEVIN_PROTOCOL_VER_1).

net/net_utils_base (connection-context logging macros):
- LOG_PRINT_CC_L4: levin trace macro (2014 import); all call sites removed in
  5833d66f6 (2017, "Change logging to easylogging++").
- LOG_PRINT_CCONTEXT_L3: had a single "REMOTE PEERLIST" call site, removed in
  the same 5833d66f6 (2017).
- LOG_PRINT_CC_L3: only ever referenced inside LOG_PRINT_CCONTEXT_L3's body,
  never invoked directly - transitively dead once the above was removed.
- LOG_CC: dead on arrival - added in 5833d66f6 (2017) but never invoked.
  (The plain LOG_PRINT_L3 macro that LOG_PRINT_CC_L3/CCONTEXT_L3 wrap is still
  used elsewhere and is left untouched; only these unused CC wrappers go.)

net/network_throttle:
- typedef network_MB: added eabb51960 (2015); its only consumers
  (set_target_kill / m_target_MB) were stripped the same day in 5ce4256e3
  (2015), leaving an unused typedef.

profile_tools:
- START_WAY_POINTS / WAY_POINT / WAY_POINT2: dead on arrival - upstream-epee
  profiling macros present since the 2014 import, never once invoked (they only
  ever appear as definitions in profile_tools.h across all history).
- TIME_MEASURE_PAUSE / TIME_MEASURE_RESTART and their _NS_ variants: dead on
  arrival - added bda8c5983 (2017, "epee: add nanosecond timer and pause/restart
  profiling macros") but never wired to any call site. Of this family only
  TIME_MEASURE_START / TIME_MEASURE_FINISH are actually used.

storages:
- typedef binarybuffer (portable_storage_base): used by the binary store/load
  API since the 2014 import; its last consumer (store_to_binary) was removed in
  7414e2bac (2020, "Change epee binary output from std::stringstream to
  byte_stream").
- the templated min_bytes() member declaration (portable_storage_from_bin):
  declared but never defined or called. Added 7f407c027 (2020-12-26,
  "portable_storage: add some sanity checks on data size") alongside the
  ps_min_bytes<> trait struct, but the size checks were implemented via that
  trait (ps_min_bytes<>::strict), so this member was never defined or wired up
  - dead on arrival. The ps_min_bytes<> trait remains in use and is left intact.
2026-06-30 15:59:47 +02:00
jpk68 7eb70c7858 chore: remove msvc remnants 2026-06-29 21:29:19 -04:00
tobtoht 6eef935d2c Merge pull request #10810
07f7c75 http: parse server Content-Length strictly (alhudz)

ACKs: vtnerd, selsta
2026-06-29 11:42:27 +00:00
Thomas fecef767c9 Fix spelling typos in comments and string literals 2026-06-27 09:53:48 +02:00