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

Cannot read encrypted message sent by kazv #8751

Open
tusooa opened this issue Feb 7, 2024 · 1 comment
Open

Cannot read encrypted message sent by kazv #8751

tusooa opened this issue Feb 7, 2024 · 1 comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@tusooa
Copy link

tusooa commented Feb 7, 2024

Co-stream: https://lily-is.land/kazv/kazv/-/issues/57

Steps to reproduce

  1. Have only Element Android running for account A (stop all other clients)
  2. Send an encrypted message from account B in kazv (https://lily-is.land/kazv/kazv)

Outcome

What did you expect?

Element Android should be able to decrypt the message

What happened instead?

Element Android is not able to decrypt the message. If other clients are running, the key might be forwarded to Element Android, but a grey shield will be displayed, indicating "the authenticity of this message cannot be guaranteed on this device."

Your phone model

No response

Operating system version

No response

Application version and app store

No response

Homeserver

No response

Will you send logs?

Yes

Are you willing to provide a PR?

No

@tusooa tusooa added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Feb 7, 2024
@tusooa
Copy link
Author

tusooa commented Feb 11, 2024

I think I have found out the root cause of this problem.

https://github.com/matrix-org/matrix-rust-sdk/blob/008330a7448441ec11c5daa413a05d2146a61be1/crates/matrix-sdk-crypto/src/types/events/room/encrypted.rs#L179

the format of an Olm-encrypted event is a map from the recipient's key to a string (cipher text)
element android only checks the first item in the map, and check if it contains the current device's key. if it doesn't, it just fails.
but kazv sends the same thing to every device. the event contains every cipher text for every device
like {"key1": "ciphertext1", "key2": "ciphertext2"}
element android only checks the first item in the map, i.e. key1
suppose element android's pubkey is actually key2, then key2 will be completely ignored

element should instead check for its own public key in the map, and use that mapped value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

1 participant