From 537841093760daad7509b541454169a97b0c070c Mon Sep 17 00:00:00 2001 From: michael starke Date: Sat, 27 Jul 2013 02:56:35 +0200 Subject: [PATCH] Updated submodules Unfinished Toolbar Button --- KeePassKit | 2 +- MacPass.xcodeproj/project.pbxproj | 6 ------ MacPass/MPConstants.h | 2 ++ MacPass/MPConstants.m | 4 +++- MacPass/MPToolbarDelegate.m | 1 + .../Databases/Test_Password_1234.kdbx | Bin 1118 -> 1406 bytes MacPassTests/KPKXmlLoadingTest.m | 19 ++++++++++++++++++ MiniKeePassLib | 2 +- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/KeePassKit b/KeePassKit index 92476a50..f1d5b1a7 160000 --- a/KeePassKit +++ b/KeePassKit @@ -1 +1 @@ -Subproject commit 92476a505f75319341f0fcb7fc11eb1e376ad7b1 +Subproject commit f1d5b1a7b2fdaa26cd5fa8ace45770f44c910e44 diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 1ea3b5d0..0676b141 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -196,7 +196,6 @@ 4CA0B2FC15BCAF8600654E32 /* MPSettingsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2FB15BCAF8600654E32 /* MPSettingsWindowController.m */; }; 4CA0E3A7176FAF99004D18CB /* MPDocumentQueryService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0E3A6176FAF99004D18CB /* MPDocumentQueryService.m */; }; 4CA2335A176DBFE100F0B6AC /* MPLockDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */; }; - 4CA7C36C179A98140099C34B /* NSString+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA7C36B179A98140099C34B /* NSString+Base64.m */; }; 4CAD747B15B887FD00104512 /* DDXMLElementAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */; }; 4CAD747C15B887FD00104512 /* NSString+DDXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745A15B887FD00104512 /* NSString+DDXML.m */; }; 4CAD747D15B887FD00104512 /* DDXMLDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745D15B887FD00104512 /* DDXMLDocument.m */; }; @@ -618,8 +617,6 @@ 4CA0E3A6176FAF99004D18CB /* MPDocumentQueryService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocumentQueryService.m; sourceTree = ""; }; 4CA23358176DBFE100F0B6AC /* MPLockDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPLockDaemon.h; sourceTree = ""; }; 4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPLockDaemon.m; sourceTree = ""; }; - 4CA7C36A179A98140099C34B /* NSString+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Base64.h"; sourceTree = ""; }; - 4CA7C36B179A98140099C34B /* NSString+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Base64.m"; sourceTree = ""; }; 4CAAFDD51787AED60013FCF9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = ""; }; 4CAD745615B887FD00104512 /* DDXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDXMLElementAdditions.h; sourceTree = ""; }; 4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDXMLElementAdditions.m; sourceTree = ""; }; @@ -996,8 +993,6 @@ 4C2724D917790E7C00FD8456 /* NSMutableData+Base64.m */, 4C801AFA179310E2002821E3 /* NSString+Hexdata.h */, 4C801AFB179310E2002821E3 /* NSString+Hexdata.m */, - 4CA7C36A179A98140099C34B /* NSString+Base64.h */, - 4CA7C36B179A98140099C34B /* NSString+Base64.m */, ); name = Categories; sourceTree = ""; @@ -1963,7 +1958,6 @@ 4C45100C1798C65C00219998 /* Kdb4Entry+MPAdditions.m in Sources */, 4CFEB36E1799D9CF00AF1868 /* Kdb3Entry+KVOAdditions.m in Sources */, 4C305F36179A0BD70082334F /* KPKIcon.m in Sources */, - 4CA7C36C179A98140099C34B /* NSString+Base64.m in Sources */, 4C1842AB179B027800E2F5BC /* KPKDeletedNode.m in Sources */, 4C1842AF179B211C00E2F5BC /* KPKXmlTreeReader.m in Sources */, 4C1842B2179B28C400E2F5BC /* KPKLegacyTreeReader.m in Sources */, diff --git a/MacPass/MPConstants.h b/MacPass/MPConstants.h index d3134db3..76b59e62 100644 --- a/MacPass/MPConstants.h +++ b/MacPass/MPConstants.h @@ -12,6 +12,8 @@ #import FOUNDATION_EXPORT NSString *const MPPasteBoardType; +FOUNDATION_EXPORT NSString *const MPEntryUTI; +FOUNDATION_EXPORT NSString *const MPGroupUTI; FOUNDATION_EXPORT NSString *const MPErrorDomain; #endif diff --git a/MacPass/MPConstants.m b/MacPass/MPConstants.m index d5e12304..6fb5e239 100644 --- a/MacPass/MPConstants.m +++ b/MacPass/MPConstants.m @@ -9,4 +9,6 @@ #import "MPConstants.h" NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard"; -NSString *const MPErrorDomain = @"com.hicknhack.macpass.error"; \ No newline at end of file +NSString *const MPErrorDomain = @"com.hicknhack.macpass.error"; +NSString *const MPEntryUTI = @"com.hicknhack.macpass.entry"; +NSString *const MPGroupUTI = @"com.hicknhack.macpass.group"; \ No newline at end of file diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 21b9c4df..a643419d 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -100,6 +100,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; fittingRect.size.width = MAX( (CGFloat)32.0,fittingRect.size.width); [button setFrame:fittingRect]; [item setView:button]; + /* Create the Contextual Menu button */ NSMenuItem *menuRepresentation = [[NSMenuItem alloc] initWithTitle:itemLabel action:[self _actionForToolbarItemIdentifier:itemIdentifier] keyEquivalent:@""]; diff --git a/MacPassTests/Databases/Test_Password_1234.kdbx b/MacPassTests/Databases/Test_Password_1234.kdbx index fe1036b700428a538b51cfc4d13fb99074cd3502..08fa7cdf8119e63b8ee0489f5f58c7788bcb6575 100644 GIT binary patch delta 1337 zcmV-91;+Z`2>uF?DIgamTv;}ByF2h4M)uBqV)q$TdzaYILW^F+la@k2A0UxQF@KDW zS@F{Sb#LlmYD`He$JYoT09_LG3i=a@{<~kT9FBQUgS16rJsk4|-n-rAqkwsM_6Z;W zAhiUmC;DoLH$#o^l8-&CxJ}pr{;3NX9hG_pwPr1c3IqTG000001ON>R4GKDK6Blkm znYv>*0(5x_#1HLcTjT`bgmj+q^?wv=)Hc_Sm7v_393AI~s@E>8$u;ZjPb`j_yyhHX zJaTvG&_I^|L`o|Iw4%`)HomyY_O#i{nPVXKmOaN&Vr@Zlb;(AP4|O4u+nI`tA0&SQ z#=6z1#v%i)N&XTqg=|_aTci*fRz6zO#=9)64(_6ks6h*cV=n1{VEy3vV1J!g{17dl zc|iOOR0q;86R*)%)y(E^3}6<2Y;c%qbaGb^6wwKyi6J@OIP=o}3{yEUK4U_nCG7c$ zuH+w4U9nMoXQv~I?5>>M!oujn0eOQsgyYM!CtbwsH!utD1%Dec_?d3z$8e@(3o|nw z?Rz<_vZzt@qP0qf%>Exh;eT6rq1tFMC!KnNV*)#%f>2Df)v7YJv!eR9E5S9Ja$7$O zi+>(MIW^9H-Ql^a4&*kdoUVD+cL6>H6FE>tC^*NWKH$2hXZ4pgYGC4G-OIgyjC&!l z(Kf>lpy^V+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pp?NV;6kl+#0G4vV z?9A;jxNI28aK#3iZc{6JU8Mgn1ixXpl`#9qlUjYxe-;7OBhd1Cm=Az;f2SSgf?0eo z>Rq9;UEWppRBZ4Ifqp@YTK(^jE1IjmAS@n5x4HB@b9aTGN6XoKlz-zPU_~uE|IdZM zT;&DJXlp=b{B3YtX_^YxiIv`6pKQ#oUXt2G)@M4AAxr>m6@)je(ej+9gO;nv3W8(R@S@gUL%mnf`$kTA!jl?#dLGmW_{FZN=N%Hs9n7Zdq(+z)W#jJlm#lMvgl;Y1_RCb{r~^~ diff --git a/MacPassTests/KPKXmlLoadingTest.m b/MacPassTests/KPKXmlLoadingTest.m index 5e6429ea..b2c028fe 100644 --- a/MacPassTests/KPKXmlLoadingTest.m +++ b/MacPassTests/KPKXmlLoadingTest.m @@ -10,6 +10,10 @@ #import "KPKTreeCryptor.h" #import "KPKPassword.h" +#import "KPKTree.h" +#import "KPKEntry.h" +#import "KPKGroup.h" + @implementation KPKXmlLoadingTest - (void)setUp { @@ -28,6 +32,21 @@ KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_data password:_password]; KPKTree *tree = [cryptor decryptTree:NULL]; STAssertNotNil(tree, @"Loading should result in a tree object"); + + STAssertTrue([tree.root.groups count] == 0, @"Tree contains just root group"); + STAssertTrue([tree.root.entries count] == 1, @"Tree has only one entry"); + + KPKEntry *entry = [tree.root.entries lastObject]; + NSMutableData *data = [[NSMutableData alloc] init]; + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; + [entry encodeWithCoder:archiver]; + [archiver finishEncoding]; + + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; + KPKEntry *newEntry = [[KPKEntry alloc] initWithCoder:unarchiver]; + [unarchiver finishDecoding]; + + STAssertTrue([entry.title isEqualToString:newEntry.title], @"Entries must have same attributes"); } @end diff --git a/MiniKeePassLib b/MiniKeePassLib index 14a183af..80c95a1e 160000 --- a/MiniKeePassLib +++ b/MiniKeePassLib @@ -1 +1 @@ -Subproject commit 14a183afd1a7197197c1688190242158dcd077f7 +Subproject commit 80c95a1eadc96259dbfe3f9f4bdb8401b33ae551