diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c343cd2..8ef683efe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to the subprojects will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [Unreleased] + +### Fixed + + - Fixed signer rejecting valid `PreapproveInvoice` requests for uppercase bolt11 invoices by using case-insensitive comparison, matching the bech32 spec (BIP173). ([#698](https://github.com/Blockstream/greenlight/pull/698)) + ## [0.3.3] ### Changed diff --git a/libs/gl-client/src/signer/resolve.rs b/libs/gl-client/src/signer/resolve.rs index 6b94d29e0..4534c7099 100644 --- a/libs/gl-client/src/signer/resolve.rs +++ b/libs/gl-client/src/signer/resolve.rs @@ -93,16 +93,16 @@ impl Resolver { true } (Message::PreapproveInvoice(l), Request::Pay(r)) => { - l.invstring.0 == r.bolt11.as_bytes() + l.invstring.0.eq_ignore_ascii_case(r.bolt11.as_bytes()) } (Message::PreapproveInvoice(l), Request::PreApproveInvoice(r)) => { // Manually calling preapproveinvoice should // always be allowed. The bolt11 string have to // match. - l.invstring.0 == r.bolt11.as_bytes() + l.invstring.0.eq_ignore_ascii_case(r.bolt11.as_bytes()) } (Message::PreapproveInvoice(l), Request::TrampolinePay(r)) => { - l.invstring.0 == r.bolt11.as_bytes() + l.invstring.0.eq_ignore_ascii_case(r.bolt11.as_bytes()) } (_, _) => false, };