Skip to content
Permalink
Browse files

[FIX] "Too much data for IPC layer" error.

Count bytes instead of charaters.
[#437 state:fixed assigned:mento milestone:1.4.3]
  • Loading branch information...
Mento committed Dec 20, 2017
1 parent ffd9e38 commit 128637ef7baaca554635f627d110dad2310d7ff4
Showing with 10 additions and 7 deletions.
  1. +10 −7 Source/SheetController.m
@@ -971,6 +971,16 @@ - (BOOL)checkPassphrase {
if (!self.confirmPassphrase) {
self.confirmPassphrase = @"";
}

/*
* For the max password length, look in gnupg/agent/genkey.c "agent_ask_new_passphrase" for the pinentry_loopback call.
* The limit is the count of bytes, not the count of characters.
*/
if (self.passphrase.UTF8Length > 255) {
NSRunAlertPanel(localized(@"CheckAlert_PassphraseTooLong_Title"), localized(@"CheckAlert_PassphraseTooLong_Message"), nil, nil, nil, 255);
return NO;
}

if (![self.passphrase isEqualToString:self.confirmPassphrase]) {
NSRunAlertPanel(localized(@"Error"), localized(@"CheckError_PassphraseMissmatch"), nil, nil, nil);
return NO;
@@ -1003,13 +1013,6 @@ - (BOOL)checkPassphrase {
}
}
}
/*
* For the max password length, look in gnupg/agent/genkey.c "agent_ask_new_passphrase" for the pinentry_loopback call.
*/
if (self.passphrase.length > 255) {
NSRunAlertPanel(localized(@"CheckAlert_PassphraseTooLong_Title"), localized(@"CheckAlert_PassphraseTooLong_Message"), nil, nil, nil, 255);
return NO;
}

return YES;
}

0 comments on commit 128637e

Please sign in to comment.
You can’t perform that action at this time.