Using immutable dicts, showing in signatures
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 11 Mar 2016 19:09:55 +0100
changeset 10177f011e32818
parent 100 c2f33f275d55
child 102 ca5c8d4ec6e2
Using immutable dicts, showing in signatures
iOSTests/iOSTests.m
pEpiOSAdapter/PEPMessage.h
pEpiOSAdapter/PEPMessage.m
pEpiOSAdapter/PEPSession.h
pEpiOSAdapter/PEPSession.m
pEpiOSAdapter/PEPiOSAdapter.m
     1.1 --- a/iOSTests/iOSTests.m	Mon Mar 07 09:34:45 2016 +0100
     1.2 +++ b/iOSTests/iOSTests.m	Fri Mar 11 19:09:55 2016 +0100
     1.3 @@ -364,7 +364,7 @@
     1.4      XCTAssert( clr == PEP_rating_yellow);
     1.5  
     1.6      NSMutableDictionary *encmsg;
     1.7 -    PEP_STATUS status = [session encryptMessage:msg extra:@[] dest:&encmsg];
     1.8 +    PEP_STATUS status = [session encryptMessageDict:msg extra:@[] dest:&encmsg];
     1.9      
    1.10      XCTAssert(status == PEP_STATUS_OK);
    1.11      
    1.12 @@ -403,7 +403,7 @@
    1.13                                      @YES, @"outgoing",
    1.14                                      nil];
    1.15          
    1.16 -        PEP_STATUS status = [session encryptMessage:msg extra:@[] dest:&petrasMsg];
    1.17 +        PEP_STATUS status = [session encryptMessageDict:msg extra:@[] dest:&petrasMsg];
    1.18          XCTAssert(status == PEP_UNENCRYPTED);
    1.19  
    1.20      }
    1.21 @@ -430,7 +430,7 @@
    1.22      
    1.23          NSMutableDictionary *decmsg;
    1.24          NSArray* keys;
    1.25 -        PEP_color clr = [session decryptMessage:petrasMsg dest:&decmsg keys:&keys];
    1.26 +        PEP_color clr = [session decryptMessageDict:petrasMsg dest:&decmsg keys:&keys];
    1.27          XCTAssert(clr == PEP_rating_unencrypted);
    1.28  
    1.29          NSMutableDictionary *msg = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    1.30 @@ -446,7 +446,7 @@
    1.31                                      @YES, @"outgoing",
    1.32                                      nil];
    1.33          
    1.34 -        PEP_STATUS status = [session encryptMessage:msg extra:@[] dest:&mirosMsg];
    1.35 +        PEP_STATUS status = [session encryptMessageDict:msg extra:@[] dest:&mirosMsg];
    1.36          XCTAssert(status == PEP_STATUS_OK);
    1.37          
    1.38      }
    1.39 @@ -464,7 +464,7 @@
    1.40          [encmsg setObject:identMiroAtPetra.mutableCopy forKey:@"from"];
    1.41          
    1.42          
    1.43 -        PEP_color clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.44 +        PEP_color clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.45          
    1.46          XCTAssert(clr == PEP_rating_reliable);
    1.47          
    1.48 @@ -478,31 +478,31 @@
    1.49          // Trust to that identity
    1.50          [session trustPersonalKey:identMiroAtPetra];
    1.51  
    1.52 -        clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.53 +        clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.54          XCTAssertEqual(clr, PEP_rating_trusted, @"Not trusted");
    1.55  
    1.56          // Undo trust
    1.57          [session keyResetTrust:identMiroAtPetra];
    1.58          
    1.59 -        clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.60 +        clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.61          XCTAssertEqual(clr, PEP_rating_reliable, @"keyResetTrust didn't work?");
    1.62          
    1.63          // Try compromized
    1.64          [session keyCompromized:identMiroAtPetra];
    1.65  
    1.66 -        clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.67 +        clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.68          XCTAssertEqual(clr, PEP_rating_mistrust, @"Not mistrusted");
    1.69          
    1.70          // Regret
    1.71          [session keyResetTrust:identMiroAtPetra];
    1.72          
    1.73 -        clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.74 +        clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.75          XCTAssertEqual(clr, PEP_rating_reliable, @"keyResetTrust didn't work?");
    1.76          
    1.77          // Trust again.
    1.78          [session trustPersonalKey:identMiroAtPetra];
    1.79          
    1.80 -        clr = [session decryptMessage:encmsg dest:&decmsg keys:&keys];
    1.81 +        clr = [session decryptMessageDict:encmsg dest:&decmsg keys:&keys];
    1.82          XCTAssertEqual(clr, PEP_rating_trusted, @"Not trusted");
    1.83          
    1.84          XCTAssert([@"That was so easy !" compare:decmsg[@"longmsg"]]==0);
    1.85 @@ -572,7 +572,7 @@
    1.86  
    1.87      NSArray* keys;
    1.88      NSMutableDictionary *pepDecryptedMail;
    1.89 -    PEP_color color = [session decryptMessage:msgDict dest:&pepDecryptedMail keys:&keys];
    1.90 +    PEP_color color = [session decryptMessageDict:msgDict dest:&pepDecryptedMail keys:&keys];
    1.91      XCTAssertEqual(color, PEP_rating_reliable);
    1.92  
    1.93      [self pEpCleanUp];
    1.94 @@ -598,7 +598,7 @@
    1.95  
    1.96      NSArray* keys;
    1.97      NSMutableDictionary *pepDecryptedMail;
    1.98 -    PEP_color color = [session decryptMessage:msgDict dest:&pepDecryptedMail keys:&keys];
    1.99 +    PEP_color color = [session decryptMessageDict:msgDict dest:&pepDecryptedMail keys:&keys];
   1.100      XCTAssertEqual(color, PEP_rating_reliable);
   1.101  
   1.102      [self pEpCleanUp];
   1.103 @@ -624,7 +624,7 @@
   1.104  
   1.105      NSArray* keys;
   1.106      NSMutableDictionary *pepDecryptedMail;
   1.107 -    PEP_color color = [session decryptMessage:msgDict dest:&pepDecryptedMail keys:&keys];
   1.108 +    PEP_color color = [session decryptMessageDict:msgDict dest:&pepDecryptedMail keys:&keys];
   1.109      XCTAssertEqual(color, PEP_rating_reliable);
   1.110  
   1.111      [self pEpCleanUp];
   1.112 @@ -653,7 +653,7 @@
   1.113  
   1.114      NSArray* keys;
   1.115      NSMutableDictionary *pepDecryptedMail;
   1.116 -    PEP_color color = [session decryptMessage:msgDict dest:&pepDecryptedMail keys:&keys];
   1.117 +    PEP_color color = [session decryptMessageDict:msgDict dest:&pepDecryptedMail keys:&keys];
   1.118      XCTAssertEqual(color, PEP_rating_reliable);
   1.119  
   1.120      [self pEpCleanUp];
   1.121 @@ -684,7 +684,7 @@
   1.122  
   1.123      NSArray* keys;
   1.124      NSMutableDictionary *pepDecryptedMail;
   1.125 -    [session decryptMessage:msgDict dest:&pepDecryptedMail keys:&keys];
   1.126 +    [session decryptMessageDict:msgDict dest:&pepDecryptedMail keys:&keys];
   1.127      XCTAssertNotNil(pepDecryptedMail[kPepLongMessage]);
   1.128  
   1.129      [self pEpCleanUp];
   1.130 @@ -745,7 +745,7 @@
   1.131                                                          lowercaseString]);
   1.132              [session importKey:pubKeyPartner1];
   1.133              [session importKey:pubKeyPartner2];
   1.134 -            PEP_STATUS status = [session encryptMessage:mail extra:nil dest:&pepEncMail];
   1.135 +            PEP_STATUS status = [session encryptMessageDict:mail extra:nil dest:&pepEncMail];
   1.136              XCTAssertEqual(status, PEP_STATUS_OK);
   1.137          }];
   1.138      }
   1.139 @@ -777,7 +777,7 @@
   1.140  
   1.141              NSMutableDictionary *pepDecryptedMail;
   1.142              NSArray *keys = [NSArray array];
   1.143 -            [session decryptMessage:pepEncMail dest:&pepDecryptedMail keys:&keys];
   1.144 +            [session decryptMessageDict:pepEncMail dest:&pepDecryptedMail keys:&keys];
   1.145  
   1.146              // If this assert holds, then the engine ignores BCCs when encrypting
   1.147              XCTAssertNotEqualObjects(pepDecryptedMail[kPepLongMessage], theMessage);
     2.1 --- a/pEpiOSAdapter/PEPMessage.h	Mon Mar 07 09:34:45 2016 +0100
     2.2 +++ b/pEpiOSAdapter/PEPMessage.h	Fri Mar 11 19:09:55 2016 +0100
     2.3 @@ -12,8 +12,8 @@
     2.4  NSArray *PEP_arrayFromStringlist(stringlist_t *sl);
     2.5  stringlist_t *PEP_arrayToStringlist(NSArray *array);
     2.6  
     2.7 -pEp_identity *PEP_identityToStruct(NSDictionary *dict);
     2.8 -NSMutableDictionary *PEP_identityFromStruct(pEp_identity *ident);
     2.9 +pEp_identity *PEP_identityDictToStruct(NSDictionary *dict);
    2.10 +NSDictionary *PEP_identityDictFromStruct(pEp_identity *ident);
    2.11  
    2.12 -message *PEP_messageToStruct(NSMutableDictionary *dict);
    2.13 -NSMutableDictionary *PEP_messageFromStruct(message *msg);
    2.14 +message *PEP_messageDictToStruct(NSDictionary *dict);
    2.15 +NSDictionary *PEP_messageDictFromStruct(message *msg);
     3.1 --- a/pEpiOSAdapter/PEPMessage.m	Mon Mar 07 09:34:45 2016 +0100
     3.2 +++ b/pEpiOSAdapter/PEPMessage.m	Fri Mar 11 19:09:55 2016 +0100
     3.3 @@ -107,7 +107,7 @@
     3.4      return _bl;
     3.5  }
     3.6  
     3.7 -NSMutableDictionary *PEP_identityFromStruct(pEp_identity *ident)
     3.8 +NSDictionary *PEP_identityDictFromStruct(pEp_identity *ident)
     3.9  {
    3.10      NSMutableDictionary *dict = [NSMutableDictionary new];
    3.11  
    3.12 @@ -137,7 +137,7 @@
    3.13      return dict;
    3.14  }
    3.15  
    3.16 -pEp_identity *PEP_identityToStruct(NSDictionary *dict)
    3.17 +pEp_identity *PEP_identityDictToStruct(NSDictionary *dict)
    3.18  {
    3.19      pEp_identity *ident = new_identity(NULL, NULL, NULL, NULL);
    3.20      
    3.21 @@ -182,7 +182,7 @@
    3.22      NSMutableArray *array = [NSMutableArray array];
    3.23      
    3.24      for (identity_list *_il = il; _il && _il->ident; _il = _il->next) {
    3.25 -        [array addObject:PEP_identityFromStruct(il->ident)];
    3.26 +        [array addObject:PEP_identityDictFromStruct(il->ident)];
    3.27      }
    3.28      
    3.29      return array;
    3.30 @@ -196,7 +196,7 @@
    3.31      
    3.32      identity_list *_il = il;
    3.33      for (NSDictionary *dict in array) {
    3.34 -        _il = identity_list_add(_il, PEP_identityToStruct(dict));
    3.35 +        _il = identity_list_add(_il, PEP_identityDictToStruct(dict));
    3.36      }
    3.37      
    3.38      return il;
    3.39 @@ -210,25 +210,25 @@
    3.40      
    3.41      identity_list *_il = il;
    3.42      for (NSMutableDictionary *address in array) {
    3.43 -        _il = identity_list_add(_il, PEP_identityToStruct(address));
    3.44 +        _il = identity_list_add(_il, PEP_identityDictToStruct(address));
    3.45      }
    3.46      
    3.47      return il;
    3.48  }
    3.49  
    3.50 -NSMutableArray *PEP_identityArrayFromList(identity_list *il)
    3.51 +NSArray *PEP_identityArrayFromList(identity_list *il)
    3.52  {
    3.53      NSMutableArray *array = [NSMutableArray array];
    3.54      
    3.55      for (identity_list *_il = il; _il && _il->ident; _il = _il->next) {
    3.56 -        NSMutableDictionary *address = PEP_identityFromStruct(_il->ident);
    3.57 +        NSDictionary *address = PEP_identityDictFromStruct(_il->ident);
    3.58          [array addObject:address];
    3.59      }
    3.60      
    3.61      return array;
    3.62  }
    3.63  
    3.64 -NSMutableDictionary *PEP_messageFromStruct(message *msg)
    3.65 +NSDictionary *PEP_messageDictFromStruct(message *msg)
    3.66  {
    3.67      NSMutableDictionary *dict = [NSMutableDictionary new];
    3.68      if (msg && dict) {
    3.69 @@ -248,13 +248,13 @@
    3.70              [dict setObject:[NSDate dateWithTimeIntervalSince1970:mktime(msg->recv)] forKey:@"recv"];
    3.71          
    3.72          if (msg->from)
    3.73 -            [dict setObject:PEP_identityFromStruct(msg->from) forKey:@"from"];
    3.74 +            [dict setObject:PEP_identityDictFromStruct(msg->from) forKey:@"from"];
    3.75          
    3.76          if (msg->to && msg->to->ident)
    3.77              [dict setObject:PEP_identityArrayFromList(msg->to) forKey:@"to"];
    3.78          
    3.79          if (msg->recv_by)
    3.80 -            [dict setObject:PEP_identityFromStruct(msg->recv_by) forKey:@"recv_by"];
    3.81 +            [dict setObject:PEP_identityDictFromStruct(msg->recv_by) forKey:@"recv_by"];
    3.82          
    3.83          if (msg->cc && msg->cc->ident)
    3.84              [dict setObject:PEP_identityArrayFromList(msg->cc) forKey:@"cc"];
    3.85 @@ -275,7 +275,8 @@
    3.86              [dict setObject:PEP_arrayFromStringPairlist(msg->opt_fields) forKey:@"opt_fields"];
    3.87          
    3.88          if (msg->longmsg_formatted)
    3.89 -            [dict setObject:[NSString stringWithUTF8String:msg->longmsg_formatted] forKey:@"longmsg_formatted"];
    3.90 +            [dict setObject:[NSString stringWithUTF8String:msg->longmsg_formatted]
    3.91 +                     forKey:@"longmsg_formatted"];
    3.92  
    3.93          if (msg->longmsg)
    3.94              [dict setObject:[NSString stringWithUTF8String:msg->longmsg] forKey:@"longmsg"];
    3.95 @@ -289,7 +290,7 @@
    3.96  }
    3.97  
    3.98  
    3.99 -message *PEP_messageToStruct(NSMutableDictionary *dict)
   3.100 +message *PEP_messageDictToStruct(NSDictionary *dict)
   3.101  {
   3.102      // Direction default to incoming
   3.103      PEP_msg_direction dir = PEP_dir_incoming;
   3.104 @@ -303,11 +304,13 @@
   3.105          return NULL;
   3.106      
   3.107      if ([dict objectForKey:@"id"])
   3.108 -        msg->id = strdup([[[dict objectForKey:@"id"] precomposedStringWithCanonicalMapping] UTF8String]);
   3.109 +        msg->id = strdup([[[dict objectForKey:@"id"] precomposedStringWithCanonicalMapping]
   3.110 +                          UTF8String]);
   3.111      
   3.112      if ([dict objectForKey:@"shortmsg"])
   3.113 -        msg->shortmsg = strdup([[[dict objectForKey:@"shortmsg"] precomposedStringWithCanonicalMapping] UTF8String]);
   3.114 -    
   3.115 +        msg->shortmsg = strdup([[[dict objectForKey:@"shortmsg"]
   3.116 +                                 precomposedStringWithCanonicalMapping] UTF8String]);
   3.117 +
   3.118      if ([dict objectForKey:@"sent"])
   3.119          msg->sent = new_timestamp([[dict objectForKey:@"sent"] timeIntervalSince1970]);
   3.120      
   3.121 @@ -315,13 +318,13 @@
   3.122          msg->recv = new_timestamp([[dict objectForKey:@"recv"] timeIntervalSince1970]);
   3.123      
   3.124      if ([dict objectForKey:@"from"])
   3.125 -        msg->from = PEP_identityToStruct([dict objectForKey:@"from"]);
   3.126 +        msg->from = PEP_identityDictToStruct([dict objectForKey:@"from"]);
   3.127  
   3.128      if ([dict objectForKey:@"to"])
   3.129          msg->to = PEP_identityArrayToList([dict objectForKey:@"to"]);
   3.130  
   3.131      if ([dict objectForKey:@"recv_by"])
   3.132 -        msg->recv_by = PEP_identityToStruct([dict objectForKey:@"recv_by"]);
   3.133 +        msg->recv_by = PEP_identityDictToStruct([dict objectForKey:@"recv_by"]);
   3.134  
   3.135      if ([dict objectForKey:@"cc"])
   3.136          msg->cc = PEP_identityArrayToList([dict objectForKey:@"cc"]);
     4.1 --- a/pEpiOSAdapter/PEPSession.h	Mon Mar 07 09:34:45 2016 +0100
     4.2 +++ b/pEpiOSAdapter/PEPSession.h	Fri Mar 11 19:09:55 2016 +0100
     4.3 @@ -66,10 +66,10 @@
     4.4  + (void)dispatchSyncOnSession:(PEPSessionBlock)block;
     4.5  
     4.6  /** Decrypt a message */
     4.7 -- (PEP_color)decryptMessage:(NSMutableDictionary *)src dest:(NSMutableDictionary **)dst keys:(NSArray **)keys;
     4.8 +- (PEP_color)decryptMessageDict:(NSDictionary *)src dest:(NSDictionary **)dst keys:(NSArray **)keys;
     4.9  
    4.10  /** Encrypt a message */
    4.11 -- (PEP_STATUS)encryptMessage:(NSMutableDictionary *)src extra:(NSArray *)keys dest:(NSMutableDictionary **)dst;
    4.12 +- (PEP_STATUS)encryptMessageDict:(NSDictionary *)src extra:(NSArray *)keys dest:(NSDictionary **)dst;
    4.13  
    4.14  /** Determine the status color of a message to be sent */
    4.15  - (PEP_color)outgoingMessageColor:(NSMutableDictionary *)msg;
     5.1 --- a/pEpiOSAdapter/PEPSession.m	Mon Mar 07 09:34:45 2016 +0100
     5.2 +++ b/pEpiOSAdapter/PEPSession.m	Fri Mar 11 19:09:55 2016 +0100
     5.3 @@ -103,9 +103,9 @@
     5.4      release(_session);
     5.5  }
     5.6  
     5.7 -- (PEP_color)decryptMessage:(NSMutableDictionary *)src dest:(NSMutableDictionary **)dst keys:(NSArray **)keys
     5.8 +- (PEP_color)decryptMessageDict:(NSDictionary *)src dest:(NSDictionary **)dst keys:(NSArray **)keys
     5.9  {
    5.10 -    message * _src = PEP_messageToStruct(src);
    5.11 +    message * _src = PEP_messageDictToStruct(src);
    5.12      message * _dst = NULL;
    5.13      stringlist_t * _keys = NULL;
    5.14      PEP_color color = PEP_rating_undefined;
    5.15 @@ -114,13 +114,13 @@
    5.16          decrypt_message(_session, _src, &_dst, &_keys, &color);
    5.17      }
    5.18  
    5.19 -    NSMutableDictionary * dst_;
    5.20 +    NSDictionary * dst_;
    5.21  
    5.22      if (_dst) {
    5.23 -        dst_ = PEP_messageFromStruct(_dst);
    5.24 +        dst_ = PEP_messageDictFromStruct(_dst);
    5.25      }
    5.26      else {
    5.27 -        dst_ = PEP_messageFromStruct(_src);
    5.28 +        dst_ = PEP_messageDictFromStruct(_src);
    5.29      }
    5.30  
    5.31      NSArray * keys_ = nil;
    5.32 @@ -136,10 +136,10 @@
    5.33      return color;
    5.34  }
    5.35  
    5.36 -- (PEP_STATUS)encryptMessage:(NSMutableDictionary *)src extra:(NSArray *)keys dest:(NSMutableDictionary **)dst
    5.37 +- (PEP_STATUS)encryptMessageDict:(NSDictionary *)src extra:(NSArray *)keys dest:(NSDictionary **)dst
    5.38  {
    5.39      PEP_STATUS status;
    5.40 -    message * _src = PEP_messageToStruct(src);
    5.41 +    message * _src = PEP_messageDictToStruct(src);
    5.42      message * _dst = NULL;
    5.43      stringlist_t * _keys = PEP_arrayToStringlist(keys);
    5.44  
    5.45 @@ -147,13 +147,13 @@
    5.46          status = encrypt_message(_session, _src, _keys, &_dst, PEP_enc_PGP_MIME);
    5.47      }
    5.48  
    5.49 -    NSMutableDictionary * dst_;
    5.50 +    NSDictionary * dst_;
    5.51  
    5.52      if (_dst) {
    5.53 -        dst_ = PEP_messageFromStruct(_dst);
    5.54 +        dst_ = PEP_messageDictFromStruct(_dst);
    5.55      }
    5.56      else {
    5.57 -        dst_ = PEP_messageFromStruct(_src);
    5.58 +        dst_ = PEP_messageDictFromStruct(_src);
    5.59      }
    5.60      *dst = dst_;
    5.61  
    5.62 @@ -166,7 +166,7 @@
    5.63  
    5.64  - (PEP_color)outgoingMessageColor:(NSMutableDictionary *)msg
    5.65  {
    5.66 -    message * _msg = PEP_messageToStruct(msg);
    5.67 +    message * _msg = PEP_messageDictToStruct(msg);
    5.68      PEP_color color = PEP_rating_undefined;
    5.69  
    5.70      @synchronized (self) {
    5.71 @@ -180,7 +180,7 @@
    5.72  
    5.73  - (PEP_color)identityColor:(NSMutableDictionary *)identity
    5.74  {
    5.75 -    pEp_identity *ident = PEP_identityToStruct(identity);
    5.76 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
    5.77      PEP_color color = PEP_rating_undefined;
    5.78      
    5.79      @synchronized (self) {
    5.80 @@ -228,61 +228,61 @@
    5.81  
    5.82  - (void)mySelf:(NSMutableDictionary *)identity
    5.83  {
    5.84 -    pEp_identity *ident = PEP_identityToStruct(identity);
    5.85 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
    5.86  
    5.87      @synchronized(self) {
    5.88          myself(_session, ident);
    5.89      }
    5.90  
    5.91 -    [identity setValuesForKeysWithDictionary:PEP_identityFromStruct(ident)];
    5.92 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
    5.93      free_identity(ident);
    5.94  }
    5.95  
    5.96  - (void)updateIdentity:(NSMutableDictionary *)identity
    5.97  {
    5.98 -    pEp_identity *ident = PEP_identityToStruct(identity);
    5.99 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
   5.100  
   5.101      @synchronized(self) {
   5.102          update_identity(_session, ident);
   5.103      }
   5.104  
   5.105 -    [identity setValuesForKeysWithDictionary:PEP_identityFromStruct(ident)];
   5.106 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
   5.107      free_identity(ident);
   5.108  }
   5.109  
   5.110  - (void)trustPersonalKey:(NSMutableDictionary *)identity
   5.111  {
   5.112 -    pEp_identity *ident = PEP_identityToStruct(identity);
   5.113 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
   5.114      
   5.115      @synchronized(self) {
   5.116          trust_personal_key(_session, ident);
   5.117      }
   5.118      
   5.119 -    [identity setValuesForKeysWithDictionary:PEP_identityFromStruct(ident)];
   5.120 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
   5.121      free_identity(ident);
   5.122  }
   5.123  
   5.124  - (void)keyResetTrust:(NSMutableDictionary *)identity
   5.125  {
   5.126 -    pEp_identity *ident = PEP_identityToStruct(identity);
   5.127 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
   5.128      
   5.129      @synchronized(self) {
   5.130          key_reset_trust(_session, ident);
   5.131      }
   5.132      
   5.133 -    [identity setValuesForKeysWithDictionary:PEP_identityFromStruct(ident)];
   5.134 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
   5.135      free_identity(ident);
   5.136  }
   5.137  
   5.138  - (void)keyCompromized:(NSMutableDictionary *)identity
   5.139  {
   5.140 -    pEp_identity *ident = PEP_identityToStruct(identity);
   5.141 +    pEp_identity *ident = PEP_identityDictToStruct(identity);
   5.142      
   5.143      @synchronized(self) {
   5.144          key_compromized(_session, ident);
   5.145      }
   5.146      
   5.147 -    [identity setValuesForKeysWithDictionary:PEP_identityFromStruct(ident)];
   5.148 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
   5.149      free_identity(ident);
   5.150  }
   5.151  
     6.1 --- a/pEpiOSAdapter/PEPiOSAdapter.m	Mon Mar 07 09:34:45 2016 +0100
     6.2 +++ b/pEpiOSAdapter/PEPiOSAdapter.m	Fri Mar 11 19:09:55 2016 +0100
     6.3 @@ -20,7 +20,7 @@
     6.4      //PEPQueue *q = (__bridge PEPQueue *)management;
     6.5      PEPQueue *q = [PEPiOSAdapter getQueue];
     6.6      
     6.7 -    NSMutableDictionary *identity = PEP_identityFromStruct(ident);
     6.8 +    NSDictionary *identity = PEP_identityDictFromStruct(ident);
     6.9      
    6.10      [q enqueue:identity];
    6.11      return 0;
    6.12 @@ -36,7 +36,7 @@
    6.13      NSDictionary *ident = [q dequeue];
    6.14      
    6.15      if (ident)
    6.16 -        return PEP_identityToStruct(ident);
    6.17 +        return PEP_identityDictToStruct(ident);
    6.18      else
    6.19          return NULL;
    6.20  }