48 Commits
Author SHA1 Message Date
liquidraver ba33cebf6a cad improvements 2026-09-01 22:05:29 +02:00
liquidraver 2a519e11d1 try to guard accidental region load command 2026-08-28 10:59:42 +02:00
liquidraver 7d695872d4 implement radio.fem.rxgain 2026-08-22 17:32:41 +02:00
liquidraver 50b5fc3aba bump to 1.17.1 and merge upstream 2026-08-14 14:52:05 +02:00
liquidraver ee90693c89 lr20xx: add freq-error summary log and get freqerr CLI 2026-08-12 15:12:43 +02:00
liquidraver 3494411f83 x1 debug 2026-08-10 19:15:26 +02:00
liquidraver a705d5b5ce refactor / unify probes 2026-07-29 12:30:47 +02:00
liquidraver fe6e585eb6 get rid of housekeeping tick and AGC reset 2026-07-28 14:12:40 +02:00
liquidraver 13b5e2fcf3 scrub APC and bump to 1.16.6 2026-07-20 09:55:32 +02:00
liquidraver 434a49375e try to improve APC 2026-07-17 08:35:08 +02:00
liquidraver 432336867b add cad.busycap knob for hilltop repeaters 2026-07-13 10:29:50 +02:00
liquidraver dc1239537e SmartCAD p1 2026-07-12 10:48:37 +02:00
liquidraver 6057670171 sync with vanilla dev 2026-07-04 12:50:37 +02:00
liquidraver 46d27a0144 meshtimesync p2 2026-07-03 19:30:53 +02:00
liquidraver 14cb8c61f9 meshtimesync p1 2026-07-03 09:11:43 +02:00
liquidraver fc940d27ba sync with dev 2026-07-02 13:13:26 +02:00
liquidraver c4a1777956 refactor gps manager 2026-06-17 15:42:50 +02:00
liquidraver 966bf24c96 defer MQTT connect publish to main loop (uplink cross-thread fix) 2026-06-11 12:32:37 +02:00
liquidraver 2ad185bab4 license "refactor" :) 2026-06-07 22:47:17 +02:00
liquidraver ffe9ea652d sync to vanilla 1.16 2026-06-06 16:42:39 +02:00
liquidraver d13d6f4621 version to 1.15.9 2026-06-05 14:59:12 +02:00
liquidraver 743076b850 bump some magic numbers 2026-06-03 14:02:46 +02:00
liquidraver 8761a82d93 fix USB protocol handling and bump version 2026-06-03 10:09:43 +02:00
liquidraver ea27b93ac5 refactor: split RepeaterMesh into RepeaterUplink + RepeaterRegionCLI 2026-05-29 15:25:18 +02:00
liquidraver 8d138c41b3 crypto: mitigate login plaintext-password vulnerability (server-side)
Tracks upstream meshcore-dev/MeshCore#2556 — passwords sent as
plaintext over encrypted links are vulnerable to evil-twin/phishing
attacks (attacker advertises a repeater with the same name but a
different pubkey; user picks the wrong one and types the password).

The structural fix is a protocol change (PAKE adoption — SPAKE2,
OPAQUE, or HMAC-with-both-pubkeys) and must land synchronously
across all implementations. Diverging unilaterally would break
interop with Arduino-based companions and repeaters, so we wait
for upstream.

Two within-protocol mitigations applied server-side:

1. Constant-time password comparison.  Replaced strcmp() in
   RepeaterMesh::handleLoginReq with a local ct_memeq() helper.
   Pads the received password to the full 16-byte storage size,
   XOR-accumulates byte differences with no early exit. Compares
   both admin and guest passwords unconditionally so timing is
   identical regardless of which (if any) the attempt resembled.
   Eliminates the timing oracle that lets an already-MITM
   attacker recover the stored password byte-by-byte.

2. Failed-login rate limit.  New login_fail_limiter(4, 180)
   RateLimiter — 4 wrong-password attempts per 180s, matching the
   existing anon_limiter pattern. Hitting the cap trips a distinct
   LOG_WRN so operators see active brute-force attempts in logs.
   Global rate (not per-sender) — simpler, no ACL state bloat;
   trade-off documented in CRYPTO_AUDIT_INDEX.md.

What's NOT fixed: the wire protocol still carries plaintext
passwords. The evil-twin attack itself remains possible; these
mitigations raise the attacker's cost (no timing leak, no
brute-force at line rate) but don't replace the structural fix.
UI-side defenses (TOFU warnings on duplicate names, pubkey
fingerprint display) are valuable companion-side mitigations
but out of scope for this audit's server-side commit.
2026-05-28 09:49:28 +02:00
liquidraver c7a00b9533 update version 2026-05-22 15:39:07 +02:00
liquidraver bd1e022e88 fix(security): close OOB read in path-decoding callers (BLE + LoRa-anon)
Both mesh::Packet::writePath and ::copyPath did a raw memcpy of the
decoded hash_count*hash_size bytes from src to dest with no bound on
src. Two call sites used phone-supplied or LoRa-anon-supplied buffers
where the path_len byte was attacker-controlled:

  - CompanionMesh CMD_SEND_CHANNEL_DATA accepted len>=4 and called
    writePath with no src bound; a paired phone could leak up to ~65
    bytes of syswq stack into the outgoing LoRa channel-data frame.

  - RepeaterMesh handleAnonRegionsReq / handleAnonOwnerReq /
    handleAnonClockReq read reply_path_len from an unauthenticated
    LoRa anon-request payload and called copyPath without any src
    bound. Any LoRa neighbor could leak repeater stack into the
    reply path.

