IOSAD-172 configurePassphrase:error calls config_passphrase IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Sat, 27 Jun 2020 16:05:38 +0200
branchIOSAD-172
changeset 152286c579f701a2
parent 1521 dae9a0765a7b
child 1523 3c94dcd2e7d6
IOSAD-172 configurePassphrase:error calls config_passphrase
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapterFramework/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Sat Jun 27 15:52:56 2020 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Sat Jun 27 16:05:38 2020 +0200
     1.3 @@ -1085,6 +1085,12 @@
     1.4  
     1.5      [[PEPPassphraseCache sharedInstance] addPassphrase:normalizedPassphrase];
     1.6  
     1.7 +    PEP_STATUS status = config_passphrase(_session, [normalizedPassphrase UTF8String]);
     1.8 +
     1.9 +    if ([NSError setError:error fromPEPStatusInternal:status]) {
    1.10 +        return NO;
    1.11 +    }
    1.12 +
    1.13      return YES;
    1.14  }
    1.15  
     2.1 --- a/pEpObjCAdapterFramework/PEPSessionProtocol.h	Sat Jun 27 15:52:56 2020 +0200
     2.2 +++ b/pEpObjCAdapterFramework/PEPSessionProtocol.h	Sat Jun 27 16:05:38 2020 +0200
     2.3 @@ -317,7 +317,8 @@
     2.4  /// approximated by checking the string length.
     2.5  /// If the passphrase exceeds this limit, the adapter throws PEPAdapterErrorPassphraseTooLong
     2.6  /// with a domain of PEPObjCAdapterErrorDomain.
     2.7 -/// @Throws PEPAdapterErrorPassphraseTooLong (with a domain of PEPObjCAdapterErrorDomain).
     2.8 +/// @Throws PEPAdapterErrorPassphraseTooLong (with a domain of PEPObjCAdapterErrorDomain)
     2.9 +/// or PEPStatusOutOfMemory (with PEPObjCAdapterEngineStatusErrorDomain)
    2.10  - (BOOL)configurePassphrase:(NSString * _Nonnull)passphrase
    2.11                        error:(NSError * _Nullable * _Nullable)error;
    2.12