π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Guard missing file decryption header
Neeraj Gupta31a831783fda
diff --git a/mobile/apps/photos/lib/utils/file_download_util.dart b/mobile/apps/photos/lib/utils/file_download_util.dartindex 8299672e50..99ed57cf57 100644--- a/mobile/apps/photos/lib/utils/file_download_util.dart+++ b/mobile/apps/photos/lib/utils/file_download_util.dart@@ -255,13 +255,21 @@ Future<File?> downloadAndDecrypt(duration: const Duration(milliseconds: 5000),): null;+ final fileDecryptionHeader = file.fileDecryptionHeader;+ if (fileDecryptionHeader == null) {+ _logger.warning("$logPrefix missing file decryption header");+ if (throwOnFailure) {+ throw DownloadFailedError("Missing file decryption header");+ }+ return null;+ }try {// Start the periodic callback after initial 5 secondsfakeProgress?.start();await CryptoUtil.decryptFile(encryptedFilePath,decryptedFilePath,- CryptoUtil.base642bin(file.fileDecryptionHeader!),+ CryptoUtil.base642bin(fileDecryptionHeader),getFileKey(file),);fakeProgress?.stop();