1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-10 07:22:27 +03:00

offer to upgrade device verifications to cross-signing

This commit is contained in:
Hubert Chathi
2019-07-08 12:26:00 -04:00
parent 761f22b63d
commit 7f8b9de560
3 changed files with 269 additions and 12 deletions

View File

@@ -561,6 +561,7 @@ MatrixClient.prototype.initCrypto = async function() {
"crypto.devicesUpdated",
"cross-signing.savePrivateKeys",
"cross-signing.getKey",
"cross-signing.upgradeDeviceVerifications",
]);
logger.log("Crypto: initialising crypto object...");
@@ -4751,6 +4752,22 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
* provided if a previously provided key was invalid.
*/
/**
* Fires when a device verification can be upgraded to a cross-signing
* verification. The handler should call the `accept` callback in order to
* perform the upgrade.
* @event module:client~MatrixClient#"cross-signing.upgradeDeviceVerifications"
* @param {object} data
* @param {object} data.users The users whose device verifications can be
* upgraded to cross-signing verifications. This will be a map of user IDs
* to objects with the properties `devices` (array of the user's devices
* that verified their cross-signing key), and `crossSigningInfo` (the
* user's cross-signing information)
* @param {object} data.accept a function to call to upgrade the device
* verifications. It should be called with an array of the user IDs who
* should be cross-signed.
*/
/**
* Fires when a secret has been requested by another client. Clients should
* ensure that the requesting device is allowed to have the secret. For