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.
111 lines
3.5 KiB
INI
111 lines
3.5 KiB
INI
[esp32p4_base]
|
|
extends = esp32_common
|
|
custom_esp32_kind = esp32p4
|
|
board_build.mcu = esp32p4
|
|
|
|
build_unflags=
|
|
-DHAS_UDP_MULTICAST=1
|
|
|
|
build_flags =
|
|
${esp32_common.build_flags}
|
|
-DMESHTASTIC_EXCLUDE_WIFI=1 ; TODO
|
|
-DMESHTASTIC_EXCLUDE_MQTT=1
|
|
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
|
|
|
build_src_filter =
|
|
${esp32_common.build_src_filter} -<libpax/> +<platform/esp32> -<mesh/raspihttp> -<serialization/>
|
|
|
|
extra_scripts =
|
|
${esp32_common.extra_scripts}
|
|
extra_scripts/ld_response_file.py
|
|
|
|
; Override esp32_common component pruning: keep esp_hosted + esp_wifi_remote for P4 hosted BT
|
|
custom_component_remove =
|
|
espressif/esp_modem
|
|
espressif/esp-dsp
|
|
espressif/esp32-camera
|
|
espressif/libsodium
|
|
espressif/esp-modbus
|
|
espressif/qrcode
|
|
espressif/esp_insights
|
|
espressif/esp_diag_data_store
|
|
espressif/esp_diagnostics
|
|
espressif/esp_rainmaker
|
|
espressif/rmaker_common
|
|
espressif/network_provisioning
|
|
chmorgan/esp-libhelix-mp3
|
|
espressif/esp-tflite-micro
|
|
espressif/esp-sr
|
|
espressif/esp_matter
|
|
espressif/esp-zboss-lib
|
|
espressif/esp-zigbee-lib
|
|
espressif/mqtt
|
|
|
|
custom_sdkconfig =
|
|
${esp32_common.custom_sdkconfig}
|
|
CONFIG_ARDUINO_SELECTIVE_SD_MMC=y
|
|
CONFIG_BT_CONTROLLER_DISABLED=y
|
|
CONFIG_ESP_WIFI_REMOTE_ENABLED=y
|
|
# esp_hosted core
|
|
CONFIG_ESP_HOSTED_ENABLED=y
|
|
# Board: custom (not Espressif EV board)
|
|
CONFIG_ESP_HOSTED_P4_DEV_BOARD_NONE=y
|
|
# Delay after C6 reset to allow boot (e.g. old v2.3.0 may be slow)
|
|
CONFIG_ESP_HOSTED_SDIO_RESET_DELAY_MS=1500
|
|
CONFIG_ESP_HOSTED_SDIO_OPTIMIZATION_RX_STREAMING_MODE=y
|
|
CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y
|
|
CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET="esp32c6"
|
|
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
|
|
CONFIG_ESP_HOSTED_CP_TARGET_ESP32H2=n
|
|
CONFIG_ESP_HOSTED_PRIV_SDIO_OPTION=y
|
|
CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE=n
|
|
CONFIG_ESP_HOSTED_TRANSPORT_SDIO=y
|
|
CONFIG_ESP_HOSTED_ENABLE_NIMBLE=y
|
|
CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y
|
|
CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y
|
|
CONFIG_ESP_HOSTED_ENABLE_PEER_DATA_TRANSFER=y
|
|
CONFIG_ESP_HOSTED_MAX_CUSTOM_MSG_HANDLERS=3
|
|
# OTA method: LittleFS
|
|
CONFIG_OTA_METHOD_LITTLEFS=y
|
|
|
|
# Skip version check - we force OTA regardless
|
|
# CONFIG_OTA_VERSION_CHECK_HOST_SLAVE is not set
|
|
# CONFIG_OTA_VERSION_CHECK_SLAVEFW_SLAVE is not set
|
|
|
|
# RX streaming mode
|
|
CONFIG_ESP_HOSTED_SLAVE_RESET_ON_EVERY_HOST_BOOTUP=y
|
|
;CONFIG_ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY=y
|
|
# SOC_LCD (MUI / lovyanGFX)
|
|
CONFIG_SOC_LCD_I80_SUPPORTED=y
|
|
CONFIG_SOC_LCD_RGB_SUPPORTED=y
|
|
CONFIG_SOC_MIPI_DSI_SUPPORTED=y
|
|
# stack dump
|
|
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y ; remove for production version
|
|
;CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y; for production version
|
|
;CONFIG_ESP_SYSTEM_PANIC_GDBSTUB=y ; for target debugging
|
|
# Logger: verbose for experiment
|
|
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
|
CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y
|
|
|
|
|
|
lib_ignore =
|
|
${esp32_common.lib_ignore}
|
|
libpax
|
|
esp8266-oled-ssd1306
|
|
bsec2
|
|
esp32_idf5_https_server
|
|
esp_driver_cam
|
|
esp_http_server
|
|
|
|
; Override lib_deps to exclude environmental_extras
|
|
lib_deps =
|
|
${arduino_base.lib_deps}
|
|
${networking_base.lib_deps}
|
|
${networking_extra.lib_deps}
|
|
${environmental_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
|
|
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
|
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|