mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 17:32:17 +00:00
Merge pull request #377 from mlterpstra92/master
Fixed spelling errors in comments and some strings
This commit is contained in:
@@ -12,8 +12,8 @@ typedef NS_ENUM(NSUInteger, MPActionType) {
|
||||
MPUnkownAction, // Neutral element to be used for returns
|
||||
MPActionAddEntry, // Add an new entry
|
||||
MPActionAddGroup, // Add a new group
|
||||
MPActionDuplicateEntry, // Simply duplicate an entry (inlcuding history)
|
||||
MPActionDuplicateEntryWithOptions, // Request user inptu on what to duplicate
|
||||
MPActionDuplicateEntry, // Simply duplicate an entry (including history)
|
||||
MPActionDuplicateEntryWithOptions, // Request user input on what to duplicate
|
||||
MPActionDelete, // Delete entry or group
|
||||
MPActionCopyUsername, // copy username to pasteboard
|
||||
MPActionCopyPassword, // copy password to pasteboard
|
||||
@@ -25,11 +25,11 @@ typedef NS_ENUM(NSUInteger, MPActionType) {
|
||||
MPActionEditPassword, // change the database password
|
||||
MPActionDatabaseSettings, // Show the settings for the database
|
||||
MPActionEditTemplateGroup, // Edit the Template group
|
||||
MPActionExportXML, // Exporte as XML
|
||||
MPActionExportXML, // Export as XML
|
||||
MPActionImportXML, // Import form XML
|
||||
MPActionToggleQuicklook,
|
||||
MPActionShowHistory, // History anzeigen
|
||||
MPActionExitHistory, // History ausblenden
|
||||
MPActionShowHistory, // show history
|
||||
MPActionExitHistory, // exit history
|
||||
MPActionPerformAutotypeForSelectedEntry // Perform Autotype for selected Entry
|
||||
};
|
||||
/**
|
||||
|
||||
@@ -65,7 +65,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if(self) {
|
||||
/* We know that we do not use the varibale after instancation */
|
||||
/* We know that we do not use the variable after instantiation */
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
MPDocumentController *documentController = [[MPDocumentController alloc] init];
|
||||
@@ -97,7 +97,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
/* Update the … at the save menu */
|
||||
[[self.saveMenuItem menu] setDelegate:self];
|
||||
|
||||
/* We want to inform anyone about the changes to keyFile remmebering */
|
||||
/* We want to inform anyone about the changes to keyFile remembering */
|
||||
[self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile))
|
||||
toObject:[NSUserDefaultsController sharedUserDefaultsController]
|
||||
withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyRememberKeyFilesForDatabases]
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
@class MPAutotypeContext;
|
||||
|
||||
/**
|
||||
* The Autotype command reperesent a capsualted Action that was determined by interpreting
|
||||
* Autotype field for a given entry. This is a class cluster and schould be considered the sole
|
||||
* enty point for creating AutotypeCommands. You should never need to build a command on your own.
|
||||
* The Autotype command represents a capsuled Action that was determined by interpreting
|
||||
* Autotype field for a given entry. This is a class cluster and should be considered the sole
|
||||
* entry point for creating AutotypeCommands. You should never need to build a command on your own.
|
||||
*/
|
||||
@interface MPAutotypeCommand : NSObject
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
/**
|
||||
* Creates a command sequence for the given context. The context's keystroke sequence is
|
||||
* is evaluated (Placholders filled, references resolved) and the commands are created in the
|
||||
* is evaluated (Placeholders filled, references resolved) and the commands are created in the
|
||||
* order of their execution
|
||||
*
|
||||
* @param context the context to create the comamnds from.
|
||||
* @param context the context to create the commands from.
|
||||
*
|
||||
* @return NSArray of MPAutotypeCommand
|
||||
*/
|
||||
@@ -46,7 +46,7 @@
|
||||
- (void)sendPasteKeyCode;
|
||||
|
||||
/**
|
||||
* Exectues the Autotype Command.
|
||||
* Executes the Autotype Command.
|
||||
*/
|
||||
- (void)execute;
|
||||
|
||||
|
||||
@@ -136,16 +136,16 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
|
||||
[self appendAppropriatePasteCommandForEntry:context.entry withContent:pasteValue toCommands:commands];
|
||||
}
|
||||
}
|
||||
/* Test for modifer Key */
|
||||
/* Test for modifier Key */
|
||||
NSString *commandString = [context.evaluatedCommand substringWithRange:commandRange];
|
||||
/* append commands for non-modifer keys */
|
||||
/* append commands for non-modifier keys */
|
||||
if(![self updateModifierMask:&collectedModifers forCommand:commandString]) {
|
||||
[self appendCommandForEntry:context.entry withString:commandString toCommands:commands activeModifer:collectedModifers];
|
||||
collectedModifers = 0; // Reset the modifers;
|
||||
collectedModifers = 0; // Reset the modifiers;
|
||||
}
|
||||
lastLocation = commandRange.location + commandRange.length;
|
||||
}
|
||||
/* Collect any part that isn't a command or if onyl paste is used */
|
||||
/* Collect any part that isn't a command or if only paste is used */
|
||||
if(lastLocation < [context.evaluatedCommand length]) {
|
||||
/* We might have some dangling modifiers */
|
||||
NSRange lastRange = NSMakeRange(lastLocation, [context.evaluatedCommand length] - lastLocation);
|
||||
@@ -174,7 +174,7 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
|
||||
}
|
||||
|
||||
+ (void)appendPasteCommandForContent:(NSString *)pasteContent toCommands:(NSMutableArray *)commands {
|
||||
/* Update an already inserted paste command with the new conents */
|
||||
/* Update an already inserted paste command with the new contents */
|
||||
if([[commands lastObject] isKindOfClass:[MPAutotypePaste class]]) {
|
||||
[[commands lastObject] appendString:pasteContent];
|
||||
}
|
||||
@@ -303,7 +303,7 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
|
||||
if([numberScanner scanInteger:&value]) {
|
||||
if([kKPKAutotypeDelay isEqualToString:uppercaseCommand]) {
|
||||
if(MAX(0, value) <= 0) {
|
||||
return; // Value too low, just skipp
|
||||
return; // Value too low, just skip
|
||||
}
|
||||
[commands addObject:[[MPAutotypeDelay alloc] initWithDelay:value]];
|
||||
return; // Done
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@class KPKEntry;
|
||||
|
||||
/**
|
||||
* The autotype daemon is repsonsible for registering the globa hotkey and to perform any autotype actions
|
||||
* The autotype daemon is responsible for registering the global hotkey and to perform any autotype actions
|
||||
*/
|
||||
@interface MPAutotypeDaemon : NSObject
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
||||
}
|
||||
|
||||
MPAutotypeContext *context = [self _autotypeContextInDocument:document forWindowTitle:self.targetWindowTitle preferredEntry:entryOrNil];
|
||||
/* TODO: that's popping up if the mulit seleciton dialog goes up! */
|
||||
/* TODO: that's popping up if the multi selection dialog goes up! */
|
||||
if(!entryOrNil) {
|
||||
NSImage *appIcon = [[NSApplication sharedApplication] applicationIconImage];
|
||||
NSString *label = context ? NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH", "") : NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH", "");
|
||||
@@ -192,7 +192,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
||||
}
|
||||
if([self _orderApplicationToFront:self.targetPID]) {
|
||||
/* Sleep a bit after the app was activated */
|
||||
/* TODO - we can use a saver way and use a notification to chekc if the app actally was activated */
|
||||
/* TODO - we can use a saver way and use a notification to check if the app actually was activated */
|
||||
usleep(1 * NSEC_PER_MSEC);
|
||||
}
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import "MPAutotypeCommand.h"
|
||||
|
||||
/**
|
||||
* Autotype command to press a single key. Can be used with modifer keys as well
|
||||
* Autotype command to press a single key. Can be used with modifier keys as well
|
||||
*/
|
||||
@interface MPAutotypeKeyPress : MPAutotypeCommand
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
|
||||
- (BOOL)isValid {
|
||||
/* Pasting shoudl always be valid */
|
||||
/* Pasting should always be valid */
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
/**
|
||||
* Default Connection to handle the KeepassHttp POST requests. The Connection doesn't do anything,
|
||||
* besides using the MPRequestHandlerService to handle any request from KeePassHttp and send's back the replies
|
||||
* besides using the MPRequestHandlerService to handle any request from KeePassHttp and sends back the replies
|
||||
*/
|
||||
@interface MPConnection : HTTPConnection
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
Block the segment setter to prevent accidential settings
|
||||
Block the segment setter to prevent accidental settings
|
||||
*/
|
||||
- (void)setImage:(NSImage *)image forSegment:(NSInteger)segment {
|
||||
if(segment < 2) {
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
*/
|
||||
|
||||
metaData.rounds = MAX(0,[self.encryptionRoundsTextField integerValue]);
|
||||
/* Register an action to enable promts when user cloeses without saving */
|
||||
/* Register an action to enable prompts when user closes without saving */
|
||||
[self.document updateChangeCount:NSChangeDone];
|
||||
[self close:nil];
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
for(KPKEntry *entry in autotypeEntries) {
|
||||
/* TODO:
|
||||
|
||||
KeePass for Windows hase the following options for matching:
|
||||
KeePass for Windows has the following options for matching:
|
||||
Title is contained
|
||||
URL is contained
|
||||
Host component is contained
|
||||
|
||||
@@ -16,7 +16,7 @@ FOUNDATION_EXTERN NSString *const MPDocumentDidExitSearchNotification;
|
||||
/**
|
||||
* Posted by the document, when the search results have been updated. This is only called when searching.
|
||||
* If the search is exited, it will be notified by MPDocumentDidExitSearchNotification
|
||||
* The userInfo dictionary has one key kMPDocumentSearchResultsKey with an NSArray of KPKEntries mathching the search.
|
||||
* The userInfo dictionary has one key kMPDocumentSearchResultsKey with an NSArray of KPKEntries matching the search.
|
||||
*/
|
||||
FOUNDATION_EXTERN NSString *const MPDocumentDidChangeSearchResults;
|
||||
|
||||
|
||||
@@ -101,9 +101,9 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
#pragma mark Lock/Decrypt
|
||||
- (IBAction)lockDatabase:(id)sender;
|
||||
/**
|
||||
* Decrypts the databse with the given password and keyfile
|
||||
* Decrypts the database with the given password and keyfile
|
||||
*
|
||||
* @param password The password to unlock the db with, can be nil. This is not the same as an empty stirng @""
|
||||
* @param password The password to unlock the db with, can be nil. This is not the same as an empty string @""
|
||||
* @param keyFileURL URL for the keyfile to use, can be nil
|
||||
* @param error Pointer to an NSError pointer of error reporting.
|
||||
*
|
||||
@@ -111,7 +111,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
*/
|
||||
- (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error;
|
||||
/**
|
||||
* Changes the password of the database. Some sanity checks are applied and the change is aborted if the new values arent valid
|
||||
* Changes the password of the database. Some sanity checks are applied and the change is aborted if the new values aren't valid
|
||||
*
|
||||
* @param password new password, can be nil
|
||||
* @param keyFileURL new key URL can be nil
|
||||
@@ -132,7 +132,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
/**
|
||||
* Finds an entry with the given UUID. If none is found, nil is returned
|
||||
* @param uuid The UUID for the searched Entry
|
||||
* @return enty, matching the UUID, nil if none was found
|
||||
* @return entry, matching the UUID, nil if none was found
|
||||
*/
|
||||
- (KPKEntry *)findEntry:(NSUUID *)uuid;
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
|
||||
#pragma mark Actions
|
||||
/**
|
||||
* Empties the Trash group. Removing all Groups and Entries inside. This aciton is not undoable
|
||||
* Empties the Trash group. Removing all Groups and Entries inside. This action is not undo-able
|
||||
* @param sender sender
|
||||
*/
|
||||
- (IBAction)emptyTrash:(id)sender;
|
||||
|
||||
@@ -235,8 +235,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
||||
- (void)close {
|
||||
[self _cleanupLock];
|
||||
/*
|
||||
We store the last url. Restored windows are automatically handeld.
|
||||
If closeAllDocuments is set, all docs get this messgae
|
||||
We store the last url. Restored windows are automatically handled.
|
||||
If closeAllDocuments is set, all docs get this message
|
||||
*/
|
||||
if([[self fileURL] isFileURL]) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[self.fileURL absoluteString] forKey:kMPSettingsKeyLastDatabasePath];
|
||||
@@ -331,8 +331,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
||||
/* Key change is not undoable so just recored the change as done */
|
||||
[self updateChangeCount:NSChangeDone];
|
||||
/*
|
||||
If the user opted to remeber key files for documents, we should update this information.
|
||||
But it's impossible to know, if he actaully saves the changes!
|
||||
If the user opted to remember key files for documents, we should update this information.
|
||||
But it's impossible to know, if he actually saves the changes!
|
||||
*/
|
||||
return YES;
|
||||
}
|
||||
@@ -646,7 +646,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
||||
|
||||
- (void)createEntryFromTemplate:(id)sender {
|
||||
if(![sender respondsToSelector:@selector(representedObject)]) {
|
||||
return; // sender cannot provide usefull data
|
||||
return; // sender cannot provide useful data
|
||||
}
|
||||
id obj = [sender representedObject];
|
||||
if(![obj isKindOfClass:[NSUUID class]]) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@class MPDocument;
|
||||
|
||||
/**
|
||||
* Service for querying for resultis withing a request
|
||||
* Service for querying for result is withing a request
|
||||
* This shared instance handles creating of config entries,
|
||||
* and abstracts all open documents for the KeePassHttp interface.
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ static NSUUID *_rootUuid = nil;
|
||||
}
|
||||
|
||||
- (KPKEntry *)configurationEntry {
|
||||
/* TODO: lazy getter or do something differen like init at first call? */
|
||||
/* TODO: lazy getter or do something different like init at first call? */
|
||||
if(nil != _configurationEntry) {
|
||||
return _configurationEntry;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert setMessageText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE", "")];
|
||||
[alert setInformativeText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE_DESCRIPTION", "Informative Text displayed when saving woudl yield data loss")];
|
||||
[alert setInformativeText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE_DESCRIPTION", "Informative Text displayed when saving would yield data loss")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"SAVE_LOSSY", "Save lossy")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"CHANGE_FORMAT", "")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"CANCEL", "Cancel")];
|
||||
@@ -417,8 +417,8 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
NSView *entryView = [self.entryViewController view];
|
||||
|
||||
/*
|
||||
The current easy way to prevent layout hickups is to add the inspect
|
||||
Add all neded contraints an then remove it again, if it was hidden
|
||||
The current easy way to prevent layout hiccups is to add the inspect
|
||||
Add all needed constraints an then remove it again, if it was hidden
|
||||
*/
|
||||
BOOL removeInspector = NO;
|
||||
if(![inspectorView superview]) {
|
||||
|
||||
@@ -45,7 +45,7 @@ static NSUInteger const kMPAttachmentsMenuItem = 2000;
|
||||
if([lastItem isSeparatorItem]) {
|
||||
[menu removeItem:lastItem];
|
||||
}
|
||||
/* since we can get opend on the non-selected entry, we have to resolve the target node */
|
||||
/* since we can get opened on the non-selected entry, we have to resolve the target node */
|
||||
id<MPTargetNodeResolving> entryResolver = [NSApp targetForAction:@selector(currentTargetEntry)];
|
||||
KPKEntry *entry = [entryResolver currentTargetEntry];
|
||||
|
||||
|
||||
@@ -301,18 +301,18 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
}
|
||||
|
||||
- (void)popoverDidClose:(NSNotification *)notification {
|
||||
/* We do not enable the button all the time, but it's wokring find this way */
|
||||
/* We do not enable the button all the time, but it's working find this way */
|
||||
[self.generatePasswordButton setEnabled:YES];
|
||||
id controller = _activePopover.contentViewController;
|
||||
/* Check for password wizzard */
|
||||
if([controller respondsToSelector:@selector(generatedPassword)]) {
|
||||
NSString *password = [controller generatedPassword];
|
||||
/* We should only use the password if there is actally one */
|
||||
/* We should only use the password if there is actually one */
|
||||
if([password length] > 0) {
|
||||
self.entry.password = [controller generatedPassword];
|
||||
}
|
||||
}
|
||||
/* TODO: Check for Icon wizzard */
|
||||
/* TODO: Check for Icon wizard */
|
||||
|
||||
_activePopover = nil;
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ typedef NS_OPTIONS(NSUInteger, MPEntrySearchFlags) {
|
||||
MPEntrySearchNotes = (1<<4),
|
||||
MPEntrySearchAllAttributes = (1<<5),
|
||||
/* The following two flags should be used like enums.
|
||||
They are not intented to be used in conjunktion with any other flag */
|
||||
They are not intended to be used in conjunction with any other flag */
|
||||
MPEntrySearchDoublePasswords = (1<<6),
|
||||
MPEntrySearchExpiredEntries = (1<<7),
|
||||
/* All combinebale search flags combined */
|
||||
/* All combine-able search flags combined */
|
||||
MPEntrySearchAllCombineableFlags = (MPEntrySearchDoublePasswords |
|
||||
MPEntrySearchExpiredEntries |
|
||||
MPEntrySearchNotes |
|
||||
@@ -33,11 +33,11 @@ typedef NS_OPTIONS(NSUInteger, MPEntrySearchFlags) {
|
||||
MPEntrySearchAllFlags = (MPEntrySearchAllCombineableFlags | MPEntrySearchSingleFlags )
|
||||
};
|
||||
|
||||
/* Wrap serach criteria to be able to store them */
|
||||
/* Wrap search criteria to be able to store them */
|
||||
@interface MPEntrySearchContext : NSObject <NSSecureCoding,NSCopying>
|
||||
|
||||
/**
|
||||
* Returns a default search context initalized with sane values.
|
||||
* Returns a default search context initialized with sane values.
|
||||
*
|
||||
* @return The default search context
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef NS_ENUM( NSUInteger, MPCopyContentTypeTag) {
|
||||
@property (weak,readonly) NSTableView *entryTable;
|
||||
@property (readonly, strong) NSArrayController *entryArrayController;
|
||||
|
||||
/* Call this after alle viewcontroller are loaded */
|
||||
/* Call this after all view controllers are loaded */
|
||||
- (void)regsiterNotificationsForDocument:(MPDocument *)document;
|
||||
|
||||
/* Copy/Paste */
|
||||
|
||||
@@ -250,7 +250,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
|
||||
- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
|
||||
/*
|
||||
bind bakground color to entry color
|
||||
bind background color to entry color
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
}
|
||||
|
||||
- (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
|
||||
/* Rows being removed for data change should be chekced here to clear selections */
|
||||
/* Rows being removed for data change should be checked here to clear selections */
|
||||
if(row == -1) {
|
||||
[self tableViewSelectionDidChange:nil];
|
||||
}
|
||||
@@ -376,7 +376,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
#pragma mark MPTargetItemResolving
|
||||
- (KPKEntry *)currentTargetEntry {
|
||||
NSInteger activeRow = [self.entryTable clickedRow];
|
||||
/* Fallback to selection e.g. for toolbar actions */
|
||||
/* Fall back to selection e.g. for toolbar actions */
|
||||
if(activeRow < 0 ) {
|
||||
activeRow = [self.entryTable selectedRow];
|
||||
}
|
||||
@@ -531,7 +531,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
[[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contextBar]|" options:0 metrics:nil views:views]];
|
||||
/* Pin height and to top of entry table */
|
||||
[[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[contextBar(==30)]-0-[scrollView]" options:0 metrics:nil views:views]];
|
||||
/* Create the top constraint for the filter bar where we can change the contanst instaed of removing/adding constraints all the time */
|
||||
/* Create the top constraint for the filter bar where we can change the constant instead of removing/adding constraints all the time */
|
||||
self.contextBarTopConstraint = [NSLayoutConstraint constraintWithItem:contextBar
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -594,7 +594,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
|
||||
case MPOverlayInfoCustom:
|
||||
infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"];
|
||||
infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field nam that was copied to the pasteboard"), name];
|
||||
infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field name that was copied to the pasteboard"), name];
|
||||
break;
|
||||
}
|
||||
[[MPOverlayWindowController sharedController] displayOverlayImage:infoImage label:infoText atView:self.view];
|
||||
@@ -602,7 +602,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
|
||||
#pragma mark Validation
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
/* Validation is soley handeld in the document */
|
||||
/* Validation is solely handled in the document */
|
||||
MPDocument *document = [[self windowController] document];
|
||||
return [document validateMenuItem:menuItem];
|
||||
}
|
||||
@@ -722,7 +722,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
}
|
||||
NSInteger columnIndex = [self.entryTable clickedColumn];
|
||||
if(columnIndex < 0 || columnIndex >= [[self.entryTable tableColumns] count]) {
|
||||
return; // No Colum to use
|
||||
return; // No Column to use
|
||||
}
|
||||
NSTableColumn *column = [self.entryTable tableColumns][[self.entryTable clickedColumn]];
|
||||
NSString *identifier = [column identifier];
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
dispatch_source_set_event_handler(self.source, self.block);
|
||||
|
||||
// close the file descriptor when the dispatch source is cancelled
|
||||
// close the file descriptor when the dispatch source is canceled
|
||||
dispatch_source_set_cancel_handler(self.source, ^{
|
||||
|
||||
close(self.fileDescriptor);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <Foundation/Foundation.h>
|
||||
/**
|
||||
* Tests if the given flag is set in the mode options.
|
||||
* The test operatats on bit flag leve. Hence it will return YES
|
||||
* The test operates on bit flag left. Hence it will return YES
|
||||
* if only one single bit is common in both parameters!
|
||||
*
|
||||
* @param options single flag to test for
|
||||
|
||||
@@ -95,7 +95,7 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper class to retrieve Icons for Keys. KDB sortes Icons as an Integer
|
||||
* Helper class to retrieve Icons for Keys. KDB sorts Icons as an Integer
|
||||
* The Helper maps those numbers to icons.
|
||||
* It can furthermore be used to retrieve other Icons, that are non-Database Icons
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
|
||||
|
||||
/**
|
||||
* Available Icon names (all)
|
||||
* @return Dictioary with MPIconType keys and NSString values containing their names
|
||||
* @return Dictionary with MPIconType keys and NSString values containing their names
|
||||
*/
|
||||
+ (NSDictionary *)availableIconNames;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
- (IBAction)pickExpiryDate:(id)sender;
|
||||
- (IBAction)toggleEdit:(id)sender;
|
||||
|
||||
/* Seperate call to ensure alle registered objects are in place */
|
||||
/* Separate call to ensure all registered objects are in place */
|
||||
- (void)regsiterNotificationsForDocument:(NSDocument *)document;
|
||||
|
||||
@end
|
||||
|
||||
@@ -177,7 +177,7 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
||||
[self.entryViewController endEditing];
|
||||
|
||||
/*
|
||||
We need to be carefull to only undo the things we actually changed
|
||||
We need to be careful to only undo the things we actually changed
|
||||
otherwise we undo older actions
|
||||
*/
|
||||
if(didCancel) {
|
||||
@@ -312,7 +312,7 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
||||
- (void)_didChangeCurrentItem:(NSNotification *)notification {
|
||||
MPDocument *document = [notification object];
|
||||
if(!document.selectedItem) {
|
||||
/* show emty tab and hide edit button */
|
||||
/* show empty tab and hide edit button */
|
||||
self.activeTab = MPEmptyTab;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -21,7 +21,7 @@ FOUNDATION_EXTERN uint16_t const kMPUnknownKeyCode;
|
||||
+ (NSString *)stringForKey:(CGKeyCode)keyCode;
|
||||
|
||||
/**
|
||||
* Determines the keyCode (if possible) for the charater
|
||||
* Determines the keyCode (if possible) for the character
|
||||
*
|
||||
* @param character NSString with a single character to be transformed
|
||||
* @return virtual Keycode for the supplied string. If none is found, kMPUnkonwKeyCode is returned
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
NSTimeInterval currentInterval = ([NSDate timeIntervalSinceReferenceDate] - self.lastLocalEventTime);
|
||||
if(self.idleLockTime < currentInterval) {
|
||||
[(MPAppDelegate *)[NSApp delegate] lockAllDocuments];
|
||||
/* Reset the timer to full intervall */
|
||||
/* Reset the timer to full interval */
|
||||
[self.idleCheckTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:_idleLockTime]];
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
NSDragOperation operationMask = NSDragOperationMove;
|
||||
/*
|
||||
If we can support copy on drag, this can be used
|
||||
to optain the dragging modifier mask the user presses
|
||||
to obtain the dragging modifier mask the user presses
|
||||
*/
|
||||
BOOL localCopy = NO;
|
||||
if([info draggingSourceOperationMask] == NSDragOperationCopy) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
+ (MPOverlayWindowController *)sharedController;
|
||||
|
||||
/**
|
||||
* Displays an overlay HUD style image with the given text, image centerd at the given view.
|
||||
* Displays an overlay HUD style image with the given text, image centered at the given view.
|
||||
* There are two use cases. Either displaying information over a view by providing on,
|
||||
* or displaying information on the main screen by using nil for the view.
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
56 - 85 Excellent
|
||||
85 - Fantastic
|
||||
|
||||
Skale 0-90
|
||||
Scale 0-90
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, MPPasswordRating) {
|
||||
MPPasswordTerrible = 10,
|
||||
@@ -205,7 +205,7 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[self.customCharactersTextField stringValue] forKey:kMPSettingsKeyPasswordCustomString];
|
||||
}
|
||||
else {
|
||||
NSLog(@"Cannot set password generator defaults. Inconsitent state. Aborting.");
|
||||
NSLog(@"Cannot set password generator defaults. Inconsistent state. Aborting.");
|
||||
}
|
||||
self.setDefaultButton.enabled = NO;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
@optional
|
||||
/**
|
||||
* Get's called on dismissing the password editor.
|
||||
* @param changedPasswordOrKey YES if the password and/or key was saved (not necessairly changed!);
|
||||
* @param changedPasswordOrKey YES if the password and/or key was saved (not necessarily changed!);
|
||||
*/
|
||||
- (void)didFinishPasswordEditing:(BOOL)changedPasswordOrKey;
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
if(!hasPasswordOrKey) {
|
||||
[self.errorTextField setTextColor:[NSColor controlTextColor]];
|
||||
[self.errorTextField setStringValue:NSLocalizedString(@"WARNING_NO_PASSWORD_OR_KEYFILE", "No Key or Password")];
|
||||
return; // alldone
|
||||
return; // all done
|
||||
}
|
||||
[self.errorTextField setTextColor:[NSColor redColor]];
|
||||
if(!passwordOk && !keyOk ) {
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
}
|
||||
|
||||
- (void)requestPassword {
|
||||
// show Warnign if read-only mode!
|
||||
// show warning if read-only mode!
|
||||
[self _reset];
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
|
||||
- (IBAction)resetKeyFile:(id)sender {
|
||||
/* If the reset was triggerd by ourselves we want to preselct the keyfile */
|
||||
/* If the reset was triggered by ourselves we want to preselect the keyfile */
|
||||
if(sender == self) {
|
||||
[self _selectKeyURL];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/**
|
||||
* The PasteBoardController did copy new items to the pasteboard
|
||||
* The userInfo dictionary is empty. You can optain the timeout via the clearTimeout property
|
||||
* The userInfo dictionary is empty. You can obtain the timeout via the clearTimeout property
|
||||
*/
|
||||
FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidCopyObjects;
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidCopyObjects;
|
||||
FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidClearClipboard;
|
||||
|
||||
/*
|
||||
This time sets the time interval after which a copied entry shoudl be purged from the pasteboard
|
||||
This time sets the time interval after which a copied entry should be purged from the pasteboard
|
||||
*/
|
||||
@property (assign, nonatomic) NSTimeInterval clearTimeout;
|
||||
@property (assign, nonatomic) BOOL clearPasteboardOnShutdown;
|
||||
|
||||
@@ -17,7 +17,7 @@ FOUNDATION_EXPORT NSString *const MPRequestTypeSetLogin;
|
||||
FOUNDATION_EXPORT NSString *const MPRequestTypeGeneratePassword;
|
||||
|
||||
/**
|
||||
* Servive class to be called for getting specific request handler for indifidual reuqest
|
||||
* Service class to be called for getting specific request handler for individual request
|
||||
* The service is identified by a string
|
||||
*/
|
||||
@interface MPRequestHandlerService : NSObject
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/**
|
||||
* Formulate a response to the request passed in as Dictionary
|
||||
*
|
||||
* @param data An NSDictionary containing the parsed JSON reuest
|
||||
* @param data An NSDictionary containing the parsed JSON request
|
||||
*/
|
||||
- (void)respondTo:(NSDictionary *)data;
|
||||
|
||||
|
||||
@@ -41,14 +41,14 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideNotes;
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideURL;
|
||||
/* Document/Key Location store */
|
||||
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyLastDatabasePath; // Path to the last opened Database. Workaround if users have disabled the feautere in the OS
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyLastDatabasePath; // Path to the last opened Database. Workaround if users have disabled the feature in the OS
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyRememeberdKeysForDatabases; // NSDictionary of all db file urls and the corresponding key file url
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases; // YES if key files should be rememberd
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases; // YES if key files should be remembers
|
||||
|
||||
/* Autotype */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey; // Should MacPass swap control for command. This is usefull in a cross plattform environment
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey; // Should MacPass swap control for command. This is useful in a cross platform environment
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype; // Is Global Autotype enabled?
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the useder defined global autotype key
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the user defined global autotype key
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence; // Default sequence used for Autotype
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup included entry URL
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup included host part of entry URL
|
||||
@@ -92,12 +92,12 @@ typedef NS_ENUM(NSUInteger, MPPasswordEncoding) {
|
||||
@interface MPSettingsHelper : NSObject
|
||||
|
||||
/**
|
||||
* Registers all the defaults for the applciaiton
|
||||
* Registers all the defaults for the application
|
||||
*/
|
||||
+ (void)setupDefaults;
|
||||
|
||||
/**
|
||||
* Brings the defaults to a current status. Removes obsoltes entries.
|
||||
* Brings the defaults to a current status. Removes obsolete entries.
|
||||
*/
|
||||
+ (void)migrateDefaults;
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
/*
|
||||
Protrocoll to be implemented by ViewControllers that can be added to
|
||||
the settings windows. Tabs are orded as the controllers are included.
|
||||
the settings windows. Tabs are ordered as the controllers are included.
|
||||
*/
|
||||
@protocol MPSettingsTab <NSObject>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
- (NSImage *)image;
|
||||
/* Called when the tab is about to be selected and displayed */
|
||||
- (void)willShowTab;
|
||||
/* Called whent the tab was selected and is being displayed */
|
||||
/* Called when the tab was selected and is being displayed */
|
||||
- (void)didShowTab;
|
||||
|
||||
@end
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
id<MPSettingsTab> tab = self.settingsController[identifier];
|
||||
if(tab == nil){
|
||||
NSLog(@"Warning. Unknow settingscontroller for identifier: %@. Did you miss to add the controller?", identifier);
|
||||
NSLog(@"Warning. Unknown settingscontroller for identifier: %@. Did you miss to add the controller?", identifier);
|
||||
return;
|
||||
}
|
||||
[self.toolbar setSelectedItemIdentifier:identifier];
|
||||
@@ -112,7 +112,7 @@
|
||||
}
|
||||
NSString *identifier = [tabController identifier];
|
||||
if(nil != self.settingsController[identifier]) {
|
||||
NSLog(@"Warning: Settingscontroller with identifer %@ already present!", identifier);
|
||||
NSLog(@"Warning: Settingscontroller with identifier %@ already present!", identifier);
|
||||
}
|
||||
else {
|
||||
self.settingsController[identifier] = tabController;
|
||||
@@ -165,7 +165,7 @@
|
||||
item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
|
||||
/*
|
||||
Setup the item to use the controllers label if one is present
|
||||
and supports the appropriate @optional protocoll messages
|
||||
and supports the appropriate @optional protocol messages
|
||||
*/
|
||||
id<MPSettingsTab> tab = self.settingsController[itemIdentifier];
|
||||
if([tab respondsToSelector:@selector(label)]) {
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
/**
|
||||
* Generic Windowcontroller to be used for sheets
|
||||
* Subclasses are able to initalize their views within updateView
|
||||
* and thus are able to reset themself befor being displayed as sheets
|
||||
* Subclasses are able to initialize their views within updateView
|
||||
* and thus are able to reset themselves before being displayed as sheets
|
||||
*/
|
||||
@interface MPSheetWindowController : NSWindowController
|
||||
/**
|
||||
* Flag to indicate that the view might need resetting.
|
||||
* The default implementation of dismissi sheet and the
|
||||
* designate initalizer both set the value to YES
|
||||
* The default implementation of dismiss sheet and the
|
||||
* designate initializer both set the value to YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isDirty;
|
||||
/**
|
||||
* This method is a entry point to ensure updated ui befor being presented
|
||||
* This method is a entry point to ensure updated ui before being presented
|
||||
* The method is called every time the window message is sent to the controller
|
||||
*/
|
||||
- (void)updateView;
|
||||
|
||||
@@ -296,7 +296,7 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
|
||||
if(_displayModeBeforeSearch == NSToolbarDisplayModeLabelOnly) {
|
||||
[self.toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
|
||||
}
|
||||
/* only make the searchfield first responder if it's not aleady in an active search */
|
||||
/* only make the searchfield first responder if it's not already in an active search */
|
||||
if(![self.searchField currentEditor]) {
|
||||
[[self.searchField window] makeFirstResponder:self.searchField];
|
||||
[self.searchField selectText:self];
|
||||
|
||||
@@ -19,10 +19,10 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
|
||||
@interface NSString (MPPasswordCreation)
|
||||
|
||||
/**
|
||||
* Creates a Password using the supplied password character set with the given lenght
|
||||
* Creates a Password using the supplied password character set with the given length
|
||||
*
|
||||
* @param allowedCharacters Characters allowed for the password
|
||||
* @param theLength lenght of the password to be created
|
||||
* @param theLength length of the password to be created
|
||||
*
|
||||
* @return new password with only the allowed characters.
|
||||
*/
|
||||
@@ -33,9 +33,9 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
|
||||
* Creats a password based on the supplied string
|
||||
*
|
||||
* @param source String containing the allowed characters
|
||||
* @param length Lenght for the password to be chreated
|
||||
* @param length Length for the password to be created
|
||||
*
|
||||
* @return Password consisint only of allowed characters
|
||||
* @return Password consistent only of allowed characters
|
||||
*/
|
||||
+ (NSString *)passwordFromString:(NSString *)source length:(NSUInteger)length;
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
|
||||
*
|
||||
* @param length Length of the password to be created
|
||||
*
|
||||
* @return Password containing only the charactesr in receiver
|
||||
* @return Password containing only the characters in receiver
|
||||
*/
|
||||
- (NSString *)passwordWithLength:(NSUInteger)length;
|
||||
/**
|
||||
@@ -54,12 +54,12 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
|
||||
*/
|
||||
- (NSString *)randomCharacter;
|
||||
/**
|
||||
* Calculates the entropy of the receiver based on the allowed characers. The caluclation consideres the characters chosen randomly.
|
||||
* If the password supplied was not created randomly based on the full character set, the calulated entropy is NOT correct.
|
||||
* Do NOT use this method to estrimate unknown passwords
|
||||
* Calculates the entropy of the receiver based on the allowed characters. The calculation considers the characters chosen randomly.
|
||||
* If the password supplied was not created randomly based on the full character set, the calculated entropy is NOT correct.
|
||||
* Do NOT use this method to estimate unknown passwords
|
||||
*
|
||||
* @param allowedCharacters set of allowed Characters
|
||||
* @param customCharacters alternative string of unique allowed charactes (String is not stripped of duplicates!)
|
||||
* @param customCharacters alternative string of unique allowed characters (String is not stripped of duplicates!)
|
||||
*
|
||||
* @return entropy of the receiver as bits
|
||||
*/
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
/* Class = "NSBox"; title = "Preview"; ObjectID = "VVs-b5-cX9"; */
|
||||
"VVs-b5-cX9.title" = "Preview";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "If enabled attached files will be copied to a tempoary location for preview and deleted after the preview is closed."; ObjectID = "WmI-IB-Aso"; */
|
||||
"WmI-IB-Aso.title" = "If enabled attached files will be copied to a tempoary location for preview and deleted after the preview is closed. This is a potential security risk!";
|
||||
/* Class = "NSTextFieldCell"; title = "If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed."; ObjectID = "WmI-IB-Aso"; */
|
||||
"WmI-IB-Aso.title" = "If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed. This is a potential security risk!";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Interpret ⌃ as ⌘"; ObjectID = "QfO-yG-l3F"; */
|
||||
"QfO-yG-l3F.title" = "Interpret ⌃ as ⌘";
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"ERROR_INVALID_FIELD_SIZE" = "Incorrect size at data field. Password wrong?";
|
||||
"ERROR_INVALID_FIELD_TYPE" = "Unknown data field. Password wrong?";
|
||||
"ERROR_UNSUPPORTED_DATABASER_VERSION" = "The Database version is not supported";
|
||||
"ERROR_UNSUPPORTED_CHIPHER" = "Unsupported chipher algorithm";
|
||||
"ERROR_UNSUPPORTED_CHIPHER" = "Unsupported cipher algorithm";
|
||||
"ERROR_UNKNOWN_FILE_FORMAT" = "Unknown file format";
|
||||
"ERROR_HEADER_CORRUPTED" = "Header is corrupted";
|
||||
"ERROR_UNSUPPORTED_KDBX_COMPRESSION_ALGORITHM" = "Unsported compression algorithm";
|
||||
@@ -32,6 +32,6 @@
|
||||
"ERROR_GROUP_ELEMENT_MISSING" = "The XML file contains no Group node";
|
||||
"ERROR_HEADER_HASH_MISSMATCH" = "The header hash doesn't match. File corrupted";
|
||||
"ERROR_XML_KEYFILE_WITHOUT_KEY_ELEMENT" = "The XML keyfile is missing the key element";
|
||||
"ERROR_XML_KEYFILE_WITHOUT_DATA_ELEMENT" = "The XML keyfiel is missing the data element";
|
||||
"ERROR_XML_KEYFILE_WITHOUT_DATA_ELEMENT" = "The XML keyfile is missing the data element";
|
||||
"ERROR_XML_KEYFILE_DATA_PARSING_ERROR" = "Unable to read the data of the XML keyfile";
|
||||
"ERROR_HEADER_HASH_VERIFICATION_FAILED" = "The database header hash is wrong. Data integritiy might be broken!";
|
||||
"ERROR_HEADER_HASH_VERIFICATION_FAILED" = "The database header hash is wrong. Data integrity might be broken!";
|
||||
Binary file not shown.
@@ -53,7 +53,7 @@
|
||||
NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:4 freeWhenDone:NO];
|
||||
NSColor *color = [NSColor colorWithData:colorData];
|
||||
NSData *newData = [color colorData];
|
||||
XCTAssertEqualObjects(colorData, newData, @"Convertion should result in same data");
|
||||
XCTAssertEqualObjects(colorData, newData, @"Conversion should result in same data");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
- (void)testLegacyKeyfileGeneration {
|
||||
NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion];
|
||||
// test if strucutre is sound;
|
||||
// test if structure is sound;
|
||||
XCTAssertNotNil(data, @"Keydata should have been generated");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
XCTAssertNotNil(tree, @"Tree should be created");
|
||||
error = nil;
|
||||
NSData *data = [tree encryptWithPassword:password forVersion:KPKLegacyVersion error:&error];
|
||||
XCTAssertNotNil(data, @"Serialized Data shoudl be created");
|
||||
XCTAssertNotNil(data, @"Serialized Data should be created");
|
||||
NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234.kdb"];
|
||||
NSLog(@"Saved to %@", tempFile);
|
||||
[data writeToFile:tempFile atomically:YES];
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
|
||||
XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match");
|
||||
XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
|
||||
|
||||
KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
|
||||
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
|
||||
}
|
||||
|
||||
- (void)testIconCoding {
|
||||
|
||||
@@ -59,11 +59,11 @@
|
||||
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
|
||||
XCTAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match");
|
||||
XCTAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
|
||||
|
||||
KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
|
||||
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
- (void)testUndelemitedUUID {
|
||||
NSUUID *uuid1 = [[NSUUID alloc] initWithUUIDString:@"31C1F2E6-BF71-4350-BE58-05216AFC5AFF"];
|
||||
NSUUID *uuid2 = [[NSUUID alloc] initWithUndelemittedUUIDString:@"31C1F2E6BF714350BE5805216AFC5AFF"];
|
||||
XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs shoudl match");
|
||||
XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs should match");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data");
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing");
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing");
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
- (void)testCreateNewDatabase {
|
||||
MPDocument *document = [[MPDocument alloc] init];
|
||||
XCTAssertNotNil(document, @"Document should be created");
|
||||
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in defautl case");
|
||||
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in default case");
|
||||
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation");
|
||||
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user