Skip to content

Commit

Permalink
Raise error if missing keyInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Jun 19, 2023
1 parent 9cc7eda commit d744d6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rust-crypto/rust-crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ export class RustCrypto implements CryptoBackend {
const recoveryKey = await createSecretStorageKey();

// keyInfo is required to continue
if (!recoveryKey.keyInfo) return;
if (!recoveryKey.keyInfo) {
throw new Error("missing keyInfo field in the secret storage key created by createSecretStorageKey");
}

const secretStorageKeyObject = await this.secretStorage.addKey(
SECRET_STORAGE_ALGORITHM_V1_AES,
Expand Down

0 comments on commit d744d6b

Please sign in to comment.