Entropy is now calculated for Custom Alphabets in Password Generator View

Custom String in Password Generator View are now filtered to only include unique characters
This commit is contained in:
michael starke
2013-08-04 03:41:09 +02:00
parent 9d22494bf4
commit 450bc3d4dd
20 changed files with 902 additions and 279 deletions

View File

@@ -12,7 +12,6 @@
4C01C245176500C40016D5D0 /* HNHLevelIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */; };
4C055E74179620BF00BD2BAB /* NSString+CommandString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C055E73179620BF00BD2BAB /* NSString+CommandString.m */; };
4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */; };
4C16BA6217879A3C002B42BD /* MPPasswordStringFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C16BA6117879A3C002B42BD /* MPPasswordStringFormatter.m */; };
4C17D8E517A1C780006C8C1E /* MPDocumentWindowDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C17D8E417A1C780006C8C1E /* MPDocumentWindowDelegate.m */; };
4C1842AB179B027800E2F5BC /* KPKDeletedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842AA179B027800E2F5BC /* KPKDeletedNode.m */; };
4C1842AF179B211C00E2F5BC /* KPKXmlTreeReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842AE179B211C00E2F5BC /* KPKXmlTreeReader.m */; };
@@ -23,7 +22,6 @@
4C1842C0179B5BFD00E2F5BC /* NSData+CommonCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842BF179B5BFD00E2F5BC /* NSData+CommonCrypto.m */; };
4C1842C3179B69E700E2F5BC /* NSData+HashedData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842C2179B69E700E2F5BC /* NSData+HashedData.m */; };
4C1842C6179BF52100E2F5BC /* KPKLegacyHeaderReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842C5179BF52000E2F5BC /* KPKLegacyHeaderReader.m */; };
4C1842CA179C616700E2F5BC /* KPKTreeCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842C9179C616700E2F5BC /* KPKTreeCryptor.m */; };
4C1842D0179C64DD00E2F5BC /* KPKLegacyTreeCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842CF179C64DD00E2F5BC /* KPKLegacyTreeCryptor.m */; };
4C1842D3179C64F000E2F5BC /* KPKXmlTreeCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842D2179C64EF00E2F5BC /* KPKXmlTreeCryptor.m */; };
4C18816C179E06920045C5B7 /* TrashBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C18816B179E06920045C5B7 /* TrashBar.xib */; };
@@ -211,6 +209,7 @@
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 */; };
4CAC614317AD319200023F9E /* KPKTestXmlParsing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAC614217AD319200023F9E /* KPKTestXmlParsing.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 */; };
@@ -257,6 +256,7 @@
4CE5B54B173AFBA700207B39 /* MPDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE5B549173AFBA700207B39 /* MPDocument.m */; };
4CE8246F16E2E93400573141 /* MPOverlayWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */; };
4CE8247516E2F2B900573141 /* MPOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8247416E2F2B900573141 /* MPOverlayView.m */; };
4CECB31717AC326D00EAFB0F /* KPKLegacyWritingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CECB31617AC326D00EAFB0F /* KPKLegacyWritingTest.m */; };
4CF1F0CA1786B37900CD920E /* NSData+Gzip.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF1F0C81786B37900CD920E /* NSData+Gzip.m */; };
4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CF29BF317879D0000851B60 /* 26_FileSaveTemplate.pdf */; };
4CF62B86179385D700B660B6 /* KPKAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF62B85179385D700B660B6 /* KPKAttribute.m */; };
@@ -286,8 +286,8 @@
4C055E73179620BF00BD2BAB /* NSString+CommandString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+CommandString.m"; sourceTree = "<group>"; };
4C10412A178CDD44001B5239 /* NSDate+Humanized.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Humanized.h"; sourceTree = "<group>"; };
4C10412B178CDD44001B5239 /* NSDate+Humanized.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Humanized.m"; sourceTree = "<group>"; };
4C16BA6017879A3C002B42BD /* MPPasswordStringFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordStringFormatter.h; sourceTree = "<group>"; };
4C16BA6117879A3C002B42BD /* MPPasswordStringFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordStringFormatter.m; sourceTree = "<group>"; };
4C13904C17ADD1A300A62934 /* KPKTreeCrypting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPKTreeCrypting.h; sourceTree = "<group>"; };
4C13904D17ADD3BE00A62934 /* KPKTreeWriting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPKTreeWriting.h; sourceTree = "<group>"; };
4C17D8E317A1C780006C8C1E /* MPDocumentWindowDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDocumentWindowDelegate.h; sourceTree = "<group>"; };
4C17D8E417A1C780006C8C1E /* MPDocumentWindowDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocumentWindowDelegate.m; sourceTree = "<group>"; };
4C1842A9179B027700E2F5BC /* KPKDeletedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKDeletedNode.h; sourceTree = "<group>"; };
@@ -310,8 +310,6 @@
4C1842C4179BF51F00E2F5BC /* KPKLegacyHeaderReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKLegacyHeaderReader.h; sourceTree = "<group>"; };
4C1842C5179BF52000E2F5BC /* KPKLegacyHeaderReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyHeaderReader.m; sourceTree = "<group>"; };
4C1842C7179BF6A100E2F5BC /* KPKLegacyHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KPKLegacyHeader.h; path = Format/KPKLegacyHeader.h; sourceTree = "<group>"; };
4C1842C8179C616600E2F5BC /* KPKTreeCryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTreeCryptor.h; sourceTree = "<group>"; };
4C1842C9179C616700E2F5BC /* KPKTreeCryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTreeCryptor.m; sourceTree = "<group>"; };
4C1842CE179C64DC00E2F5BC /* KPKLegacyTreeCryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKLegacyTreeCryptor.h; sourceTree = "<group>"; };
4C1842CF179C64DD00E2F5BC /* KPKLegacyTreeCryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyTreeCryptor.m; sourceTree = "<group>"; };
4C1842D1179C64EF00E2F5BC /* KPKXmlTreeCryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKXmlTreeCryptor.h; sourceTree = "<group>"; };
@@ -664,6 +662,8 @@
4CA23358176DBFE100F0B6AC /* MPLockDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPLockDaemon.h; sourceTree = "<group>"; };
4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPLockDaemon.m; sourceTree = "<group>"; };
4CAAFDD51787AED60013FCF9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = "<group>"; };
4CAC614117AD319200023F9E /* KPKTestXmlParsing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestXmlParsing.h; sourceTree = "<group>"; };
4CAC614217AD319200023F9E /* KPKTestXmlParsing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestXmlParsing.m; sourceTree = "<group>"; };
4CAD745615B887FD00104512 /* DDXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDXMLElementAdditions.h; sourceTree = "<group>"; };
4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDXMLElementAdditions.m; sourceTree = "<group>"; };
4CAD745915B887FD00104512 /* NSString+DDXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+DDXML.h"; sourceTree = "<group>"; };
@@ -751,6 +751,8 @@
4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayWindowController.m; sourceTree = "<group>"; };
4CE8247316E2F2B900573141 /* MPOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOverlayView.h; sourceTree = "<group>"; };
4CE8247416E2F2B900573141 /* MPOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayView.m; sourceTree = "<group>"; };
4CECB31517AC326D00EAFB0F /* KPKLegacyWritingTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKLegacyWritingTest.h; sourceTree = "<group>"; };
4CECB31617AC326D00EAFB0F /* KPKLegacyWritingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyWritingTest.m; sourceTree = "<group>"; };
4CF1F0C81786B37900CD920E /* NSData+Gzip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Gzip.m"; sourceTree = "<group>"; };
4CF1F0C91786B37900CD920E /* NSData+Gzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Gzip.h"; sourceTree = "<group>"; };
4CF29BF317879D0000851B60 /* 26_FileSaveTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 26_FileSaveTemplate.pdf; sourceTree = "<group>"; };
@@ -1111,8 +1113,6 @@
4C01C2411764D8980016D5D0 /* MPContextMenuHelper.m */,
4CA23358176DBFE100F0B6AC /* MPLockDaemon.h */,
4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */,
4C16BA6017879A3C002B42BD /* MPPasswordStringFormatter.h */,
4C16BA6117879A3C002B42BD /* MPPasswordStringFormatter.m */,
4C4B7EF617A4B335000234C7 /* MPUniqueCharactersFormatter.h */,
4C4B7EF717A4B335000234C7 /* MPUniqueCharactersFormatter.m */,
);
@@ -1193,6 +1193,10 @@
4C79E80517A9400500AC6CD2 /* KPKTestNSCoding.m */,
4C79E80717A9485600AC6CD2 /* KPKTestNSCopying.h */,
4C79E80817A9485600AC6CD2 /* KPKTestNSCopying.m */,
4CECB31517AC326D00EAFB0F /* KPKLegacyWritingTest.h */,
4CECB31617AC326D00EAFB0F /* KPKLegacyWritingTest.m */,
4CAC614117AD319200023F9E /* KPKTestXmlParsing.h */,
4CAC614217AD319200023F9E /* KPKTestXmlParsing.m */,
);
path = MacPassTests;
sourceTree = "<group>";
@@ -1617,8 +1621,6 @@
children = (
4CDB5C401794AA4F0017667E /* KPKTree+Serializing.h */,
4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */,
4C1842C8179C616600E2F5BC /* KPKTreeCryptor.h */,
4C1842C9179C616700E2F5BC /* KPKTreeCryptor.m */,
4C1842BA179B434C00E2F5BC /* KPKXmlHeaderReader.h */,
4C1842BB179B434C00E2F5BC /* KPKXmlHeaderReader.m */,
4C79E80117A9187400AC6CD2 /* KPKXmlHeaderWriter.h */,
@@ -1637,9 +1639,11 @@
4C1842C5179BF52000E2F5BC /* KPKLegacyHeaderReader.m */,
4C1842CE179C64DC00E2F5BC /* KPKLegacyTreeCryptor.h */,
4C1842CF179C64DD00E2F5BC /* KPKLegacyTreeCryptor.m */,
4C13904C17ADD1A300A62934 /* KPKTreeCrypting.h */,
4C1842D4179C6DE400E2F5BC /* KPKHeaderReading.h */,
4C1842D5179C6F1800E2F5BC /* KPKHeaderWriting.h */,
4CCEDE2F179F550D008402BE /* KPKTreeReading.h */,
4C13904D17ADD3BE00A62934 /* KPKTreeWriting.h */,
4CCEDE30179F5B6C008402BE /* KPKDataStreamReader.h */,
4CCEDE31179F5B6C008402BE /* KPKDataStreamReader.m */,
4C5FA86B17A5F26800C781C9 /* KPKDataStreamWriter.h */,
@@ -1884,6 +1888,8 @@
4CFC8743179DFD3E000DFC03 /* KPKXmlLoadingTest.m in Sources */,
4C79E80617A9400500AC6CD2 /* KPKTestNSCoding.m in Sources */,
4C79E80917A9485600AC6CD2 /* KPKTestNSCopying.m in Sources */,
4CECB31717AC326D00EAFB0F /* KPKLegacyWritingTest.m in Sources */,
4CAC614317AD319200023F9E /* KPKTestXmlParsing.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2033,7 +2039,6 @@
4C5FE9AE17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m in Sources */,
4CF1F0CA1786B37900CD920E /* NSData+Gzip.m in Sources */,
4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */,
4C16BA6217879A3C002B42BD /* MPPasswordStringFormatter.m in Sources */,
4CD6C5AE1789FDE6000891F6 /* HNHRoundedSecureTextField.m in Sources */,
4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */,
4CD3ABBA178F71B50073F5C5 /* KPKTree.m in Sources */,
@@ -2067,7 +2072,6 @@
4C1842C0179B5BFD00E2F5BC /* NSData+CommonCrypto.m in Sources */,
4C1842C3179B69E700E2F5BC /* NSData+HashedData.m in Sources */,
4C1842C6179BF52100E2F5BC /* KPKLegacyHeaderReader.m in Sources */,
4C1842CA179C616700E2F5BC /* KPKTreeCryptor.m in Sources */,
4C1842D0179C64DD00E2F5BC /* KPKLegacyTreeCryptor.m in Sources */,
4C1842D3179C64F000E2F5BC /* KPKXmlTreeCryptor.m in Sources */,
4CFC873B179DEDF3000DFC03 /* KPKMetaData.m in Sources */,

View File

@@ -107,7 +107,7 @@
<object class="NSImageCell" key="NSCell" id="152819686">
<int key="NSCellFlags">134217728</int>
<int key="NSCellFlags2">33554432</int>
<object class="NSCustomResource" key="NSContents">
<object class="NSCustomResource" key="NSContents" id="1066877891">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSActionTemplate</string>
</object>
@@ -126,8 +126,8 @@
<array class="NSMutableArray" key="NSSubviews">
<object class="NSButton" id="830540359">
<reference key="NSNextResponder" ref="381395509"/>
<int key="NSvFlags">-2147483380</int>
<string key="NSFrame">{{20, 2}, {59, 25}}</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 2}, {238, 25}}</string>
<reference key="NSSuperview" ref="381395509"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
@@ -142,10 +142,7 @@
<reference key="NSControlView" ref="830540359"/>
<int key="NSButtonFlags">918306816</int>
<int key="NSButtonFlags2">163</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">07_NotepadTemplate</string>
</object>
<reference key="NSNormalImage" ref="1066877891"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -178,7 +175,7 @@
<string key="NSFrameSize">{278, 369}</string>
<reference key="NSSuperview" ref="45251842"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="381395509"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:28</string>
</object>
<string key="NSLabel">Entry</string>
@@ -601,6 +598,22 @@
<int key="objectID">2930</int>
<reference key="object" ref="381395509"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="46370971">
<reference key="firstItem" ref="381395509"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
<reference key="secondItem" ref="830540359"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="381395509"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="696932551">
<reference key="firstItem" ref="830540359"/>
<int key="firstAttribute">10</int>
@@ -870,6 +883,11 @@
<reference key="object" ref="696932551"/>
<reference key="parent" ref="381395509"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3115</int>
<reference key="object" ref="46370971"/>
<reference key="parent" ref="381395509"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -911,6 +929,7 @@
<reference ref="574545128"/>
<reference ref="618180937"/>
<reference ref="696932551"/>
<reference ref="46370971"/>
</array>
<boolean value="NO" key="2930.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="2930.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -954,12 +973,13 @@
<string key="3110.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="3111.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="3112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="3115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">3114</int>
<int key="maxID">3115</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1059,10 +1079,10 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="07_NotepadTemplate">{128, 128}</string>
<string key="NSActionTemplate">{15, 15}</string>
</dictionary>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">NSActionTemplate</string>
<string key="NS.object.0">{15, 15}</string>
</object>
<bool key="IBDocument.UseAutolayout">YES</bool>
</data>
</archive>

