diff --git a/Cartfile.resolved b/Cartfile.resolved index 4c1cbece..8cb4dc2a 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -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" diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 98d4f16a..eda9cae1 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -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; diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 61f99049..5a7d5187 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -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:)) {