... sync
authorVolker Birk <vb@pep.foundation>
Thu, 09 Aug 2018 17:33:39 +0200
branchsync
changeset 28347a35e7ea6138
parent 2833 ce3baad227c5
child 2835 20d73101227c
...
src/cryptotech.c
src/keymanagement.c
src/keymanagement.h
src/message_api.c
src/mime.c
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
src/pgp_gpg.c
src/sync.c
src/sync.h
src/sync_impl.h
sync/gen_statemachine.ysl2
     1.1 --- a/src/cryptotech.c	Thu Aug 09 13:39:49 2018 +0200
     1.2 +++ b/src/cryptotech.c	Thu Aug 09 17:33:39 2018 +0200
     1.3 @@ -62,11 +62,11 @@
     1.4  
     1.5      status = pgp_init(session, in_first);
     1.6      if (status != PEP_STATUS_OK)
     1.7 -        goto pep_error;
     1.8 +        goto pEp_error;
     1.9  
    1.10      return PEP_STATUS_OK;
    1.11  
    1.12 -pep_error:
    1.13 +pEp_error:
    1.14      pgp_release(session, in_first);
    1.15      return status;
    1.16  }
     2.1 --- a/src/keymanagement.c	Thu Aug 09 13:39:49 2018 +0200
     2.2 +++ b/src/keymanagement.c	Thu Aug 09 17:33:39 2018 +0200
     2.3 @@ -134,11 +134,11 @@
     2.4          ident->comm_type = ct;
     2.5      }
     2.6      
     2.7 -    bool pep_user = false;
     2.8 +    bool pEp_user = false;
     2.9      
    2.10 -    is_pep_user(session, ident, &pep_user);
    2.11 +    is_pEp_user(session, ident, &pEp_user);
    2.12  
    2.13 -    if (pep_user) {
    2.14 +    if (pEp_user) {
    2.15          switch (ct) {
    2.16              case PEP_ct_OpenPGP:
    2.17              case PEP_ct_OpenPGP_unconfirmed:
    2.18 @@ -369,7 +369,7 @@
    2.19      new_ident->me = new_ident->me || stored_ident->me;
    2.20  }
    2.21  
    2.22 -static void adjust_pep_trust_status(PEP_SESSION session, pEp_identity* identity) {
    2.23 +static void adjust_pEp_trust_status(PEP_SESSION session, pEp_identity* identity) {
    2.24      assert(session);
    2.25      assert(identity);
    2.26      
    2.27 @@ -377,11 +377,11 @@
    2.28          (identity->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
    2.29          return;
    2.30      
    2.31 -    bool pep_user;
    2.32 +    bool pEp_user;
    2.33      
    2.34 -    is_pep_user(session, identity, &pep_user);
    2.35 +    is_pEp_user(session, identity, &pEp_user);
    2.36      
    2.37 -    if (pep_user) {
    2.38 +    if (pEp_user) {
    2.39          PEP_comm_type confirmation_status = identity->comm_type & PEP_ct_confirmed;
    2.40          identity->comm_type = PEP_ct_pEp_unconfirmed | confirmation_status;    
    2.41      }
    2.42 @@ -456,7 +456,7 @@
    2.43          return_id->user_id = strdup(stored_ident->user_id);
    2.44      } 
    2.45      
    2.46 -    adjust_pep_trust_status(session, return_id);
    2.47 +    adjust_pEp_trust_status(session, return_id);
    2.48     
    2.49      // Call set_identity() to store
    2.50      if ((is_identity_default || is_user_default) &&
    2.51 @@ -615,7 +615,7 @@
    2.52              //    * call set_identity() to store
    2.53              if (status == PEP_STATUS_OK) {
    2.54                  // FIXME: Do we set if we had to copy in the address?
    2.55 -                adjust_pep_trust_status(session, identity);
    2.56 +                adjust_pEp_trust_status(session, identity);
    2.57                  status = set_identity(session, identity);
    2.58              }
    2.59              //  * Return: created identity
    2.60 @@ -709,7 +709,7 @@
    2.61                      status = get_key_rating(session, identity->fpr, &identity->comm_type);
    2.62              
    2.63                  //    * call set_identity() to store
    2.64 -                adjust_pep_trust_status(session, identity);            
    2.65 +                adjust_pEp_trust_status(session, identity);            
    2.66                  status = set_identity(session, identity);
    2.67              }
    2.68          }
    2.69 @@ -776,7 +776,7 @@
    2.70                  status = get_key_rating(session, identity->fpr, &identity->comm_type);
    2.71          
    2.72              //    * call set_identity() to store
    2.73 -            adjust_pep_trust_status(session, identity);            
    2.74 +            adjust_pEp_trust_status(session, identity);            
    2.75              status = set_identity(session, identity);
    2.76  
    2.77          }
    2.78 @@ -789,12 +789,12 @@
    2.79          if (session->examine_identity)
    2.80              session->examine_identity(identity, session->examine_management);
    2.81  
    2.82 -    goto pep_free;
    2.83 +    goto pEp_free;
    2.84  
    2.85  enomem:
    2.86      status = PEP_OUT_OF_MEMORY;
    2.87  
    2.88 -pep_free:
    2.89 +pEp_free:
    2.90      free(default_own_id);
    2.91      free_identity(stored_ident);
    2.92      return status;
    2.93 @@ -908,13 +908,13 @@
    2.94          status = set_userid_alias(session, default_own_id, identity->user_id);
    2.95          // Do we want this to be fatal? For now, we'll do it...
    2.96          if (status != PEP_STATUS_OK)
    2.97 -            goto pep_free;
    2.98 +            goto pEp_free;
    2.99              
   2.100          free(identity->user_id);
   2.101          identity->user_id = strdup(default_own_id);
   2.102          if (identity->user_id == NULL) {
   2.103              status = PEP_OUT_OF_MEMORY;
   2.104 -            goto pep_free;
   2.105 +            goto pEp_free;
   2.106          }
   2.107      }
   2.108  
   2.109 @@ -941,7 +941,7 @@
   2.110      assert(status != PEP_OUT_OF_MEMORY);
   2.111      if (status == PEP_OUT_OF_MEMORY) {
   2.112          status = PEP_OUT_OF_MEMORY;
   2.113 -        goto pep_free;
   2.114 +        goto pEp_free;
   2.115      }
   2.116  
   2.117      // Set usernames - priority is input username > stored name > address
   2.118 @@ -954,7 +954,7 @@
   2.119          identity->username = strdup(uname);
   2.120          if (identity->username == NULL) {
   2.121              status = PEP_OUT_OF_MEMORY;
   2.122 -            goto pep_free;
   2.123 +            goto pEp_free;
   2.124          }
   2.125      }
   2.126  
   2.127 @@ -970,14 +970,14 @@
   2.128          // Fall back / retrieve
   2.129          status = validate_fpr(session, stored_identity, false);
   2.130          if (status == PEP_OUT_OF_MEMORY)
   2.131 -            goto pep_free;
   2.132 +            goto pEp_free;
   2.133          if (status == PEP_STATUS_OK) {
   2.134              if (stored_identity->comm_type >= PEP_ct_strong_but_unconfirmed) {
   2.135                  identity->fpr = strdup(stored_identity->fpr);
   2.136                  assert(identity->fpr);
   2.137                  if (!identity->fpr) {
   2.138                      status = PEP_OUT_OF_MEMORY;
   2.139 -                    goto pep_free;
   2.140 +                    goto pEp_free;
   2.141                  }
   2.142                  valid_key_found = true;            
   2.143              }
   2.144 @@ -985,13 +985,13 @@
   2.145                  bool revoked = false;
   2.146                  status = key_revoked(session, stored_identity->fpr, &revoked);
   2.147                  if (status)
   2.148 -                    goto pep_free;
   2.149 +                    goto pEp_free;
   2.150                  if (revoked) {
   2.151                      revoked_fpr = strdup(stored_identity->fpr);
   2.152                      assert(revoked_fpr);
   2.153                      if (!revoked_fpr) {
   2.154                          status = PEP_OUT_OF_MEMORY;
   2.155 -                        goto pep_free;
   2.156 +                        goto pEp_free;
   2.157                      }
   2.158                  }
   2.159              }
   2.160 @@ -1037,41 +1037,15 @@
   2.161      
   2.162      status = set_identity(session, identity);
   2.163      if (status == PEP_STATUS_OK)
   2.164 -        status = set_as_pep_user(session, identity);
   2.165 +        status = set_as_pEp_user(session, identity);
   2.166  
   2.167 -pep_free:    
   2.168 +pEp_free:    
   2.169      free(default_own_id);
   2.170      free(revoked_fpr);                     
   2.171      free_identity(stored_identity);
   2.172      return status;
   2.173  }
   2.174  
   2.175 -// DYNAMIC_API PEP_STATUS initialise_own_identities(PEP_SESSION session,
   2.176 -//                                                  identity_list* my_idents) {
   2.177 -//     PEP_STATUS status = PEP_STATUS_OK;
   2.178 -//     if (!session)
   2.179 -//         return PEP_ILLEGAL_VALUE;
   2.180 -//         
   2.181 -//     if (!my_idents)
   2.182 -//         return PEP_STATUS_OK;
   2.183 -//             
   2.184 -//     identity_list* ident_curr = my_idents;
   2.185 -//     while (ident_curr) {
   2.186 -//         pEp_identity* ident = ident_curr->ident;
   2.187 -//         if (!ident || !ident->address) {
   2.188 -//             status = PEP_ILLEGAL_VALUE;
   2.189 -//             goto pep_error;
   2.190 -//         }
   2.191 -// 
   2.192 -//         status = _myself(session, ident, false, false);
   2.193 -//         
   2.194 -//         ident_curr = ident_curr->next;
   2.195 -//     }
   2.196 -//     
   2.197 -// pep_error:
   2.198 -//     return status;
   2.199 -// }
   2.200 -
   2.201  DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
   2.202  {
   2.203      return _myself(session, identity, true, false);
   2.204 @@ -1094,26 +1068,19 @@
   2.205  }
   2.206  
   2.207  DYNAMIC_API PEP_STATUS do_keymanagement(
   2.208 +        PEP_SESSION session,
   2.209          retrieve_next_identity_t retrieve_next_identity,
   2.210          messageToSend_t messageToSend,
   2.211          void *management
   2.212      )
   2.213  {
   2.214 -    PEP_SESSION session;
   2.215      pEp_identity *identity;
   2.216      PEP_STATUS status;
   2.217  
   2.218 -    assert(retrieve_next_identity);
   2.219 -    assert(management);
   2.220 -
   2.221 -    if (!retrieve_next_identity || !management)
   2.222 +    assert(session && retrieve_next_identity);
   2.223 +    if (!(session && retrieve_next_identity))
   2.224          return PEP_ILLEGAL_VALUE;
   2.225  
   2.226 -    status = init(&session, messageToSend);
   2.227 -    assert(status == PEP_STATUS_OK);
   2.228 -    if (status != PEP_STATUS_OK)
   2.229 -        return status;
   2.230 -
   2.231      log_event(session, "keymanagement thread started", "pEp engine", NULL, NULL);
   2.232  
   2.233      while ((identity = retrieve_next_identity(management))) 
   2.234 @@ -1138,7 +1105,6 @@
   2.235  
   2.236      log_event(session, "keymanagement thread shutdown", "pEp engine", NULL, NULL);
   2.237  
   2.238 -    release(session);
   2.239      return PEP_STATUS_OK;
   2.240  }
   2.241  
   2.242 @@ -1212,7 +1178,7 @@
   2.243              // THIS SHOULDN'T BE NECESSARY - PREVIOUS VALUE WAS IN THE DB
   2.244              // if (status == PEP_STATUS_OK) {
   2.245              //     if ((cached_ident->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
   2.246 -            //         status = set_as_pep_user(session, cached_ident);
   2.247 +            //         status = set_as_pEp_user(session, cached_ident);
   2.248              // }            
   2.249              free_identity(session->cached_mistrusted);
   2.250          }
   2.251 @@ -1248,18 +1214,18 @@
   2.252      status = get_trust(session, input_copy);
   2.253      
   2.254      if (status != PEP_STATUS_OK)
   2.255 -        goto pep_free;
   2.256 +        goto pEp_free;
   2.257          
   2.258      PEP_comm_type new_trust = PEP_ct_unknown;
   2.259      status = get_key_rating(session, ident->fpr, &new_trust);
   2.260      if (status != PEP_STATUS_OK)
   2.261 -        goto pep_free;
   2.262 +        goto pEp_free;
   2.263  
   2.264 -    bool pep_user = false;
   2.265 +    bool pEp_user = false;
   2.266      
   2.267 -    status = is_pep_user(session, ident, &pep_user);
   2.268 +    status = is_pEp_user(session, ident, &pEp_user);
   2.269      
   2.270 -    if (pep_user && new_trust >= PEP_ct_unconfirmed_encryption)
   2.271 +    if (pEp_user && new_trust >= PEP_ct_unconfirmed_encryption)
   2.272          input_copy->comm_type = PEP_ct_pEp_unconfirmed;
   2.273      else
   2.274          input_copy->comm_type = new_trust;
   2.275 @@ -1267,20 +1233,20 @@
   2.276      status = set_trust(session, input_copy);
   2.277      
   2.278      if (status != PEP_STATUS_OK)
   2.279 -        goto pep_free;
   2.280 +        goto pEp_free;
   2.281  
   2.282      bool mistrusted_key = false;
   2.283          
   2.284      status = is_mistrusted_key(session, ident->fpr, &mistrusted_key);
   2.285  
   2.286      if (status != PEP_STATUS_OK)
   2.287 -        goto pep_free;
   2.288 +        goto pEp_free;
   2.289      
   2.290      if (mistrusted_key)
   2.291          status = delete_mistrusted_key(session, ident->fpr);
   2.292  
   2.293      if (status != PEP_STATUS_OK)
   2.294 -        goto pep_free;
   2.295 +        goto pEp_free;
   2.296          
   2.297      tmp_ident = new_identity(ident->address, NULL, ident->user_id, NULL);
   2.298  
   2.299 @@ -1293,7 +1259,7 @@
   2.300          status = update_identity(session, tmp_ident);
   2.301      
   2.302      if (status != PEP_STATUS_OK)
   2.303 -        goto pep_free;
   2.304 +        goto pEp_free;
   2.305      
   2.306      // remove as default if necessary
   2.307      if (!EMPTYSTR(tmp_ident->fpr) && strcmp(tmp_ident->fpr, ident->fpr) == 0) {
   2.308 @@ -1302,7 +1268,7 @@
   2.309          tmp_ident->comm_type = PEP_ct_unknown;
   2.310          status = set_identity(session, tmp_ident);
   2.311          if (status != PEP_STATUS_OK)
   2.312 -            goto pep_free;
   2.313 +            goto pEp_free;
   2.314      }
   2.315      
   2.316      char* user_default = NULL;
   2.317 @@ -1312,10 +1278,10 @@
   2.318          if (strcmp(user_default, ident->fpr) == 0)
   2.319              status = refresh_userid_default_key(session, ident->user_id);
   2.320          if (status != PEP_STATUS_OK)
   2.321 -            goto pep_free;    
   2.322 +            goto pEp_free;    
   2.323      }
   2.324              
   2.325 -pep_free:
   2.326 +pEp_free:
   2.327      free_identity(tmp_ident);
   2.328      free_identity(input_copy);
   2.329      return status;
   2.330 @@ -1367,11 +1333,11 @@
   2.331          // first of all, does this key even have a private component.
   2.332          status = contains_priv_key(session, ident->fpr, &has_private);
   2.333          if (status != PEP_STATUS_OK && status != PEP_KEY_NOT_FOUND)
   2.334 -            goto pep_free;
   2.335 +            goto pEp_free;
   2.336              
   2.337          if (has_private) {
   2.338              status = set_own_key(session, ident_copy, ident->fpr); 
   2.339 -            goto pep_free;
   2.340 +            goto pEp_free;
   2.341          }
   2.342      }
   2.343      
   2.344 @@ -1424,7 +1390,7 @@
   2.345                      status = set_identity(session, ident_copy); // replace identity default
   2.346                      if (status == PEP_STATUS_OK) {
   2.347                          if ((ident_copy->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
   2.348 -                            status = set_as_pep_user(session, ident_copy);
   2.349 +                            status = set_as_pEp_user(session, ident_copy);
   2.350                      }            
   2.351                  }
   2.352              }
   2.353 @@ -1463,7 +1429,7 @@
   2.354          }
   2.355      }    
   2.356  
   2.357 -pep_free:
   2.358 +pEp_free:
   2.359      free(ident_default_fpr);
   2.360      free(cached_fpr);
   2.361      free_identity(tmp_id);
     3.1 --- a/src/keymanagement.h	Thu Aug 09 13:39:49 2018 +0200
     3.2 +++ b/src/keymanagement.h	Thu Aug 09 17:33:39 2018 +0200
     3.3 @@ -164,6 +164,7 @@
     3.4  // do_keymanagement() - function to be run on an extra thread
     3.5  //
     3.6  //  parameters:
     3.7 +//      session (in)                session to use
     3.8  //      retrieve_next_identity (in) pointer to retrieve_next_identity()
     3.9  //                                  callback which returns at least a valid
    3.10  //                                  address field in the identity struct
    3.11 @@ -177,8 +178,6 @@
    3.12  //      value on failure
    3.13  //
    3.14  //  caveat:
    3.15 -//      this function is creating and releasing a new session
    3.16 -//
    3.17  //      to ensure proper working of this library, a thread has to be started
    3.18  //      with this function immediately after initialization
    3.19  //
    3.20 @@ -188,6 +187,7 @@
    3.21  //      if transport system is not used it must not be NULL
    3.22  
    3.23  DYNAMIC_API PEP_STATUS do_keymanagement(
    3.24 +        PEP_SESSION session,
    3.25          retrieve_next_identity_t retrieve_next_identity,
    3.26          messageToSend_t messageToSend,
    3.27          void *management
     4.1 --- a/src/message_api.c	Thu Aug 09 13:39:49 2018 +0200
     4.2 +++ b/src/message_api.c	Thu Aug 09 17:33:39 2018 +0200
     4.3 @@ -34,9 +34,9 @@
     4.4      bool retval = false;
     4.5      
     4.6      if (src) {
     4.7 -        unsigned char pepstr[] = PEP_SUBJ_STRING;
     4.8 +        unsigned char pEpstr[] = PEP_SUBJ_STRING;
     4.9          if (is_a_pEpmessage(src) || (src->shortmsg == NULL || strcmp(src->shortmsg, "pEp") == 0 ||
    4.10 -            _unsigned_signed_strcmp(pepstr, src->shortmsg, PEP_SUBJ_BYTELEN) == 0) ||
    4.11 +            _unsigned_signed_strcmp(pEpstr, src->shortmsg, PEP_SUBJ_BYTELEN) == 0) ||
    4.12              (strcmp(src->shortmsg, "p=p") == 0)) {
    4.13              char* plaintext = src->longmsg;
    4.14              if (plaintext) {
    4.15 @@ -353,11 +353,11 @@
    4.16  {
    4.17      assert(shortmsg);
    4.18      
    4.19 -    unsigned char pepstr[] = PEP_SUBJ_STRING;
    4.20 -    assert(strcmp(shortmsg, "pEp") != 0 && _unsigned_signed_strcmp(pepstr, shortmsg, PEP_SUBJ_BYTELEN) != 0); 
    4.21 +    unsigned char pEpstr[] = PEP_SUBJ_STRING;
    4.22 +    assert(strcmp(shortmsg, "pEp") != 0 && _unsigned_signed_strcmp(pEpstr, shortmsg, PEP_SUBJ_BYTELEN) != 0); 
    4.23      
    4.24      if (!shortmsg || strcmp(shortmsg, "pEp") == 0 || 
    4.25 -                     _unsigned_signed_strcmp(pepstr, shortmsg, PEP_SUBJ_BYTELEN) == 0) {
    4.26 +                     _unsigned_signed_strcmp(pEpstr, shortmsg, PEP_SUBJ_BYTELEN) == 0) {
    4.27          if (!longmsg) {
    4.28              return NULL;
    4.29          }
    4.30 @@ -389,7 +389,7 @@
    4.31  }
    4.32  
    4.33  static PEP_STATUS replace_subject(message* msg) {
    4.34 -    unsigned char pepstr[] = PEP_SUBJ_STRING;
    4.35 +    unsigned char pEpstr[] = PEP_SUBJ_STRING;
    4.36      if (msg->shortmsg && *(msg->shortmsg) != '\0') {
    4.37          char* longmsg = combine_short_and_long(msg->shortmsg, msg->longmsg);
    4.38          if (!longmsg)
    4.39 @@ -403,7 +403,7 @@
    4.40  #ifdef WIN32
    4.41      msg->shortmsg = strdup("pEp");
    4.42  #else
    4.43 -    msg->shortmsg = strdup((char*)pepstr);
    4.44 +    msg->shortmsg = strdup((char*)pEpstr);
    4.45  #endif    
    4.46      
    4.47      if (!msg->shortmsg)
    4.48 @@ -807,7 +807,7 @@
    4.49      if (!envelope)
    4.50          return NULL;
    4.51          
    4.52 -    envelope->shortmsg = _pep_subj_copy();
    4.53 +    envelope->shortmsg = _pEp_subj_copy();
    4.54      if (!envelope->shortmsg)
    4.55          goto enomem;
    4.56  
    4.57 @@ -1028,7 +1028,7 @@
    4.58      status = _mime_encode_message_internal(_src, true, &mimetext, mime_encode);
    4.59      assert(status == PEP_STATUS_OK);
    4.60      if (status != PEP_STATUS_OK)
    4.61 -        goto pep_error;
    4.62 +        goto pEp_error;
    4.63  
    4.64      if (free_ptext){
    4.65          free(ptext);
    4.66 @@ -1038,7 +1038,7 @@
    4.67      _src = NULL;
    4.68      assert(mimetext);
    4.69      if (mimetext == NULL)
    4.70 -        goto pep_error;
    4.71 +        goto pEp_error;
    4.72  
    4.73      if (flags & PEP_encrypt_flag_force_unsigned)
    4.74          status = encrypt_only(session, keys, mimetext, strlen(mimetext),
    4.75 @@ -1048,7 +1048,7 @@
    4.76              &ctext, &csize);
    4.77      free(mimetext);
    4.78      if (ctext == NULL)
    4.79 -        goto pep_error;
    4.80 +        goto pEp_error;
    4.81  
    4.82      dst->longmsg = strdup("this message was encrypted with p≡p "
    4.83          "https://pEp-project.org");
    4.84 @@ -1076,7 +1076,7 @@
    4.85  enomem:
    4.86      status = PEP_OUT_OF_MEMORY;
    4.87  
    4.88 -pep_error:
    4.89 +pEp_error:
    4.90      if (free_ptext)
    4.91          free(ptext);
    4.92      free(_src);
    4.93 @@ -1597,7 +1597,7 @@
    4.94      
    4.95      status = myself(session, src->from);
    4.96      if (status != PEP_STATUS_OK)
    4.97 -        goto pep_error;
    4.98 +        goto pEp_error;
    4.99  
   4.100      keys = new_stringlist(src->from->fpr);
   4.101      if (keys == NULL)
   4.102 @@ -1644,7 +1644,7 @@
   4.103                  if (_status != PEP_STATUS_OK) {
   4.104                      // DB error
   4.105                      status = PEP_UNENCRYPTED;
   4.106 -                    goto pep_error;
   4.107 +                    goto pEp_error;
   4.108                  }
   4.109                  if (is_blacklisted) {
   4.110                      bool user_default, ident_default, address_default; 
   4.111 @@ -1665,7 +1665,7 @@
   4.112              _status = myself(session, _il->ident);
   4.113          if (_status != PEP_STATUS_OK) {
   4.114              status = PEP_UNENCRYPTED;
   4.115 -            goto pep_error;
   4.116 +            goto pEp_error;
   4.117          }
   4.118  
   4.119          if (_il->ident->fpr && _il->ident->fpr[0]) {
   4.120 @@ -1696,7 +1696,7 @@
   4.121                      if (_status != PEP_STATUS_OK) {
   4.122                          // DB error
   4.123                          status = PEP_UNENCRYPTED;
   4.124 -                        goto pep_error;
   4.125 +                        goto pEp_error;
   4.126                      }
   4.127                      if (is_blacklisted) {
   4.128                          bool user_default, ident_default, address_default; 
   4.129 @@ -1717,7 +1717,7 @@
   4.130                  _status = myself(session, _il->ident);
   4.131              if (_status != PEP_STATUS_OK) {
   4.132                  status = PEP_UNENCRYPTED;
   4.133 -                goto pep_error;
   4.134 +                goto pEp_error;
   4.135              }
   4.136  
   4.137              if (_il->ident->fpr && _il->ident->fpr[0]) {
   4.138 @@ -1747,7 +1747,7 @@
   4.139                      if (_status != PEP_STATUS_OK) {
   4.140                          // DB error
   4.141                          status = PEP_UNENCRYPTED;
   4.142 -                        goto pep_error;
   4.143 +                        goto pEp_error;
   4.144                      }
   4.145                      if (is_blacklisted) {
   4.146                          bool user_default, ident_default, address_default; 
   4.147 @@ -1769,7 +1769,7 @@
   4.148              if (_status != PEP_STATUS_OK)
   4.149              {
   4.150                  status = PEP_UNENCRYPTED;
   4.151 -                goto pep_error;
   4.152 +                goto pEp_error;
   4.153              }
   4.154  
   4.155              if (_il->ident->fpr && _il->ident->fpr[0]) {
   4.156 @@ -1804,7 +1804,7 @@
   4.157          if ((!force_v_1) && ((max_comm_type | PEP_ct_confirmed) == PEP_ct_pEp)) {
   4.158              _src = wrap_message_as_attachment(NULL, src, false);
   4.159              if (!_src)
   4.160 -                goto pep_error;
   4.161 +                goto pEp_error;
   4.162          }
   4.163          else {
   4.164              // hide subject
   4.165 @@ -1836,14 +1836,14 @@
   4.166              default:
   4.167                  assert(0);
   4.168                  status = PEP_ILLEGAL_VALUE;
   4.169 -                goto pep_error;
   4.170 +                goto pEp_error;
   4.171          }
   4.172  
   4.173          if (status == PEP_OUT_OF_MEMORY)
   4.174              goto enomem;
   4.175  
   4.176          if (status != PEP_STATUS_OK)
   4.177 -            goto pep_error;
   4.178 +            goto pEp_error;
   4.179      }
   4.180  
   4.181      free_stringlist(keys);
   4.182 @@ -1879,7 +1879,7 @@
   4.183  enomem:
   4.184      status = PEP_OUT_OF_MEMORY;
   4.185  
   4.186 -pep_error:
   4.187 +pEp_error:
   4.188      free_stringlist(keys);
   4.189      free_message(msg);
   4.190      if (_src && _src != src)
   4.191 @@ -1942,7 +1942,7 @@
   4.192              status = get_userid_alias_default(session, src->from->user_id, &default_id);
   4.193              if (status != PEP_STATUS_OK || !default_id || strcmp(default_id, own_id) != 0) {
   4.194                  status = PEP_ILLEGAL_VALUE;
   4.195 -                goto pep_free;
   4.196 +                goto pEp_free;
   4.197              }
   4.198          }        
   4.199      }
   4.200 @@ -1954,7 +1954,7 @@
   4.201      status = myself(session, own_identity);
   4.202  
   4.203      if (status != PEP_STATUS_OK)
   4.204 -        goto pep_free;
   4.205 +        goto pEp_free;
   4.206  
   4.207      // Ok, now we know the address is an own address. All good. Then...
   4.208      own_private_fpr = own_identity->fpr;
   4.209 @@ -1965,12 +1965,12 @@
   4.210      if (status != PEP_STATUS_OK) {
   4.211          if (status == PEP_CANNOT_FIND_IDENTITY)
   4.212              status = PEP_ILLEGAL_VALUE;
   4.213 -        goto pep_free;
   4.214 +        goto pEp_free;
   4.215      }
   4.216          
   4.217      if ((own_identity->comm_type & PEP_ct_confirmed) != PEP_ct_confirmed) {
   4.218          status = PEP_ILLEGAL_VALUE;
   4.219 -        goto pep_free;
   4.220 +        goto pEp_free;
   4.221      }
   4.222                  
   4.223      // Ok, so all the things are now allowed.
   4.224 @@ -1981,18 +1981,18 @@
   4.225                                  &priv_key_size);
   4.226  
   4.227      if (status != PEP_STATUS_OK)
   4.228 -        goto pep_free;
   4.229 +        goto pEp_free;
   4.230      
   4.231      if (!priv_key_data) {
   4.232          status = PEP_CANNOT_EXPORT_KEY;
   4.233 -        goto pep_free;
   4.234 +        goto pEp_free;
   4.235      }
   4.236      
   4.237      // Ok, fine... let's encrypt yon blob
   4.238      keys = new_stringlist(own_private_fpr);
   4.239      if (!keys) {
   4.240          status = PEP_OUT_OF_MEMORY;
   4.241 -        goto pep_free;
   4.242 +        goto pEp_free;
   4.243      }
   4.244      
   4.245      stringlist_add(keys, to_fpr);
   4.246 @@ -2009,7 +2009,7 @@
   4.247      
   4.248      if (!encrypted_key_text) {
   4.249          status = PEP_UNKNOWN_ERROR;
   4.250 -        goto pep_free;
   4.251 +        goto pEp_free;
   4.252      }
   4.253  
   4.254      // We will have to delete this before returning, as we allocated it.
   4.255 @@ -2042,7 +2042,7 @@
   4.256      
   4.257      if (!created_bl) {
   4.258          status = PEP_OUT_OF_MEMORY;
   4.259 -        goto pep_free;
   4.260 +        goto pEp_free;
   4.261      }
   4.262              
   4.263      // Ok, it's in there. Let's do this.        
   4.264 @@ -2059,7 +2059,7 @@
   4.265              src->attachments = NULL;    
   4.266      }
   4.267      
   4.268 -pep_free:
   4.269 +pEp_free:
   4.270      free(own_id);
   4.271      free(default_id);
   4.272      free(own_private_fpr);
   4.273 @@ -2112,7 +2112,7 @@
   4.274      if (target_id->address) {
   4.275          status = myself(session, target_id);
   4.276          if (status != PEP_STATUS_OK)
   4.277 -            goto pep_error;
   4.278 +            goto pEp_error;
   4.279      }
   4.280      else if (!target_id->fpr)
   4.281          return PEP_ILLEGAL_VALUE;
   4.282 @@ -2122,7 +2122,7 @@
   4.283      // PEP_STATUS _status = update_identity(session, target_id);
   4.284      // if (_status != PEP_STATUS_OK) {
   4.285      //     status = _status;
   4.286 -    //     goto pep_error;
   4.287 +    //     goto pEp_error;
   4.288      // }
   4.289  
   4.290      char* target_fpr = target_id->fpr;
   4.291 @@ -2145,7 +2145,7 @@
   4.292  
   4.293      _src = wrap_message_as_attachment(NULL, src, false);
   4.294      if (!_src)
   4.295 -        goto pep_error;
   4.296 +        goto pEp_error;
   4.297  
   4.298      msg = clone_to_empty_message(_src);
   4.299      if (msg == NULL)
   4.300 @@ -2162,17 +2162,17 @@
   4.301          default:
   4.302              assert(0);
   4.303              status = PEP_ILLEGAL_VALUE;
   4.304 -            goto pep_error;
   4.305 +            goto pEp_error;
   4.306      }
   4.307  
   4.308      if (status == PEP_OUT_OF_MEMORY)
   4.309          goto enomem;
   4.310  
   4.311      if (status != PEP_STATUS_OK)
   4.312 -        goto pep_error;
   4.313 +        goto pEp_error;
   4.314  
   4.315       if (msg && msg->shortmsg == NULL) {
   4.316 -         msg->shortmsg = _pep_subj_copy();
   4.317 +         msg->shortmsg = _pEp_subj_copy();
   4.318           assert(msg->shortmsg);
   4.319           if (msg->shortmsg == NULL)
   4.320               goto enomem;
   4.321 @@ -2198,7 +2198,7 @@
   4.322  enomem:
   4.323      status = PEP_OUT_OF_MEMORY;
   4.324  
   4.325 -pep_error:
   4.326 +pEp_error:
   4.327      free_stringlist(keys);
   4.328      free_message(msg);
   4.329      if (src != _src)
   4.330 @@ -2482,7 +2482,7 @@
   4.331                                                char** msg_wrap_info) {
   4.332      if (!src)
   4.333          return PEP_ILLEGAL_VALUE;
   4.334 -    unsigned char pepstr[] = PEP_SUBJ_STRING;
   4.335 +    unsigned char pEpstr[] = PEP_SUBJ_STRING;
   4.336      PEP_STATUS status = PEP_STATUS_OK;
   4.337  
   4.338      bool change_source_in_place = (msg ? false : true);
   4.339 @@ -2505,7 +2505,7 @@
   4.340                  
   4.341              // FIXME: This is a mess. Talk with VB about how far we go to identify
   4.342              if (is_a_pEpmessage(src) || (src->shortmsg == NULL || strcmp(src->shortmsg, "pEp") == 0 ||
   4.343 -                _unsigned_signed_strcmp(pepstr, src->shortmsg, PEP_SUBJ_BYTELEN) == 0) ||
   4.344 +                _unsigned_signed_strcmp(pEpstr, src->shortmsg, PEP_SUBJ_BYTELEN) == 0) ||
   4.345                  (strcmp(src->shortmsg, "p=p") == 0))
   4.346              {
   4.347                  char * shortmsg = NULL;
   4.348 @@ -2526,7 +2526,7 @@
   4.349                  if (!(*msg_wrap_info || change_source_in_place)) {
   4.350                      if (!shortmsg || 
   4.351                          (src->shortmsg != NULL && strcmp(src->shortmsg, "pEp") != 0 &&
   4.352 -                         _unsigned_signed_strcmp(pepstr, src->shortmsg, PEP_SUBJ_BYTELEN) != 0 &&
   4.353 +                         _unsigned_signed_strcmp(pEpstr, src->shortmsg, PEP_SUBJ_BYTELEN) != 0 &&
   4.354                          strcmp(src->shortmsg, "p=p") != 0)) {
   4.355                               
   4.356                          if (shortmsg != NULL)
   4.357 @@ -2809,7 +2809,7 @@
   4.358      return status;
   4.359  }
   4.360  
   4.361 -static PEP_STATUS update_sender_to_pep_trust(
   4.362 +static PEP_STATUS update_sender_to_pEp_trust(
   4.363          PEP_SESSION session, 
   4.364          pEp_identity* sender, 
   4.365          stringlist_t* keylist) 
   4.366 @@ -3049,7 +3049,7 @@
   4.367      size_t psize;
   4.368      stringlist_t *_keylist = NULL;
   4.369      char* signer_fpr = NULL;
   4.370 -    bool is_pep_msg = is_a_pEpmessage(src);
   4.371 +    bool is_pEp_msg = is_a_pEpmessage(src);
   4.372  
   4.373      // Grab input flags
   4.374      bool reencrypt = (((*flags & PEP_decrypt_flag_untrusted_server) > 0) && *keylist && !EMPTYSTR((*keylist)->value));
   4.375 @@ -3073,7 +3073,7 @@
   4.376      // encrypted or not, we set the sender as a pEp user. This has NOTHING to do
   4.377      // with the key.
   4.378      if (src->from && !(is_me(session, src->from))) {
   4.379 -        if (is_pep_msg) {
   4.380 +        if (is_pEp_msg) {
   4.381              pEp_identity* tmp_from = src->from;
   4.382              
   4.383              // Ensure there's a user id
   4.384 @@ -3150,7 +3150,7 @@
   4.385                                                     &ptext, &psize, &_keylist);
   4.386  
   4.387      if (status > PEP_CANNOT_DECRYPT_UNKNOWN)
   4.388 -        goto pep_error;
   4.389 +        goto pEp_error;
   4.390  
   4.391      decrypt_status = status;
   4.392      
   4.393 @@ -3165,7 +3165,7 @@
   4.394              
   4.395                  status = mime_decode_message(ptext, psize, &msg);
   4.396                  if (status != PEP_STATUS_OK)
   4.397 -                    goto pep_error;
   4.398 +                    goto pEp_error;
   4.399                  
   4.400                  /* Ensure messages whose maintext is in the attachments
   4.401                     move main text into message struct longmsg et al */
   4.402 @@ -3187,7 +3187,7 @@
   4.403                                                               &imported_private_key_address,
   4.404                                                               private_il);
   4.405                  if (status != PEP_STATUS_OK)
   4.406 -                    goto pep_error;            
   4.407 +                    goto pEp_error;            
   4.408  
   4.409                  /* if decrypted, but not verified... */
   4.410                  if (decrypt_status == PEP_DECRYPTED) {
   4.411 @@ -3230,7 +3230,7 @@
   4.412              goto enomem;
   4.413              
   4.414          if (status != PEP_STATUS_OK)
   4.415 -            goto pep_error;
   4.416 +            goto pEp_error;
   4.417  
   4.418          if (decrypt_status == PEP_DECRYPTED || decrypt_status == PEP_DECRYPTED_AND_VERIFIED) {
   4.419              char* wrap_info = NULL;
   4.420 @@ -3260,7 +3260,7 @@
   4.421                                                               actual_message->size, 
   4.422                                                               &inner_message);
   4.423                                  if (status != PEP_STATUS_OK)
   4.424 -                                    goto pep_error;
   4.425 +                                    goto pEp_error;
   4.426                                  
   4.427                                  if (inner_message) {
   4.428                                      // Though this will strip any message info on the
   4.429 @@ -3277,7 +3277,7 @@
   4.430                                          if (strcmp(wrap_info, "INNER") == 0) {
   4.431                                              if (status != PEP_STATUS_OK) {
   4.432                                                  free_message(inner_message);
   4.433 -                                                goto pep_error;
   4.434 +                                                goto pEp_error;
   4.435                                              }
   4.436  
   4.437                                              // check for private key in decrypted message attachment while importing
   4.438 @@ -3295,7 +3295,7 @@
   4.439                                                                                           &imported_private_key_address,
   4.440                                                                                           private_il);
   4.441                                              if (status != PEP_STATUS_OK)
   4.442 -                                                goto pep_error;            
   4.443 +                                                goto pEp_error;            
   4.444  
   4.445                                              // THIS is our message
   4.446                                              // Now, let's make sure we've copied in 
   4.447 @@ -3318,7 +3318,7 @@
   4.448                                          else { // should never happen
   4.449                                              status = PEP_UNKNOWN_ERROR;
   4.450                                              free_message(inner_message);
   4.451 -                                            goto pep_error;
   4.452 +                                            goto pEp_error;
   4.453                                          }
   4.454                                      }
   4.455                                      inner_message->enc_format = PEP_enc_none;
   4.456 @@ -3343,8 +3343,8 @@
   4.457          
   4.458          // Ok, so if it was signed and it's all verified, we can update
   4.459          // eligible signer comm_types to PEP_ct_pEp_*
   4.460 -        if (decrypt_status == PEP_DECRYPTED_AND_VERIFIED && is_pep_msg)
   4.461 -            status = update_sender_to_pep_trust(session, calculated_src->from, _keylist);
   4.462 +        if (decrypt_status == PEP_DECRYPTED_AND_VERIFIED && is_pEp_msg)
   4.463 +            status = update_sender_to_pEp_trust(session, calculated_src->from, _keylist);
   4.464  
   4.465          /* Ok, now we have a keylist used for decryption/verification.
   4.466             now we need to update the message rating with the 
   4.467 @@ -3353,7 +3353,7 @@
   4.468                   rating, calculated_src->from, _keylist);
   4.469  
   4.470          if (status != PEP_STATUS_OK)
   4.471 -            goto pep_error;
   4.472 +            goto pEp_error;
   4.473          
   4.474          /* We decrypted ok, hallelujah. */
   4.475          msg->enc_format = PEP_enc_none;    
   4.476 @@ -3362,7 +3362,7 @@
   4.477          // We did not get a plaintext out of the decryption process.
   4.478          // Abort and return error.
   4.479          *rating = decrypt_rating(decrypt_status);
   4.480 -        goto pep_error;
   4.481 +        goto pEp_error;
   4.482      }
   4.483  
   4.484      /* 
   4.485 @@ -3454,7 +3454,7 @@
   4.486  enomem:
   4.487      status = PEP_OUT_OF_MEMORY;
   4.488  
   4.489 -pep_error:
   4.490 +pEp_error:
   4.491      free(ptext);
   4.492      free(signer_fpr);
   4.493      free_message(msg);
   4.494 @@ -4016,7 +4016,7 @@
   4.495  
   4.496      status = mime_decode_message(mimetext, size, &tmp_msg);
   4.497      if (status != PEP_STATUS_OK)
   4.498 -        goto pep_error;
   4.499 +        goto pEp_error;
   4.500  
   4.501      // MIME decode message delivers only addresses. We need more.
   4.502      if (tmp_msg->from) {
   4.503 @@ -4026,20 +4026,20 @@
   4.504              status = myself(session, tmp_msg->from);
   4.505  
   4.506          if (status == PEP_ILLEGAL_VALUE || status == PEP_OUT_OF_MEMORY)
   4.507 -            goto pep_error;
   4.508 +            goto pEp_error;
   4.509      }
   4.510  
   4.511      status = update_identity_recip_list(session, tmp_msg->to);
   4.512      if (status != PEP_STATUS_OK)
   4.513 -        goto pep_error;
   4.514 +        goto pEp_error;
   4.515  
   4.516      status = update_identity_recip_list(session, tmp_msg->cc);
   4.517      if (status != PEP_STATUS_OK)
   4.518 -        goto pep_error;
   4.519 +        goto pEp_error;
   4.520  
   4.521      status = update_identity_recip_list(session, tmp_msg->bcc);
   4.522      if (status != PEP_STATUS_OK)
   4.523 -        goto pep_error;
   4.524 +        goto pEp_error;
   4.525  
   4.526      PEP_STATUS decrypt_status = decrypt_message(session,
   4.527                                                  tmp_msg,
   4.528 @@ -4056,7 +4056,7 @@
   4.529      if (decrypt_status > PEP_CANNOT_DECRYPT_UNKNOWN || !dec_msg)
   4.530      {
   4.531          status = decrypt_status;
   4.532 -        goto pep_error;
   4.533 +        goto pEp_error;
   4.534      }
   4.535  
   4.536      if (*flags & PEP_decrypt_flag_src_modified) {
   4.537 @@ -4077,7 +4077,7 @@
   4.538          return decrypt_status;
   4.539      }
   4.540      
   4.541 -pep_error:
   4.542 +pEp_error:
   4.543      free_message(tmp_msg);
   4.544      free_message(dec_msg);
   4.545  
   4.546 @@ -4101,7 +4101,7 @@
   4.547  
   4.548      status = mime_decode_message(mimetext, size, &tmp_msg);
   4.549      if (status != PEP_STATUS_OK)
   4.550 -        goto pep_error;
   4.551 +        goto pEp_error;
   4.552  
   4.553      // MIME decode message delivers only addresses. We need more.
   4.554      if (tmp_msg->from) {
   4.555 @@ -4118,7 +4118,7 @@
   4.556              
   4.557          status = myself(session, tmp_msg->from);
   4.558          if (status != PEP_STATUS_OK)
   4.559 -            goto pep_error;
   4.560 +            goto pEp_error;
   4.561      }
   4.562      
   4.563      // Own identities can be retrieved here where they would otherwise
   4.564 @@ -4126,15 +4126,15 @@
   4.565      // desired. FIXME: IS it?
   4.566      status = update_identity_recip_list(session, tmp_msg->to);
   4.567      if (status != PEP_STATUS_OK)
   4.568 -        goto pep_error;
   4.569 +        goto pEp_error;
   4.570      
   4.571      status = update_identity_recip_list(session, tmp_msg->cc);
   4.572      if (status != PEP_STATUS_OK)
   4.573 -        goto pep_error;
   4.574 +        goto pEp_error;
   4.575      
   4.576      status = update_identity_recip_list(session, tmp_msg->bcc);
   4.577      if (status != PEP_STATUS_OK)
   4.578 -        goto pep_error;
   4.579 +        goto pEp_error;
   4.580      
   4.581      // This isn't incoming, though... so we need to reverse the direction
   4.582      tmp_msg->dir = PEP_dir_outgoing;
   4.583 @@ -4146,17 +4146,17 @@
   4.584                               flags);
   4.585                               
   4.586      if (status != PEP_STATUS_OK)
   4.587 -        goto pep_error;
   4.588 +        goto pEp_error;
   4.589  
   4.590  
   4.591      if (!enc_msg) {
   4.592          status = PEP_UNKNOWN_ERROR;
   4.593 -        goto pep_error;
   4.594 +        goto pEp_error;
   4.595      }
   4.596  
   4.597      status = _mime_encode_message_internal(enc_msg, false, mime_ciphertext, false);
   4.598  
   4.599 -pep_error:
   4.600 +pEp_error:
   4.601      free_message(tmp_msg);
   4.602      free_message(enc_msg);
   4.603  
   4.604 @@ -4181,7 +4181,7 @@
   4.605  
   4.606      status = mime_decode_message(mimetext, size, &tmp_msg);
   4.607      if (status != PEP_STATUS_OK)
   4.608 -        goto pep_error;
   4.609 +        goto pEp_error;
   4.610  
   4.611      // This isn't incoming, though... so we need to reverse the direction
   4.612      tmp_msg->dir = PEP_dir_outgoing;
   4.613 @@ -4193,16 +4193,16 @@
   4.614                                        enc_format,
   4.615                                        flags);
   4.616      if (status != PEP_STATUS_OK)
   4.617 -        goto pep_error;
   4.618 +        goto pEp_error;
   4.619   
   4.620      if (!enc_msg) {
   4.621          status = PEP_UNKNOWN_ERROR;
   4.622 -        goto pep_error;
   4.623 +        goto pEp_error;
   4.624      }
   4.625  
   4.626      status = mime_encode_message(enc_msg, false, mime_ciphertext);
   4.627  
   4.628 -pep_error:
   4.629 +pEp_error:
   4.630      free_message(tmp_msg);
   4.631      free_message(enc_msg);
   4.632  
   4.633 @@ -4322,7 +4322,7 @@
   4.634              if (strcasecmp(i->value->key, "X-KeyList") == 0){
   4.635                  status = string_to_keylist(i->value->value, &_keylist);
   4.636                  if (status != PEP_STATUS_OK)
   4.637 -                    goto pep_error;
   4.638 +                    goto pEp_error;
   4.639                  must_free_keylist = true;
   4.640                  goto got_keylist;
   4.641              }
   4.642 @@ -4353,7 +4353,7 @@
   4.643          case PEP_STATUS_OK:
   4.644              break;
   4.645          default:
   4.646 -            goto pep_error;
   4.647 +            goto pEp_error;
   4.648      }
   4.649  
   4.650      status = amend_rating_according_to_sender_and_recipients(session, &_rating,
   4.651 @@ -4361,7 +4361,7 @@
   4.652      if (status == PEP_STATUS_OK)
   4.653          *rating = _rating;
   4.654      
   4.655 -pep_error:
   4.656 +pEp_error:
   4.657      if (must_free_keylist)
   4.658          free_stringlist(_keylist);
   4.659  
     5.1 --- a/src/mime.c	Thu Aug 09 13:39:49 2018 +0200
     5.2 +++ b/src/mime.c	Thu Aug 09 17:33:39 2018 +0200
     5.3 @@ -84,12 +84,12 @@
     5.4  
     5.5  err_file:
     5.6      status = PEP_CANNOT_CREATE_TEMP_FILE;
     5.7 -    goto pep_error;
     5.8 +    goto pEp_error;
     5.9  
    5.10  enomem:
    5.11      status = PEP_OUT_OF_MEMORY;
    5.12  
    5.13 -pep_error:
    5.14 +pEp_error:
    5.15  	if (buffer)
    5.16  		mmap_string_free(buffer);
    5.17  	if (buf)
    5.18 @@ -111,10 +111,10 @@
    5.19  
    5.20      *result = NULL;
    5.21  
    5.22 -// TODO: It seems the pep com server adapter sends an empty string here,
    5.23 +// TODO: It seems the pEp COM server adapter sends an empty string here,
    5.24  // which leads to a crash later. Thus, we workaround here by treating an
    5.25  // empty string as NULL. We need to check whether the bug really is here,
    5.26 -// or the pep com server adapter needs to be changed.
    5.27 +// or the pEp COM server adapter needs to be changed.
    5.28      if (blob->mime_type == NULL || blob->mime_type[0] == '\0')
    5.29          mime_type = "application/octet-stream";
    5.30      else
    5.31 @@ -437,11 +437,11 @@
    5.32      struct mailimf_fields * fields = NULL;
    5.33      int r;
    5.34      clist * fields_list = NULL;
    5.35 -    unsigned char pepstr[] = PEP_SUBJ_STRING; // unsigned due to UTF-8 byte fun
    5.36 +    unsigned char pEpstr[] = PEP_SUBJ_STRING; // unsigned due to UTF-8 byte fun
    5.37  #ifdef WIN32
    5.38      char* altstr = "pEp";
    5.39  #else
    5.40 -    char* altstr = (char*)pepstr;
    5.41 +    char* altstr = (char*)pEpstr;
    5.42  #endif        
    5.43      char *subject = msg->shortmsg ? msg->shortmsg : altstr;
    5.44  
    5.45 @@ -754,7 +754,7 @@
    5.46                                  transport_encode);
    5.47                  
    5.48          if (status != PEP_STATUS_OK)
    5.49 -            goto pep_error;
    5.50 +            goto pEp_error;
    5.51      }
    5.52      else {
    5.53          pEp_rid_list_t* resource = NULL;
    5.54 @@ -814,7 +814,7 @@
    5.55  
    5.56              status = mime_attachment(_a, &submime, transport_encode);
    5.57              if (status != PEP_STATUS_OK)
    5.58 -                goto pep_error;
    5.59 +                goto pEp_error;
    5.60  
    5.61              r = mailmime_smart_add_part(mime, submime);
    5.62              assert(r == MAILIMF_NO_ERROR);
    5.63 @@ -834,7 +834,7 @@
    5.64  enomem:
    5.65      status = PEP_OUT_OF_MEMORY;
    5.66  
    5.67 -pep_error:
    5.68 +pEp_error:
    5.69      if (mime)
    5.70          mailmime_free(mime);
    5.71  
    5.72 @@ -977,7 +977,7 @@
    5.73      }
    5.74  
    5.75      if (status != PEP_STATUS_OK)
    5.76 -        goto pep_error;
    5.77 +        goto pEp_error;
    5.78  
    5.79      msg_mime = mailmime_new_message_data(NULL);
    5.80      assert(msg_mime);
    5.81 @@ -994,14 +994,14 @@
    5.82      if (!omit_fields) {
    5.83          status = build_fields(msg, &fields);
    5.84          if (status != PEP_STATUS_OK)
    5.85 -            goto pep_error;
    5.86 +            goto pEp_error;
    5.87  
    5.88          mailmime_set_imf_fields(msg_mime, fields);
    5.89      }
    5.90  
    5.91      status = render_mime(msg_mime, &buf);
    5.92      if (status != PEP_STATUS_OK)
    5.93 -        goto pep_error;
    5.94 +        goto pEp_error;
    5.95  
    5.96      mailmime_free(msg_mime);
    5.97      *mimetext = buf;
    5.98 @@ -1011,7 +1011,7 @@
    5.99  enomem:
   5.100      status = PEP_OUT_OF_MEMORY;
   5.101  
   5.102 -pep_error:
   5.103 +pEp_error:
   5.104      if (msg_mime)
   5.105          mailmime_free(msg_mime);
   5.106      else
   5.107 @@ -1209,7 +1209,7 @@
   5.108  
   5.109                      ident = mbl_to_identity(mbl);
   5.110                      if (ident == NULL)
   5.111 -                        goto pep_error;
   5.112 +                        goto pEp_error;
   5.113  
   5.114                      free_identity(msg->from);
   5.115                      msg->from = ident;
   5.116 @@ -1352,7 +1352,7 @@
   5.117  enomem:
   5.118      status = PEP_OUT_OF_MEMORY;
   5.119  
   5.120 -pep_error:
   5.121 +pEp_error:
   5.122      return status;
   5.123  }
   5.124  
   5.125 @@ -1705,7 +1705,7 @@
   5.126      if (_fieldlist) {
   5.127          status = read_fields(_msg, _fieldlist);
   5.128          if (status != PEP_STATUS_OK)
   5.129 -            goto pep_error;
   5.130 +            goto pEp_error;
   5.131      }
   5.132  
   5.133      struct mailmime_content *content = _get_content(mime);
   5.134 @@ -1714,7 +1714,7 @@
   5.135          status = interpret_MIME(mime->mm_data.mm_message.mm_msg_mime,
   5.136                  _msg);
   5.137          if (status != PEP_STATUS_OK)
   5.138 -            goto pep_error;
   5.139 +            goto pEp_error;
   5.140      }
   5.141  
   5.142      mailmime_free(mime);
   5.143 @@ -1724,12 +1724,12 @@
   5.144  
   5.145  err_mime:
   5.146      status = PEP_ILLEGAL_VALUE;
   5.147 -    goto pep_error;
   5.148 +    goto pEp_error;
   5.149  
   5.150  enomem:
   5.151      status = PEP_OUT_OF_MEMORY;
   5.152  
   5.153 -pep_error:
   5.154 +pEp_error:
   5.155      free_message(_msg);
   5.156  
   5.157      if (mime)
     6.1 --- a/src/pEpEngine.c	Thu Aug 09 13:39:49 2018 +0200
     6.2 +++ b/src/pEpEngine.c	Thu Aug 09 17:33:39 2018 +0200
     6.3 @@ -284,7 +284,7 @@
     6.4      "update trust set comm_type = ?3 " 
     6.5      "   where user_id = ?1 and pgp_keypair_fpr = upper(replace(?2,' ',''));";
     6.6  
     6.7 -static const char *sql_update_trust_to_pep =
     6.8 +static const char *sql_update_trust_to_pEp =
     6.9      "update trust set comm_type = comm_type + 71 "
    6.10      "   where (user_id = ?1 "
    6.11      "          and (case when (comm_type = 56) then (1) "
    6.12 @@ -548,7 +548,7 @@
    6.13      assert(LOCAL_DB);
    6.14      if (LOCAL_DB == NULL) {
    6.15          status = PEP_INIT_CANNOT_OPEN_DB;
    6.16 -        goto pep_error;
    6.17 +        goto pEp_error;
    6.18      }
    6.19      
    6.20  #if _PEP_SQLITE_DEBUG    
    6.21 @@ -567,7 +567,7 @@
    6.22  
    6.23      if (int_result != SQLITE_OK) {
    6.24          status = PEP_INIT_CANNOT_OPEN_DB;
    6.25 -        goto pep_error;
    6.26 +        goto pEp_error;
    6.27      }
    6.28  
    6.29      int_result = sqlite3_exec(
    6.30 @@ -592,7 +592,7 @@
    6.31      assert(SYSTEM_DB);
    6.32      if (SYSTEM_DB == NULL) {
    6.33          status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
    6.34 -        goto pep_error;
    6.35 +        goto pEp_error;
    6.36      }
    6.37  
    6.38      int_result = sqlite3_open_v2(
    6.39 @@ -605,7 +605,7 @@
    6.40  
    6.41      if (int_result != SQLITE_OK) {
    6.42          status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
    6.43 -        goto pep_error;
    6.44 +        goto pEp_error;
    6.45      }
    6.46  
    6.47      sqlite3_busy_timeout(_session->system_db, 1000);
    6.48 @@ -1154,8 +1154,8 @@
    6.49              (int)strlen(sql_update_trust), &_session->update_trust, NULL);
    6.50      assert(int_result == SQLITE_OK);
    6.51  
    6.52 -    int_result = sqlite3_prepare_v2(_session->db, sql_update_trust_to_pep,
    6.53 -            (int)strlen(sql_update_trust_to_pep), &_session->update_trust_to_pep, NULL);
    6.54 +    int_result = sqlite3_prepare_v2(_session->db, sql_update_trust_to_pEp,
    6.55 +            (int)strlen(sql_update_trust_to_pEp), &_session->update_trust_to_pEp, NULL);
    6.56      assert(int_result == SQLITE_OK);
    6.57  
    6.58      int_result = sqlite3_prepare_v2(_session->db, sql_exists_trust_entry,
    6.59 @@ -1270,15 +1270,15 @@
    6.60      
    6.61      status = init_cryptotech(_session, in_first);
    6.62      if (status != PEP_STATUS_OK)
    6.63 -        goto pep_error;
    6.64 +        goto pEp_error;
    6.65  
    6.66      status = init_transport_system(_session, in_first);
    6.67      if (status != PEP_STATUS_OK)
    6.68 -        goto pep_error;
    6.69 +        goto pEp_error;
    6.70  
    6.71      status = log_event(_session, "init", "pEp " PEP_ENGINE_VERSION, NULL, NULL);
    6.72      if (status != PEP_STATUS_OK)
    6.73 -        goto pep_error;
    6.74 +        goto pEp_error;
    6.75  
    6.76      // runtime config
    6.77  
    6.78 @@ -1313,7 +1313,7 @@
    6.79  enomem:
    6.80      status = PEP_OUT_OF_MEMORY;
    6.81  
    6.82 -pep_error:
    6.83 +pEp_error:
    6.84      release(_session);
    6.85      return status;
    6.86  }
    6.87 @@ -1390,8 +1390,8 @@
    6.88                  sqlite3_finalize(session->set_trust);
    6.89              if (session->update_trust)
    6.90                  sqlite3_finalize(session->update_trust);
    6.91 -            if (session->update_trust_to_pep)
    6.92 -                sqlite3_finalize(session->update_trust_to_pep);                                                
    6.93 +            if (session->update_trust_to_pEp)
    6.94 +                sqlite3_finalize(session->update_trust_to_pEp);                                                
    6.95              if (session->update_trust_for_fpr)
    6.96                  sqlite3_finalize(session->update_trust_for_fpr);
    6.97              if (session->get_trust)
    6.98 @@ -2384,20 +2384,20 @@
    6.99      status = set_person(session, ident_copy, false);
   6.100      if (status != PEP_STATUS_OK) {
   6.101          sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   6.102 -        goto pep_free;
   6.103 +        goto pEp_free;
   6.104      }
   6.105  
   6.106      status = set_identity_entry(session, ident_copy, false);
   6.107      if (status != PEP_STATUS_OK) {
   6.108          sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   6.109 -        goto pep_free;
   6.110 +        goto pEp_free;
   6.111      }
   6.112  
   6.113      if (has_fpr) {
   6.114          status = _set_trust_internal(session, ident_copy, false);
   6.115          if (status != PEP_STATUS_OK) {
   6.116              sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   6.117 -            goto pep_free;
   6.118 +            goto pEp_free;
   6.119          }
   6.120      }
   6.121      
   6.122 @@ -2407,7 +2407,7 @@
   6.123      else
   6.124          status = PEP_COMMIT_FAILED;
   6.125  
   6.126 -pep_free:
   6.127 +pEp_free:
   6.128      free_identity(ident_copy);
   6.129      return status;
   6.130  }
   6.131 @@ -2417,11 +2417,11 @@
   6.132      if (!user->user_id)
   6.133          return PEP_ILLEGAL_VALUE;
   6.134      
   6.135 -    sqlite3_reset(session->update_trust_to_pep);
   6.136 -    sqlite3_bind_text(session->update_trust_to_pep, 1, user->user_id, -1,
   6.137 +    sqlite3_reset(session->update_trust_to_pEp);
   6.138 +    sqlite3_bind_text(session->update_trust_to_pEp, 1, user->user_id, -1,
   6.139              SQLITE_STATIC);
   6.140 -    int result = sqlite3_step(session->update_trust_to_pep);
   6.141 -    sqlite3_reset(session->update_trust_to_pep);
   6.142 +    int result = sqlite3_step(session->update_trust_to_pEp);
   6.143 +    sqlite3_reset(session->update_trust_to_pEp);
   6.144      if (result != SQLITE_DONE)
   6.145          return PEP_CANNOT_SET_TRUST;
   6.146  
   6.147 @@ -2516,17 +2516,17 @@
   6.148      return status;
   6.149  }
   6.150  
   6.151 -DYNAMIC_API PEP_STATUS is_pEp_user(PEP_SESSION session, pEp_identity *identity, bool* is_pep)
   6.152 +DYNAMIC_API PEP_STATUS is_pEp_user(PEP_SESSION session, pEp_identity *identity, bool* is_pEp)
   6.153  {
   6.154      assert(session);
   6.155 -    assert(is_pep);
   6.156 +    assert(is_pEp);
   6.157      assert(identity);
   6.158      assert(!EMPTYSTR(identity->user_id));
   6.159  
   6.160 -    if (!session || !is_pep || !identity || EMPTYSTR(identity->user_id))
   6.161 +    if (!session || !is_pEp || !identity || EMPTYSTR(identity->user_id))
   6.162          return PEP_ILLEGAL_VALUE;
   6.163      
   6.164 -    *is_pep = false;
   6.165 +    *is_pEp = false;
   6.166              
   6.167      const char* user_id = identity->user_id;
   6.168      
   6.169 @@ -2549,7 +2549,7 @@
   6.170      switch (result) {
   6.171          case SQLITE_ROW: {
   6.172              // yeah yeah, I know, we could be lazy here, but it looks bad.
   6.173 -            *is_pep = (sqlite3_column_int(session->is_pEp_user, 0) != 0);
   6.174 +            *is_pEp = (sqlite3_column_int(session->is_pEp_user, 0) != 0);
   6.175              break;
   6.176          }
   6.177          default:
     7.1 --- a/src/pEpEngine.h	Thu Aug 09 13:39:49 2018 +0200
     7.2 +++ b/src/pEpEngine.h	Thu Aug 09 17:33:39 2018 +0200
     7.3 @@ -1240,9 +1240,9 @@
     7.4  //  parameters:
     7.5  //      identity (in) - identity containing the user_id to check (this is
     7.6  //                      the only part of the struct we require to be set)
     7.7 -//      is_pep (out)  - boolean pointer - will return true or false by
     7.8 +//      is_pEp (out)  - boolean pointer - will return true or false by
     7.9  //                      reference with respect to whether or not user is
    7.10 -//                      a known pep user
    7.11 +//                      a known pEp user
    7.12  //
    7.13  //  return_value: PEP_STATUS_OK if user found in person table
    7.14  //                PEP_ILLEGAL_VALUE if no user_id in input
    7.15 @@ -1252,7 +1252,7 @@
    7.16  //                         
    7.17  DYNAMIC_API PEP_STATUS is_pEp_user(PEP_SESSION session, 
    7.18                                     pEp_identity *identity, 
    7.19 -                                   bool* is_pep);
    7.20 +                                   bool* is_pEp);
    7.21  
    7.22  
    7.23  
    7.24 @@ -1291,7 +1291,7 @@
    7.25  PEP_STATUS refresh_userid_default_key(PEP_SESSION session, const char* user_id);
    7.26  
    7.27  // This ONLY sets the *user* flag, and creates a shell identity if necessary.
    7.28 -PEP_STATUS set_as_pep_user(PEP_SESSION session, pEp_identity* user);
    7.29 +PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user);
    7.30  
    7.31  // returns true (by reference) if a person with this user_id exists; 
    7.32  // Also replaces aliased user_ids by defaults in identity.
     8.1 --- a/src/pEp_internal.h	Thu Aug 09 13:39:49 2018 +0200
     8.2 +++ b/src/pEp_internal.h	Thu Aug 09 17:33:39 2018 +0200
     8.3 @@ -154,8 +154,8 @@
     8.4      sqlite3_stmt *unset_identity_flags;
     8.5      sqlite3_stmt *set_trust;
     8.6      sqlite3_stmt *update_trust;
     8.7 -    sqlite3_stmt *update_trust_to_pep;    
     8.8      sqlite3_stmt *exists_trust_entry;
     8.9 +    sqlite3_stmt *update_trust_to_pEp;
    8.10      sqlite3_stmt *update_trust_for_fpr;
    8.11      sqlite3_stmt *get_trust;
    8.12      sqlite3_stmt *least_trust;
    8.13 @@ -387,11 +387,11 @@
    8.14  }
    8.15  
    8.16  // This is just a horrible example of C type madness. UTF-8 made me do it.
    8.17 -static inline char* _pep_subj_copy() {
    8.18 +static inline char* _pEp_subj_copy() {
    8.19  #ifndef WIN32
    8.20 -    unsigned char pepstr[] = PEP_SUBJ_STRING;
    8.21 +    unsigned char pEpstr[] = PEP_SUBJ_STRING;
    8.22      void* retval = calloc(1, sizeof(unsigned char)*PEP_SUBJ_BYTELEN + 1);
    8.23 -    memcpy(retval, pepstr, PEP_SUBJ_BYTELEN);
    8.24 +    memcpy(retval, pEpstr, PEP_SUBJ_BYTELEN);
    8.25      return (char*)retval;
    8.26  #else
    8.27      return strdup("pEp");
     9.1 --- a/src/pgp_gpg.c	Thu Aug 09 13:39:49 2018 +0200
     9.2 +++ b/src/pgp_gpg.c	Thu Aug 09 17:33:39 2018 +0200
     9.3 @@ -273,7 +273,7 @@
     9.4          assert(bResult);
     9.5          if (!bResult) {
     9.6              status = PEP_INIT_NO_GPG_HOME;
     9.7 -            goto pep_error;
     9.8 +            goto pEp_error;
     9.9          }
    9.10  
    9.11          conf_keys = new_stringlist("default-cache-ttl");
    9.12 @@ -293,7 +293,7 @@
    9.13          assert(bResult);
    9.14          if (!bResult) {
    9.15              status = PEP_INIT_CANNOT_CONFIG_GPG_AGENT;
    9.16 -            goto pep_error;
    9.17 +            goto pEp_error;
    9.18          }
    9.19  
    9.20          gpgme = dlopen(LIBGPGME, RTLD_LAZY);
    9.21 @@ -301,7 +301,7 @@
    9.22              // FIXME: Hotfix here?
    9.23              
    9.24              status = PEP_INIT_CANNOT_LOAD_GPGME;
    9.25 -            goto pep_error;
    9.26 +            goto pEp_error;
    9.27          }
    9.28  
    9.29          memset(&gpg, 0, sizeof(struct gpg_s));
    9.30 @@ -545,7 +545,7 @@
    9.31      gpgme_error = _GPGERR(gpgme_error);
    9.32      if (gpgme_error != GPG_ERR_NO_ERROR) {
    9.33          status = PEP_INIT_GPGME_INIT_FAILED;
    9.34 -        goto pep_error;
    9.35 +        goto pEp_error;
    9.36      }
    9.37      assert(session->ctx);
    9.38  
    9.39 @@ -557,7 +557,7 @@
    9.40  
    9.41      return PEP_STATUS_OK;
    9.42  
    9.43 -pep_error:
    9.44 +pEp_error:
    9.45      pgp_release(session, in_first);
    9.46      return status;
    9.47  }
    10.1 --- a/src/sync.c	Thu Aug 09 13:39:49 2018 +0200
    10.2 +++ b/src/sync.c	Thu Aug 09 17:33:39 2018 +0200
    10.3 @@ -92,7 +92,7 @@
    10.4          if (_partner == NULL)
    10.5              return PEP_OUT_OF_MEMORY;
    10.6      }
    10.7 -    status = inject_DeviceState_event(session, event, _partner, NULL);
    10.8 +    status = send_Sync_message(session, Sync_PR_keysync, event);
    10.9  
   10.10      return status;
   10.11  }
   10.12 @@ -107,47 +107,30 @@
   10.13      time_t timeout = 0;
   10.14  
   10.15      assert(session && session->retrieve_next_sync_msg);
   10.16 -    assert(obj);
   10.17 -
   10.18 -    if (!(session && session->retrieve_next_sync_msg) || !obj)
   10.19 +    if (!(session && session->retrieve_next_sync_msg))
   10.20          return PEP_ILLEGAL_VALUE;
   10.21  
   10.22      log_event(session, "sync_protocol thread started", "pEp sync protocol", NULL, NULL);
   10.23  
   10.24      session->sync_obj = obj;
   10.25 -
   10.26      while (true) 
   10.27      {
   10.28          msg = (sync_msg_t *) session->retrieve_next_sync_msg(session->sync_management, &timeout);
   10.29 -        if(msg == NULL && timeout == 0)
   10.30 +        if (msg == NULL)
   10.31              break;
   10.32 -        else if(msg == NULL && timeout != 0){
   10.33 -            status = fsm_DeviceState_inject(session, Timeout, NULL, NULL, &timeout);
   10.34 -#ifndef NDEBUG
   10.35 +
   10.36 +        status = receive_sync_msg(session, msg, &timeout);
   10.37 +        if (status != PEP_STATUS_OK && status != PEP_MESSAGE_IGNORE) {
   10.38              char buffer[MAX_LINELENGTH];
   10.39              memset(buffer, 0, MAX_LINELENGTH);
   10.40 -            snprintf(buffer, MAX_LINELENGTH, "problem with timeout event : %d\n", (int) status);
   10.41 +            snprintf(buffer, MAX_LINELENGTH, "problem with msg received: %d\n", (int) status);
   10.42              log_event(session, buffer, "pEp sync protocol", NULL, NULL);
   10.43 -            continue;
   10.44 -#endif
   10.45 -        }
   10.46 -        else {
   10.47 -            status = receive_sync_msg(session, msg, &timeout);
   10.48 -            if (status != PEP_STATUS_OK && status != PEP_MESSAGE_IGNORE) {
   10.49 -#ifndef NDEBUG
   10.50 -                char buffer[MAX_LINELENGTH];
   10.51 -                memset(buffer, 0, MAX_LINELENGTH);
   10.52 -                snprintf(buffer, MAX_LINELENGTH, "problem with msg received: %d\n", (int) status);
   10.53 -                log_event(session, buffer, "pEp sync protocol", NULL, NULL);
   10.54 -#endif
   10.55 -            }
   10.56          }
   10.57      }
   10.58 +    session->sync_obj = NULL;
   10.59  
   10.60      log_event(session, "sync_protocol thread shutdown", "pEp sync protocol", NULL, NULL);
   10.61  
   10.62 -    session->sync_obj = NULL;
   10.63 -
   10.64      return PEP_STATUS_OK;
   10.65  }
   10.66  
   10.67 @@ -165,9 +148,8 @@
   10.68  
   10.69      *text = NULL;
   10.70  
   10.71 -    DeviceGroup_Protocol_t *msg = NULL;
   10.72 -    uper_decode_complete(NULL, &asn_DEF_DeviceGroup_Protocol, (void **) &msg,
   10.73 -            data, size);
   10.74 +    Sync_t *msg = NULL;
   10.75 +    uper_decode_complete(NULL, &asn_DEF_Sync, (void **) &msg, data, size);
   10.76      if (!msg)
   10.77          return PEP_SYNC_ILLEGAL_MESSAGE;
   10.78  
   10.79 @@ -177,8 +159,8 @@
   10.80          goto the_end;
   10.81      }
   10.82  
   10.83 -    asn_enc_rval_t er = xer_encode(&asn_DEF_DeviceGroup_Protocol, msg,
   10.84 -            XER_F_BASIC, (asn_app_consume_bytes_f *) consume_bytes, (void *) dst);
   10.85 +    asn_enc_rval_t er = xer_encode(&asn_DEF_Sync, msg, XER_F_BASIC,
   10.86 +            (asn_app_consume_bytes_f *) consume_bytes, (void *) dst);
   10.87      if (er.encoded == -1) {
   10.88          status = PEP_CANNOT_ENCODE;
   10.89          goto the_end;
   10.90 @@ -189,7 +171,7 @@
   10.91  
   10.92  the_end:
   10.93      free_growing_buf(dst);
   10.94 -    ASN_STRUCT_FREE(asn_DEF_DeviceGroup_Protocol, msg);
   10.95 +    ASN_STRUCT_FREE(asn_DEF_Sync, msg);
   10.96      return status;
   10.97  }
   10.98  
   10.99 @@ -208,17 +190,17 @@
  10.100      *data = NULL;
  10.101      *size = 0;
  10.102  
  10.103 -    DeviceGroup_Protocol_t *msg = NULL;
  10.104 -    asn_dec_rval_t dr = xer_decode(NULL, &asn_DEF_DeviceGroup_Protocol,
  10.105 -            (void **) &msg, (const void *) text, strlen(text));
  10.106 +    Sync_t *msg = NULL;
  10.107 +    asn_dec_rval_t dr = xer_decode(NULL, &asn_DEF_Sync, (void **) &msg,
  10.108 +            (const void *) text, strlen(text));
  10.109      if (dr.code != RC_OK) {
  10.110          status = PEP_SYNC_ILLEGAL_MESSAGE;
  10.111          goto the_end;
  10.112      }
  10.113  
  10.114      char *payload = NULL;
  10.115 -    ssize_t _size = uper_encode_to_new_buffer(&asn_DEF_DeviceGroup_Protocol,
  10.116 -            NULL, msg, (void **) &payload);
  10.117 +    ssize_t _size = uper_encode_to_new_buffer(&asn_DEF_Sync, NULL, msg,
  10.118 +            (void **) &payload);
  10.119      if (_size == -1) {
  10.120          status = PEP_CANNOT_ENCODE;
  10.121          goto the_end;
  10.122 @@ -228,7 +210,7 @@
  10.123      *size = (size_t) _size;
  10.124  
  10.125  the_end:
  10.126 -    ASN_STRUCT_FREE(asn_DEF_DeviceGroup_Protocol, msg);
  10.127 +    ASN_STRUCT_FREE(asn_DEF_Sync, msg);
  10.128      return status;
  10.129  }
  10.130  
    11.1 --- a/src/sync.h	Thu Aug 09 13:39:49 2018 +0200
    11.2 +++ b/src/sync.h	Thu Aug 09 17:33:39 2018 +0200
    11.3 @@ -82,7 +82,6 @@
    11.4  //      msg (in)            message to inject
    11.5  //      management (in)     application defined
    11.6  //
    11.7 -//  *** BEWARE: msg is 1st parameter, obj is second!!! ***
    11.8  //  return value:
    11.9  //      0 if msg could be stored successfully or nonzero otherwise
   11.10  
    12.1 --- a/src/sync_impl.h	Thu Aug 09 13:39:49 2018 +0200
    12.2 +++ b/src/sync_impl.h	Thu Aug 09 17:33:39 2018 +0200
    12.3 @@ -25,6 +25,7 @@
    12.4  PEP_STATUS challengeAccepted(PEP_SESSION session, bool *result);
    12.5  PEP_STATUS partnerIsGrouped(PEP_SESSION session, bool *result);
    12.6  PEP_STATUS keyElectionWon(PEP_SESSION session, bool *result);
    12.7 +
    12.8  // actions
    12.9  
   12.10  PEP_STATUS closeHandshakeDialog(PEP_SESSION session);
    13.1 --- a/sync/gen_statemachine.ysl2	Thu Aug 09 13:39:49 2018 +0200
    13.2 +++ b/sync/gen_statemachine.ysl2	Thu Aug 09 17:33:39 2018 +0200
    13.3 @@ -43,6 +43,7 @@
    13.4          for "func:distinctName(*//condition)"
    13.5              | PEP_STATUS «@name»(PEP_SESSION session, bool *result);
    13.6          ||
    13.7 +
    13.8          // actions
    13.9  
   13.10          ||