src/sync_actions.c
branchkeysync
changeset 939 ed7dfdae3031
parent 907 8f5cca5bfa2d
child 951 dec407deb10e
     1.1 --- a/src/sync_actions.c	Wed Jul 27 16:20:31 2016 +0200
     1.2 +++ b/src/sync_actions.c	Fri Jul 29 10:45:13 2016 +0200
     1.3 @@ -19,14 +19,19 @@
     1.4  PEP_STATUS showHandshake(
     1.5          PEP_SESSION session,
     1.6          DeviceState_state state,
     1.7 -        const Identity partner
     1.8 +        Identity partner,
     1.9 +        void *extra
    1.10      )
    1.11  {
    1.12      PEP_STATUS status = PEP_STATUS_OK;
    1.13 +
    1.14      assert(session);
    1.15      assert(partner);
    1.16 +    assert(extra == NULL);
    1.17 +
    1.18      if (!(session && partner))
    1.19          return PEP_ILLEGAL_VALUE;
    1.20 +
    1.21      assert(session->showHandshake);
    1.22      if (!session->showHandshake)
    1.23          return PEP_SYNC_NO_TRUSTWORDS_CALLBACK;
    1.24 @@ -64,18 +69,20 @@
    1.25  PEP_STATUS reject(
    1.26          PEP_SESSION session,
    1.27          DeviceState_state state,
    1.28 -        const Identity partner
    1.29 +        Identity partner,
    1.30 +        void *extra
    1.31      )
    1.32  {
    1.33      PEP_STATUS status = PEP_STATUS_OK;
    1.34  
    1.35      assert(session);
    1.36      assert(partner);
    1.37 +    assert(extra == NULL);
    1.38      if (!(session && partner))
    1.39          return PEP_ILLEGAL_VALUE;
    1.40  
    1.41 -    // working code
    1.42 -
    1.43 +    status = set_identity_flags(session, partner,
    1.44 +            partner->flags | PEP_idf_not_for_sync);
    1.45  
    1.46      return status;
    1.47  
    1.48 @@ -93,6 +100,7 @@
    1.49  //      session (in)        session handle
    1.50  //      state (in)          state the state machine is in
    1.51  //      partner (in)        partner to communicate with
    1.52 +//      _group_keys (in)    group keys received from partner
    1.53  //
    1.54  //  returns:
    1.55  //      PEP_STATUS_OK or any other value on error
    1.56 @@ -100,17 +108,19 @@
    1.57  PEP_STATUS storeGroupKeys(
    1.58          PEP_SESSION session,
    1.59          DeviceState_state state,
    1.60 -        const Identity partner
    1.61 +        Identity partner,
    1.62 +        void *_group_keys
    1.63      )
    1.64  {
    1.65      PEP_STATUS status = PEP_STATUS_OK;
    1.66  
    1.67      assert(session);
    1.68      assert(partner);
    1.69 -    if (!(session && partner))
    1.70 +    assert(_group_keys);
    1.71 +    if (!(session && partner && _group_keys))
    1.72          return PEP_ILLEGAL_VALUE;
    1.73  
    1.74 -    // working code
    1.75 +    Stringlist group_keys = (Stringlist) _group_keys;
    1.76  
    1.77  
    1.78      return status;