merges default Xcode11
authorbuff <andreas@pep-project.org>
Tue, 15 Oct 2019 19:40:52 +0200
branchXcode11
changeset 131996838abcfa49
parent 1315 c97c2a419f7b
parent 1318 bdceebc31019
child 1320 837c04ee89aa
merges default
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed Oct 09 23:19:42 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Tue Oct 15 19:40:52 2019 +0200
     1.3 @@ -75,23 +75,6 @@
     1.4  
     1.5  #pragma mark - DEBUG UTILS
     1.6  
     1.7 -/**
     1.8 - Saves the given message dict as a plist to the local filesystem
     1.9 - (directly under NSApplicationSupportDirectory).
    1.10 - Since the complete output file will be logged by `debugSaveToFilePath`,
    1.11 - you can get access to the files easily when it's the simulator.
    1.12 - */
    1.13 -- (void)debugOutPutMessageDict:(PEPDict * _Nonnull)src
    1.14 -{
    1.15 -    NSString *from = src[kPepFrom][kPepAddress];
    1.16 -    NSArray *tos = src[kPepTo];
    1.17 -    NSString *to = tos[0][kPepAddress];
    1.18 -    NSString *msgID = src[kPepID];
    1.19 -    NSString *fileName = [NSString stringWithFormat:@"%@_from(%@)_%@",
    1.20 -                          to, from, msgID];
    1.21 -    [src debugSaveToFilePath:fileName];
    1.22 -}
    1.23 -
    1.24  #pragma mark - PEPSessionProtocol
    1.25  
    1.26  void decryptMessageDictFree(message *src, message *dst, stringlist_t *extraKeys)
    1.27 @@ -272,8 +255,7 @@
    1.28      message *_dst = NULL;
    1.29      stringlist_t *_keys = PEP_arrayToStringlist(extraKeys);
    1.30  
    1.31 -    PEPStatus theStatus = (PEPStatus) encrypt_message(
    1.32 -                                                      _session,
    1.33 +    PEPStatus theStatus = (PEPStatus) encrypt_message(_session,
    1.34                                                        _src,
    1.35                                                        _keys,
    1.36                                                        &_dst,
    1.37 @@ -397,7 +379,6 @@
    1.38                         extraKeys:extraKeys
    1.39                         status:status
    1.40                         error:error];
    1.41 -
    1.42      if (target) {
    1.43          PEPMessage *encrypted = [PEPMessage new];
    1.44          [encrypted setValuesForKeysWithDictionary:target];
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Wed Oct 09 23:19:42 2019 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Tue Oct 15 19:40:52 2019 +0200
     2.3 @@ -41,24 +41,6 @@
     2.4      [PEPSessionProvider cleanup];
     2.5  }
     2.6  
     2.7 -- (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
     2.8 -                                    flags:(PEPDecryptFlags * _Nullable)flags
     2.9 -                                   rating:(PEPRating * _Nullable)rating
    2.10 -                                extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
    2.11 -                                   status:(PEPStatus * _Nullable)status
    2.12 -                                    error:(NSError * _Nullable * _Nullable)error
    2.13 -{
    2.14 -    PEPInternalSession *session = [PEPSessionProvider session];
    2.15 -    RETURN_ON_ERROR(session, error, nil);
    2.16 -    return [session
    2.17 -            decryptMessageDict:messageDict
    2.18 -            flags:flags
    2.19 -            rating:rating
    2.20 -            extraKeys:extraKeys
    2.21 -            status:status
    2.22 -            error:error];
    2.23 -}
    2.24 -
    2.25  - (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
    2.26                                     flags:(PEPDecryptFlags * _Nullable)flags
    2.27                                    rating:(PEPRating * _Nullable)rating
    2.28 @@ -77,21 +59,6 @@
    2.29              error:error];
    2.30  }
    2.31  
    2.32 -- (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
    2.33 -                     xKeyList:(PEPStringList * _Nullable)xKeyList
    2.34 -                       rating:(PEPRating * _Nonnull)rating
    2.35 -                       status:(PEPStatus * _Nullable)status
    2.36 -                        error:(NSError * _Nullable * _Nullable)error
    2.37 -{
    2.38 -    PEPInternalSession *session = [PEPSessionProvider session];
    2.39 -    RETURN_ON_ERROR(session, error, NO);
    2.40 -    return [session reEvaluateMessageDict:messageDict
    2.41 -                                 xKeyList:xKeyList
    2.42 -                                   rating:rating
    2.43 -                                   status:status
    2.44 -                                    error:error];
    2.45 -}
    2.46 -
    2.47  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
    2.48                   xKeyList:(PEPStringList * _Nullable)xKeyList
    2.49                     rating:(PEPRating * _Nonnull)rating
    2.50 @@ -107,22 +74,6 @@
    2.51                                  error:error];
    2.52  }
    2.53  
    2.54 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    2.55 -                                    extraKeys:(PEPStringList * _Nullable)extraKeys
    2.56 -                                encFormat:(PEPEncFormat)encFormat
    2.57 -                                   status:(PEPStatus * _Nullable)status
    2.58 -                                    error:(NSError * _Nullable * _Nullable)error
    2.59 -{
    2.60 -    PEPInternalSession *session = [PEPSessionProvider session];
    2.61 -    RETURN_ON_ERROR(session, error, nil);
    2.62 -    return [session
    2.63 -            encryptMessageDict:messageDict
    2.64 -            extraKeys:extraKeys
    2.65 -            encFormat:encFormat
    2.66 -            status:status
    2.67 -            error:error];
    2.68 -}
    2.69 -
    2.70  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.71                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.72                                 encFormat:(PEPEncFormat)encFormat
    2.73 @@ -149,22 +100,6 @@
    2.74      return [session encryptMessage:message extraKeys:extraKeys status:status error:error];
    2.75  }
    2.76  
    2.77 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    2.78 -                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
    2.79 -                                extraKeys:(PEPStringList * _Nullable)extraKeys
    2.80 -                                   status:(PEPStatus * _Nullable)status
    2.81 -                                    error:(NSError * _Nullable * _Nullable)error
    2.82 -{
    2.83 -    PEPInternalSession *session = [PEPSessionProvider session];
    2.84 -    RETURN_ON_ERROR(session, error, nil);
    2.85 -    return [session
    2.86 -            encryptMessageDict:messageDict
    2.87 -            forSelf:ownIdentity
    2.88 -            extraKeys:extraKeys
    2.89 -            status:status
    2.90 -            error:error];
    2.91 -}
    2.92 -
    2.93  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    2.94                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
    2.95                                 extraKeys:(PEPStringList * _Nullable)extraKeys
    2.96 @@ -181,24 +116,6 @@
    2.97              error:error];
    2.98  }
    2.99  
   2.100 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
   2.101 -                                    toFpr:(NSString * _Nonnull)toFpr
   2.102 -                                encFormat:(PEPEncFormat)encFormat
   2.103 -                                    flags:(PEPDecryptFlags)flags
   2.104 -                                   status:(PEPStatus * _Nullable)status
   2.105 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated
   2.106 -{
   2.107 -    PEPInternalSession *session = [PEPSessionProvider session];
   2.108 -    RETURN_ON_ERROR(session, error, nil);
   2.109 -    return [session
   2.110 -            encryptMessageDict:messageDict
   2.111 -            toFpr:toFpr
   2.112 -            encFormat:encFormat
   2.113 -            flags:flags
   2.114 -            status:status
   2.115 -            error:error];
   2.116 -}
   2.117 -
   2.118  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
   2.119                                     toFpr:(NSString * _Nonnull)toFpr
   2.120                                 encFormat:(PEPEncFormat)encFormat
     3.1 --- a/pEpObjCAdapterFramework/PEPSessionProtocol.h	Wed Oct 09 23:19:42 2019 +0200
     3.2 +++ b/pEpObjCAdapterFramework/PEPSessionProtocol.h	Tue Oct 15 19:40:52 2019 +0200
     3.3 @@ -18,14 +18,6 @@
     3.4  @protocol PEPSessionProtocol <NSObject>
     3.5  
     3.6  /** Decrypt a message */
     3.7 -- (PEPDict * _Nullable)decryptMessageDict:(PEPMutableDict * _Nonnull)messageDict
     3.8 -                                    flags:(PEPDecryptFlags * _Nullable)flags
     3.9 -                                   rating:(PEPRating * _Nullable)rating
    3.10 -                                extraKeys:(PEPStringList * _Nullable * _Nullable)extraKeys
    3.11 -                                   status:(PEPStatus * _Nullable)status
    3.12 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.13 -
    3.14 -/** Decrypt a message */
    3.15  - (PEPMessage * _Nullable)decryptMessage:(PEPMessage * _Nonnull)message
    3.16                                     flags:(PEPDecryptFlags * _Nullable)flags
    3.17                                    rating:(PEPRating * _Nullable)rating
    3.18 @@ -34,13 +26,6 @@
    3.19                                     error:(NSError * _Nullable * _Nullable)error;
    3.20  
    3.21  /** Re-evaluate rating of decrypted message */
    3.22 -- (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
    3.23 -                     xKeyList:(PEPStringList *_Nullable)xKeyList
    3.24 -                       rating:(PEPRating * _Nonnull)rating
    3.25 -                       status:(PEPStatus * _Nullable)status
    3.26 -                        error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.27 -
    3.28 -/** Re-evaluate rating of decrypted message */
    3.29  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
    3.30                   xKeyList:(PEPStringList *_Nullable)xKeyList
    3.31                     rating:(PEPRating * _Nonnull)rating
    3.32 @@ -48,16 +33,6 @@
    3.33                      error:(NSError * _Nullable * _Nullable)error;
    3.34  
    3.35  /**
    3.36 - Encrypt a message dictionary, indicating the encoding format.
    3.37 - @note The resulting message dict could be the input one.
    3.38 - */
    3.39 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    3.40 -                                extraKeys:(PEPStringList * _Nullable)extraKeys
    3.41 -                                encFormat:(PEPEncFormat)encFormat
    3.42 -                                   status:(PEPStatus * _Nullable)status
    3.43 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.44 -
    3.45 -/**
    3.46   Encrypt a message, indicating the encoding format
    3.47   @note The resulting message dict could be the input one.
    3.48   */
    3.49 @@ -73,13 +48,6 @@
    3.50                                    status:(PEPStatus * _Nullable)status
    3.51                                     error:(NSError * _Nullable * _Nullable)error;
    3.52  
    3.53 -/** Encrypt a message dict for the given own identity */
    3.54 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    3.55 -                                  forSelf:(PEPIdentity * _Nonnull)ownIdentity
    3.56 -                                extraKeys:(PEPStringList * _Nullable)extraKeys
    3.57 -                                   status:(PEPStatus * _Nullable)status
    3.58 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.59 -
    3.60  /** Encrypt a message for the given own identity */
    3.61  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.62                                   forSelf:(PEPIdentity * _Nonnull)ownIdentity
    3.63 @@ -87,15 +55,7 @@
    3.64                                    status:(PEPStatus * _Nullable)status
    3.65                                     error:(NSError * _Nullable * _Nullable)error;
    3.66  
    3.67 -/** Encrypt a message dict to the given recipient FPR, attaching the private key */
    3.68 -- (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
    3.69 -                                    toFpr:(NSString * _Nonnull)toFpr
    3.70 -                                encFormat:(PEPEncFormat)encFormat
    3.71 -                                    flags:(PEPDecryptFlags)flags
    3.72 -                                   status:(PEPStatus * _Nullable)status
    3.73 -                                    error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.74 -
    3.75 -/** Encrypt a message dict to the given recipient FPR, attaching the private key */
    3.76 +/** Encrypt a message to the given recipient FPR, attaching the private key */
    3.77  - (PEPMessage * _Nullable)encryptMessage:(PEPMessage * _Nonnull)message
    3.78                                     toFpr:(NSString * _Nonnull)toFpr
    3.79                                 encFormat:(PEPEncFormat)encFormat
    3.80 @@ -128,7 +88,6 @@
    3.81  /**
    3.82   Supply an account used by our user himself. The identity is supplemented with the missing parts
    3.83  
    3.84 - An identity is a `NSDictionary` mapping a field name as `NSString` to different values.
    3.85   An identity can have the following fields (all other keys are ignored).
    3.86   It is not necessary to supply all fields; missing fields are supplemented by p≡p engine.
    3.87  
    3.88 @@ -143,11 +102,9 @@
    3.89   As an example:
    3.90  
    3.91   User has a mailbox. The mail address is "Dipul Khatri <dipul@inboxcube.com>". Then this would be:
    3.92 -
    3.93 - NSDictionary *ident = [NSDictionary dictionaryWithObjectsAndKeys:
    3.94 - @"Dipul Khatri", @"username", @"dipul@inboxcube.com", @"address",
    3.95 - @"23", @"user_id", nil];
    3.96 -
    3.97 + username = @"Dipul Khatri"
    3.98 + address= @"dipul@inboxcube.com"
    3.99 + user_id" = 23"
   3.100   */
   3.101  - (BOOL)mySelf:(PEPIdentity * _Nonnull)identity error:(NSError * _Nullable * _Nullable)error;
   3.102  
   3.103 @@ -161,21 +118,18 @@
   3.104  
   3.105  /**
   3.106   Mark a key as trusted with a person.
   3.107 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
   3.108   */
   3.109  - (BOOL)trustPersonalKey:(PEPIdentity * _Nonnull)identity
   3.110                     error:(NSError * _Nullable * _Nullable)error;
   3.111  
   3.112  /**
   3.113   if a key is not trusted by the user tell this using this message
   3.114 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
   3.115   */
   3.116  - (BOOL)keyMistrusted:(PEPIdentity * _Nonnull)identity
   3.117                  error:(NSError * _Nullable * _Nullable)error;
   3.118  
   3.119  /**
   3.120   Use this to undo keyCompromized or trustPersonalKey
   3.121 - See `mySelf:(NSMutableDictionary *)identity` for an explanation of identities.
   3.122   */
   3.123  - (BOOL)keyResetTrust:(PEPIdentity * _Nonnull)identity
   3.124                  error:(NSError * _Nullable * _Nullable)error;