core: writeEncrypted now accepts only base64 input

This commit is contained in:
Abdullah Atta
2023-03-22 09:29:21 +05:00
committed by Abdullah Atta
parent fa4a298bfa
commit 7a773937c2
2 changed files with 3 additions and 6 deletions

View File

@@ -285,10 +285,8 @@ export default class Attachments extends Collection {
async save(data, type, mimeType) {
const key = await this._db.attachments.generateKey();
const metadata = await this._db.fs.writeEncrypted(
null,
const metadata = await this._db.fs.writeEncryptedBase64(
data,
type,
key,
mimeType
);

View File

@@ -73,10 +73,9 @@ export default class FileStorage {
return this.fs.readEncrypted(filename, encryptionKey, cipherData);
}
writeEncrypted(filename, data, type, encryptionKey, mimeType) {
return this.fs.writeEncrypted(filename, {
writeEncryptedBase64(data, encryptionKey, mimeType) {
return this.fs.writeEncryptedBase64({
data,
type,
key: encryptionKey,
mimeType
});