omemo: trust given before a device's key is in is recorded as verified, kept in memory only, and not reported #5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
omemo trustfor a device whose key hasn't arrived yet (listed, but no trust row) goes intoPendingTrust(tacky/xmpp/modules/omemo.tcl, rc5d1cca8e5): the bundle is fetched and the choice applied when it lands. Found from anotherim-js 0.5.2, where an OMEMO 2 device of a room member with no fetched bundle offered Trust (another-im/anotherim-js#12 now offers no choice for such a row).1. A Trust given ahead of the key is recorded as verified.
ApplyPendingTrust(l. 6033) callsRecordDecisionfor a non-blind pending Trust once the bundle is in. That pins the fetched key as the one the user verified, but the user was never shown it, and the device then reads "Verified". A pending Trust should be refused (OMEMO TRUST_NO_KEY) or at most become blind trust.2. It is in memory only.
variable PendingTrust {}(l. 970) isn't stored, so a restart forgets it. A Don't trust given in advance silently stops applying.3.
trust_listdoesn't report it. The row keeps showing the stored trust (undecided), so a host can't show that a choice is pending. In the app, Don't trust looked like it did nothing.4. It applies only from a successful
FetchBundle. If the fetch fails, the choice waits for good, with no retry and nothing reported. I haven't checked whether a key arriving another way (an incoming message's key exchange) takes it up.Suggested:
trust -state trustedwith no known key.trust_list, e.g.pending: "untrusted".With blind trust on, a refusal ahead of the key is what stops a device someone added to a contact's list from being encrypted to as soon as its key appears.
Fixed on develop as
77050f5f(fix/omemo-pending-trust, merged8a7db33c, pushed 2026-10-16), for the next tag (rc7). As suggested:trust -state trustedfor a listed device whose key is not in yet is refused with {OMEMO TRUST_NO_KEY}, blind or not (the key that landed would be pinned as one the user verified without ever being shown it; ApplyPendingTrust and PendingBlind are gone). Anuntrustedgiven ahead of the key is stored as the row pending// of module omemo (a restart keeps it, a backup carries it like the device/ rows), reported by trust_list as OmemoTrust's newpendingfield whiletruststill reads undecided, andundecidedtakes it back. Every path that first records the device's key makes its row with that trust (SetBundle for a bundle, Unwrap for an incoming key exchange) and the row's write retires the pending row in the same commit, so a failed fetch leaves it pending and reported, with no retry of its own. Not synced to the account's other devices (not asked). Tests: the refusal, the pending report through a failed fetch, a restart, a key exchange, undecided, the backup fixture; omemo suites 456/456.