Skip to content

fix(csapi): sign keys when uploading them. - #960

Merged
devonh merged 1 commit into
matrix-org:mainfrom
prmadev:prmadev/complement-upload-signed-keys
Nov 12, 2026
Merged

devonh merged 1 commit into
matrix-org:mainfrom
prmadev:prmadev/complement-upload-signed-keys

Conversation

@prmadev

@prmadev prmadev commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since Matrix version 1.17 uploaded keys must be signed.

A device uploads the public parts of identity keys to their homeserver
as a signed JSON object, using the /keys/upload API. The JSON object
must include the public part of the device’s Ed25519 key, and must be
signed by that key, as described in Signing JSON.

Tests in the tests/csapi/device_list_test.go do not sign the device keys they are uploading. To fix that I added the signature the request.

Pull Request Checklist

@prmadev
prmadev requested review from a team as code owners November 10, 2026 14:08
@prmadev
prmadev requested review from devonh and removed request for a team November 10, 2026 14:08
Comment thread tests/csapi/device_lists_test.go Resolved
Comment thread tests/csapi/device_lists_test.go Resolved
@prmadev
prmadev force-pushed the prmadev/complement-upload-signed-keys branch from 57262a7 to 39eb2b0 Compare November 11, 2026 13:33
Since Matrix version 1.17 uploaded keys must be signed.
<https://spec.matrix.org/v1.17/client-server-api/#uploading-keys>

> A device uploads the public parts of identity keys to their homeserver
> as a signed JSON object, using the /keys/upload API. The JSON object
> must include the public part of the device’s Ed25519 key, and must be
> signed by that key, as described in Signing JSON.

Certain tests in the tests/csapi/device_list_test.go do not do that.
To fix that the signature was added to the request.

Signed-off-by: Perma Alesheikh <[email protected]>
@prmadev
prmadev force-pushed the prmadev/complement-upload-signed-keys branch from 39eb2b0 to 71a2145 Compare November 11, 2026 13:34
@prmadev
prmadev requested a review from devonh November 11, 2026 13:40
@devonh
devonh merged commit 7cd072c into matrix-org:main Nov 12, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants