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

fix: aws signer does not throw error on unnormalized sig #1099

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Unreleased

- Fix aws signer bug which maps un-normalized signature to error if no normalization occurs (in `aws::utils::decode_signature`)
- `Transaction::from` will default to `Address::zero()`. Add `recover_from` and
`recover_from_mut` methods for recovering the sender from signature, and also
setting the same on tx [1075](https://github.com/gakonst/ethers-rs/pull/1075).
Expand Down
6 changes: 2 additions & 4 deletions ethers-signers/src/aws/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ pub(super) fn decode_signature(resp: SignResponse) -> Result<KSig, AwsSignerErro
.signature
.ok_or_else(|| AwsSignerError::from("Signature not found in response".to_owned()))?;

let sig = KSig::from_der(&raw)?
.normalize_s()
.ok_or_else(|| AwsSignerError::from("Could not normalize `s`".to_owned()))?;
Ok(sig)
let sig = KSig::from_der(&raw)?;
Ok(sig.normalize_s().unwrap_or(sig))
}