IOSAD-121 Handle BOOL cases. IOSAD-121
authorDirk Zimmermann <dz@pep.security>
Thu, 25 Jul 2019 10:47:04 +0200
branchIOSAD-121
changeset 1108b61cf4d87e40
parent 1107 4283084b59e2
child 1109 8de941d1c5c7
IOSAD-121 Handle BOOL cases.
pEpObjCAdapter/PEPSession.m
     1.1 --- a/pEpObjCAdapter/PEPSession.m	Thu Jul 25 10:47:04 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSession.m	Thu Jul 25 10:47:04 2019 +0200
     1.3 @@ -76,6 +76,7 @@
     1.4                          error:(NSError * _Nullable * _Nullable)error
     1.5  {
     1.6      PEPInternalSession *session = [PEPSessionProvider session];
     1.7 +    RETURN_ON_ERROR(session, error, NO);
     1.8      return [session reEvaluateMessageDict:messageDict
     1.9                                   xKeyList:xKeyList
    1.10                                     rating:rating
    1.11 @@ -90,6 +91,7 @@
    1.12                      error:(NSError * _Nullable * _Nullable)error
    1.13  {
    1.14      PEPInternalSession *session = [PEPSessionProvider session];
    1.15 +    RETURN_ON_ERROR(session, error, NO);
    1.16      return [session reEvaluateMessage:message
    1.17                               xKeyList:xKeyList
    1.18                                 rating:rating
    1.19 @@ -248,6 +250,7 @@
    1.20  - (BOOL)mySelf:(PEPIdentity * _Nonnull)identity error:(NSError * _Nullable * _Nullable)error
    1.21  {
    1.22      PEPInternalSession *session = [PEPSessionProvider session];
    1.23 +    RETURN_ON_ERROR(session, error, NO);
    1.24      return [session mySelf:identity error:error];
    1.25  }
    1.26  
    1.27 @@ -255,6 +258,7 @@
    1.28                   error:(NSError * _Nullable * _Nullable)error
    1.29  {
    1.30      PEPInternalSession *session = [PEPSessionProvider session];
    1.31 +    RETURN_ON_ERROR(session, error, NO);
    1.32      return [session updateIdentity:identity error:error];
    1.33  }
    1.34  
    1.35 @@ -262,6 +266,7 @@
    1.36                     error:(NSError * _Nullable * _Nullable)error
    1.37  {
    1.38      PEPInternalSession *session = [PEPSessionProvider session];
    1.39 +    RETURN_ON_ERROR(session, error, NO);
    1.40      return [session trustPersonalKey:identity error:error];
    1.41  }
    1.42  
    1.43 @@ -269,6 +274,7 @@
    1.44                  error:(NSError * _Nullable * _Nullable)error
    1.45  {
    1.46      PEPInternalSession *session = [PEPSessionProvider session];
    1.47 +    RETURN_ON_ERROR(session, error, NO);
    1.48      return [session keyMistrusted:identity error:error];
    1.49  }
    1.50  
    1.51 @@ -276,6 +282,7 @@
    1.52                  error:(NSError * _Nullable * _Nullable)error
    1.53  {
    1.54      PEPInternalSession *session = [PEPSessionProvider session];
    1.55 +    RETURN_ON_ERROR(session, error, NO);
    1.56      return [session keyResetTrust:identity error:error];
    1.57  }
    1.58  
    1.59 @@ -296,6 +303,7 @@
    1.60             error:(NSError * _Nullable * _Nullable)error
    1.61  {
    1.62      PEPInternalSession *session = [PEPSessionProvider session];
    1.63 +    RETURN_ON_ERROR(session, error, NO);
    1.64      return [session
    1.65              logTitle:title
    1.66              entity:entity
    1.67 @@ -368,6 +376,7 @@
    1.68              error:(NSError * _Nullable * _Nullable)error
    1.69  {
    1.70      PEPInternalSession *session = [PEPSessionProvider session];
    1.71 +    RETURN_ON_ERROR(session, error, NO);
    1.72      return [session setOwnKey:identity fingerprint:fingerprint error:error];
    1.73  }
    1.74  
    1.75 @@ -382,6 +391,7 @@
    1.76             error:(NSError * _Nullable * _Nullable)error
    1.77  {
    1.78      PEPInternalSession *session = [PEPSessionProvider session];
    1.79 +    RETURN_ON_ERROR(session, error, NO);
    1.80      return [session setFlags:flags forIdentity:identity error:error];
    1.81  }
    1.82  
    1.83 @@ -389,6 +399,7 @@
    1.84                        error:(NSError * _Nullable * _Nullable)error
    1.85  {
    1.86      PEPInternalSession *session = [PEPSessionProvider session];
    1.87 +    RETURN_ON_ERROR(session, error, NO);
    1.88      return [session trustOwnKeyIdentity:identity error:error];
    1.89  }
    1.90  
    1.91 @@ -397,6 +408,7 @@
    1.92                           error:(NSError * _Nullable * _Nullable)error;
    1.93  {
    1.94      PEPInternalSession *session = [PEPSessionProvider session];
    1.95 +    RETURN_ON_ERROR(session, error, NO);
    1.96      return [session deliverHandshakeResult:result identitiesSharing:identitiesSharing error:error];
    1.97  }
    1.98  
    1.99 @@ -411,12 +423,14 @@
   1.100             error:(NSError * _Nullable * _Nullable)error
   1.101  {
   1.102      PEPInternalSession *session = [PEPSessionProvider session];
   1.103 +    RETURN_ON_ERROR(session, error, NO);
   1.104      return [session keyReset:identity fingerprint:fingerprint error:error];
   1.105  }
   1.106  
   1.107  - (BOOL)leaveDeviceGroupError:(NSError * _Nullable * _Nullable)error
   1.108  {
   1.109      PEPInternalSession *session = [PEPSessionProvider session];
   1.110 +    RETURN_ON_ERROR(session, error, NO);
   1.111      return [session leaveDeviceGroupError:error];
   1.112  }
   1.113