File diff suppressed because it is too large Load Diff

View File

@@ -524,7 +524,7 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1004379867">
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags">-2075131840</int>
<int key="NSCellFlags2">272631104</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="851874085"/>

View File

@@ -38,10 +38,6 @@
#import "DDXMLNode.h"
#import "KPKPassword.h"
#import "KPKTreeCryptor.h"
#import "KPKTree.h"
NSString *const MPDocumentDidAddGroupNotification = @"com.hicknhack.macpass.MPDocumentDidAddGroupNotification";
NSString *const MPDocumentDidAddEntryNotification = @"com.hicknhack.macpass.MPDocumentDidAddEntryNotification";
NSString *const MPDocumentDidRevertNotifiation = @"com.hicknhack.macpass.MPDocumentDidRevertNotifiation";
@@ -196,11 +192,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
#pragma mark Lock/Unlock/Decrypt
- (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL {
// KPKPassword *pwd = [[KPKPassword alloc] initWithPassword:password key:nil];
//
// KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_fileData password:pwd];
// KPKTree *tree = [cryptor decryptTree:NULL];
self.key = keyFileURL;
self.password = [password length] > 0 ? password : nil;
@try {

View File

@@ -8,7 +8,7 @@
#import "MPViewController.h"
@interface MPPasswordCreatorViewController : MPViewController
@interface MPPasswordCreatorViewController : MPViewController <NSTextFieldDelegate>
@property (copy, readonly) NSString *generatedPassword;

View File

@@ -52,9 +52,10 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
@property (weak) IBOutlet NSTextField *entropyTextField;
@property (weak) IBOutlet NSLevelIndicator *entropyIndicator;
@property (assign, nonatomic) BOOL useCustomString;
@property (assign, nonatomic) NSUInteger passwordLength;
@property (assign, nonatomic) CGFloat entropy;
@property (nonatomic, copy) NSString *customString;
@property (nonatomic, assign) BOOL useCustomString;
@property (nonatomic, assign) NSUInteger passwordLength;
@property (nonatomic, assign) CGFloat entropy;
- (IBAction)_generatePassword:(id)sender;
- (IBAction)_toggleCharacters:(id)sender;
@@ -72,6 +73,7 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
_passwordLength = 12;
_characterFlags = MPPasswordCharactersAll;
_useCustomString = NO;
_customString = @"";
_entropy = 0.0;
}
return self;
@@ -93,8 +95,10 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
[self.entropyIndicator bind:NSValueBinding toObject:self withKeyPath:@"entropy" options:nil];
[self.entropyTextField bind:NSValueBinding toObject:self withKeyPath:@"entropy" options:nil];
[self.customCharactersTextField setDelegate:self];
[_customButton bind:NSValueBinding toObject:self withKeyPath:@"useCustomString" options:nil];
[_numbersButton setTag:MPPasswordCharactersNumbers];
[_upperCaseButton setTag:MPPasswordCharactersUpperCase];
[_lowerCaseButton setTag:MPPasswordCharactersLowerCase];
@@ -104,6 +108,9 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
[self _generatePassword:nil];
}
#pragma mark -
#pragma mark Actions
- (IBAction)_generatePassword:(id)sender {
if(_useCustomString) {
if([[_customCharactersTextField stringValue] length] > 0) {
@@ -137,6 +144,9 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
}
#pragma mark -
#pragma mark Custom Setter
- (void)setPassword:(NSString *)password {
if(![_password isEqualToString:password]) {
_password = [password copy];
@@ -159,6 +169,18 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
}
}
#pragma mark -
#pragma mark NSTextFieldDelegate
- (void)controlTextDidChange:(NSNotification *)obj {
if([obj object] == self.customCharactersTextField) {
[self _generatePassword:nil];
}
}
#pragma mark -
#pragma mark Helper
- (void)_resetCharacters {
if(_useCustomString) {
[_customButton setState:NSOnState];

View File

@@ -1,13 +0,0 @@
//
// MPPasswordStringFormatter.h
// MacPass
//
// Created by Michael Starke on 06.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MPPasswordStringFormatter : NSFormatter
@end

View File

@@ -1,13 +0,0 @@
//
// MPPasswordStringFormatter.m
// MacPass
//
// Created by Michael Starke on 06.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPPasswordStringFormatter.h"
@implementation MPPasswordStringFormatter
@end

View File

@@ -27,9 +27,16 @@
originalString:(NSString *)origString
originalSelectedRange:(NSRange)origSelRange
errorDescription:(NSString **)error {
return YES;
NSInteger newLenght = [*partialStringPtr length];
NSInteger oldLenght = [origString length];
if( oldLenght == 0 || (newLenght < oldLenght)) {
return YES;
}
NSCharacterSet *newCharacterSet = [NSCharacterSet characterSetWithCharactersInString:*partialStringPtr];
NSCharacterSet *oldCharacterSet = [NSCharacterSet characterSetWithCharactersInString:origString];
return ![oldCharacterSet isSupersetOfSet:newCharacterSet];
}
@end

View File

@@ -73,12 +73,11 @@ static NSString *allowedCharactersString(MPPasswordCharacterFlags flags) {
}
- (CGFloat)entropyWhithPossibleCharacterSet:(MPPasswordCharacterFlags)allowedCharacters orCustomCharacters:(NSString *)customCharacters {
if(nil != customCharacters) {
return 0; // We need a sophisticated parser here!
CGFloat alphabetCount = [customCharacters length];
if(nil == customCharacters) {
NSString *stringSet = allowedCharactersString(allowedCharacters);
alphabetCount = [stringSet length];
}
NSString *stringSet = allowedCharactersString(allowedCharacters);
CGFloat alphabetCount = [stringSet length];
CGFloat passwordLegnth = [self length];
return passwordLegnth * ( log10(alphabetCount) / log10(2) );
}

View File

@@ -303,8 +303,8 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="358808223">
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<int key="NSCellFlags">-1805647807</int>
<int key="NSCellFlags2">272631872</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="510117885"/>
<string key="NSCellIdentifier">_NS:9</string>
@@ -576,7 +576,7 @@
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="932376285">
<int key="NSCellFlags">-2074083263</int>
<int key="NSCellFlags2">272631808</int>
<int key="NSCellFlags2">272632384</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport">
<string key="NSName">Menlo-Regular</string>

Binary file not shown.

View File

@@ -7,8 +7,9 @@
//
#import "KPKLegacyLoadingTest.h"
#import "KPKTreeCryptor.h"
#import "KPKTree+Serializing.h"
#import "KPKPassword.h"
#import "KPKErrors.h"
@implementation KPKLegacyLoadingTest
@@ -24,10 +25,19 @@
_password = nil;
}
- (void)testLoading {
KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_data password:_password];
KPKTree *tree = [cryptor decryptTree:NULL];
- (void)testValidFile {
KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:NULL];
STAssertNotNil(tree, @"Loading should result in a tree object");
}
- (void)testInvalidFile {
NSError *error;
uint8 bytes[] = {0x00,0x11,0x22,0x33,0x44};
NSData *data = [NSData dataWithBytes:bytes length:5];
KPKTree *tree = [[KPKTree alloc] initWithData:data password:nil error:&error];
STAssertNil(tree, @"Tree should be nil with invalid data");
STAssertNotNil(error, @"Error object should have been created");
STAssertTrue(KPKErrorUnknownFileFormat == [error code], @"Error should be Unknown file format");
}
@end

View File

@@ -0,0 +1,17 @@
//
// KPKLegacyWritingTest.h
// MacPass
//
// Created by Michael Starke on 02.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@class KPKPassword;
@interface KPKLegacyWritingTest : SenTestCase {
NSData *_data;
KPKPassword *_password;
}
@end

View File

@@ -0,0 +1,36 @@
//
// KPKLegacyWritingTest.m
// MacPass
//
// Created by Michael Starke on 02.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKLegacyWritingTest.h"
#import "KPKPassword.h"
#import "KPKTree+Serializing.h"
@implementation KPKLegacyWritingTest
- (void)setUp {
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdb"];
_data = [NSData dataWithContentsOfURL:url];
_password = [[KPKPassword alloc] initWithPassword:@"1234" key:nil];
}
- (void)tearDown {
_data = nil;
_password = nil;
}
- (void)testWriting {
NSError *error = nil;
KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:&error];
NSData *data = [tree encryptWithPassword:_password forVersion:KPKVersion1 error:&error];
}
@end

View File

@@ -0,0 +1,13 @@
//
// KPKTestXmlParsing.h
// MacPass
//
// Created by Michael Starke on 03.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface KPKTestXmlParsing : SenTestCase
@end

View File

@@ -0,0 +1,47 @@
//
// KPKTestXmlParsing.m
// MacPass
//
// Created by Michael Starke on 03.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestXmlParsing.h"
#import "KPKXmlTreeReader.h"
#import "KPKErrors.h"
#import "DDXMLDocument.h"
@implementation KPKTestXmlParsing
- (void)testEmptyXmlFile {
DDXMLDocument *document = [[DDXMLDocument alloc] initWithXMLString:@"" options:0 error:NULL];
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error;
KPKTree *tree = [reader tree:&error];
STAssertNil(tree, @"No Tree form emptry data");
STAssertNotNil(error, @"Error Object should be provided");
STAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data");
}
- (void)testNoNodeXmlFile {
DDXMLDocument *document = [[DDXMLDocument alloc] initWithXMLString:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><root></root>" options:0 error:NULL];
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error;
KPKTree *tree = [reader tree:&error];
STAssertNil(tree, @"No Tree form emptry data");
STAssertNotNil(error, @"Error Object should be provided");
STAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing");
}
- (void)testNoRoodXmlFil {
DDXMLDocument *document = [[DDXMLDocument alloc] initWithXMLString:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><KeePassFile><Root></Root></KeePassFile>" options:0 error:NULL];
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error;
KPKTree *tree = [reader tree:&error];
STAssertNil(tree, @"No Tree form emptry data");
STAssertNotNil(error, @"Error Object should be provided");
STAssertTrue([error code] == KPKErrorXMLRootElementMissing, @"Error Code should be KeePassFile root missing");
}
@end

View File

@@ -7,10 +7,9 @@
//
#import "KPKXmlLoadingTest.h"
#import "KPKTreeCryptor.h"
#import "KPKPassword.h"
#import "KPKTree.h"
#import "KPKTree+Serializing.h"
#import "KPKEntry.h"
#import "KPKGroup.h"
@@ -29,12 +28,12 @@
}
- (void)testLoading {
KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_data password:_password];
KPKTree *tree = [cryptor decryptTree:NULL];
//STAssertNotNil(tree, @"Loading should result in a tree object");
NSError *error;
KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:&error];
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");
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];