From 2d84f2f8f8f9d8ac40fb179371e7d62bbb5bf8e2 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 11 Sep 2013 00:54:26 +0200 Subject: [PATCH] Merged Advanced and Templates of database settings into on - Advanced Added encryption rounds benchmark and setting to security tab (non-functional setter, benchmark works) --- KeePassKit | 2 +- MacPass.xcodeproj/project.pbxproj | 6 + .../xcshareddata/xcschemes/MacPass.xcscheme | 2 +- MacPass/DatabaseSettingsWindow.xib | 1769 +++++++++++------ MacPass/MPDatabaseSettingsWindowController.h | 14 +- MacPass/MPDatabaseSettingsWindowController.m | 40 +- MacPass/MPDocumentWindowController.m | 2 +- MacPass/MPNumericalInputFormatter.h | 13 + MacPass/MPNumericalInputFormatter.m | 46 + MacPass/PasswordEditWindow.xib | 27 +- 10 files changed, 1223 insertions(+), 698 deletions(-) create mode 100644 MacPass/MPNumericalInputFormatter.h create mode 100644 MacPass/MPNumericalInputFormatter.m diff --git a/KeePassKit b/KeePassKit index 05b59b46..da5e32a4 160000 --- a/KeePassKit +++ b/KeePassKit @@ -1 +1 @@ -Subproject commit 05b59b464eb8c52e5ce4047ce1e6311f7d8f7c30 +Subproject commit da5e32a452d5cb0b6fb1096a8d9ee9878be53e14 diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index ebff62c3..40924325 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -38,6 +38,7 @@ 4C19E500178E26EF002F2CD0 /* Test_Password_1234.kdbx in Resources */ = {isa = PBXBuildFile; fileRef = 4C19E4FF178E26EF002F2CD0 /* Test_Password_1234.kdbx */; }; 4C19E503178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */; }; 4C1DDCDD1711ECEB00C98DA3 /* PasswordCreatorWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */; }; + 4C224B4217DFCB2400FF6AEE /* MPNumericalInputFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C224B4117DFCB2400FF6AEE /* MPNumericalInputFormatter.m */; }; 4C245B76176E1E3D0086100E /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C245A6A176E1E3C0086100E /* DDData.m */; }; 4C245B77176E1E3D0086100E /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C245A6C176E1E3C0086100E /* DDNumber.m */; }; 4C245B78176E1E3D0086100E /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C245A6E176E1E3C0086100E /* DDRange.m */; }; @@ -328,6 +329,8 @@ 4C19E501178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabasePasswordAndKeyfile.h; sourceTree = ""; }; 4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabasePasswordAndKeyfile.m; sourceTree = ""; }; 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordCreatorWindow.xib; sourceTree = ""; }; + 4C224B4017DFCB2300FF6AEE /* MPNumericalInputFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNumericalInputFormatter.h; sourceTree = ""; }; + 4C224B4117DFCB2400FF6AEE /* MPNumericalInputFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNumericalInputFormatter.m; sourceTree = ""; }; 4C245A69176E1E3C0086100E /* DDData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDData.h; sourceTree = ""; }; 4C245A6A176E1E3C0086100E /* DDData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDData.m; sourceTree = ""; }; 4C245A6B176E1E3C0086100E /* DDNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDNumber.h; sourceTree = ""; }; @@ -1046,6 +1049,8 @@ 4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */, 4C4B7EF617A4B335000234C7 /* MPUniqueCharactersFormatter.h */, 4C4B7EF717A4B335000234C7 /* MPUniqueCharactersFormatter.m */, + 4C224B4017DFCB2300FF6AEE /* MPNumericalInputFormatter.h */, + 4C224B4117DFCB2400FF6AEE /* MPNumericalInputFormatter.m */, ); name = Helper; sourceTree = ""; @@ -1999,6 +2004,7 @@ 4CC6DB7D17D23DCE002C6091 /* KPKUTIs.m in Sources */, 4CEED1C617D7BD0E007180F1 /* NSError+Messages.m in Sources */, 4C00E33817D8FA3500F37192 /* DDHotKeyCenter.m in Sources */, + 4C224B4217DFCB2400FF6AEE /* MPNumericalInputFormatter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme index e6329ac5..82d6dd66 100644 --- a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme +++ b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme @@ -70,7 +70,7 @@ + isEnabled = "NO"> diff --git a/MacPass/DatabaseSettingsWindow.xib b/MacPass/DatabaseSettingsWindow.xib index 3b1797e6..bf1b227d 100644 --- a/MacPass/DatabaseSettingsWindow.xib +++ b/MacPass/DatabaseSettingsWindow.xib @@ -68,7 +68,6 @@ {{473, 13}, {59, 32}} - _NS:9 YES @@ -97,13 +96,13 @@ {{13, 41}, {520, 307}} - + _NS:9 1 - + 256 @@ -111,7 +110,6 @@ 268 {{136, 209}, {280, 22}} - _NS:9 YES @@ -149,7 +147,6 @@ 268 {{50, 184}, {81, 17}} - _NS:1535 YES @@ -183,7 +180,6 @@ 268 {{25, 212}, {106, 17}} - _NS:1535 YES @@ -204,7 +200,6 @@ 268 {{134, 68}, {120, 26}} - _NS:9 YES @@ -271,7 +266,6 @@ 268 {{39, 73}, {92, 17}} - _NS:1535 YES @@ -292,7 +286,6 @@ 268 {{88, 31}, {43, 17}} - _NS:1535 YES @@ -316,7 +309,6 @@ {{136, 28}, {44, 23}} - _NS:1116 YES @@ -338,28 +330,8 @@ 2322 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - {278, 99} - _NS:13 @@ -422,7 +394,6 @@ {{1, 1}, {278, 99}} - _NS:11 @@ -453,7 +424,6 @@ 256 {{263, 1}, {16, 99}} - _NS:83 NO @@ -466,7 +436,6 @@ -2147483392 {{-100, -100}, {87, 18}} - _NS:33 NO @@ -479,7 +448,6 @@ {{136, 100}, {280, 101}} - _NS:9 133138 @@ -492,8 +460,6 @@ {{10, 33}, {500, 261}} - - _NS:11 @@ -503,14 +469,15 @@ - + 256 268 - {{184, 181}, {98, 18}} + {{184, 216}, {98, 18}} + _NS:9 YES @@ -540,8 +507,9 @@ 268 - {{184, 152}, {133, 18}} + {{184, 187}, {133, 18}} + _NS:9 YES @@ -566,8 +534,9 @@ 268 - {{184, 123}, {130, 18}} + {{184, 158}, {130, 18}} + _NS:9 YES @@ -592,8 +561,9 @@ 268 - {{184, 94}, {95, 18}} + {{184, 129}, {95, 18}} + _NS:9 YES @@ -618,9 +588,10 @@ 268 - {{184, 65}, {107, 18}} + {{184, 100}, {107, 18}} - + + _NS:9 YES @@ -641,11 +612,85 @@ NO + + + 268 + {{29, 62}, {151, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Key encryption rounds: + + _NS:1535 + + + + + NO + + + + 268 + {{185, 60}, {129, 22}} + + + + _NS:9 + YES + + -1804599231 + -1874852800 + + + _NS:9 + + YES + + + + NO + + + + 268 + {{185, 33}, {129, 19}} + + + + _NS:9 + YES + + -2080374784 + 134217728 + Benchmark + + LucidaGrande + 12 + 16 + + _NS:9 + + -2038153216 + 164 + + + 400 + 75 + + NO + {{10, 33}, {500, 261}} + + - Protection + Security @@ -657,7 +702,7 @@ 268 - {{70, 184}, {307, 18}} + {{70, 225}, {307, 18}} _NS:9 @@ -683,7 +728,7 @@ 268 - {{70, 85}, {138, 18}} + {{70, 126}, {138, 18}} _NS:9 @@ -709,9 +754,9 @@ 268 - {{112, 62}, {187, 18}} + {{112, 103}, {187, 18}} - + _NS:9 YES @@ -735,7 +780,7 @@ 268 - {{111, 161}, {98, 17}} + {{111, 202}, {98, 17}} _NS:1535 @@ -755,7 +800,7 @@ 268 - {{214, 159}, {96, 22}} + {{214, 200}, {96, 22}} _NS:9 @@ -776,7 +821,7 @@ 268 - {{315, 156}, {19, 27}} + {{315, 197}, {19, 27}} _NS:1099 @@ -795,7 +840,7 @@ 268 - {{212, 81}, {220, 26}} + {{212, 122}, {220, 26}} _NS:9 @@ -831,7 +876,7 @@ 268 - {{121, 128}, {88, 17}} + {{121, 169}, {88, 17}} _NS:1535 @@ -851,7 +896,7 @@ 268 - {{214, 126}, {96, 22}} + {{214, 167}, {96, 22}} _NS:9 @@ -872,7 +917,7 @@ 268 - {{315, 123}, {19, 27}} + {{315, 164}, {19, 27}} _NS:1099 @@ -888,6 +933,134 @@ NO + + + 268 + {{88, 66}, {121, 17}} + + _NS:1535 + YES + + 68157504 + 272630784 + Default Username: + + _NS:1535 + + + + + NO + + + + 268 + {{99, 37}, {110, 17}} + + + _NS:1535 + YES + + 68157504 + 272630784 + Template Group: + + _NS:1535 + + + + + NO + + + + 268 + {{214, 63}, {215, 22}} + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + + + + NO + + + + 268 + {{212, 31}, {220, 27}} + + _NS:9 + YES + + -2076180416 + 2048 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + {{10, 33}, {500, 261}} @@ -896,123 +1069,14 @@ - - - - 256 - - - - 268 - {{96, 138}, {121, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Default Username: - - _NS:1535 - - - - - NO - - - - 268 - {{220, 104}, {184, 26}} - - - _NS:9 - YES - - -2076180416 - 2048 - - _NS:9 - - 109199360 - 129 - - - 400 - 75 - - YES - - OtherViews - - - - -1 - 1 - YES - YES - 2 - - NO - - - - 268 - {{107, 109}, {110, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Template Group: - - _NS:1535 - - - - - NO - - - - 268 - {{222, 136}, {179, 22}} - - - _NS:9 - YES - - -1804599231 - 272630784 - - - _NS:9 - - YES - - - - NO - - - {{10, 33}, {500, 261}} - - - Templates - - - - + 0 YES YES - + @@ -1157,14 +1221,6 @@ 1183 - - - templateGroupPopUpButton - - - - 1262 - close: @@ -1181,6 +1237,46 @@ 1553 + + + encryptionRoundsTextField + + + + 1773 + + + + templateGroupPopUpButton + + + + 1796 + + + + defaultUsernameTextField + + + + 1819 + + + + benchmarkRounds: + + + + 1827 + + + + benchmarkButton + + + + 1828 + @@ -1379,7 +1475,6 @@ - @@ -1770,15 +1865,207 @@ 24 2 - + 4 0 - + 4 1 - 84 + 34 + + 1000 + + 3 + 9 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 4 + 1 + + 7 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 4 + 1 + + 4 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 4 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 3 + 1 + + 115 1000 @@ -1802,7 +2089,23 @@ 24 3 - + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + 3 0 @@ -1810,7 +2113,7 @@ 3 1 - 113 + 72 1000 @@ -1898,21 +2201,21 @@ 24 2 - - - 4 + + + 11 0 - - 4 + + 11 1 - 64 + 0.0 1000 - 3 - 9 - 3 + 6 + 24 + 2 @@ -1946,22 +2249,6 @@ 24 2 - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - 11 @@ -2010,6 +2297,22 @@ 24 2 + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 3 + 9 + 3 + 5 @@ -2026,22 +2329,6 @@ 9 3 - - - 3 - 0 - - 3 - 1 - - 61 - - 1000 - - 3 - 9 - 3 - @@ -2052,6 +2339,10 @@ + + + + @@ -2067,6 +2358,86 @@ 371 + + + 4 + 0 + + 4 + 1 + + 34 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 3 @@ -2131,7 +2502,23 @@ 24 2 - + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + 3 0 @@ -2139,7 +2526,7 @@ 3 1 - 122 + 87 1000 @@ -2163,22 +2550,6 @@ 24 2 - - - 3 - 0 - - 3 - 1 - - 93 - - 1000 - - 3 - 9 - 3 - 9 @@ -2195,7 +2566,23 @@ 22 2 - + + + 3 + 0 + + 3 + 1 + + 58 + + 1000 + + 3 + 9 + 3 + + 3 0 @@ -2203,7 +2590,7 @@ 3 1 - 64 + 29 1000 @@ -2227,11 +2614,30 @@ 24 2 + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + @@ -2326,11 +2732,6 @@ - - 490 - - - 504 @@ -2344,11 +2745,6 @@ - - 506 - - - 509 @@ -2442,6 +2838,22 @@ + + + 8 + 0 + + 0 + 1 + + 14 + + 1000 + + 9 + 40 + 1 + @@ -2626,217 +3038,6 @@ - - 1210 - - - - - - - - 1211 - - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 103 - - 1000 - - 3 - 9 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 99 - - 1000 - - 3 - 9 - 3 - - - - - - - - - - 1212 - - - - - - - - 1213 - - - - - 1230 - - - - - - - - 1231 - - - - - - - - 1232 - - - - - - 1239 - - - - - - - - 1240 - - - 1268 @@ -2941,11 +3142,6 @@ - - 1376 - - - 1387 @@ -3107,31 +3303,11 @@ - - 1456 - - - - - 1458 - - - - - 1459 - - - 1460 - - 1463 - - - 1475 @@ -3142,85 +3318,6 @@ - - 1474 - - - - - 1473 - - - - - 1501 - - - - - - 7 - 0 - - 0 - 1 - - 179 - - 1000 - - 3 - 9 - 1 - - - - - - 1502 - - - - - 1506 - - - - - 1509 - - - - - 1511 - - - - - 1512 - - - - - 1513 - - - - - 1514 - - - - - 1515 - - - - - 1516 - - - 1529 @@ -3271,21 +3368,6 @@ - - 1547 - - - - - 1548 - - - - - 1549 - - - 1550 @@ -3301,6 +3383,339 @@ + + 1637 + + + + + 1638 + + + + + 1641 + + + + + 1643 + + + + + + + + 1644 + + + + + 1647 + + + + + + 7 + 0 + + 0 + 1 + + 129 + + 1000 + + 3 + 9 + 1 + + + + + + 1648 + + + + + + 1730 + + + + + + 8 + 0 + + 0 + 1 + + 22 + + 1000 + + 9 + 40 + 1 + + + + + + 1731 + + + + + 1734 + + + + + 1754 + + + + + 1771 + + + + + 1772 + + + + + 1774 + + + + + + + + 1775 + + + + + 506 + + + + + 490 + + + + + 1563 + + + + + 1750 + + + + + 1565 + + + + + 1564 + + + + + 1584 + + + + + + 8 + 0 + + 0 + 1 + + 17 + + 1000 + + 3 + 9 + 1 + + + + + + 1588 + + + + + 1582 + + + + + + + + 1736 + + + + + 1732 + + + + + 1591 + + + + + 1738 + + + + + + + + 1799 + + + + + 1747 + + + + + 1746 + + + + + 1745 + + + + + 1739 + + + + + + + + 1740 + + + + + + + + + + 1743 + + + + + 1742 + + + + + 1741 + + + + + 1810 + + + + + 1811 + + + + + 1812 + + + + + 1814 + + + + + 1815 + + + + + 1816 + + + + + 1817 + + + + + 1818 + + + + + 1820 + + + + + 1755 + + + + + 1776 + + + + + 1779 + + + + + 1777 + + + + + 1778 + + + @@ -3316,29 +3731,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3361,7 +3753,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3392,29 +3783,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3425,12 +3796,74 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3485,24 +3918,36 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - + + - - + - + + - + + + + + + + + + + + + + @@ -3510,17 +3955,24 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + - + + - - + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3557,6 +4009,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3591,27 +4046,39 @@ - 1553 + 1828 - - HNHRoundedTextField - NSTextField - - IBProjectSource - ./Classes/HNHRoundedTextField.h - - MPDatabaseSettingsWindowController MPSheetWindowController + + id + id + id + + + + benchmarkRounds: + id + + + close: + id + + + save: + id + + NSTextView NSTextField - HNHRoundedTextField + NSTextField NSButton NSButton + NSTextField NSButton NSButton NSButton @@ -3632,7 +4099,7 @@ defaultUsernameTextField - HNHRoundedTextField + NSTextField emptyRecycleBinOnQuitCheckButton @@ -3642,6 +4109,10 @@ enableRecycleBinCheckButton NSButton + + encryptionRoundsTextField + NSTextField + protectNotesCheckButton NSButton diff --git a/MacPass/MPDatabaseSettingsWindowController.h b/MacPass/MPDatabaseSettingsWindowController.h index 015424e5..9f3251d5 100644 --- a/MacPass/MPDatabaseSettingsWindowController.h +++ b/MacPass/MPDatabaseSettingsWindowController.h @@ -11,9 +11,8 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) { MPDatabaseSettingsTabGeneral, - MPDatabaseSettingsTabDisplay, - MPDatabaseSettingsTabAdvanced, - MPDatabaseSettingsTabTemplates, + MPDatabaseSettingsTabSecurity, + MPDatabaseSettingsTabAdvanced }; @class MPDocument; @@ -27,21 +26,20 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) { @property (weak) IBOutlet NSTextField *databaseNameTextField; @property (unsafe_unretained) IBOutlet NSTextView *databaseDescriptionTextView; -/* Display Tab */ +/* Security Tab */ @property (weak) IBOutlet NSButton *protectTitleCheckButton; @property (weak) IBOutlet NSButton *protectUserNameCheckButton; @property (weak) IBOutlet NSButton *protectPasswortCheckButton; @property (weak) IBOutlet NSButton *protectURLCheckButton; @property (weak) IBOutlet NSButton *protectNotesCheckButton; +@property (weak) IBOutlet NSTextField *encryptionRoundsTextField; +@property (weak) IBOutlet NSButton *benchmarkButton; /* Advanced Tab*/ @property (weak) IBOutlet NSButton *enableRecycleBinCheckButton; @property (weak) IBOutlet NSButton *emptyRecycleBinOnQuitCheckButton; @property (weak) IBOutlet NSPopUpButton *selectRecycleBinGroupPopUpButton; - - -/* Templates Tab */ -@property (weak) IBOutlet HNHRoundedTextField *defaultUsernameTextField; +@property (weak) IBOutlet NSTextField *defaultUsernameTextField; @property (weak) IBOutlet NSPopUpButton *templateGroupPopUpButton; diff --git a/MacPass/MPDatabaseSettingsWindowController.m b/MacPass/MPDatabaseSettingsWindowController.m index 8f202a25..32cea240 100644 --- a/MacPass/MPDatabaseSettingsWindowController.m +++ b/MacPass/MPDatabaseSettingsWindowController.m @@ -12,11 +12,13 @@ #import "MPDatabaseVersion.h" #import "MPIconHelper.h" #import "MPSettingsHelper.h" +#import "MPNumericalInputFormatter.h" #import "KPKGroup.h" #import "KPKTree.h" #import "KPKMetaData.h" #import "KPKNode+IconImage.h" +#import "KPKPassword.h" #import "HNHRoundedTextField.h" #import "HNHRoundedSecureTextField.h" @@ -54,8 +56,11 @@ NSAssert(_document != nil, @"Document needs to be present"); [self.sectionTabView setDelegate:self]; + [self.encryptionRoundsTextField setFormatter:[[MPNumericalInputFormatter alloc] init]]; } +#pragma mark Actions + - (IBAction)save:(id)sender { /* General */ KPKMetaData *metaData = _document.tree.metaData; @@ -86,7 +91,7 @@ metaData.protectUrl = protectURL; metaData.protectUserName = protectUsername; metaData.defaultUserName = [self.defaultUsernameTextField stringValue]; - + /* NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setBool:protectNotes forKey:kMPSettingsKeyLegacyHideNotes]; @@ -103,6 +108,14 @@ [self dismissSheet:0]; } +- (IBAction)benchmarkRounds:(id)sender { + [self.benchmarkButton setEnabled:NO]; + [KPKPassword benchmarkTransformationRounds:1 completionHandler:^(NSUInteger rounds) { + [self.encryptionRoundsTextField setIntegerValue:rounds]; + [self.benchmarkButton setEnabled:YES]; + }]; +} + - (void)updateView { if(!self.isDirty) { return; @@ -112,7 +125,6 @@ [self _setupDatabase:metaData]; [self _setupProtectionTab:metaData]; [self _setupAdvancedTab:_document.tree]; - [self _setupTemplatesTab:_document.tree]; self.isDirty = NO; } @@ -124,11 +136,6 @@ if(![self window]) { return; } - NSTabViewItem *tabViewItem = [self.sectionTabView tabViewItemAtIndex:tab]; - BOOL canSelectTab = [self tabView:self.sectionTabView shouldSelectTabViewItem:tabViewItem]; - if(!canSelectTab) { - [self.sectionTabView selectTabViewItemAtIndex:MPDatabaseSettingsTabTemplates]; - } [self.sectionTabView selectTabViewItemAtIndex:tab]; } @@ -136,14 +143,10 @@ - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem { NSUInteger index = [tabView indexOfTabViewItem:tabViewItem]; switch ((MPDatabaseSettingsTab)index) { - case MPDatabaseSettingsTabDisplay: - return YES; - + case MPDatabaseSettingsTabSecurity: case MPDatabaseSettingsTabAdvanced: case MPDatabaseSettingsTabGeneral: - case MPDatabaseSettingsTabTemplates: return YES; - //return (_document.version == MPDatabaseVersion4); default: return NO; @@ -162,15 +165,15 @@ [self.protectTitleCheckButton setState:metaData.protectTitle ? NSOnState : NSOffState]; [self.protectURLCheckButton setState:metaData.protectUrl ? NSOnState : NSOffState]; [self.protectUserNameCheckButton setState:metaData.protectUserName ? NSOnState : NSOffState]; + [self.encryptionRoundsTextField setIntegerValue:metaData.rounds]; + [self.benchmarkButton setEnabled:YES]; } - (void)_setupAdvancedTab:(KPKTree *)tree { [self.enableRecycleBinCheckButton bind:NSValueBinding toObject:self withKeyPath:@"trashEnabled" options:nil]; [self.selectRecycleBinGroupPopUpButton bind:NSEnabledBinding toObject:self withKeyPath:@"trashEnabled" options:nil]; [self _updateTrashFolders:tree]; -} - -- (void)_setupTemplatesTab:(KPKTree *)tree { + [self.defaultUsernameTextField setStringValue:tree.metaData.defaultUserName]; [self.defaultUsernameTextField setEditable:YES]; [self _updateTemplateGroup:tree]; @@ -182,19 +185,16 @@ switch(tab) { case MPDatabaseSettingsTabAdvanced: - [[self window] makeFirstResponder:self.databaseNameTextField]; + [[self window] makeFirstResponder:self.defaultUsernameTextField]; break; - case MPDatabaseSettingsTabDisplay: + case MPDatabaseSettingsTabSecurity: [[self window] makeFirstResponder:self.protectTitleCheckButton]; break; case MPDatabaseSettingsTabGeneral: [[self window] makeFirstResponder:self.databaseNameTextField]; break; - - case MPDatabaseSettingsTabTemplates: - break; } } diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index 831c76c1..a944cef2 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -299,7 +299,7 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) { } - (void)editTemplateGroup:(id)sender { - [self _showDatabaseSetting:MPDatabaseSettingsTabTemplates]; + [self _showDatabaseSetting:MPDatabaseSettingsTabAdvanced]; } - (void)editTrashGroup:(id)sender { diff --git a/MacPass/MPNumericalInputFormatter.h b/MacPass/MPNumericalInputFormatter.h new file mode 100644 index 00000000..4167ef00 --- /dev/null +++ b/MacPass/MPNumericalInputFormatter.h @@ -0,0 +1,13 @@ +// +// MPNumericalInputFormatter.h +// MacPass +// +// Created by Michael Starke on 10.09.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import + +@interface MPNumericalInputFormatter : NSFormatter + +@end diff --git a/MacPass/MPNumericalInputFormatter.m b/MacPass/MPNumericalInputFormatter.m new file mode 100644 index 00000000..da425235 --- /dev/null +++ b/MacPass/MPNumericalInputFormatter.m @@ -0,0 +1,46 @@ +// +// MPNumericalInputFormatter.m +// MacPass +// +// Created by Michael Starke on 10.09.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPNumericalInputFormatter.h" + +@implementation MPNumericalInputFormatter + +static NSCharacterSet *_characterSet = nil; + +- (id)init +{ + self = [super init]; + if (self) { + _characterSet = [[NSCharacterSet characterSetWithCharactersInString:@"1234567890"] invertedSet]; + } + return self; +} + +- (NSString *)stringForObjectValue:(id)obj { + if([obj isKindOfClass:[NSNumber class]]) { + return [[NSString alloc] initWithFormat:@"%ld",[obj integerValue]]; + } + return nil; +} + +- (BOOL)getObjectValue:(out id *)obj forString:(NSString *)string errorDescription:(out NSString **)error { + NSNumber *number = [[NSNumber alloc] initWithInteger:[string integerValue]]; + *obj = number; + return YES; +} + +- (BOOL)isPartialStringValid:(NSString **)partialStringPtr + proposedSelectedRange:(NSRangePointer)proposedSelRangePtr + originalString:(NSString *)origString + originalSelectedRange:(NSRange)origSelRange + errorDescription:(NSString **)error { + NSRange range = [*partialStringPtr rangeOfCharacterFromSet:_characterSet]; + return (range.location == NSNotFound); +} + +@end diff --git a/MacPass/PasswordEditWindow.xib b/MacPass/PasswordEditWindow.xib index 09102a74..1daeae1f 100644 --- a/MacPass/PasswordEditWindow.xib +++ b/MacPass/PasswordEditWindow.xib @@ -151,7 +151,7 @@ {{90, 60}, {200, 19}} - + _NS:9 YES @@ -350,6 +350,7 @@ {{184, 13}, {151, 32}} + _NS:9 YES @@ -399,7 +400,7 @@ - {{0, 0}, {2560, 1418}} + {{0, 0}, {1920, 1058}} {10000000000000, 10000000000000} YES @@ -1361,11 +1362,6 @@ - - 76 - - - 77 @@ -1376,6 +1372,11 @@ + + 76 + + + @@ -1502,7 +1503,7 @@ - 85 + 98 @@ -1529,16 +1530,10 @@ MPPasswordEditWindowController MPSheetWindowController - id id id - id - - cancel: - id - clearKey: id @@ -1547,10 +1542,6 @@ generateKey: id - - save: - id - NSButton