-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix(core): remove implicit change in protocol for partial/full signatures #5488
fix(core): remove implicit change in protocol for partial/full signatures #5488
Conversation
9e6c71a
to
ca62aee
Compare
ca62aee
to
7a12c6c
Compare
let received_output = &rec.output; | ||
// we need to make sure we use our values here and not the received values. | ||
let metadata_message = TransactionOutput::metadata_signature_message_from_parts( | ||
&received_output.version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for a downgrade or other version mismatch to arise if the received output's version is not what the sender expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - completely agree there needs to be an explicit check for supported versions on both sides. FWIW currently, we have 1 enumerated version so I believe this can't be exploited.
Description
Removes check for an invalid signature, presumed to be a partial signature, which results in partial signature aggregation being skipped if a valid signature is passed in.
Motivation and Context
This check validates the receiver signature to determine if the signature is sent is partial or full. If partial we aggregate the sender and receiver partial signatures. A partial signature and an invalid signature run the same code path (
if received_output.verify_metadata_signature().is_err() {
) This code branch is executed as part of every normal Tari transaction.It is not possible for the (non-local) receiver to unilaterally produce a correct signature and "bypass" aggregation as they do not possess the required secrets. The primary reason for this check is to allow the protocol to be shortcut when the sender and receiver are the same party and therefore can produce a valid signature (sign_as_sender_and_receiver). This PR implements this shortcut explicitly by adding a separate call for this case
add_presigned_recipient_info
.How Has This Been Tested?
Existing transaction tests.
What process can a PR reviewer use to test or verify this change?
Send a normal and send-to-self transaction
Breaking Changes