mirror of
https://github.com/MacPass/MacPass.git
synced 2026-02-01 14:58:17 +00:00
Fixed errors while rebasing to latest master
This commit is contained in:
@@ -432,10 +432,6 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
completionHandler:^BOOL(KPKCompositeKey *compositeKey, NSURL* keyURL, BOOL didCancel, NSError *__autoreleasing *error) {
|
completionHandler:^BOOL(KPKCompositeKey *compositeKey, NSURL* keyURL, BOOL didCancel, NSError *__autoreleasing *error) {
|
||||||
[self.windowForSheet endSheet:sheet returnCode:(didCancel ? NSModalResponseCancel : NSModalResponseOK)];
|
[self.windowForSheet endSheet:sheet returnCode:(didCancel ? NSModalResponseCancel : NSModalResponseOK)];
|
||||||
if(!didCancel) {
|
if(!didCancel) {
|
||||||
NSData *keyFileData = keyURL ? [NSData dataWithContentsOfURL:keyURL] : nil;
|
|
||||||
KPKCompositeKey *compositeKey = [[KPKCompositeKey alloc] init];
|
|
||||||
[compositeKey addKey:[KPKKey keyWithPassword:password]];
|
|
||||||
[compositeKey addKey:[KPKKey keyWithKeyFileData:keyFileData]];
|
|
||||||
[self _mergeWithContentsFromURL:url key:compositeKey options:options];
|
[self _mergeWithContentsFromURL:url key:compositeKey options:options];
|
||||||
}
|
}
|
||||||
// just return yes regardless since we will display the sheet again if needed!
|
// just return yes regardless since we will display the sheet again if needed!
|
||||||
@@ -503,11 +499,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
|
|
||||||
- (BOOL)unlockWithPassword:(KPKCompositeKey *)compositeKey keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error{
|
- (BOOL)unlockWithPassword:(KPKCompositeKey *)compositeKey keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error{
|
||||||
// TODO: Make this API asynchronous
|
// TODO: Make this API asynchronous
|
||||||
NSData *keyFileData = keyFileURL ? [NSData dataWithContentsOfURL:keyFileURL] : nil;
|
self.compositeKey = compositeKey;
|
||||||
|
|
||||||
self.compositeKey = [[KPKCompositeKey alloc] init];
|
|
||||||
[self.compositeKey addKey:[KPKKey keyWithPassword:password]];
|
|
||||||
[self.compositeKey addKey:[KPKKey keyWithKeyFileData:keyFileData]];
|
|
||||||
self.tree = [[KPKTree alloc] initWithData:self.encryptedData key:self.compositeKey error:error];
|
self.tree = [[KPKTree alloc] initWithData:self.encryptedData key:self.compositeKey error:error];
|
||||||
|
|
||||||
BOOL isUnlocked = (nil != self.tree);
|
BOOL isUnlocked = (nil != self.tree);
|
||||||
|
|||||||
@@ -140,7 +140,11 @@ static NSMutableDictionary* touchIDSecuredPasswords;
|
|||||||
BOOL cancel = (sender == self.cancelButton);
|
BOOL cancel = (sender == self.cancelButton);
|
||||||
NSURL* keyURL = self.keyPathControl.URL;
|
NSURL* keyURL = self.keyPathControl.URL;
|
||||||
NSData *keyFileData = keyURL ? [NSData dataWithContentsOfURL:keyURL] : nil;
|
NSData *keyFileData = keyURL ? [NSData dataWithContentsOfURL:keyURL] : nil;
|
||||||
KPKCompositeKey *compositeKey = [[KPKCompositeKey alloc] initWithPassword:password keyFileData:keyFileData];
|
KPKKey* passwordKey = [KPKKey keyWithPassword:password];
|
||||||
|
KPKKey* fileKey = [KPKKey keyWithKeyFileData:keyFileData];
|
||||||
|
KPKCompositeKey* compositeKey = [[KPKCompositeKey alloc] init];
|
||||||
|
[compositeKey addKey:passwordKey];
|
||||||
|
[compositeKey addKey:fileKey];
|
||||||
BOOL result = self.completionHandler(compositeKey, keyURL, cancel, &error);
|
BOOL result = self.completionHandler(compositeKey, keyURL, cancel, &error);
|
||||||
[self _touchIdHandleUnlockAttempt:compositeKey withResult:result];
|
[self _touchIdHandleUnlockAttempt:compositeKey withResult:result];
|
||||||
if(cancel || result) {
|
if(cancel || result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user