mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-30 21:38:19 +00:00
The TouchID keypair can no be removed from the macOS keychain
This is a good feature for security and stability. It gives users the option to prevent TouchID unlock for any previously unlocked database and it is also helpful in cases where only one part of the keypair is in the macOS keychain.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#import "MPSettingsHelper.h"
|
||||
#import "MPIconHelper.h"
|
||||
#import "MPAutotypeDoctor.h"
|
||||
#import "MPConstants.h"
|
||||
|
||||
#import "DDHotKeyCenter.h"
|
||||
#import "DDHotKey+MacPassAdditions.h"
|
||||
@@ -129,4 +130,32 @@
|
||||
- (void)runAutotypeDoctor:(id)sender {
|
||||
[MPAutotypeDoctor.defaultDoctor runChecksAndPresentResults];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Keychain Actions
|
||||
- (IBAction)RenewTouchIdKey:(id)sender {
|
||||
NSData* publicKeyTag = [TouchIdUnlockPublicKeyTag dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *publicKeyQuery = @{
|
||||
(id)kSecClass: (id)kSecClassKey,
|
||||
(id)kSecAttrApplicationTag: publicKeyTag,
|
||||
(id)kSecReturnRef: @YES,
|
||||
};
|
||||
OSStatus status = SecItemDelete((__bridge CFDictionaryRef)publicKeyQuery);
|
||||
if (status != errSecSuccess) {
|
||||
NSString* description = (__bridge NSString*)SecCopyErrorMessageString(status, NULL);
|
||||
NSLog(@"Error while trying to delete public key from Keychain: %@", description);
|
||||
}
|
||||
|
||||
NSData* privateKeyTag = [TouchIdUnlockPrivateKeyTag dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *privateKeyQuery = @{
|
||||
(id)kSecClass: (id)kSecClassKey,
|
||||
(id)kSecAttrApplicationTag: privateKeyTag,
|
||||
(id)kSecReturnRef: @YES,
|
||||
};
|
||||
status = SecItemDelete((__bridge CFDictionaryRef)privateKeyQuery);
|
||||
if (status != errSecSuccess) {
|
||||
NSString* description = (__bridge NSString*)SecCopyErrorMessageString(status, NULL);
|
||||
NSLog(@"Error while trying to delete private key from Keychain: %@", description);
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user