Skip to content

Commit

Permalink
Update Cryptography.m
Browse files Browse the repository at this point in the history
Removed digest requirement for decryptAttachment method.
  • Loading branch information
mdescalzo authored Jan 16, 2019
1 parent 2bf1434 commit 49dda4a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SignalCoreKit/src/Cryptography.m
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,14 @@ + (nullable NSData *)decryptAttachment:(NSData *)dataToDecrypt
unpaddedSize:(UInt32)unpaddedSize
error:(NSError **)error
{
if (digest.length <= 0) {
// This *could* happen with sufficiently outdated clients.
OWSLogError(@"Refusing to decrypt attachment without a digest.");
*error = SCKErrorWithCodeDescription(SCKErrorCodeFailedToDecryptMessage,
NSLocalizedString(@"ERROR_MESSAGE_ATTACHMENT_FROM_OLD_CLIENT",
@"Error message when unable to receive an attachment because the sending client is too old."));
return nil;
}
// if (digest.length <= 0) {
// // This *could* happen with sufficiently outdated clients.
// OWSLogError(@"Refusing to decrypt attachment without a digest.");
// *error = SCKErrorWithCodeDescription(SCKErrorCodeFailedToDecryptMessage,
// NSLocalizedString(@"ERROR_MESSAGE_ATTACHMENT_FROM_OLD_CLIENT",
// @"Error message when unable to receive an attachment because the sending client is too old."));
// return nil;
// }

if (([dataToDecrypt length] < AES_CBC_IV_LENGTH + HMAC256_OUTPUT_LENGTH) ||
([key length] < AES_KEY_SIZE + HMAC256_KEY_LENGTH)) {
Expand Down

0 comments on commit 49dda4a

Please sign in to comment.