Fixed crash when saving files with ChaCha chipher

This commit is contained in:
Michael Starke
2022-02-10 21:36:31 +01:00
parent b690d6051e
commit e985d23fa5
3 changed files with 22 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
github "MacPass/KeePassKit" "3.2.0"
github "MacPass/KeePassKit" "3.2.1"
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa"
github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f"
github "mstarke/HNHUi" "6.0"

View File

@@ -3148,7 +3148,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8;
CURRENT_PROJECT_VERSION = 0.8.1;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -3204,7 +3204,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.8;
CURRENT_PROJECT_VERSION = 0.8.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;

View File

@@ -170,7 +170,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"WARNING_ON_SAVE_NO_PASSWORD_OR_KEY_SET_SUGGESTION", ""),
NSLocalizedRecoveryOptionsErrorKey : @[ NSLocalizedString(@"CHANGE_PASSWORD_WITH_DOTS", ""), NSLocalizedString(@"CANCEL", "") ],
NSRecoveryAttempterErrorKey : recovery
};
};
if(outError != NULL) {
*outError = [NSError errorWithDomain:MPDefaultErrorDomain code:MPErrorNoPasswordOrKeyFile userInfo:userInfo];
}
@@ -423,17 +423,17 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
[passwordInputController requestPasswordWithMessage:NSLocalizedString(@"EXTERN_CHANGE_OF_MASTERKEY", @"The master key was changed by an external program!")
cancelLabel:NSLocalizedString(@"ABORT_MERGE_KEEP_MINE", @"Button label to abort a merge on a file with changed master key!")
completionHandler:^BOOL(NSString *password, NSURL *keyURL, BOOL didCancel, NSError *__autoreleasing *error) {
[self.windowForSheet endSheet:sheet returnCode:(didCancel ? NSModalResponseCancel : NSModalResponseOK)];
if(!didCancel) {
NSData *keyFileData = keyURL ? [NSData dataWithContentsOfURL:keyURL] : nil;
KPKCompositeKey *compositeKey = [[KPKCompositeKey alloc] init];
[compositeKey addKey:[KPKKey keyWithPassword:password]];
[compositeKey addKey:[KPKKey keyWithKeyFileData:keyFileData]];
[self _mergeWithContentsFromURL:url key:compositeKey options:options];
}
// just return yes regardless since we will display the sheet again if needed!
return YES;
}];
[self.windowForSheet endSheet:sheet returnCode:(didCancel ? NSModalResponseCancel : NSModalResponseOK)];
if(!didCancel) {
NSData *keyFileData = keyURL ? [NSData dataWithContentsOfURL:keyURL] : nil;
KPKCompositeKey *compositeKey = [[KPKCompositeKey alloc] init];
[compositeKey addKey:[KPKKey keyWithPassword:password]];
[compositeKey addKey:[KPKKey keyWithKeyFileData:keyFileData]];
[self _mergeWithContentsFromURL:url key:compositeKey options:options];
}
// just return yes regardless since we will display the sheet again if needed!
return YES;
}];
sheet.contentViewController = passwordInputController;
[self.windowForSheet beginSheet:sheet completionHandler:^(NSModalResponse returnCode) { /* nothing to do, rest is done in other handler! */ }];
}
@@ -714,9 +714,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
newGroup.title = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group");
newGroup.iconId = MPIconFolder;
KPK_SCOPED_DISABLE_UNDO_END;
[newGroup addToGroup:parent];
[newGroup.undoManager setActionName:NSLocalizedString(@"NEW_GROUP", "Action name for a newly created group")];
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidAddGroupNotification
@@ -851,12 +851,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
}
[self.undoManager setActionName:[NSString stringWithFormat:NSLocalizedString(@"DUPLICATE_ENTRIES_ACTION_NAME", @"Action name for duplicating entries"), self.selectedEntries.count]];
if(lastDuplicate) {
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidAddEntryNotification
object:self
userInfo:@{ MPDocumentEntryKey: lastDuplicate }];
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidAddEntryNotification
object:self
userInfo:@{ MPDocumentEntryKey: lastDuplicate }];
}
}
- (void)duplicateGroup:(id)sender {
for(KPKGroup *group in self.selectedGroups) {
@@ -888,7 +888,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
KPKEntry *targetEntry = targetEntries.count == 1 ? targetEntries.firstObject : nil;
KPKGroup *targetGroup = targetGroups.count == 1 ? targetGroups.firstObject : nil;
if(self.encrypted || self.isReadOnly) {
if(anItem.action == @selector(revertDocumentToSaved:) ||
anItem.action == @selector(browseDocumentVersions:)) {