pull/396/head
nielsandriesse 5 years ago
parent deb301e5b7
commit 95d3311fac

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

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

Loading…
Cancel
Save