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

Element-R: Replace CryptoBackend.checkDeviceTrust #25092

Closed
Tracked by #24979
richvdh opened this issue Apr 12, 2023 · 2 comments · Fixed by matrix-org/matrix-react-sdk#10663
Closed
Tracked by #24979

Element-R: Replace CryptoBackend.checkDeviceTrust #25092

richvdh opened this issue Apr 12, 2023 · 2 comments · Fixed by matrix-org/matrix-react-sdk#10663
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning

Comments

@richvdh
Copy link
Member

richvdh commented Apr 12, 2023

(currently stubbed).

I think it's a matter of calling OlmMachine.getDevice and then mapping the result back into a DeviceTrustLevel. Expose it via CryptoApi. Use it in places in the react-sdk where we currently call CrossSigningInfo.checkDeviceTrust directly.

@richvdh richvdh added T-Task Tasks for the team like planning A-Element-R Issues affecting the port of Element's crypto layer to Rust labels Apr 12, 2023
richvdh added a commit to matrix-org/matrix-js-sdk that referenced this issue Apr 13, 2023
richvdh added a commit to matrix-org/matrix-js-sdk that referenced this issue Apr 13, 2023
richvdh added a commit to matrix-org/matrix-js-sdk that referenced this issue Apr 13, 2023
@richvdh richvdh self-assigned this Apr 14, 2023
@richvdh richvdh changed the title Element-R: Implement CryptoBackend.checkDeviceTrust Element-R: Replace CryptoBackend.checkDeviceTrust Apr 14, 2023
@richvdh
Copy link
Member Author

richvdh commented Apr 14, 2023

turns out we have to replace it, rather than implement it, because we need it to be async.

github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Apr 18, 2023
github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Apr 18, 2023
* Element-R: implement `{get,set}TrustCrossSignedDevices`

A precursor to element-hq/element-web#25092

* Pull out new `DeviceVerificationStatus`

Define a new base class to replace `DeviceTrustLevel`. The intention is to have
a cleaner interface which is easier to expose from the new crypto impl

* Define, and implement, a new `CryptoApi.getDeviceVerificationStatus`

This is similar to `checkDeviceTrust`, which we're deprecating, but:
 * is `async`, meaning we can implement it in Rust
 * Returns a `DeviceVerificationStatus` instead of a `DeviceTrustLevel`
 * Returns `null` rather than "not verified" if the device is unknown

* add some tests

* Export DeviceVerificationStatus as a proper class

... so that we can instantiate it in tests
@richvdh
Copy link
Member Author

richvdh commented Apr 24, 2023

This was done by matrix-org/matrix-js-sdk#3287.

@richvdh richvdh closed this as completed Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning
Projects
None yet
1 participant