From d601d6ed3f03c686ae98a52f81c801c0a8f08f68 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 30 Aug 2022 13:13:12 +0200 Subject: [PATCH] Refactored touchID codebase to be more in line with the rest. Fixed a lot of potential memory leaks Fixed all issues reported analyzer --- MacPass.xcodeproj/project.pbxproj | 8 +- .../xcshareddata/xcschemes/MacPass.xcscheme | 2 +- MacPass/MPAutotypeDaemon.m | 9 +- MacPass/MPConstants.h | 4 +- MacPass/MPConstants.m | 4 +- .../MPDocument+BiometricEncryptionSupport.h | 19 ++ .../MPDocument+BiometricEncryptionSupport.m | 32 +++ MacPass/MPEntryInspectorViewController.m | 1 - MacPass/MPIntegrationPreferencesController.m | 8 +- MacPass/MPKeyMapper.m | 3 + MacPass/MPModifiedKey.h | 4 + MacPass/MPPasswordEditWindowController.m | 2 +- MacPass/MPPasswordInputController.m | 194 +++------------ MacPass/MPPickfieldViewController.m | 4 +- MacPass/MPSettingsHelper.m | 4 +- MacPass/MPToolbarDelegate.m | 4 +- MacPass/MPTouchIdCompositeKeyStore.h | 25 +- MacPass/MPTouchIdCompositeKeyStore.m | 224 +++++++++++++++--- MacPass/NSError+Messages.h | 3 +- MacPass/NSImage+MPQRCode.h | 4 +- 20 files changed, 329 insertions(+), 229 deletions(-) create mode 100644 MacPass/MPDocument+BiometricEncryptionSupport.h create mode 100644 MacPass/MPDocument+BiometricEncryptionSupport.m diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 773f5a70..96892845 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 4C0F647B17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0F647A17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m */; }; 4C10207F1B750E2F00BFCD59 /* MPTestAutotype.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C10207E1B750E2F00BFCD59 /* MPTestAutotype.m */; }; 4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */; }; + 4C11BE6928B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C11BE6828B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.m */; }; 4C15B74618BCA3B1003F8008 /* MPDocument+Search.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C15B74518BCA3B1003F8008 /* MPDocument+Search.m */; }; 4C17D11E2250EFBC00C650C4 /* SavePanelAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C17D1202250EFBC00C650C4 /* SavePanelAccessoryView.xib */; }; 4C17D8E517A1C780006C8C1E /* MPDocumentWindowDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C17D8E417A1C780006C8C1E /* MPDocumentWindowDelegate.m */; }; @@ -401,6 +402,8 @@ 4C10207E1B750E2F00BFCD59 /* MPTestAutotype.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTestAutotype.m; sourceTree = ""; }; 4C10412A178CDD44001B5239 /* NSDate+Humanized.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Humanized.h"; sourceTree = ""; }; 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Humanized.m"; sourceTree = ""; }; + 4C11BE6728B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MPDocument+BiometricEncryptionSupport.h"; sourceTree = ""; }; + 4C11BE6828B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MPDocument+BiometricEncryptionSupport.m"; sourceTree = ""; }; 4C15B74518BCA3B1003F8008 /* MPDocument+Search.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MPDocument+Search.m"; sourceTree = ""; }; 4C17D11F2250EFBC00C650C4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SavePanelAccessoryView.xib; sourceTree = ""; }; 4C17D1222250EFBF00C650C4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/SavePanelAccessoryView.strings; sourceTree = ""; }; @@ -1423,6 +1426,8 @@ 6E719715172058BA00E4C5FC /* MPDatabaseVersion.h */, 4CE5B548173AFBA700207B39 /* MPDocument.h */, 4CE5B549173AFBA700207B39 /* MPDocument.m */, + 4C11BE6728B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.h */, + 4C11BE6828B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.m */, 4C3666401787327E00B249F1 /* MPDocument+Attachments.m */, 4C1FA07A18231900003A3F8C /* MPDocument+Autotype.m */, 4C6B7C7C18BE7EB0001D5D77 /* MPDocument+History.m */, @@ -2027,7 +2032,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = MP; - LastUpgradeCheck = 1250; + LastUpgradeCheck = 1340; ORGANIZATIONNAME = "HicknHack Software GmbH"; TargetAttributes = { 4C77E36115B84A240093A587 = { @@ -2384,6 +2389,7 @@ 4C4B7EE917A45EC6000234C7 /* MPDatePickingViewController.m in Sources */, 4C4B7EEE17A467E1000234C7 /* MPGroupInspectorViewController.m in Sources */, 4C71BCB72167B79C00B4CBDA /* MPPluginVersionComparator.m in Sources */, + 4C11BE6928B3B54900E2DAEA /* MPDocument+BiometricEncryptionSupport.m in Sources */, 4C4B7EF317A467FC000234C7 /* MPEntryInspectorViewController.m in Sources */, 4C1BDF2B1E4392640012A3F0 /* MPPluginDataViewController.m in Sources */, 4C4B7EF817A4B335000234C7 /* MPUniqueCharactersFormatter.m in Sources */, diff --git a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme index 05f2fa75..7f8794ad 100644 --- a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme +++ b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme @@ -1,6 +1,6 @@