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

Failed to decrypt Olm message with InvalidMAC(MacError) #7479

Closed
richvdh opened this issue Apr 6, 2023 · 2 comments
Closed

Failed to decrypt Olm message with InvalidMAC(MacError) #7479

richvdh opened this issue Apr 6, 2023 · 2 comments
Labels
A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@richvdh
Copy link
Member

richvdh commented Apr 6, 2023

Steps to reproduce

n/a

Outcome

See https://github.com/matrix-org/element-ios-rageshakes/issues/23065; in particular https://rageshakes.element.io/api/listing/2023-02-07/145153-6DJDEHFV/console.2.log.gz at 10:41:28.270:

2023-02-07 10:41:28.270 Element[22034:7611900] [MXCryptoSDK]  WARN receive_sync_changes:receive_to_device_event{sender="@Amandine:matrix.org" event_type="m.room.encrypted" message_id="36b8c441-8739-42f6-85a1-fd80f55d5bcb"}: matrix_sdk_crypto::olm::account: Failed to create a new Olm session from a pre-key message: InboundCreation(Decryption(InvalidMAC(MacError))) sender_key="curve25519:yCzeJlVPpPrg6prkD4l4UezGxye3aXJE9Rd40wzNNhg" session_keys=SessionKeys { identity_key: "yCzeJlVPpPrg6prkD4l4UezGxye3aXJE9Rd40wzNNhg", base_key: "QjzU4LLyreQNMBTczt4bI1+wRzexKfqdrzYoGxEwf04", one_time_key: "gw9P5us0F4J3Zs2s0TUfel4zC1qOSgpeK0U3zQuBfxc" }

An InvalidMac should only happen if there was a MITM, so this suggests one end or the other has gotten its maths wrong.

For the record, the sender side is https://github.com/matrix-org/element-web-rageshakes/issues/19977:

2023-02-07T10:29:34.727Z I encryptMessage: Olm Session ID LZEEkkqCVeOb9ar7lwSaZNtZR0Ym2MD2VaCsktXOJkg to OG9C4AjzK563NZ0Wzm3H4uZ1ySqWNpQv8PSdJlU3ZiI: sender chain index: 2 receiver chain indices: skipped message keys:
2023-02-07T10:29:34.727Z I Saving Olm session LZEEkkqCVeOb9ar7lwSaZNtZR0Ym2MD2VaCsktXOJkg with device OG9C4AjzK563NZ0Wzm3H4uZ1ySqWNpQv8PSdJlU3ZiI: sender chain index: 3 receiver chain indices: skipped message keys:

It's interesting to note the chain index here, suggesting that this is in fact the third attempt to send on this Olm session. I wonder if that is related. We do not have logs going back any further.

Your phone model

iPhone 11 Pro

Operating system version

iOS 16.2

Application version

1.10.0

Homeserver

No response

Will you send logs?

Yes

@richvdh richvdh added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Apr 6, 2023
@Velin92 Velin92 added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely A-E2EE labels Apr 12, 2023
@BillCarsonFr
Copy link
Member

Closing as cannot reproduce

@richvdh
Copy link
Member Author

richvdh commented Apr 26, 2024

Likely this was matrix-org/matrix-rust-sdk#3110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
Status: Closed
Development

No branches or pull requests

3 participants