This commit is contained in:
Manav Rathi
2024-08-17 21:04:02 +05:30
parent 757ff5cd9a
commit 788ce53388
2 changed files with 8 additions and 9 deletions

View File

@@ -69,6 +69,10 @@ export const _decryptMetadataJSON_New = async (
) as unknown;
export const _decryptMetadataJSON = async (r: DecryptBlobB64) =>
JSON.parse(
new TextDecoder().decode(await _decryptAssociatedDataB64(r)),
) as unknown;
_decryptMetadataJSON_New(
{
encryptedData: r.encryptedDataB64,
decryptionHeader: r.decryptionHeaderB64,
},
r.keyB64,
);

View File

@@ -200,12 +200,7 @@ export const decryptMetadataJSON_New = (
);
/**
* Decrypt the metadata JSON associated with an Ente object.
*
* This is the sibling of {@link encryptMetadataJSON}.
*
* @returns The decrypted JSON value. Since TypeScript does not have a native
* JSON type, we need to return it as an `unknown`.
* Deprecated, retains the old API.
*/
export const decryptMetadataJSON = (r: DecryptBlobB64) =>
inWorker()