From 74f9f1ca00338a96e5138461da7b690b4b3cbe83 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 28 Aug 2017 19:37:51 -0400 Subject: [PATCH] Fix up objc code to match new C API. --- platform-darwin/Source/MPAlgorithmV0.m | 6 +++--- platform-darwin/Source/MPAppDelegate_Store.m | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform-darwin/Source/MPAlgorithmV0.m b/platform-darwin/Source/MPAlgorithmV0.m index f70fb4ad..4dca1b5e 100644 --- a/platform-darwin/Source/MPAlgorithmV0.m +++ b/platform-darwin/Source/MPAlgorithmV0.m @@ -133,7 +133,7 @@ static NSOperationQueue *_mpwQueue = nil; keyData = [NSData dataWithBytes:masterKey length:MPMasterKeySize]; trc( @"User: %@, password: %@ derives to key ID: %@ (took %0.2fs)", // fullName, masterPassword, [self keyIDForKey:masterKey], -[start timeIntervalSinceNow] ); - mpw_free( masterKey, MPMasterKeySize ); + mpw_free( &masterKey, MPMasterKeySize ); } }]; @@ -368,7 +368,7 @@ static NSOperationQueue *_mpwQueue = nil; name.UTF8String, counter, purpose, context.UTF8String, type, parameter.UTF8String, [self version] ); if (resultBytes) { result = [NSString stringWithCString:resultBytes encoding:NSUTF8StringEncoding]; - mpw_free_string( resultBytes ); + mpw_free_string( &resultBytes ); } }]; @@ -396,7 +396,7 @@ static NSOperationQueue *_mpwQueue = nil; MPCounterValueInitial, MPKeyPurposeAuthentication, NULL, site.type, plainText.UTF8String, [self version] ); if (stateBytes) { state = [[NSString stringWithCString:stateBytes encoding:NSUTF8StringEncoding] decodeBase64]; - mpw_free_string( stateBytes ); + mpw_free_string( &stateBytes ); } }]; diff --git a/platform-darwin/Source/MPAppDelegate_Store.m b/platform-darwin/Source/MPAppDelegate_Store.m index 375c8726..11330181 100644 --- a/platform-darwin/Source/MPAppDelegate_Store.m +++ b/platform-darwin/Source/MPAppDelegate_Store.m @@ -692,7 +692,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); ((MPGeneratedSiteEntity *)site).counter = importSite->counter; site.algorithm = MPAlgorithmForVersion( importSite->algorithm ); site.loginName = importSite->loginContent? @(importSite->loginContent): nil; - site.loginGenerated = importSite->loginGenerated; + site.loginGenerated = importSite->loginType & MPResultTypeClassTemplate; site.url = importSite->url? @(importSite->url): nil; site.uses = importSite->uses; site.lastUsed = [NSDate dateWithTimeIntervalSince1970:importSite->lastUsed]; @@ -725,7 +725,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); site.name.UTF8String, site.type, counter, site.algorithm.version ); exportSite->content = content.UTF8String; exportSite->loginContent = site.loginName.UTF8String; - exportSite->loginGenerated = site.loginGenerated; + exportSite->loginType = site.loginGenerated? MPResultTypeTemplateName: MPResultTypeStatefulPersonal; exportSite->url = site.url.UTF8String; exportSite->uses = (unsigned int)site.uses; exportSite->lastUsed = (time_t)site.lastUsed.timeIntervalSince1970; @@ -740,7 +740,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); NSString *mpsites = nil; if (export && exportError.type == MPMarshallSuccess) mpsites = [NSString stringWithCString:export encoding:NSUTF8StringEncoding]; - mpw_free_string( export ); + mpw_free_string( &export ); resultBlock( mpsites, exportError.type == MPMarshallSuccess? nil: [NSError errorWithDomain:MPErrorDomain code:MPErrorMarshallCode userInfo:@{