Refactored password handling in Document. Now only the composite key is stored and not the plain password and key file URL. This for now breaks the change password dialog a bit. Needs to be addressed.

Started conceptualising for auto type functionality
This commit is contained in:
michael starke
2013-10-31 21:10:10 +01:00
parent 55b4ce648f
commit 8f6622102b
18 changed files with 399 additions and 106 deletions

View File

@@ -7,7 +7,7 @@
//
#import "KPKTestXmlLoading.h"
#import "KPKPassword.h"
#import "KPKCompositeKey.h"
#import "KPKTree+Serializing.h"
#import "KPKEntry.h"
@@ -19,7 +19,7 @@
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdbx"];
_data = [NSData dataWithContentsOfURL:url];
_password = [[KPKPassword alloc] initWithPassword:@"1234" key:nil];
_password = [[KPKCompositeKey alloc] initWithPassword:@"1234" key:nil];
}
- (void)tearDown {
@@ -39,7 +39,7 @@
- (void)testAutotypeLoading {
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [myBundle URLForResource:@"Autotype_test" withExtension:@"kdbx"];
KPKPassword *password = [[KPKPassword alloc] initWithPassword:@"test" key:nil];
KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"test" key:nil];
NSError *error;
KPKTree *tree = [[KPKTree alloc] initWithContentsOfUrl:url password:password error:&error];
STAssertNotNil(tree, @"Tree shoud be loaded");