... sync
authorVolker Birk <vb@pep.foundation>
Thu, 09 Aug 2018 13:39:49 +0200
branchsync
changeset 2833ce3baad227c5
parent 2832 e03dfbbaf5ef
child 2834 7a35e7ea6138
...
src/keymanagement.c
src/keymanagement.h
src/message_api.c
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
src/sync.c
src/sync.h
     1.1 --- a/src/keymanagement.c	Thu Aug 09 12:44:05 2018 +0200
     1.2 +++ b/src/keymanagement.c	Thu Aug 09 13:39:49 2018 +0200
     1.3 @@ -1095,6 +1095,7 @@
     1.4  
     1.5  DYNAMIC_API PEP_STATUS do_keymanagement(
     1.6          retrieve_next_identity_t retrieve_next_identity,
     1.7 +        messageToSend_t messageToSend,
     1.8          void *management
     1.9      )
    1.10  {
    1.11 @@ -1108,7 +1109,7 @@
    1.12      if (!retrieve_next_identity || !management)
    1.13          return PEP_ILLEGAL_VALUE;
    1.14  
    1.15 -    status = init(&session);
    1.16 +    status = init(&session, messageToSend);
    1.17      assert(status == PEP_STATUS_OK);
    1.18      if (status != PEP_STATUS_OK)
    1.19          return status;
     2.1 --- a/src/keymanagement.h	Thu Aug 09 12:44:05 2018 +0200
     2.2 +++ b/src/keymanagement.h	Thu Aug 09 13:39:49 2018 +0200
     2.3 @@ -164,23 +164,32 @@
     2.4  // do_keymanagement() - function to be run on an extra thread
     2.5  //
     2.6  //  parameters:
     2.7 -//      retrieve_next_identity  pointer to retrieve_next_identity() callback
     2.8 -//                              which returns at least a valid address field in
     2.9 -//                              the identity struct
    2.10 -//      management              management data to give to keymanagement
    2.11 -//                              (implementation defined)
    2.12 +//      retrieve_next_identity (in) pointer to retrieve_next_identity()
    2.13 +//                                  callback which returns at least a valid
    2.14 +//                                  address field in the identity struct
    2.15 +//      messageToSend (in)          callback for sending message by the
    2.16 +//                                  application
    2.17 +//      management (in)             management data to give to keymanagement
    2.18 +//                                  (implementation defined)
    2.19  //
    2.20  //  return value:
    2.21  //      PEP_STATUS_OK if thread has to terminate successfully or any other
    2.22  //      value on failure
    2.23  //
    2.24  //  caveat:
    2.25 +//      this function is creating and releasing a new session
    2.26 +//
    2.27  //      to ensure proper working of this library, a thread has to be started
    2.28  //      with this function immediately after initialization
    2.29 +//
    2.30  //      do_keymanagement() calls retrieve_next_identity(management)
    2.31 +//
    2.32 +//      messageToSend can only be null if no transport is application based
    2.33 +//      if transport system is not used it must not be NULL
    2.34  
    2.35  DYNAMIC_API PEP_STATUS do_keymanagement(
    2.36          retrieve_next_identity_t retrieve_next_identity,
    2.37 +        messageToSend_t messageToSend,
    2.38          void *management
    2.39      );
    2.40  
     3.1 --- a/src/message_api.c	Thu Aug 09 12:44:05 2018 +0200
     3.2 +++ b/src/message_api.c	Thu Aug 09 13:39:49 2018 +0200
     3.3 @@ -1612,7 +1612,7 @@
     3.4      }
     3.5  
     3.6      bool dest_keys_found = true;
     3.7 -    bool has_pep_user = false;
     3.8 +    bool has_pEp_user = false;
     3.9      
    3.10      PEP_comm_type max_comm_type = PEP_ct_pEp;
    3.11  
    3.12 @@ -1658,8 +1658,8 @@
    3.13                      }
    3.14                  }    
    3.15              }
    3.16 -            if (!has_pep_user && !EMPTYSTR(_il->ident->user_id))
    3.17 -                is_pep_user(session, _il->ident, &has_pep_user);
    3.18 +            if (!has_pEp_user && !EMPTYSTR(_il->ident->user_id))
    3.19 +                is_pEp_user(session, _il->ident, &has_pEp_user);
    3.20          }
    3.21          else
    3.22              _status = myself(session, _il->ident);
    3.23 @@ -1710,8 +1710,8 @@
    3.24                          }
    3.25                      }    
    3.26                  }
    3.27 -                if (!has_pep_user && !EMPTYSTR(_il->ident->user_id))
    3.28 -                    is_pep_user(session, _il->ident, &has_pep_user);
    3.29 +                if (!has_pEp_user && !EMPTYSTR(_il->ident->user_id))
    3.30 +                    is_pEp_user(session, _il->ident, &has_pEp_user);
    3.31              }
    3.32              else
    3.33                  _status = myself(session, _il->ident);
    3.34 @@ -1761,8 +1761,8 @@
    3.35                          }
    3.36                      }    
    3.37                  }
    3.38 -                if (!has_pep_user && !EMPTYSTR(_il->ident->user_id))
    3.39 -                    is_pep_user(session, _il->ident, &has_pep_user);
    3.40 +                if (!has_pEp_user && !EMPTYSTR(_il->ident->user_id))
    3.41 +                    is_pEp_user(session, _il->ident, &has_pEp_user);
    3.42              }
    3.43              else
    3.44                  _status = myself(session, _il->ident);
    3.45 @@ -1791,7 +1791,7 @@
    3.46                  PEP_rating_undefined) < PEP_rating_reliable)
    3.47      {
    3.48          free_stringlist(keys);
    3.49 -        if ((has_pep_user || !session->passive_mode) && 
    3.50 +        if ((has_pEp_user || !session->passive_mode) && 
    3.51              !(flags & PEP_encrypt_flag_force_no_attached_key)) {
    3.52              attach_own_key(session, src);
    3.53              added_key_to_real_src = true;
    3.54 @@ -3090,7 +3090,7 @@
    3.55              }
    3.56              if (status == PEP_STATUS_OK) {
    3.57                  // Now set user as PEP (may also create an identity if none existed yet)
    3.58 -                status = set_as_pep_user(session, tmp_from);
    3.59 +                status = set_as_pEp_user(session, tmp_from);
    3.60              }
    3.61          }
    3.62      }
     4.1 --- a/src/pEpEngine.c	Thu Aug 09 12:44:05 2018 +0200
     4.2 +++ b/src/pEpEngine.c	Thu Aug 09 13:39:49 2018 +0200
     4.3 @@ -152,12 +152,12 @@
     4.4      "           (select device_group from person where id = ?1)"
     4.5      "   where id = ?1 ;";
     4.6      
     4.7 -static const char *sql_set_as_pep_user =
     4.8 -    "update person set is_pep_user = 1 "
     4.9 +static const char *sql_set_as_pEp_user =
    4.10 +    "update person set is_pEp_user = 1 "
    4.11      "   where id = ?1 ; ";
    4.12  
    4.13 -static const char *sql_is_pep_user =
    4.14 -    "select is_pep_user from person "
    4.15 +static const char *sql_is_pEp_user =
    4.16 +    "select is_pEp_user from person "
    4.17      "   where id = ?1 ; ";
    4.18  
    4.19  static const char* sql_exists_person = 
    4.20 @@ -489,7 +489,10 @@
    4.21  PEP_STATUS pgp_import_ultimately_trusted_keypairs(PEP_SESSION session);
    4.22  #endif // USE_GPG
    4.23  
    4.24 -DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
    4.25 +DYNAMIC_API PEP_STATUS init(
    4.26 +        PEP_SESSION *session,
    4.27 +        messageToSend_t messageToSend
    4.28 +    )
    4.29  {
    4.30      PEP_STATUS status = PEP_STATUS_OK;
    4.31      int int_result;
    4.32 @@ -536,6 +539,7 @@
    4.33          goto enomem;
    4.34  
    4.35      _session->version = PEP_ENGINE_VERSION;
    4.36 +    _session->messageToSend = messageToSend;
    4.37  
    4.38  #ifdef DEBUG_ERRORSTACK
    4.39      _session->errorstack = new_stringlist("init()");
    4.40 @@ -655,7 +659,7 @@
    4.41                  "   lang text,\n"
    4.42                  "   comment text,\n"
    4.43                  "   device_group text,\n"
    4.44 -                "   is_pep_user integer default 0\n"
    4.45 +                "   is_pEp_user integer default 0\n"
    4.46                  ");\n"
    4.47                  "create table if not exists identity (\n"
    4.48                  "   address text,\n"
    4.49 @@ -758,7 +762,7 @@
    4.50              if (table_contains_column(_session, "identity", "timestamp") > 0) {
    4.51                  version = 8;
    4.52              }            
    4.53 -            if (table_contains_column(_session, "person", "is_pep_user") > 0) {
    4.54 +            if (table_contains_column(_session, "person", "is_pEp_user") > 0) {
    4.55                  version = 7;
    4.56              }            
    4.57              else if (table_contains_column(_session, "identity", "is_own") > 0) {
    4.58 @@ -926,7 +930,7 @@
    4.59                  int_result = sqlite3_exec(
    4.60                      _session->db,
    4.61                      "alter table person\n"
    4.62 -                    "   add column is_pep_user integer default 0;\n",
    4.63 +                    "   add column is_pEp_user integer default 0;\n",
    4.64                      NULL,
    4.65                      NULL,
    4.66                      NULL
    4.67 @@ -935,7 +939,7 @@
    4.68                  int_result = sqlite3_exec(
    4.69                      _session->db,
    4.70                      "update person\n"
    4.71 -                    "   set is_pep_user = 1\n"
    4.72 +                    "   set is_pEp_user = 1\n"
    4.73                      "   where id = "
    4.74                      "       (select distinct id from person "
    4.75                      "               join trust on id = user_id "
    4.76 @@ -1099,12 +1103,12 @@
    4.77              (int)strlen(sql_exists_person), &_session->exists_person, NULL);
    4.78      assert(int_result == SQLITE_OK);
    4.79  
    4.80 -    int_result = sqlite3_prepare_v2(_session->db, sql_set_as_pep_user,
    4.81 -            (int)strlen(sql_set_as_pep_user), &_session->set_as_pep_user, NULL);
    4.82 +    int_result = sqlite3_prepare_v2(_session->db, sql_set_as_pEp_user,
    4.83 +            (int)strlen(sql_set_as_pEp_user), &_session->set_as_pEp_user, NULL);
    4.84      assert(int_result == SQLITE_OK);
    4.85      
    4.86 -    int_result = sqlite3_prepare_v2(_session->db, sql_is_pep_user,
    4.87 -            (int)strlen(sql_is_pep_user), &_session->is_pep_user, NULL);
    4.88 +    int_result = sqlite3_prepare_v2(_session->db, sql_is_pEp_user,
    4.89 +            (int)strlen(sql_is_pEp_user), &_session->is_pEp_user, NULL);
    4.90      assert(int_result == SQLITE_OK);
    4.91  
    4.92      int_result = sqlite3_prepare_v2(_session->db, sql_set_device_group,
    4.93 @@ -1358,10 +1362,10 @@
    4.94                  sqlite3_finalize(session->remove_fpr_as_default);            
    4.95              if (session->set_person)
    4.96                  sqlite3_finalize(session->set_person);
    4.97 -            if (session->set_as_pep_user)
    4.98 -                sqlite3_finalize(session->set_as_pep_user);
    4.99 -            if (session->is_pep_user)
   4.100 -                sqlite3_finalize(session->is_pep_user);
   4.101 +            if (session->set_as_pEp_user)
   4.102 +                sqlite3_finalize(session->set_as_pEp_user);
   4.103 +            if (session->is_pEp_user)
   4.104 +                sqlite3_finalize(session->is_pEp_user);
   4.105              if (session->exists_person)
   4.106                  sqlite3_finalize(session->exists_person);                        
   4.107              if (session->set_device_group)
   4.108 @@ -2305,7 +2309,7 @@
   4.109      status = _set_trust_internal(session, identity, true);
   4.110      if (status == PEP_STATUS_OK) {
   4.111          if ((identity->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
   4.112 -            status = set_as_pep_user(session, identity);
   4.113 +            status = set_as_pEp_user(session, identity);
   4.114      }
   4.115      return status;
   4.116  }
   4.117 @@ -2330,7 +2334,7 @@
   4.118                                         guard_transaction);
   4.119  }
   4.120  
   4.121 -// This will NOT call set_as_pep_user; you have to do that separately.
   4.122 +// This will NOT call set_as_pEp_user; you have to do that separately.
   4.123  DYNAMIC_API PEP_STATUS set_identity(
   4.124          PEP_SESSION session, const pEp_identity *identity
   4.125      )
   4.126 @@ -2408,7 +2412,7 @@
   4.127      return status;
   4.128  }
   4.129  
   4.130 -PEP_STATUS update_pep_user_trust_vals(PEP_SESSION session,
   4.131 +PEP_STATUS update_pEp_user_trust_vals(PEP_SESSION session,
   4.132                                        pEp_identity* user) {
   4.133      if (!user->user_id)
   4.134          return PEP_ILLEGAL_VALUE;
   4.135 @@ -2426,7 +2430,7 @@
   4.136  
   4.137  
   4.138  // This ONLY sets the user flag. Must be called outside of a transaction.
   4.139 -PEP_STATUS set_as_pep_user(PEP_SESSION session, pEp_identity* user) {
   4.140 +PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user) {
   4.141  
   4.142      assert(session);
   4.143      assert(user);
   4.144 @@ -2448,16 +2452,16 @@
   4.145          status = set_person(session, user, true);
   4.146          
   4.147      // Ok, let's set it.
   4.148 -    sqlite3_reset(session->set_as_pep_user);
   4.149 -    sqlite3_bind_text(session->set_as_pep_user, 1, user->user_id, -1,
   4.150 +    sqlite3_reset(session->set_as_pEp_user);
   4.151 +    sqlite3_bind_text(session->set_as_pEp_user, 1, user->user_id, -1,
   4.152              SQLITE_STATIC);
   4.153 -    int result = sqlite3_step(session->set_as_pep_user);
   4.154 -    sqlite3_reset(session->set_as_pep_user);
   4.155 +    int result = sqlite3_step(session->set_as_pEp_user);
   4.156 +    sqlite3_reset(session->set_as_pEp_user);
   4.157      
   4.158      if (result != SQLITE_DONE)
   4.159          return PEP_CANNOT_SET_PERSON;
   4.160  
   4.161 -    status = update_pep_user_trust_vals(session, user);
   4.162 +    status = update_pEp_user_trust_vals(session, user);
   4.163          
   4.164      return status;
   4.165  }
   4.166 @@ -2512,7 +2516,7 @@
   4.167      return status;
   4.168  }
   4.169  
   4.170 -DYNAMIC_API PEP_STATUS is_pep_user(PEP_SESSION session, pEp_identity *identity, bool* is_pep)
   4.171 +DYNAMIC_API PEP_STATUS is_pEp_user(PEP_SESSION session, pEp_identity *identity, bool* is_pep)
   4.172  {
   4.173      assert(session);
   4.174      assert(is_pep);
   4.175 @@ -2538,23 +2542,23 @@
   4.176          alias_default = strdup(user_id);
   4.177      }
   4.178      
   4.179 -    sqlite3_reset(session->is_pep_user);
   4.180 -    sqlite3_bind_text(session->is_pep_user, 1, user_id, -1,
   4.181 +    sqlite3_reset(session->is_pEp_user);
   4.182 +    sqlite3_bind_text(session->is_pEp_user, 1, user_id, -1,
   4.183              SQLITE_STATIC);
   4.184 -    int result = sqlite3_step(session->is_pep_user);
   4.185 +    int result = sqlite3_step(session->is_pEp_user);
   4.186      switch (result) {
   4.187          case SQLITE_ROW: {
   4.188              // yeah yeah, I know, we could be lazy here, but it looks bad.
   4.189 -            *is_pep = (sqlite3_column_int(session->is_pep_user, 0) != 0);
   4.190 +            *is_pep = (sqlite3_column_int(session->is_pEp_user, 0) != 0);
   4.191              break;
   4.192          }
   4.193          default:
   4.194 -            sqlite3_reset(session->is_pep_user);
   4.195 +            sqlite3_reset(session->is_pEp_user);
   4.196              free(alias_default);
   4.197              return PEP_CANNOT_FIND_PERSON;
   4.198      }
   4.199  
   4.200 -    sqlite3_reset(session->is_pep_user);
   4.201 +    sqlite3_reset(session->is_pEp_user);
   4.202      return PEP_STATUS_OK;
   4.203  }
   4.204  
   4.205 @@ -3778,7 +3782,7 @@
   4.206  }
   4.207  
   4.208  
   4.209 -DYNAMIC_API PEP_STATUS reset_peptest_hack(PEP_SESSION session)
   4.210 +DYNAMIC_API PEP_STATUS reset_pEptest_hack(PEP_SESSION session)
   4.211  {
   4.212      assert(session);
   4.213  
   4.214 @@ -3787,7 +3791,7 @@
   4.215  
   4.216      int int_result = sqlite3_exec(
   4.217          session->db,
   4.218 -        "delete from identity where address like '%@peptest.ch' ;",
   4.219 +        "delete from identity where address like '%@pEptest.ch' ;",
   4.220          NULL,
   4.221          NULL,
   4.222          NULL
     5.1 --- a/src/pEpEngine.h	Thu Aug 09 12:44:05 2018 +0200
     5.2 +++ b/src/pEpEngine.h	Thu Aug 09 13:39:49 2018 +0200
     5.3 @@ -120,11 +120,29 @@
     5.4  } PEP_STATUS;
     5.5  
     5.6  
     5.7 +// messageToSend() - a message needs to be delivered by application
     5.8 +//
     5.9 +//  parameters:
    5.10 +//      obj (in)        object handle (implementation defined)
    5.11 +//      msg (in)        message struct with message to send
    5.12 +//
    5.13 +//  return value:
    5.14 +//      PEP_STATUS_OK or any other value on error
    5.15 +//
    5.16 +//  caveat:
    5.17 +//      the ownership of msg goes to the callee
    5.18 +
    5.19 +struct _message;
    5.20 +typedef PEP_STATUS (*messageToSend_t)(void *obj, struct _message *msg);
    5.21 +
    5.22 +
    5.23  // INIT_STATUS init() - initialize pEpEngine for a thread
    5.24  //
    5.25  //  parameters:
    5.26 -//        session (out)   init() allocates session memory and returns a pointer
    5.27 -//                        as a handle
    5.28 +//        session (out)                     init() allocates session memory and
    5.29 +//                                          returns a pointer as a handle
    5.30 +//        messageToSend (in)                callback for sending message by the
    5.31 +//                                          application
    5.32  //
    5.33  //  return value:
    5.34  //        PEP_STATUS_OK = 0                 if init() succeeds
    5.35 @@ -138,8 +156,8 @@
    5.36  //                                            opened
    5.37  //
    5.38  //  caveat:
    5.39 -//      THE CALLER MUST GUARD THIS CALL EXTERNALLY WITH A MUTEX. release() should
    5.40 -//      be similarly guarded.
    5.41 +//      THE CALLER MUST GUARD THIS CALL EXTERNALLY WITH A MUTEX. release()
    5.42 +//      should be similarly guarded.
    5.43  //
    5.44  //      the pointer is valid only if the return value is PEP_STATUS_OK
    5.45  //      in other case a NULL pointer will be returned; a valid handle must
    5.46 @@ -147,8 +165,14 @@
    5.47  //
    5.48  //      the caller has to guarantee that the first call to this function
    5.49  //      will succeed before further calls can be done
    5.50 +//
    5.51 +//      messageToSend can only be null if no transport is application based
    5.52 +//      if transport system is not used it must not be NULL
    5.53  
    5.54 -DYNAMIC_API PEP_STATUS init(PEP_SESSION *session);
    5.55 +DYNAMIC_API PEP_STATUS init(
    5.56 +        PEP_SESSION *session,
    5.57 +        messageToSend_t messageToSend
    5.58 +    );
    5.59  
    5.60  
    5.61  // void release() - release thread session handle
    5.62 @@ -1210,7 +1234,7 @@
    5.63  //
    5.64  DYNAMIC_API const char* get_engine_version();
    5.65  
    5.66 -// is_pep_user() - returns true if the USER corresponding to this identity 
    5.67 +// is_pEp_user() - returns true if the USER corresponding to this identity 
    5.68  //                 has been listed in the *person* table as a pEp user. 
    5.69  //
    5.70  //  parameters:
    5.71 @@ -1226,13 +1250,13 @@
    5.72  //
    5.73  //  caveat: This *does not check comm_type*
    5.74  //                         
    5.75 -DYNAMIC_API PEP_STATUS is_pep_user(PEP_SESSION session, 
    5.76 +DYNAMIC_API PEP_STATUS is_pEp_user(PEP_SESSION session, 
    5.77                                     pEp_identity *identity, 
    5.78                                     bool* is_pep);
    5.79  
    5.80  
    5.81  
    5.82 -DYNAMIC_API PEP_STATUS reset_peptest_hack(PEP_SESSION session);
    5.83 +DYNAMIC_API PEP_STATUS reset_pEptest_hack(PEP_SESSION session);
    5.84  
    5.85  // This is used internally when there is a temporary identity to be retrieved
    5.86  // that may not yet have an FPR attached. See get_identity() for functionality,
     6.1 --- a/src/pEp_internal.h	Thu Aug 09 12:44:05 2018 +0200
     6.2 +++ b/src/pEp_internal.h	Thu Aug 09 13:39:49 2018 +0200
     6.3 @@ -115,6 +115,8 @@
     6.4  typedef struct _pEpSession pEpSession;
     6.5  struct _pEpSession {
     6.6      const char *version;
     6.7 +    messageToSend_t messageToSend;
     6.8 +
     6.9  #ifdef USE_GPG
    6.10      gpgme_ctx_t ctx;
    6.11  #elif defined(USE_NETPGP)
    6.12 @@ -140,8 +142,8 @@
    6.13      sqlite3_stmt *set_person;
    6.14      sqlite3_stmt *update_person;
    6.15      sqlite3_stmt *exists_person;    
    6.16 -    sqlite3_stmt *set_as_pep_user;
    6.17 -    sqlite3_stmt *is_pep_user;
    6.18 +    sqlite3_stmt *set_as_pEp_user;
    6.19 +    sqlite3_stmt *is_pEp_user;
    6.20      sqlite3_stmt *set_device_group;
    6.21      sqlite3_stmt *get_device_group;
    6.22      sqlite3_stmt *set_pgp_keypair;
    6.23 @@ -202,7 +204,6 @@
    6.24      void *examine_management;
    6.25      void *sync_management;
    6.26      void *sync_obj;
    6.27 -    messageToSend_t messageToSend;
    6.28      notifyHandshake_t notifyHandshake;
    6.29      inject_sync_msg_t inject_sync_msg;
    6.30      retrieve_next_sync_msg_t retrieve_next_sync_msg;
     7.1 --- a/src/sync.c	Thu Aug 09 12:44:05 2018 +0200
     7.2 +++ b/src/sync.c	Thu Aug 09 13:39:49 2018 +0200
     7.3 @@ -20,18 +20,16 @@
     7.4  DYNAMIC_API PEP_STATUS register_sync_callbacks(
     7.5          PEP_SESSION session,
     7.6          void *management,
     7.7 -        messageToSend_t messageToSend,
     7.8          notifyHandshake_t notifyHandshake,
     7.9          inject_sync_msg_t inject_sync_msg,
    7.10          retrieve_next_sync_msg_t retrieve_next_sync_msg
    7.11      )
    7.12  {
    7.13 -    assert(session && management && messageToSend && notifyHandshake && inject_sync_msg && retrieve_next_sync_msg);
    7.14 -    if (!(session && management && messageToSend && notifyHandshake && inject_sync_msg && retrieve_next_sync_msg))
    7.15 +    assert(session && management && notifyHandshake && inject_sync_msg && retrieve_next_sync_msg);
    7.16 +    if (!(session && management && notifyHandshake && inject_sync_msg && retrieve_next_sync_msg))
    7.17          return PEP_ILLEGAL_VALUE;
    7.18  
    7.19      session->sync_management = management;
    7.20 -    session->messageToSend = messageToSend;
    7.21      session->notifyHandshake = notifyHandshake;
    7.22      session->inject_sync_msg = inject_sync_msg;
    7.23      session->retrieve_next_sync_msg = retrieve_next_sync_msg;
    7.24 @@ -50,7 +48,6 @@
    7.25  
    7.26      // unregister
    7.27      session->sync_management = NULL;
    7.28 -    session->messageToSend = NULL;
    7.29      session->notifyHandshake = NULL;
    7.30      session->inject_sync_msg = NULL;
    7.31      session->retrieve_next_sync_msg = NULL;
     8.1 --- a/src/sync.h	Thu Aug 09 12:44:05 2018 +0200
     8.2 +++ b/src/sync.h	Thu Aug 09 13:39:49 2018 +0200
     8.3 @@ -33,19 +33,6 @@
     8.4      SYNC_NOTIFY_OVERTAKEN
     8.5  } sync_handshake_signal;
     8.6  
     8.7 -// messageToSend() - send a message
     8.8 -//
     8.9 -//  parameters:
    8.10 -//      obj (in)        object handle (implementation defined)
    8.11 -//      msg (in)        message struct with message to send
    8.12 -//
    8.13 -//  return value:
    8.14 -//      PEP_STATUS_OK or any other value on error
    8.15 -//
    8.16 -//  caveat:
    8.17 -//      the ownership of msg goes to the callee
    8.18 -
    8.19 -typedef PEP_STATUS (*messageToSend_t)(void *obj, message *msg);
    8.20  
    8.21  // notifyHandshake() - notify UI about sync handshaking process
    8.22  //
    8.23 @@ -122,7 +109,6 @@
    8.24  //  parameters:
    8.25  //      session (in)                session where to store obj handle
    8.26  //      management (in)             application defined
    8.27 -//      messageToSend (in)          callback for sending message
    8.28  //      notifyHandshake (in)        callback for doing the handshake
    8.29  //      retrieve_next_sync_msg (in) callback for receiving sync messages
    8.30  //
    8.31 @@ -135,7 +121,6 @@
    8.32  DYNAMIC_API PEP_STATUS register_sync_callbacks(
    8.33          PEP_SESSION session,
    8.34          void *management,
    8.35 -        messageToSend_t messageToSend,
    8.36          notifyHandshake_t notifyHandshake,
    8.37          inject_sync_msg_t inject_sync_msg,
    8.38          retrieve_next_sync_msg_t retrieve_next_sync_msg