Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Recipient can not see decrypted message #283

Open
postoronnii opened this issue Dec 29, 2021 · 3 comments
Open

[Android] Recipient can not see decrypted message #283

postoronnii opened this issue Dec 29, 2021 · 3 comments
Labels
P2 Issue Unable to complete an action, application crashes during action

Comments

@postoronnii
Copy link

WTR:

  1. Send transaction with encrypted message from account A to B
  2. Try to decrypt this message from account B

Result: Blank field

image

@postoronnii postoronnii added the P2 Issue Unable to complete an action, application crashes during action label Dec 29, 2021
@cryptoBeliever
Copy link
Contributor

cryptoBeliever commented Dec 29, 2021

This issue is on current market application.

How to reproduce

Precondition:

Account X that doesn't have any outgoing transaction (public key not known to network) but has at least one incoming.
Account Y that has outgoing transaction(s).

Steps:

  1. Init transaction from Y to X with the encrypted message.

Result:
Recipient is not able read message.

Why This Happens

It happens because we are not able fetch public key of recipient to correctly encrypt message.
In situation when account has incoming transactions but not outgoing API returns key contains 64 zeros. In such situation it should be also consider as unknown. Example:
https://201-joey-dual.symboltest.net:3001/accounts/TDDWJ33SDOMDLPTINAJE2Q6VTY2IVJCUWEXIP4Q

{
"account": {
"version": 1,
"address": "98C764EF721B9835BE6868124D43D59E348AA454B12E87F2",
"addressHeight": "62145",
"publicKey": "0000000000000000000000000000000000000000000000000000000000000000",
"publicKeyHeight": "0",
"accountType": 0,
"supplementalPublicKeys": {},
"activityBuckets": [],
"mosaics": [
{
"id": "3A8416DB2D53B6C8",
"amount": "1000000"
}
],
"importance": "0",
"importanceHeight": "0"
},
"id": "61CF2EA5D1CB6A4DD7BE3A4A"
}

Proposed Improvement

Not allow to send encrypted message if public key of recipient is unknown. Same as in desktop wallet.
Current comparasion should be fixed: https://github.com/symbol/mobile-wallet/blob/dev/src/screens/Send.js#L305 and should also not allow if public key is only zeros.
Desktop wallet checks that:
https://github.com/symbol/desktop-wallet/blob/3e3f46f184e4700e52fd4b5520b91dcdd6e3f510/src/views/forms/FormTransferTransaction/FormTransferTransactionTs.ts#L568

@postoronnii
Copy link
Author

postoronnii commented Dec 30, 2021

@cryptoBeliever it's already implemented, I can not reproduce it this way.

@cryptoBeliever
Copy link
Contributor

cryptoBeliever commented Dec 31, 2021

@NikolaiB edited the description a bit. Account X needs to have at least one incoming tx (but no outgoing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Issue Unable to complete an action, application crashes during action
Projects
None yet
Development

No branches or pull requests

2 participants