IOSAD-95 all encrpyt now have flags
authorDirk Zimmermann <dirk@pep-project.org>
Mon, 18 Jun 2018 11:37:17 +0200
changeset 6297e6343055e4d
parent 628 502f5b19c07f
child 630 ac0b9f0507ba
IOSAD-95 all encrpyt now have flags
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed Jun 13 11:30:24 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Mon Jun 18 11:37:17 2018 +0200
     1.3 @@ -267,12 +267,11 @@
     1.4  
     1.5  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     1.6                                  extraKeys:(PEPStringList * _Nullable)extraKeys
     1.7 +                                    flags:(PEP_encrypt_flags_t)flags
     1.8                                  encFormat:(PEP_enc_format)encFormat
     1.9                                     status:(PEP_STATUS * _Nullable)status
    1.10                                      error:(NSError * _Nullable * _Nullable)error
    1.11  {
    1.12 -    PEP_encrypt_flags_t flags = 0;
    1.13 -
    1.14      message *_src = PEP_messageDictToStruct([self removeEmptyRecipients:messageDict]);
    1.15      message *_dst = NULL;
    1.16      stringlist_t *_keys = PEP_arrayToStringlist(extraKeys);
    1.17 @@ -306,13 +305,15 @@
    1.18  }
    1.19  
    1.20  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    1.21 -                                   extraKeys:(PEPStringList * _Nullable)extraKeys
    1.22 +                               extraKeys:(PEPStringList * _Nullable)extraKeys
    1.23 +                                   flags:(PEP_encrypt_flags_t)flags
    1.24                                 encFormat:(PEP_enc_format)encFormat
    1.25                                    status:(PEP_STATUS * _Nullable)status
    1.26                                     error:(NSError * _Nullable * _Nullable)error
    1.27  {
    1.28      PEPDict *encryptedDict = [self encryptMessageDict:(NSDictionary *) message
    1.29                                              extraKeys:extraKeys
    1.30 +                                                flags:flags
    1.31                                              encFormat:encFormat
    1.32                                                 status:status
    1.33                                                  error:error];
    1.34 @@ -326,13 +327,15 @@
    1.35  }
    1.36  
    1.37  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    1.38 -                                   extraKeys:(PEPStringList * _Nullable)extraKeys
    1.39 +                               extraKeys:(PEPStringList * _Nullable)extraKeys
    1.40 +                                   flags:(PEP_encrypt_flags_t)flags
    1.41                                    status:(PEP_STATUS * _Nullable)status
    1.42                                     error:(NSError * _Nullable * _Nullable)error
    1.43  {
    1.44      return [self
    1.45              encryptMessage:message
    1.46              extraKeys:extraKeys
    1.47 +            flags:flags
    1.48              encFormat:PEP_enc_PEP
    1.49              status:status
    1.50              error:error];
    1.51 @@ -341,11 +344,10 @@
    1.52  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    1.53                                    forSelf:(PEPIdentity * _Nonnull)ownIdentity
    1.54                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    1.55 +                                    flags:(PEP_encrypt_flags_t)flags
    1.56                                     status:(PEP_STATUS * _Nullable)status
    1.57                                      error:(NSError * _Nullable * _Nullable)error
    1.58  {
    1.59 -    PEP_encrypt_flags_t flags = 0;
    1.60 -
    1.61      message *_src = PEP_messageDictToStruct([self removeEmptyRecipients:messageDict]);
    1.62      pEp_identity *ident = PEP_identityToStruct(ownIdentity);
    1.63      message *_dst = NULL;
    1.64 @@ -391,6 +393,7 @@
    1.65  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    1.66                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
    1.67                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    1.68 +                                   flags:(PEP_encrypt_flags_t)flags
    1.69                                    status:(PEP_STATUS * _Nullable)status
    1.70                                     error:(NSError * _Nullable * _Nullable)error
    1.71  {
    1.72 @@ -398,6 +401,7 @@
    1.73                         encryptMessageDict:message.dictionary
    1.74                         forSelf:ownIdentity
    1.75                         extraKeys:extraKeys
    1.76 +                       flags:flags
    1.77                         status:status
    1.78                         error:error];
    1.79  
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Wed Jun 13 11:30:24 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Mon Jun 18 11:37:17 2018 +0200
     2.3 @@ -76,6 +76,7 @@
     2.4  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     2.5                                      extraKeys:(PEPStringList * _Nullable)extraKeys
     2.6                                  encFormat:(PEP_enc_format)encFormat
     2.7 +                                    flags:(PEP_encrypt_flags_t)flags
     2.8                                     status:(PEP_STATUS * _Nullable)status
     2.9                                      error:(NSError * _Nullable * _Nullable)error
    2.10  {
    2.11 @@ -84,6 +85,7 @@
    2.12              encryptMessageDict:messageDict
    2.13              extraKeys:extraKeys
    2.14              encFormat:encFormat
    2.15 +            flags:flags
    2.16              status:status
    2.17              error:error];
    2.18  }
    2.19 @@ -91,6 +93,7 @@
    2.20  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.21                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.22                                 encFormat:(PEP_enc_format)encFormat
    2.23 +                                   flags:(PEP_encrypt_flags_t)flags
    2.24                                    status:(PEP_STATUS * _Nullable)status
    2.25                                     error:(NSError * _Nullable * _Nullable)error
    2.26  {
    2.27 @@ -99,22 +102,30 @@
    2.28              encryptMessage:message
    2.29              extraKeys:extraKeys
    2.30              encFormat:encFormat
    2.31 +            flags:flags
    2.32              status:status
    2.33              error:error];
    2.34  }
    2.35  
    2.36  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.37                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.38 +                                   flags:(PEP_encrypt_flags_t)flags
    2.39                                    status:(PEP_STATUS * _Nullable)status
    2.40                                     error:(NSError * _Nullable * _Nullable)error
    2.41  {
    2.42      PEPInternalSession *session = [PEPSessionProvider session];
    2.43 -    return [session encryptMessage:message extraKeys:extraKeys status:status error:error];
    2.44 +    return [session
    2.45 +            encryptMessage:message
    2.46 +            extraKeys:extraKeys
    2.47 +            flags:flags
    2.48 +            status:status
    2.49 +            error:error];
    2.50  }
    2.51  
    2.52  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    2.53                                    forSelf:(PEPIdentity * _Nonnull)ownIdentity
    2.54                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    2.55 +                                    flags:(PEP_encrypt_flags_t)flags
    2.56                                     status:(PEP_STATUS * _Nullable)status
    2.57                                      error:(NSError * _Nullable * _Nullable)error
    2.58  {
    2.59 @@ -123,6 +134,7 @@
    2.60              encryptMessageDict:messageDict
    2.61              forSelf:ownIdentity
    2.62              extraKeys:extraKeys
    2.63 +            flags:flags
    2.64              status:status
    2.65              error:error];
    2.66  }
    2.67 @@ -130,6 +142,7 @@
    2.68  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.69                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
    2.70                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.71 +                                   flags:(PEP_encrypt_flags_t)flags
    2.72                                    status:(PEP_STATUS * _Nullable)status
    2.73                                     error:(NSError * _Nullable * _Nullable)error
    2.74  {
    2.75 @@ -138,6 +151,7 @@
    2.76              encryptMessage:message
    2.77              forSelf:ownIdentity
    2.78              extraKeys:extraKeys
    2.79 +            flags:flags
    2.80              status:status
    2.81              error:error];
    2.82  }
     3.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Wed Jun 13 11:30:24 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPSessionProtocol.h	Mon Jun 18 11:37:17 2018 +0200
     3.3 @@ -54,6 +54,7 @@
     3.4   */
     3.5  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     3.6                                  extraKeys:(PEPStringList * _Nullable)extraKeys
     3.7 +                                    flags:(PEP_encrypt_flags_t)flags
     3.8                                  encFormat:(PEP_enc_format)encFormat
     3.9                                     status:(PEP_STATUS * _Nullable)status
    3.10                                      error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.11 @@ -64,6 +65,7 @@
    3.12   */
    3.13  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.14                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    3.15 +                                   flags:(PEP_encrypt_flags_t)flags
    3.16                                 encFormat:(PEP_enc_format)encFormat
    3.17                                    status:(PEP_STATUS * _Nullable)status
    3.18                                     error:(NSError * _Nullable * _Nullable)error;
    3.19 @@ -71,6 +73,7 @@
    3.20  /** Encrypt a message with default encryption format (PEP_enc_PEP) */
    3.21  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.22                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    3.23 +                                   flags:(PEP_encrypt_flags_t)flags
    3.24                                    status:(PEP_STATUS * _Nullable)status
    3.25                                     error:(NSError * _Nullable * _Nullable)error;
    3.26  
    3.27 @@ -78,6 +81,7 @@
    3.28  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    3.29                                    forSelf:(PEPIdentity * _Nonnull)ownIdentity
    3.30                                  extraKeys:(PEPStringList * _Nullable)extraKeys
    3.31 +                                    flags:(PEP_encrypt_flags_t)flags
    3.32                                     status:(PEP_STATUS * _Nullable)status
    3.33                                      error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.34  
    3.35 @@ -85,6 +89,7 @@
    3.36  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.37                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
    3.38                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    3.39 +                                   flags:(PEP_encrypt_flags_t)flags
    3.40                                    status:(PEP_STATUS * _Nullable)status
    3.41                                     error:(NSError * _Nullable * _Nullable)error;
    3.42