HomePhabricator

[Cashtab] [Chronik] Upgrade private message decryption error handling

Description

[Cashtab] [Chronik] Upgrade private message decryption error handling

Summary:
As per T2718, I played around with a few different error handling approaches but found the best solution is to simply ensure the output hex is in relation to an incoming msg before attempting to decrypt.

I have seen this error trigger on occasions when you send a few outgoing private message transactions. This is because it is attempting to decrypt the private message when it's sitting in the sender's tx history, but obviously the message has been encrypted with the recipient's pubkey (not the sender's) hence resulting in these errors.

Test Plan:

  • receive encrypted message, verify no decryption errors in console and the message is successfully decrypted and rendered correctly
  • send encrypted message, verify no decryption errors in console and the message is successfully decrypted in the recipient wallet and rendered correctly
  • ensure no regression with sending/receiving unencrypted message
  • ensure no regression with sending/receiving oneToMany unencrypted message

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D12260

Details

Provenance
emackAuthored on Oct 15 2022, 13:57
emackPushed on Oct 19 2022, 02:05
Reviewer
Restricted Project
Differential Revision
D12260: [Cashtab] [Chronik] Upgrade private message decryption error handling
Parents
rABC649e2b3dce3c: [Cashtab] Deprecate API wrapper - signPkMessage
Branches
Unknown
Tags
Unknown