Skip to content

Commit

Permalink
node-data: add ConsensusHeader to Candidate signature
Browse files Browse the repository at this point in the history
Without a signature on the ConsensusHeader, Candidate messages
would be malleable. Adding the structure to the signable data
fix the issue.
  • Loading branch information
fed-franz committed Aug 27, 2024
1 parent 76698f2 commit b4b2f9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion node-data/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,10 @@ impl StepMessage for Candidate {
&mut self.sign_info
}
fn signable(&self) -> Vec<u8> {
self.candidate.header().hash.to_vec()
let mut signable = self.header.signable();
let candidate_hash = self.candidate.header().hash.to_vec();
signable.extend_from_slice(&candidate_hash);
signable
}
fn header(&self) -> &ConsensusHeader {
&self.header
Expand Down

0 comments on commit b4b2f9b

Please sign in to comment.