element-hq / element-hq/element-android

Unable to setup cross-signing keys

Open
#8,864 1 comment 0 reactions 0 assignees View on GitHub
T-Defect
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

1. Install [conduit](https://conduit.rs) server
2. Login with element android
3. Click Settings > Security & Privacy > Cross-Signing > Reset Keys
4. Enter the password
5. Click Continue

### Outcome

#### What did you expect?

Cross-signing keys to be reset.

#### What happened instead?

Element show the error message: "Failed to set up Cross Signing".
Conduit prints:
```
WARN http_request{path=/_matrix/client/unstable/keys/device_signing/upload}: conduit::api::ruma_wrapper::axum: try_from_http_request failed: Deserialization(Json(Error("missing field `identifier`", line: 1, column: 119)))
```

The exact request sent by Element is:
```json
{
"auth": {
"password": "",
"session": "8ndGKxkyPSBn81Y88SMBDtzRkUVDTned",
"type": "m.login.password",
"user": "@bob:"
},
"master_key": {
"keys": {
"ed25519:yG5KfTv8UlwauaUFQ4sgpqcKArVfo03SmAmBB3xDObU": "yG5KfTv8UlwauaUFQ4sgpqcKArVfo03SmAmBB3xDObU"
},
"signatures": {
"@bob:": {
"ed25519:LD0549yCCK": "U41xp/sIh23JiAKPk2rgNPpfNLDZ61+SvJag1n7AzBzht3QJtBIcOPRaXCHA/Yk5bQRi3QuczDnD/b54HHaQAg",
"ed25519:yG5KfTv8UlwauaUFQ4sgpqcKArVfo03SmAmBB3xDObU": "YrBziZkOCifL1+gVChTozjLu45kc4CJpiAYEifMqbWl9dCOEigU2iUQ6aTi/HLUZlkABtoh6vOZGR4TIIhdMDQ"
}
},
"usage": [
"master"
],
"user_id": "@bob:"
},
"self_signing_key": {
"keys": {
"ed25519:oOICLRIankieFLVafqVTuB5aKzCUD1/vcw5QVYolvfY": "oOICLRIankieFLVafqVTuB5aKzCUD1/vcw5QVYolvfY"
},
"signatures": {
"@bob:": {
"ed25519:yG5KfTv8UlwauaUFQ4sgpqcKArVfo03SmAmBB3xDObU": "X61b9girYvqVCUVZM7JfBm5vuTCgpIdlaCrvr6kPTFN0BtgL/4Hy9amWECKvf/1WLk4xp3yh+FjtEDHj5gphAw"
}
},
"usage": [
"self_signing"
],
"user_id": "@bob:"
},
"user_signing_key": {
"keys": {
"ed25519:4iFzyGjcNMeKcQkrNiwiOPU9ZdaktgNbnrNmkVKnRTw": "4iFzyGjcNMeKcQkrNiwiOPU9ZdaktgNbnrNmkVKnRTw"
},
"signatures": {
"@bob:": {
"ed25519:yG5KfTv8UlwauaUFQ4sgpqcKArVfo03SmAmBB3xDObU": "6yfZUO6ww+KsRggf7Aq4G1rH+thXHZkvfvglS6sb2DJc1c9jiOCTXD/tFe+Qr8XGe3NrZGG6qJLRiC0t/3GJAQ"
}
},
"usage": [
"user_signing"
],
"user_id": "@bob:"
}
}
```

As you can see, the `user` field is directly located under the `auth` object, whereas element-web (which works) sends this `auth` object:
```json
"auth": {
"password": "",
"session": "8ndGKxkyPSBn81Y88SMBDtzRkUVDTned",
"type": "m.login.password",
"identifier": {
"type": "m.id.user",
"user": "@bob:"
}
}
```
It seems that element-android does not respect the Matrix spec:

- https://spec.matrix.org/v1.7/client-server-api/#password-based
- https://spec.matrix.org/v1.7/client-server-api/#matrix-user-id

### Your phone model

_No response_

### Operating system version

_No response_

### Application version and app store

1.6.18 from F-Droid

### Homeserver

conduit v0.8.0

### Will you send logs?

Yes

### Are you willing to provide a PR?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.