forked from MacPass/MacPass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored touchID codebase to be more in line with the rest.
Fixed a lot of potential memory leaks Fixed all issues reported analyzer
- Loading branch information
Showing
20 changed files
with
327 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// MPDocument+BiometricEncryptionSupport.h | ||
// MacPass | ||
// | ||
// Created by Michael Starke on 22.08.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import "MPDocument.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MPDocument (BiometricEncryptionSupport) | ||
@property (nonatomic, readonly, copy, nullable) NSString *biometricKey; | ||
@property (nonatomic, readonly, copy, nullable) NSData *encryptedKeyData; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// MPDocument+BiometricEncryptionSupport.m | ||
// MacPass | ||
// | ||
// Created by Michael Starke on 22.08.22. | ||
// Copyright © 2022 HicknHack Software GmbH. All rights reserved. | ||
// | ||
|
||
#import "MPDocument+BiometricEncryptionSupport.h" | ||
#import "MPSettingsHelper.h" | ||
#import "MPTouchIdCompositeKeyStore.h" | ||
|
||
@implementation MPDocument (BiometricEncryptionSupport) | ||
|
||
@dynamic biometricKey; | ||
|
||
- (NSString *)biometricKey { | ||
if(nil == self.fileURL || nil == self.fileURL.lastPathComponent) { | ||
return nil; | ||
} | ||
return [NSString stringWithFormat:kMPSettingsKeyEntryTouchIdDatabaseEncryptedKeyFormat, self.fileURL.lastPathComponent]; | ||
} | ||
|
||
- (NSData *)encryptedKeyData { | ||
NSString *documentKey = self.biometricKey; | ||
if(nil == documentKey) { | ||
return nil; | ||
} | ||
return [MPTouchIdCompositeKeyStore.defaultStore loadEncryptedCompositeKeyForDocumentKey:documentKey]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.