mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
GCS_MAVLink: don't allow signing key to be set up when armed
Discussion is here: https://github.com/ArduPilot/ardupilot/issues/10298
This commit is contained in:
parent
871a019995
commit
b19f760628
@ -65,6 +65,13 @@ bool GCS_MAVLINK::signing_key_load(struct SigningKey &key)
|
|||||||
*/
|
*/
|
||||||
void GCS_MAVLINK::handle_setup_signing(const mavlink_message_t *msg)
|
void GCS_MAVLINK::handle_setup_signing(const mavlink_message_t *msg)
|
||||||
{
|
{
|
||||||
|
// setting up signing key when armed generally not useful /
|
||||||
|
// possibly not a good idea
|
||||||
|
if (hal.util->get_soft_armed()) {
|
||||||
|
send_text(MAV_SEVERITY_WARNING, "ERROR: Won't setup signing when armed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// decode
|
// decode
|
||||||
mavlink_setup_signing_t packet;
|
mavlink_setup_signing_t packet;
|
||||||
mavlink_msg_setup_signing_decode(msg, &packet);
|
mavlink_msg_setup_signing_decode(msg, &packet);
|
||||||
@ -75,7 +82,7 @@ void GCS_MAVLINK::handle_setup_signing(const mavlink_message_t *msg)
|
|||||||
memcpy(key.secret_key, packet.secret_key, 32);
|
memcpy(key.secret_key, packet.secret_key, 32);
|
||||||
|
|
||||||
if (!signing_key_save(key)) {
|
if (!signing_key_save(key)) {
|
||||||
hal.console->printf("Failed to save signing key");
|
send_text(MAV_SEVERITY_WARNING, "ERROR: Failed to save signing key");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user