mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-31 03:45:13 +00:00
Improve error message for cross signing reset with MSC3861 enabled (#17121)
This commit is contained in:
parent
90cc9e5b29
commit
41fbe387d6
2 changed files with 9 additions and 5 deletions
1
changelog.d/17121.bugfix
Normal file
1
changelog.d/17121.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Improve error message for cross signing reset with MSC3861 enabled.
|
|
@ -393,17 +393,20 @@ class SigningKeyUploadServlet(RestServlet):
|
||||||
# time. Because there is no UIA in MSC3861, for now we throw an error if the
|
# time. Because there is no UIA in MSC3861, for now we throw an error if the
|
||||||
# user tries to reset the device signing key when MSC3861 is enabled, but allow
|
# user tries to reset the device signing key when MSC3861 is enabled, but allow
|
||||||
# first-time setup.
|
# first-time setup.
|
||||||
#
|
|
||||||
# XXX: We now have a get-out clause by which MAS can temporarily mark the master
|
|
||||||
# key as replaceable. It should do its own equivalent of user interactive auth
|
|
||||||
# before doing so.
|
|
||||||
if self.hs.config.experimental.msc3861.enabled:
|
if self.hs.config.experimental.msc3861.enabled:
|
||||||
# The auth service has to explicitly mark the master key as replaceable
|
# The auth service has to explicitly mark the master key as replaceable
|
||||||
# without UIA to reset the device signing key with MSC3861.
|
# without UIA to reset the device signing key with MSC3861.
|
||||||
if is_cross_signing_setup and not master_key_updatable_without_uia:
|
if is_cross_signing_setup and not master_key_updatable_without_uia:
|
||||||
|
config = self.hs.config.experimental.msc3861
|
||||||
|
if config.account_management_url is not None:
|
||||||
|
url = f"{config.account_management_url}?action=org.matrix.cross_signing_reset"
|
||||||
|
else:
|
||||||
|
url = config.issuer
|
||||||
|
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
HTTPStatus.NOT_IMPLEMENTED,
|
HTTPStatus.NOT_IMPLEMENTED,
|
||||||
"Resetting cross signing keys is not yet supported with MSC3861",
|
"To reset your end-to-end encryption cross-signing identity, "
|
||||||
|
f"you first need to approve it at {url} and then try again.",
|
||||||
Codes.UNRECOGNIZED,
|
Codes.UNRECOGNIZED,
|
||||||
)
|
)
|
||||||
# But first-time setup is fine
|
# But first-time setup is fine
|
||||||
|
|
Loading…
Add table
Reference in a new issue