This commit is contained in:
nielsandriesse 2021-04-28 12:03:47 +10:00
parent deb301e5b7
commit 95d3311fac
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
// See comments in `OWSBackupIO`.
@property (nonatomic, nullable) NSNumber *uncompressedDataLength;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)init;
@end

View File

@ -126,7 +126,7 @@ public final class AttachmentDownloadJob : NSObject, Job, NSCoding { // NSObject
return failureHandler(error)
}
let plaintext: Data
if let key = pointer.encryptionKey, let digest = pointer.digest {
if let key = pointer.encryptionKey, let digest = pointer.digest, key.count > 0 && digest.count > 0 {
do {
plaintext = try Cryptography.decryptAttachment(data, withKey: key, digest: digest, unpaddedSize: pointer.byteCount)
} catch {