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

SSSSCryptoCallbacks.getSecretStorageKey: Return null, if no key found

This commit is contained in:
Christian Paul
2021-08-13 15:23:47 +02:00
committed by GitHub
parent 62058e6d48
commit 7c4f7c9dad

View File

@@ -356,7 +356,7 @@ class SSSSCryptoCallbacks {
public async getSecretStorageKey(
{ keys }: { keys: Record<string, ISecretStorageKeyInfo> },
name: string,
): Promise<[string, Uint8Array]|void> {
): Promise<[string, Uint8Array]|null> {
for (const keyId of Object.keys(keys)) {
const privateKey = this.privateKeys.get(keyId);
if (privateKey) {
@@ -374,6 +374,7 @@ class SSSSCryptoCallbacks {
}
return result;
}
return null;
}
public addPrivateKey(keyId: string, keyInfo: ISecretStorageKeyInfo, privKey: Uint8Array): void {