From a06d163ef0264241049e3a47d5657af2851b5f85 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 29 Aug 2022 15:50:52 +1000 Subject: [PATCH] GCS_MAVLink: refuse DFU for secure firmware --- libraries/GCS_MAVLink/GCS_Common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index ed2507bc52..1595f02c04 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -2966,9 +2966,14 @@ MAV_RESULT GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &pa } #if HAL_ENABLE_DFU_BOOT if (is_equal(packet.param4, 99.0f)) { - send_text(MAV_SEVERITY_WARNING,"Entering DFU mode"); +#if AP_SIGNED_FIRMWARE + send_text(MAV_SEVERITY_ERROR, "Refusing DFU for secure firmware"); + return MAV_RESULT_FAILED; +#else + send_text(MAV_SEVERITY_WARNING, "Entering DFU mode"); hal.util->boot_to_dfu(); return MAV_RESULT_ACCEPTED; +#endif } #endif }