From 8f25d7d6717bedef6890b589fe94cf43fcd80896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 27 May 2024 12:35:21 +0200 Subject: [PATCH 1/4] Do not require UIA when first uploading cross-signing keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per MSC3967. Signed-off-by: Kévin Commaille --- data/api/client-server/cross_signing.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/data/api/client-server/cross_signing.yaml b/data/api/client-server/cross_signing.yaml index 0f3a46be4..6f3313e06 100644 --- a/data/api/client-server/cross_signing.yaml +++ b/data/api/client-server/cross_signing.yaml @@ -19,11 +19,26 @@ paths: /keys/device_signing/upload: post: x-addedInMatrixVersion: "1.1" + x-changedInMatrixVersion: + "1.11": UIA is not always required for this endpoint. summary: Upload cross-signing keys. description: |- Publishes cross-signing keys for the user. This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api). + + User-Interactive Authentication is required, except in these cases: + - there is no existing cross-signing master key uploaded to the homeserver, OR + - there is an existing cross-signing master key and it exactly matches the + cross-signing master key provided in the request body. If there are any additional + keys provided in the request (self-signing key, user-signing key) they MUST also + match the existing keys stored on the server. In other words, the request contains + no new keys. + + This allows clients to freely upload 1 set of keys, but not modify/overwrite keys if + they already exist. By allowing clients to upload the same set of keys more than once, + this makes this endpoint idempotent in the case where the response is lost over the + network, which would otherwise cause a UIA challenge upon retry. operationId: uploadCrossSigningKeys security: - accessTokenQuery: [] From 49564a5087111bd8c788ae3e92d4b0578c563d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 27 May 2024 12:37:03 +0200 Subject: [PATCH 2/4] Add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/client_server/newsfragments/1828.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/1828.feature diff --git a/changelogs/client_server/newsfragments/1828.feature b/changelogs/client_server/newsfragments/1828.feature new file mode 100644 index 000000000..65d7420b4 --- /dev/null +++ b/changelogs/client_server/newsfragments/1828.feature @@ -0,0 +1 @@ +Do not require UIA when first uploading cross-signing keys, as per [MSC3967](https://github.com/matrix-org/matrix-spec-proposals/pull/3967). From 7e8e4bf147e9068efb170af7ec1e0ce39503e96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 29 May 2024 10:42:00 +0200 Subject: [PATCH 3/4] Apply review suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/cross_signing.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/api/client-server/cross_signing.yaml b/data/api/client-server/cross_signing.yaml index 6f3313e06..230dc5dc2 100644 --- a/data/api/client-server/cross_signing.yaml +++ b/data/api/client-server/cross_signing.yaml @@ -35,10 +35,10 @@ paths: match the existing keys stored on the server. In other words, the request contains no new keys. - This allows clients to freely upload 1 set of keys, but not modify/overwrite keys if - they already exist. By allowing clients to upload the same set of keys more than once, - this makes this endpoint idempotent in the case where the response is lost over the - network, which would otherwise cause a UIA challenge upon retry. + This allows clients to freely upload one set of keys, but not modify/overwrite keys if + they already exist. Allowing clients to upload the same set of keys more than once + makes this endpoint idempotent in the case where the response is lost over the network, + which would otherwise cause a UIA challenge upon retry. operationId: uploadCrossSigningKeys security: - accessTokenQuery: [] From 6ef6de2358bbe913b6cb2f4f796178640e1ae862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 29 May 2024 10:43:14 +0200 Subject: [PATCH 4/4] Change wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/cross_signing.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/api/client-server/cross_signing.yaml b/data/api/client-server/cross_signing.yaml index 230dc5dc2..8f499d23b 100644 --- a/data/api/client-server/cross_signing.yaml +++ b/data/api/client-server/cross_signing.yaml @@ -27,7 +27,7 @@ paths: This API endpoint uses the [User-Interactive Authentication API](/client-server-api/#user-interactive-authentication-api). - User-Interactive Authentication is required, except in these cases: + User-Interactive Authentication MUST be performed, except in these cases: - there is no existing cross-signing master key uploaded to the homeserver, OR - there is an existing cross-signing master key and it exactly matches the cross-signing master key provided in the request body. If there are any additional