Store cross-signing keys in secret storage

This commit is contained in:
J. Ryan Stinnett
2019-11-20 17:48:36 +00:00
parent cc192efe45
commit 4116d89d5f
+6 -1
View File
@@ -324,7 +324,12 @@ Crypto.prototype.bootstrapSecretStorage = async function({
// If cross-signing keys changed, store them in Secure Secret Storage.
if (crossSigningKeysChanged) {
throw new Error("Cross-signing keys need to be stored!");
logger.log("Storing cross-signing keys in secret storage");
// XXX: We need to think about how to re-do this step if it fails.
const getKey = this._baseApis._cryptoCallbacks.getCrossSigningKey;
for (const name of ["master", "self_signing", "user_signing"]) {
await this.storeSecret(`m.cross_signing.${name}`, getKey(name));
}
}
logger.log("Secure Secret Storage ready");