@@ -420,7 +420,7 @@ pub trait Verification {
420
420
) -> Hmac<Sha256>;
421
421
422
422
/// Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`].
423
- fn verify (
423
+ fn verify_for_offer_payment (
424
424
&self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
425
425
) -> Result<(), ()>;
426
426
}
@@ -436,7 +436,7 @@ impl Verification for PaymentHash {
436
436
437
437
/// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
438
438
/// [`OffersContext::InboundPayment`].
439
- fn verify (
439
+ fn verify_for_offer_payment (
440
440
&self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
441
441
) -> Result<(), ()> {
442
442
signer::verify_payment_hash(*self, hmac, nonce, expanded_key)
@@ -461,15 +461,15 @@ impl Verification for PaymentId {
461
461
fn hmac_for_offer_payment(
462
462
&self, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
463
463
) -> Hmac<Sha256> {
464
- signer::hmac_for_payment_id (*self, nonce, expanded_key)
464
+ signer::hmac_for_offer_payment_id (*self, nonce, expanded_key)
465
465
}
466
466
467
467
/// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
468
468
/// [`OffersContext::OutboundPayment`].
469
- fn verify (
469
+ fn verify_for_offer_payment (
470
470
&self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
471
471
) -> Result<(), ()> {
472
- signer::verify_payment_id (*self, hmac, nonce, expanded_key)
472
+ signer::verify_offer_payment_id (*self, hmac, nonce, expanded_key)
473
473
}
474
474
}
475
475
@@ -11144,7 +11144,7 @@ where
11144
11144
OffersMessage::StaticInvoice(invoice) => {
11145
11145
let payment_id = match context {
11146
11146
Some(OffersContext::OutboundPayment { payment_id, nonce, hmac: Some(hmac) }) => {
11147
- if payment_id.verify (hmac, nonce, expanded_key).is_err() {
11147
+ if payment_id.verify_for_offer_payment (hmac, nonce, expanded_key).is_err() {
11148
11148
return None
11149
11149
}
11150
11150
payment_id
@@ -11157,7 +11157,7 @@ where
11157
11157
OffersMessage::InvoiceError(invoice_error) => {
11158
11158
let payment_hash = match context {
11159
11159
Some(OffersContext::InboundPayment { payment_hash, nonce, hmac }) => {
11160
- match payment_hash.verify (hmac, nonce, expanded_key) {
11160
+ match payment_hash.verify_for_offer_payment (hmac, nonce, expanded_key) {
11161
11161
Ok(_) => Some(payment_hash),
11162
11162
Err(_) => None,
11163
11163
}
@@ -11170,7 +11170,7 @@ where
11170
11170
11171
11171
match context {
11172
11172
Some(OffersContext::OutboundPayment { payment_id, nonce, hmac: Some(hmac) }) => {
11173
- if let Ok(()) = payment_id.verify (hmac, nonce, expanded_key) {
11173
+ if let Ok(()) = payment_id.verify_for_offer_payment (hmac, nonce, expanded_key) {
11174
11174
self.abandon_payment_with_reason(
11175
11175
payment_id, PaymentFailureReason::InvoiceRequestRejected,
11176
11176
);
0 commit comments