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:
parent
b9c4a948d1
commit
cfd7268bd5
@ -53,7 +53,13 @@ bool GCS_MAVLINK::signing_key_load(struct SigningKey &key)
|
|||||||
if (_signing_storage.size() < sizeof(key)) {
|
if (_signing_storage.size() < sizeof(key)) {
|
||||||
return false;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user