Hardened the API: both functions now require an explicit src_len
and reject (return 0) when the decoded byte count exceeds it.
Updated all 14 call sites across Packet/Mesh/Dispatcher/BaseChatMesh/
CompanionMesh/RepeaterMesh. Trusted callers (internal MAX_PATH_SIZE
buffers) pass MAX_PATH_SIZE; untrusted callers pass real remaining
length. Added len-5 plumbing through the anon-handler signatures.

CMD_SEND_CHANNEL_DATA also gained a local len>=5 + path_bytes
sanity check for early rejection.
2026-05-20 11:52:39 +02:00
liquidraver 1092c49a7d port vanilla duty cycling logic 2026-04-28 14:43:12 +02:00
liquidraver b57df41753 micro-tweak: skip APC math when APC is off 2026-04-28 14:18:10 +02:00
liquidraver e18d017b2c refactor repeater prefs changes 2026-04-28 13:49:08 +02:00
liquidraver 7ecf647af8 runtime guard agc reset if rx duty cycle is enabled 2026-04-28 13:49:08 +02:00
liquidraver d5f260c1c9 Fix ESP OTA functions 2026-04-25 14:52:45 +02:00
liquidraver a3244e2dc2 Three driver fixes for RX duty cycle, all applied to the existing patch
stolen from Zephyr main:

  1. Issue StopTimerOnPreamble=1 before SetRxDutyCycle so the chip's
     timer is not reset on every preamble detect (per §13.1 of the
     datasheet). Without this, duty cycle effectively never sleeps in
     noisy RF and current draw spikes.
  2. On IRQ_RX_TX_TIMEOUT during duty-cycle RX, re-arm via
     sx126x_restart_rx() instead of falling through to set_sleep().
     The old path silently killed duty cycle after the first preamble
     false-positive.
  3. On recv_duty_cycle(NULL) cancel, wake the radio before issuing
     SetStandby — BUSY stays asserted during the sleep phase and the
     standby command was being dropped.

Also adds a dc_timeout_restarts atomic counter incremented on the Fix 2
path, exposed end-to-end: sx126x_ext.h accessors → LoRaRadioBase vtable
→ SX126xRadio override → CommonCLICallbacks → RepeaterMesh. Query via
`get dc.restarts` on the repeater CLI; cleared by `clear stats`. High
values indicate a noisy environment or a too-loose preamble threshold.

(+increase ESP BT stack because future zephyr pin advance will trip that mine)
2026-04-20 13:36:45 +02:00
liquidraver 78561036d0 bump version to match vanilla 2026-04-19 10:16:59 +02:00
liquidraver d2cec84100 sync with vanilla dev 2026-04-17 13:21:30 +02:00
liquidraver a716d2478f port seeed solar p1 + gps command fixes 2026-04-13 11:48:34 +02:00
liquidraver 4f6b0cca27 fix repeater-observer hybrid freezing 2026-04-09 12:23:27 +02:00
liquidraver 0898699c33 patch file CLRF fixup and repeater-observer hybrid first implementation 2026-04-09 11:02:58 +02:00
liquidraver a1dddbea75 Repeater GPS: separate advert vs telemetry position, persist last fix
GPS fixes no longer overwrite prefs lat/lon — adverts use only
manually-set coordinates (via gps setloc or companion app)

Precise GPS position served via telemetry requests only
getNodeLat()/getNodeLon() returns live GPS fix

Last good fix persisted to /lfs/gps_pos — survives reboots

| Command | Description |
|---------|-------------|
| `gps` | Show GPS status (`on` or `off`) |
| `gps on` | Enable GPS module |
| `gps off` | Disable GPS module |
| `gps setloc` | Update stored latitude/longitude from current GPS fix |
| `gps advert` | Show current location advertising policy |
| `gps advert none` | Do not include location in advertisements |
| `gps advert share` | Include live GPS location in advertisements |
| `gps advert prefs` | Include stored lat/lon from prefs in advertisements |
2026-04-01 11:06:09 +02:00
liquidraver 8dd6f149f8 sync with arduino/dev 2026-03-24 20:36:36 +01:00
liquidraver d794b57e31 APC second test
This reverts commit 4bd84ddf7e.
2026-03-14 21:15:57 +01:00
liquidraver 4bd84ddf7e APC first test 2026-03-14 14:01:10 +01:00
liquidraver d45fbf7027 reactive collision avoidance 2026-03-11 12:08:48 +01:00
liquidraver 76b87292c3 1.14 changes merge 2026-03-06 07:56:17 +01:00
liquidraver 9b6a47d27b port multibyte paths 2026-02-26 15:40:51 +01:00
liquidraver 89bee0959f fix repeater advert coordinates 2026-02-23 15:20:50 +01:00
liquidraver 73222600b2 merge everything important up until d05d6abab8b52c0f20a0f85a0939c74bc762b4ad meschore/dev 2026-02-22 13:41:57 +01:00
liquidraver 8d1823d0b6 First iteration that seems to work 2026-02-20 12:43:13 +01:00