mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 02:22:28 +00:00
Using current KeePassKit. Adopted API changes
This commit is contained in:
Submodule KeePassKit updated: 3122304d90...870d252a29
@@ -158,7 +158,7 @@
|
|||||||
4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; };
|
4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; };
|
||||||
4C45FB23178E09ED0010007D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C45FB21178E09ED0010007D /* InfoPlist.strings */; };
|
4C45FB23178E09ED0010007D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C45FB21178E09ED0010007D /* InfoPlist.strings */; };
|
||||||
4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */; };
|
4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */; };
|
||||||
4C45FB30178E0CE20010007D /* MPDatabaseCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */; };
|
4C45FB30178E0CE20010007D /* MPTestDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2F178E0CE20010007D /* MPTestDocument.m */; };
|
||||||
4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; };
|
4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; };
|
||||||
4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */; };
|
4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */; };
|
||||||
4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C473A7E18AFD6340073FD2E /* KPKTestReference.m */; };
|
4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C473A7E18AFD6340073FD2E /* KPKTestReference.m */; };
|
||||||
@@ -669,7 +669,7 @@
|
|||||||
4C45FB22178E09ED0010007D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
4C45FB22178E09ED0010007D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
4C45FB27178E09ED0010007D /* MacPassTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MacPassTests-Prefix.pch"; sourceTree = "<group>"; };
|
4C45FB27178E09ED0010007D /* MacPassTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MacPassTests-Prefix.pch"; sourceTree = "<group>"; };
|
||||||
4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseLoading.m; sourceTree = "<group>"; };
|
4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseLoading.m; sourceTree = "<group>"; };
|
||||||
4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseCreation.m; sourceTree = "<group>"; };
|
4C45FB2F178E0CE20010007D /* MPTestDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTestDocument.m; sourceTree = "<group>"; };
|
||||||
4C46B88317063A070046109A /* NSString+MPPasswordCreation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MPPasswordCreation.h"; sourceTree = "<group>"; };
|
4C46B88317063A070046109A /* NSString+MPPasswordCreation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MPPasswordCreation.h"; sourceTree = "<group>"; };
|
||||||
4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MPPasswordCreation.m"; sourceTree = "<group>"; };
|
4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MPPasswordCreation.m"; sourceTree = "<group>"; };
|
||||||
4C46E09C17673A0A00DA62E8 /* HNHShadowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHShadowBox.h; sourceTree = "<group>"; };
|
4C46E09C17673A0A00DA62E8 /* HNHShadowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHShadowBox.h; sourceTree = "<group>"; };
|
||||||
@@ -1559,7 +1559,7 @@
|
|||||||
4C305F3F179A1A790082334F /* Images */,
|
4C305F3F179A1A790082334F /* Images */,
|
||||||
4C18F9AC178E123200890BCE /* Databases */,
|
4C18F9AC178E123200890BCE /* Databases */,
|
||||||
4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */,
|
4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */,
|
||||||
4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */,
|
4C45FB2F178E0CE20010007D /* MPTestDocument.m */,
|
||||||
4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */,
|
4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */,
|
||||||
4C6BC65F1A36717E00BDDF3D /* MPDatabaseSearch.m */,
|
4C6BC65F1A36717E00BDDF3D /* MPDatabaseSearch.m */,
|
||||||
4C45FB1F178E09ED0010007D /* Supporting Files */,
|
4C45FB1F178E09ED0010007D /* Supporting Files */,
|
||||||
@@ -2518,7 +2518,7 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */,
|
4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */,
|
||||||
4C45FB30178E0CE20010007D /* MPDatabaseCreation.m in Sources */,
|
4C45FB30178E0CE20010007D /* MPTestDocument.m in Sources */,
|
||||||
4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */,
|
4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */,
|
||||||
4CD25F9318B17A17006098E9 /* KPKTestUUIDAdditions.m in Sources */,
|
4CD25F9318B17A17006098E9 /* KPKTestUUIDAdditions.m in Sources */,
|
||||||
4C19E503178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m in Sources */,
|
4C19E503178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m in Sources */,
|
||||||
|
|||||||
@@ -299,6 +299,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
|||||||
- (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error{
|
- (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error{
|
||||||
self.compositeKey = [[KPKCompositeKey alloc] initWithPassword:password key:keyFileURL];
|
self.compositeKey = [[KPKCompositeKey alloc] initWithPassword:password key:keyFileURL];
|
||||||
self.tree = [[KPKTree alloc] initWithData:self.encryptedData password:self.compositeKey error:error];
|
self.tree = [[KPKTree alloc] initWithData:self.encryptedData password:self.compositeKey error:error];
|
||||||
|
/* clear out the encrypted data as we do not need it for now */
|
||||||
|
self.encryptedData = nil;
|
||||||
|
|
||||||
BOOL isUnlocked = (nil != self.tree);
|
BOOL isUnlocked = (nil != self.tree);
|
||||||
if(isUnlocked) {
|
if(isUnlocked) {
|
||||||
@@ -356,7 +358,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)encrypted {
|
- (BOOL)encrypted {
|
||||||
return (self.tree == nil);
|
/* we have an encrypted document if there's data loaded but no tree set */
|
||||||
|
return (nil != self.encryptedData && self.tree == nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (KPKGroup *)root {
|
- (KPKGroup *)root {
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
[self.URLTextField bind:NSValueBinding toObject:self.entry withKeyPath:NSStringFromSelector(@selector(url)) options:nil];
|
[self.URLTextField bind:NSValueBinding toObject:self.entry withKeyPath:NSStringFromSelector(@selector(url)) options:nil];
|
||||||
[self.expiresCheckButton bind:NSTitleBinding
|
[self.expiresCheckButton bind:NSTitleBinding
|
||||||
toObject:self.entry.timeInfo
|
toObject:self.entry.timeInfo
|
||||||
withKeyPath:NSStringFromSelector(@selector(expiryTime))
|
withKeyPath:NSStringFromSelector(@selector(expirationDate))
|
||||||
options:@{ NSValueTransformerNameBindingOption:MPExpiryDateValueTransformer }];
|
options:@{ NSValueTransformerNameBindingOption:MPExpiryDateValueTransformer }];
|
||||||
[self.expiresCheckButton bind:NSValueBinding toObject:self.entry.timeInfo withKeyPath:NSStringFromSelector(@selector(expires)) options:nil];
|
[self.expiresCheckButton bind:NSValueBinding toObject:self.entry.timeInfo withKeyPath:NSStringFromSelector(@selector(expires)) options:nil];
|
||||||
[self.tagsTokenField bind:NSValueBinding toObject:self.entry withKeyPath:NSStringFromSelector(@selector(tags)) options:nil];
|
[self.tagsTokenField bind:NSValueBinding toObject:self.entry withKeyPath:NSStringFromSelector(@selector(tags)) options:nil];
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
+ (NSString *)timeInfoModificationTimeKeyPath {
|
+ (NSString *)timeInfoModificationTimeKeyPath {
|
||||||
static NSString *timeInfoModificationTimeKeyPath;
|
static NSString *timeInfoModificationTimeKeyPath;
|
||||||
if(nil == timeInfoModificationTimeKeyPath) {
|
if(nil == timeInfoModificationTimeKeyPath) {
|
||||||
timeInfoModificationTimeKeyPath = [[NSString alloc] initWithFormat:@"%@.%@", NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(lastModificationTime))];
|
timeInfoModificationTimeKeyPath = [[NSString alloc] initWithFormat:@"%@.%@", NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(modificationDate))];
|
||||||
}
|
}
|
||||||
return timeInfoModificationTimeKeyPath;
|
return timeInfoModificationTimeKeyPath;
|
||||||
}
|
}
|
||||||
@@ -320,7 +320,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
NSString *modificatoinTimeKeyPath = [NSString stringWithFormat:@"%@.%@.%@",
|
NSString *modificatoinTimeKeyPath = [NSString stringWithFormat:@"%@.%@.%@",
|
||||||
NSStringFromSelector(@selector(objectValue)),
|
NSStringFromSelector(@selector(objectValue)),
|
||||||
NSStringFromSelector(@selector(timeInfo)),
|
NSStringFromSelector(@selector(timeInfo)),
|
||||||
NSStringFromSelector(@selector(lastModificationTime))];
|
NSStringFromSelector(@selector(modificationDate))];
|
||||||
|
|
||||||
[view.textField bind:NSValueBinding toObject:view withKeyPath:modificatoinTimeKeyPath options:nil];
|
[view.textField bind:NSValueBinding toObject:view withKeyPath:modificatoinTimeKeyPath options:nil];
|
||||||
return view;
|
return view;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
if(self.group) {
|
if(self.group) {
|
||||||
[self.titleTextField bind:NSValueBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(name)) options:nil];
|
[self.titleTextField bind:NSValueBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(name)) options:nil];
|
||||||
[self.expiresCheckButton bind:NSValueBinding toObject:self.group.timeInfo withKeyPath:NSStringFromSelector(@selector(expires)) options:nil];
|
[self.expiresCheckButton bind:NSValueBinding toObject:self.group.timeInfo withKeyPath:NSStringFromSelector(@selector(expires)) options:nil];
|
||||||
[self.expiresCheckButton bind:NSTitleBinding toObject:self.group.timeInfo withKeyPath:NSStringFromSelector(@selector(expiryTime)) options:@{ NSValueTransformerNameBindingOption:MPExpiryDateValueTransformer }];
|
[self.expiresCheckButton bind:NSTitleBinding toObject:self.group.timeInfo withKeyPath:NSStringFromSelector(@selector(expirationDate)) options:@{ NSValueTransformerNameBindingOption:MPExpiryDateValueTransformer }];
|
||||||
[self.autotypePopupButton bind:NSSelectedTagBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(isAutoTypeEnabled)) options:nil];
|
[self.autotypePopupButton bind:NSSelectedTagBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(isAutoTypeEnabled)) options:nil];
|
||||||
[self.autotypeSequenceTextField bind:NSValueBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(defaultAutoTypeSequence)) options:nil];
|
[self.autotypeSequenceTextField bind:NSValueBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(defaultAutoTypeSequence)) options:nil];
|
||||||
[self.searchPopupButton bind:NSSelectedTagBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(isSearchEnabled)) options:nil];
|
[self.searchPopupButton bind:NSSelectedTagBinding toObject:self.group withKeyPath:NSStringFromSelector(@selector(isSearchEnabled)) options:nil];
|
||||||
|
|||||||
@@ -224,8 +224,8 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
MPDatePickingViewController *controller = [[MPDatePickingViewController alloc] init];
|
MPDatePickingViewController *controller = [[MPDatePickingViewController alloc] init];
|
||||||
controller.popover = self.popover;
|
controller.popover = self.popover;
|
||||||
MPDocument *document = self.windowController.document;
|
MPDocument *document = self.windowController.document;
|
||||||
if(document.selectedItem.timeInfo.expiryTime) {
|
if(document.selectedItem.timeInfo.expirationDate) {
|
||||||
controller.date = document.selectedItem.timeInfo.expiryTime;
|
controller.date = document.selectedItem.timeInfo.expirationDate;
|
||||||
}
|
}
|
||||||
self.popover.contentViewController = controller;
|
self.popover.contentViewController = controller;
|
||||||
[self.popover showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSMinYEdge];
|
[self.popover showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSMinYEdge];
|
||||||
@@ -267,7 +267,7 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
|
|
||||||
- (void)_setExpiryDate:(NSDate *)date {
|
- (void)_setExpiryDate:(NSDate *)date {
|
||||||
MPDocument *document = [[self windowController] document];
|
MPDocument *document = [[self windowController] document];
|
||||||
document.selectedItem.timeInfo.expiryTime = date;
|
document.selectedItem.timeInfo.expirationDate = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)testSearch {
|
- (void)testSearch {
|
||||||
|
XCTFail(@"Missing Test");
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -12,18 +12,27 @@
|
|||||||
#import "KPKTree.h"
|
#import "KPKTree.h"
|
||||||
#import "KPKCompositeKey.h"
|
#import "KPKCompositeKey.h"
|
||||||
|
|
||||||
@interface MPDatabaseCreation : XCTestCase
|
@interface MPTestDocument : XCTestCase
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPDatabaseCreation
|
@implementation MPTestDocument
|
||||||
|
|
||||||
- (void)testCreateNewDatabase {
|
- (void)testCreateEmptyDocument {
|
||||||
MPDocument *document = [[MPDocument alloc] init];
|
MPDocument *document = [[MPDocument alloc] init];
|
||||||
XCTAssertNotNil(document, @"Document should be created");
|
XCTAssertNotNil(document, @"Document should be created");
|
||||||
|
XCTAssertNil(document.tree, @"Allocated document should not have a tree");
|
||||||
|
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted without a tree");
|
||||||
|
XCTAssertNil(document.compositeKey, @"Document shoudl have not key at all");
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testCreateUntitledDocument {
|
||||||
|
MPDocument *document = [[MPDocument alloc] initWithType:@"" error:nil];
|
||||||
|
XCTAssertNotNil(document, @"Document should be created");
|
||||||
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in default 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.encrypted, @"Document cannot be encrypted at creation");
|
||||||
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");
|
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Reference in New Issue
Block a user