tchapgouv / tchap-web-v4

A Matrix web client for Tchap
https://www.tchap.gouv.fr/
Apache License 2.0
12 stars 5 forks source link

Can we use "io.element.e2ee" to configure tchap-web to use secure backup ? #807

Open estellecomment opened 10 months ago

estellecomment commented 10 months ago

https://github.com/vector-im/element-web/blob/develop/docs/e2ee.md#requiring-secure-backup "Si je comprends bien, c'est des options que le serveur peut retourner dans le well-known, qui fait que element-web va demander aux users d'utiliser le secure backup. (je sais pas encore l'UX de ce truc, je vais regarder) On peut aussi indiquer qu'on utilse key et pas passphrase."

This could remove some custom code by reusing config options given by element-web. What's the UX for this ? Is it acceptable ?

Note : If the backend can't return it, we could patch to fake-return it, and trigger the UX.

estellecomment commented 9 months ago

TLDR : secure_backup_required directly displays the dialog for setting up secure storage, instead of showing the toast (the smaller less intrusive dialog in the upper left corner)

When you have "secure_backup_required": true in the well-known, if the user already has secure storage nothing happens. If the user does not have secure storage yet :

Once the dialog for secure storage setup has appeared :

estellecomment commented 9 months ago

I think that Tchap has made "escape from secure storage flow" possible because we want to avoid have secure storage but user ignored the key and didn't store it (it's not a solution to locked messages if you don't have your key)

I'm not sure that using bigger dialogs will help. People will close them without reading them, or not store the key. So I think this feature is not useful.

estellecomment commented 9 months ago

Second question : without changing the current UX, can we use this feature to simplify our patch code ?

estellecomment commented 9 months ago

No, it changes which dialogs are triggered, but not the content of the dialogs.

odelcroi commented 9 months ago

thanks for the investigation, can this issue be closed then?

estellecomment commented 9 months ago

I have a doubt : when is the toast displayed ? I thought it was at each page reload but it's not. Find out.

estellecomment commented 9 months ago

"Enable secure storage" toast displays

However sometimes another dialog shows up instead, asking to "Verify this session". (In more detail : VERIFY_THIS_SESSION in SetupEncryptionToast. if (!(await crypto.getCrossSigningKeyId()) && (await crypto.userHasCrossSigningKeys())) // Cross-signing on account but this device doesn't trust the master key (verify this session)) I think this happens because I refused Secure Storage previously, in different ways.

This can happen when you have a single session, so that you can't verify with other devices, and it sends you to setup secure storage. That's probably a bug for element : it should be "Setup Secure Storage" toast, not "Verify this session" toast.

@odelcroi would it make sense to send people to setup secure storage in all cases, and never make them verify through other devices ? (I think we're going in that direction on mobile ?)