File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -235,14 +235,17 @@ pub(super) fn verify_payer_metadata<'a, T: secp256k1::Signing>(
235235 let mut encrypted_payment_id = [ 0u8 ; PaymentId :: LENGTH ] ;
236236 encrypted_payment_id. copy_from_slice ( & metadata[ ..PaymentId :: LENGTH ] ) ;
237237
238- let metadata = & metadata[ PaymentId :: LENGTH ..] ;
239- let mut hmac = hmac_for_message ( metadata, expanded_key, iv_bytes, tlv_stream) ?;
238+ let mut hmac = hmac_for_message (
239+ & metadata[ PaymentId :: LENGTH ..] , expanded_key, iv_bytes, tlv_stream
240+ ) ?;
240241 hmac. input ( WITH_ENCRYPTED_PAYMENT_ID_HMAC_INPUT ) ;
241242 hmac. input ( & encrypted_payment_id) ;
242243
243- verify_metadata ( metadata, Hmac :: from_engine ( hmac) , signing_pubkey, secp_ctx) ?;
244+ verify_metadata (
245+ & metadata[ PaymentId :: LENGTH ..] , Hmac :: from_engine ( hmac) , signing_pubkey, secp_ctx
246+ ) ?;
244247
245- let nonce = Nonce :: try_from ( & metadata[ ..Nonce :: LENGTH ] ) . unwrap ( ) ;
248+ let nonce = Nonce :: try_from ( & metadata[ PaymentId :: LENGTH .. ] [ ..Nonce :: LENGTH ] ) . unwrap ( ) ;
246249 let payment_id = expanded_key. crypt_for_offer ( encrypted_payment_id, & nonce. 0 ) ;
247250
248251 Ok ( PaymentId ( payment_id) )
You can’t perform that action at this time.
0 commit comments