Audit of the XEdDSA packet-signing implementation (#10478) surfaced several issues in when unsigned packets are accepted on receive or emitted on send. This fixes them and adds regression coverage. - Unicast NodeInfo exchange no longer breaks against signer nodes: the NodeInfoModule downgrade drop is gated to broadcasts, since senders never sign unicast (want_response replies, directed exchanges). - Replace the payload-size sign heuristic with an exact encoded-size gate (signedDataFits) and mirror it on the receive side, removing a dead band where 167-168 B broadcasts were signed then failed TOO_LARGE. - Extract the receive policy into checkXeddsaReceivePolicy() and apply it to plaintext-MQTT decoded downlink, which previously skipped signature verification and downgrade protection entirely. - Reject signatures whose length is neither 0 nor 64 as malformed, so a crafted partial signature can't inflate the size estimate and dodge the unsigned-downgrade drop. - Hold cryptLock on the MQTT verify path (shared Ed25519 key cache). - Clear any client-preset signature on packets we originate, on all builds. - Randomized (hedged) signing per the Signal XEdDSA spec: bump the meshtastic/Crypto pin to the build where XEdDSA::sign mixes 32 bytes of caller randomness into the nonce as Z (meshtastic/Crypto#3), and seed those bytes in xeddsa_sign from HardwareRNG (checked, with a seeded-CSPRNG fallback). test_crypto pins that repeated signs differ and both verify. Adds test coverage: test_packet_signing groups A-E (receive matrix, send policy, NodeInfo backstop, encoding invariants, decoded-ingress policy), test_mqtt end-to-end downlink cases, and a test_crypto randomization check.
36 lines
1.2 KiB
INI
36 lines
1.2 KiB
INI
; Common settings for rp2040 Processor based targets
|
|
[rp2040_base]
|
|
platform =
|
|
# TODO renovate
|
|
https://github.com/maxgerhardt/platform-raspberrypi#cc24cfef37ed22ca9f2a6aead28c2deb76c39f24
|
|
; For arduino-pico >= 5.4.4
|
|
extends = arduino_base
|
|
platform_packages =
|
|
# TODO renovate
|
|
arduino-pico@https://github.com/earlephilhower/arduino-pico/releases/download/5.4.4/rp2040-5.4.4.zip
|
|
|
|
board_build.core = earlephilhower
|
|
board_build.filesystem_size = 0.5m
|
|
build_flags =
|
|
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
|
-Isrc/platform/rp2xx0
|
|
-Isrc/platform/rp2xx0/hardware_rosc/include
|
|
-Isrc/platform/rp2xx0/pico_sleep/include
|
|
-D__PLAT_RP2040__
|
|
-D__FREERTOS=1
|
|
# -D _POSIX_THREADS
|
|
build_src_filter =
|
|
${arduino_base.build_src_filter} +<platform/rp2xx0/> -<nimble/> -<modules/esp32> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
|
|
|
|
lib_ignore =
|
|
BluetoothOTA
|
|
lvgl
|
|
|
|
lib_deps =
|
|
${arduino_base.lib_deps}
|
|
${environmental_base.lib_deps}
|
|
${environmental_extra.lib_deps}
|
|
${radiolib_base.lib_deps}
|
|
# renovate: datasource=github-tags depName=meshtastic/Crypto packageName=meshtastic/Crypto
|
|
https://github.com/meshtastic/Crypto/archive/591ff9a690e8168ccb7a36abde8d7783e448d395.zip
|