1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Publicise method testing for secret storage key existence

This commit is contained in:
J. Ryan Stinnett
2019-12-04 13:51:43 +00:00
parent eeffe208ec
commit c0dbf2df7f
2 changed files with 17 additions and 2 deletions

View File

@@ -369,7 +369,7 @@ Crypto.prototype.bootstrapSecretStorage = async function({
// Check if Secure Secret Storage has a default key. If we don't have one, create the
// default key (which will also be signed by the cross-signing master key).
if (!this._secretStorage.hasKey()) {
if (!this.hasSecretStorageKey()) {
logger.log("Secret storage default key not found, creating new key");
const keyOptions = await createSecretStorageKey();
const newKeyId = await this.addSecretStorageKey(
@@ -400,6 +400,10 @@ Crypto.prototype.addSecretStorageKey = function(algorithm, opts, keyID) {
return this._secretStorage.addKey(algorithm, opts, keyID);
};
Crypto.prototype.hasSecretStorageKey = function(keyID) {
return this._secretStorage.hasKey(keyID);
};
Crypto.prototype.storeSecret = function(name, secret, keys) {
return this._secretStorage.store(name, secret, keys);
};