Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Address bug in parse_aggregate_public_key by verifying data len is 32
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Oct 27, 2023
1 parent 2be0b03 commit 2ba5647
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stacks-signer/src/stacks_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ impl StacksClient {
if let Some(ClarityValue::Sequence(SequenceData::Buffer(public_key))) =
optional_data.data.map(|boxed| *boxed)
{
if public_key.data.len() != 32 {
return Err(ClientError::MalformedClarityValue(public_key_clarity_value));
}
let mut bytes = [0_u8; 32];
bytes.copy_from_slice(&public_key.data);
Ok(Some(Point::from(Scalar::from(bytes))))
Expand Down

0 comments on commit 2ba5647

Please sign in to comment.