GCS_MAVLink: check the signing key magic on load

or we end up with a bad key when MAVLink2 is first enabled
This commit is contained in:
Andrew Tridgell 2016-09-04 19:28:48 +10:00
parent b9c4a948d1
commit cfd7268bd5

View File

@ -53,7 +53,13 @@ bool GCS_MAVLINK::signing_key_load(struct SigningKey &key)
if (_signing_storage.size() < sizeof(key)) {
return false;
}
return _signing_storage.read_block(&key, 0, sizeof(key));
if (!_signing_storage.read_block(&key, 0, sizeof(key))) {
return false;
}
if (key.magic != SIGNING_KEY_MAGIC) {
return false;
}
return true;
}
/*