IOSAD-90 encryptMessage:forSelf
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 06 Apr 2018 10:49:41 +0200
changeset 5577cf2f6710453
parent 556 8f0dfa74c08b
child 558 87889e9cacd2
IOSAD-90 encryptMessage:forSelf
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Fri Apr 06 09:13:32 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Fri Apr 06 10:49:41 2018 +0200
     1.3 @@ -304,7 +304,7 @@
     1.4  }
     1.5  
     1.6  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     1.7 -                                 identity:(PEPIdentity * _Nonnull)identity
     1.8 +                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
     1.9                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    1.10                                     status:(PEP_STATUS * _Nullable)status
    1.11                                      error:(NSError * _Nullable * _Nullable)error
    1.12 @@ -312,7 +312,7 @@
    1.13      PEP_encrypt_flags_t flags = 0;
    1.14  
    1.15      message *_src = PEP_messageDictToStruct([self removeEmptyRecipients:messageDict]);
    1.16 -    pEp_identity *ident = PEP_identityToStruct(identity);
    1.17 +    pEp_identity *ident = PEP_identityToStruct(ownIdentity);
    1.18      message *_dst = NULL;
    1.19  
    1.20      stringlist_t *keysStringList = PEP_arrayToStringlist(extraKeys);
    1.21 @@ -354,14 +354,14 @@
    1.22  }
    1.23  
    1.24  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    1.25 -                                identity:(PEPIdentity * _Nonnull)identity
    1.26 +                                 forSelf:(PEPIdentity * _Nonnull)ownIdentity
    1.27                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    1.28                                    status:(PEP_STATUS * _Nullable)status
    1.29                                     error:(NSError * _Nullable * _Nullable)error
    1.30  {
    1.31      PEPDict *target = [self
    1.32                         encryptMessageDict:message.dictionary
    1.33 -                       identity:identity
    1.34 +                       forSelf:ownIdentity
    1.35                         extraKeys:extraKeys
    1.36                         status:status
    1.37                         error:error];
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Fri Apr 06 09:13:32 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Fri Apr 06 10:49:41 2018 +0200
     2.3 @@ -109,7 +109,7 @@
     2.4  }
     2.5  
     2.6  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     2.7 -                                 identity:(PEPIdentity * _Nonnull)identity
     2.8 +                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
     2.9                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    2.10                                     status:(PEP_STATUS * _Nullable)status
    2.11                                      error:(NSError * _Nullable * _Nullable)error
    2.12 @@ -117,14 +117,14 @@
    2.13      PEPInternalSession *session = [PEPSessionProvider session];
    2.14      return [session
    2.15              encryptMessageDict:messageDict
    2.16 -            identity:identity
    2.17 +            forSelf:ownIdentity
    2.18              extraKeys:extraKeys
    2.19              status:status
    2.20              error:error];
    2.21  }
    2.22  
    2.23  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.24 -                                identity:(PEPIdentity * _Nonnull)identity
    2.25 +                                 forSelf:(PEPIdentity * _Nonnull)ownIdentity
    2.26                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.27                                    status:(PEP_STATUS * _Nullable)status
    2.28                                     error:(NSError * _Nullable * _Nullable)error
    2.29 @@ -132,7 +132,7 @@
    2.30      PEPInternalSession *session = [PEPSessionProvider session];
    2.31      return [session
    2.32              encryptMessage:message
    2.33 -            identity:identity
    2.34 +            forSelf:ownIdentity
    2.35              extraKeys:extraKeys
    2.36              status:status
    2.37              error:error];
     3.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Fri Apr 06 09:13:32 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPSessionProtocol.h	Fri Apr 06 10:49:41 2018 +0200
     3.3 @@ -74,14 +74,14 @@
     3.4  
     3.5  /** Encrypt a message dict for the given own identity */
     3.6  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     3.7 -                                 identity:(PEPIdentity * _Nonnull)identity
     3.8 +                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
     3.9                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    3.10                                     status:(PEP_STATUS * _Nullable)status
    3.11                                      error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.12  
    3.13  /** Encrypt a message for the given own identity */
    3.14  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.15 -                                identity:(PEPIdentity * _Nonnull)identity
    3.16 +                                 forSelf:(PEPIdentity * _Nonnull)ownIdentity
    3.17                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    3.18                                    status:(PEP_STATUS * _Nullable)status
    3.19                                     error:(NSError * _Nullable * _Nullable)error;
     4.1 --- a/pEpObjCTests/PEPSessionTest.m	Fri Apr 06 09:13:32 2018 +0200
     4.2 +++ b/pEpObjCTests/PEPSessionTest.m	Fri Apr 06 10:49:41 2018 +0200
     4.3 @@ -396,7 +396,7 @@
     4.4          NSError *error = nil;
     4.5          PEPMessage *encMsg = [innerSession
     4.6                                encryptMessage:msg
     4.7 -                              identity:me
     4.8 +                              forSelf:me
     4.9                                extraKeys:nil
    4.10                                status:&status error:&error];
    4.11          XCTAssertEqual(status, PEP_STATUS_OK);
    4.12 @@ -1266,7 +1266,7 @@
    4.13      PEP_STATUS status = PEP_UNKNOWN_ERROR;
    4.14      PEPMessage *encMessage = [session
    4.15                                encryptMessage:mail
    4.16 -                              identity:me
    4.17 +                              forSelf:me
    4.18                                extraKeys:nil
    4.19                                status:&status
    4.20                                error:&error];
    4.21 @@ -1295,7 +1295,7 @@
    4.22      PEP_STATUS status;
    4.23      PEPMessage *encMessage = [session
    4.24                                encryptMessage:mail
    4.25 -                              identity:me
    4.26 +                              forSelf:me
    4.27                                extraKeys:nil
    4.28                                status:&status
    4.29                                error:&error];
    4.30 @@ -1372,7 +1372,7 @@
    4.31      if (toSelf) {
    4.32          encMsg = [session
    4.33                    encryptMessage:msg
    4.34 -                  identity:identMe
    4.35 +                  forSelf:identMe
    4.36                    extraKeys:nil
    4.37                    status:&statusEnc
    4.38                    error:&error];