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.
75 lines
2.7 KiB
INI
75 lines
2.7 KiB
INI
[nrf54l15_base]
|
|
platform = https://github.com/Seeed-Studio/platform-seeedboards.git
|
|
framework = zephyr
|
|
extends = arduino_base
|
|
|
|
build_type = release
|
|
build_flags =
|
|
${arduino_base.build_flags}
|
|
-Isrc/platform/nrf54l15
|
|
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
|
-DMESHTASTIC_EXCLUDE_GPS=1
|
|
-DMESHTASTIC_EXCLUDE_MQTT=1
|
|
-DHAS_WIRE=1
|
|
-DHAS_SENSOR=1
|
|
-DHAS_BUTTON=0
|
|
-DHAS_TELEMETRY=1
|
|
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
|
-DARDUINO=100
|
|
-DMESHTASTIC_EXCLUDE_ACCELEROMETER=1
|
|
-DMAX_NUM_NODES=40
|
|
-fpermissive
|
|
# Libraries that Zephyr LDF misses; add include paths explicitly
|
|
-I.pio/libdeps/${PIOENV}/Crypto
|
|
-I.pio/libdeps/${PIOENV}/ArduinoThread
|
|
-I".pio/libdeps/${PIOENV}/ESP8266 and ESP32 OLED driver for SSD1306 displays/src"
|
|
-I.pio/libdeps/${PIOENV}/OneButton/src
|
|
-I.pio/libdeps/${PIOENV}/arduino-fsm
|
|
-I.pio/libdeps/${PIOENV}/TinyGPSPlus/src
|
|
-I.pio/libdeps/${PIOENV}/ErriezCRC32/src
|
|
-I.pio/libdeps/${PIOENV}/NonBlockingRTTTL/src
|
|
-I.pio/libdeps/${PIOENV}/RadioLib/src
|
|
|
|
build_src_filter =
|
|
${arduino_base.build_src_filter}
|
|
-<nimble/>
|
|
-<mesh/wifi/>
|
|
-<mesh/api/>
|
|
-<mesh/http/>
|
|
-<modules/esp32>
|
|
-<mesh/eth/>
|
|
-<mesh/raspihttp>
|
|
-<serialization/>
|
|
-<mqtt/>
|
|
-<motion/>
|
|
+<platform/nrf54l15/>
|
|
|
|
lib_compat_mode = off
|
|
|
|
lib_deps =
|
|
${arduino_base.lib_deps}
|
|
${radiolib_base.lib_deps}
|
|
# renovate: datasource=git-refs depName=meshtastic/Crypto packageName=https://github.com/meshtastic/Crypto gitBranch=master
|
|
https://github.com/meshtastic/Crypto/archive/591ff9a690e8168ccb7a36abde8d7783e448d395.zip
|
|
; Cherry-picked sensor libs from environmental_base. The full
|
|
; environmental_base pulls Adafruit_SSD1306 / GFX which need Arduino
|
|
; pin macros (digitalPinToPort / portOutputRegister) that the Zephyr
|
|
; Arduino shim does not implement.
|
|
https://github.com/adafruit/Adafruit_BusIO/archive/refs/tags/1.17.4.zip
|
|
https://github.com/adafruit/Adafruit_Sensor/archive/refs/tags/1.1.15.zip
|
|
https://github.com/adafruit/Adafruit_BMP280_Library/archive/refs/tags/3.0.0.zip
|
|
https://github.com/adafruit/Adafruit_BME280_Library/archive/refs/tags/2.3.0.zip
|
|
https://github.com/adafruit/Adafruit_INA260/archive/refs/tags/1.5.3.zip
|
|
https://github.com/adafruit/Adafruit_INA219/archive/refs/tags/1.2.3.zip
|
|
https://github.com/RobTillaart/INA3221_RT/archive/refs/tags/0.4.2.zip
|
|
https://github.com/RobTillaart/INA226/archive/refs/tags/0.6.6.zip
|
|
; SHTXXSensor gates on __has_include(<SHTSensor.h>), a header shipped by
|
|
; Sensirion/arduino-sht. Adafruit_SHT4X ships Adafruit_SHT4X.h instead and
|
|
; has no consumer in src/, so it left the SHT40 driver out of the build.
|
|
https://github.com/Sensirion/arduino-sht/archive/refs/tags/v1.2.6.zip
|
|
|
|
lib_ignore =
|
|
BluetoothOTA
|
|
lvgl
|
|
Adafruit_nRFCrypto
|