index : matrix-js-sdk

My fork of matrix-js-sdk

diff options
context:
space:
mode:
-rw-r--r--src/crypto/SecretStorage.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/crypto/SecretStorage.js b/src/crypto/SecretStorage.js
index cb21b1c1..ecfa96db 100644
--- a/src/crypto/SecretStorage.js
+++ b/src/crypto/SecretStorage.js
@@ -292,6 +292,11 @@ export class SecretStorage extends EventEmitter {
}
}
+ if (Object.keys(keys).length === 0) {
+ throw new Error(`Could not decrypt ${name} because none of ` +
+ `the keys it is encrypted with are for a supported algorithm`);
+ }
+
let keyId;
let decryption;
try {