mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 03:32:40 +00:00
Fixed layout issues in Group inspector
Added key-file generator fixes #25 #76 Improvements on the context menu toolbar button to add templates entries
This commit is contained in:
13
MacPassTests/KPKTestKeyfileParsing.h
Normal file
13
MacPassTests/KPKTestKeyfileParsing.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// KPKTestKeyfileParsing.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 13.08.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <SenTestingKit/SenTestingKit.h>
|
||||
|
||||
@interface KPKTestKeyfileParsing : SenTestCase
|
||||
|
||||
@end
|
||||
47
MacPassTests/KPKTestKeyfileParsing.m
Normal file
47
MacPassTests/KPKTestKeyfileParsing.m
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// KPKTestKeyfileParsing.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 13.08.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KPKTestKeyfileParsing.h"
|
||||
#import "NSData+Keyfile.h"
|
||||
|
||||
@implementation KPKTestKeyfileParsing
|
||||
|
||||
- (void)testXmlKeyfileLoadingValidFile {
|
||||
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
|
||||
NSURL *url = [myBundle URLForResource:@"Keepass2Key" withExtension:@"xml"];
|
||||
NSError *error;
|
||||
NSData *data = [NSData dataWithContentsOfKeyFile:url version:KPKXmlVersion error:&error];
|
||||
STAssertNotNil(data, @"Data should be loaded");
|
||||
STAssertNil(error, @"No error should occur on keyfile loading");
|
||||
}
|
||||
|
||||
- (void)testXmlKeyfileLoadingCorruptData {
|
||||
STAssertFalse(NO, @"Not Implemented");
|
||||
}
|
||||
|
||||
- (void)testXmlKeyfileLoadingMissingVersion {
|
||||
STAssertFalse(NO, @"Not Implemented");
|
||||
}
|
||||
|
||||
- (void)testXmlKeyfileLoadingLowerVersion {
|
||||
STAssertFalse(NO, @"Not Implemented");
|
||||
}
|
||||
|
||||
- (void)testXmlKeyfilGeneration {
|
||||
NSData *data = [NSData generateKeyfiledataForVersion:KPKXmlVersion];
|
||||
// Test if structure is sound;
|
||||
STAssertNotNil(data, @"Keydata should have been generated");
|
||||
}
|
||||
|
||||
- (void)testLegacyKeyfileGeneration {
|
||||
NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion];
|
||||
// test if strucutre is sound;
|
||||
STAssertNotNil(data, @"Keydata should have been generated");
|
||||
}
|
||||
|
||||
@end
|
||||
9
MacPassTests/Keyfiles/Keepass2Key.xml
Normal file
9
MacPassTests/Keyfiles/Keepass2Key.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<KeyFile>
|
||||
<Meta>
|
||||
<Version>1.00</Version>
|
||||
</Meta>
|
||||
<Key>
|
||||
<Data>L8JyIjlAd3SowrQPm6ZaR9mMolm/7iL6T1GJRGBNrAE=</Data>
|
||||
</Key>
|
||||
</KeyFile>
|
||||
Reference in New Issue
Block a user