Skip to content

Commit

Permalink
Merge pull request #270 from hko-s/message-verify-strict
Browse files Browse the repository at this point in the history
fix: return an error in Message::verify if we don't know what to verify
  • Loading branch information
dignifiedquire committed Jan 24, 2024
2 parents a98202f + e29d089 commit d2baf98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/composed/message/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ impl Message {
let msg = Message::from_bytes(data.decompress()?)?;
msg.verify(key)
}
// Nothing to do for others.
// TODO: should this return an error?
_ => Ok(()),
// We don't know how to verify a signature for other Message types, and shouldn't return Ok
_ => Err(Error::Unsupported(format!(
"Unexpected message format: {self:?}",
))),
}
}

Expand Down

0 comments on commit d2baf98

Please sign in to comment.