-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signing #253
Signing #253
Conversation
Can you rebase over master ? |
I have fixed the merge conflicts for this, but I should probably add signing variant of the new async methods too. Hence I marked this a draft until I have implemented this. |
I have added |
Nice work, but I think you've merged the updated master into this branch instead of rebasing it over master |
…kV2MessageRaw add calculate_signature, checksum_bytes, signature_link_id[_mut], signature_timestamp[_bytes[_mut]], signature_value[_mut] to MAVLinkV2MessageRaw
feat: add distinct pub fn for signing, signing in MavConnection send, add signing feature to mavlink test: add --features signing to all test, add signing test, add Debug, Clone to SigningConfig
test: add signing to msrv check
test: add signing to internal-tests matrix test: add signing as msrv matrix option
As pointed out in #82 MAVLink 2 message signing is not supported beyond being able to correctly parse signed messages.
This PR adds full support for signature creation and verification.
This is done by introducing the
signing
feature to themavlink
andmavlink-core
crates.The implementation is done in a way that the public interfaces remain unchanged without the feature and are semver compatible when it is enabled.
Additions
signing
feature for mavlink-core and as passthrough tomavlink
, all following additions require this, this is not enabled by defaultSigningConfig
to configure signing with a secret key, enable sign outgoing and allow unsigned messagesSigningData
to execute signing withverify_signature()
,sign_message()
MavConnection::setup_signing(..)
to all connection implementationspub fn
that have an additionalOption<&SigningData>
paramter:read_versioned_msg_signed()
,read_v2_raw_message_signed()
,read_v2_msg_signed()
,write_versioned_msg_signed()
,write_v2_msg_signed()
MAVLinkV2MessageRaw
:checksum_bytes()
,signature_link_id[_mut]()
,signature_timestamp[_bytes[_mut]]()
,signature_value[_mut]()
MAVLinkV2MessageRaw::header()
requiring a mut referenceMAVLinkV2MessageRaw::calculate_signature()
that calculates a messages current signatureMAVLinkV2MessageRaw::serialize_message_for_signing()
to serialze while setting the incompat_flagSigning specifications
With the
signing
feature enabled and signing setup the following applies:allow_unsigned
is setsign_outgoing
is set.Tests
signing
feature for all testCaveats
std::SystemTime::now()
which might not exist in a none-std enviroment, maybe thesigning
feature should depend onstd
.mavlink
are broken since they depend on the published version ofmavlink-core
which does not have signing, when testing locally with a path dependency they succeed.incompat_flags
field of the MAVLink header, for the purpose of preserving API stability the coresponding structMavHeader
is not modified but this should probably be done in a future breaking version.MavConnection
and then set a it to use MAVLink 1 only which ignores the setup signing configuration.