Skip to content

Commit

Permalink
Merge pull request #246 from LedgerHQ/sig_deser_fix
Browse files Browse the repository at this point in the history
Fix wrong deserialization of yielded signatures for keypath spends in Rust client
  • Loading branch information
bigspider authored Mar 20, 2024
2 parents f3dc84a + 9ecf4f0 commit d32ce5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bitcoin_client_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ledger_bitcoin_client"
version = "0.4.0"
version = "0.4.1"
authors = ["Edouard Paris <[email protected]>"]
edition = "2018"
description = "Ledger Bitcoin application client"
Expand Down
4 changes: 2 additions & 2 deletions bitcoin_client_rs/src/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ impl PartialSignature {
.map_err(PartialSignatureError::XOnlyPubKey)?;
let tap_leaf_hash =
TapLeafHash::from_slice(&slice[33..65]).map_err(PartialSignatureError::TapLeaf)?;
let sig = taproot::Signature::from_slice(&slice[65..])
let sig = taproot::Signature::from_slice(&slice[key_augment_len + 1..])
.map_err(PartialSignatureError::TaprootSig)?;
Ok(Self::TapScriptSig(key, Some(tap_leaf_hash), sig))
} else if key_augment_len == 32 {
let key = XOnlyPublicKey::from_slice(&slice[1..33])
.map_err(PartialSignatureError::XOnlyPubKey)?;
let sig = taproot::Signature::from_slice(&slice[65..])
let sig = taproot::Signature::from_slice(&slice[key_augment_len + 1..])
.map_err(PartialSignatureError::TaprootSig)?;
Ok(Self::TapScriptSig(key, None, sig))
} else {
Expand Down

0 comments on commit d32ce5f

Please sign in to comment.