Sync: added transmission of Beacon when timeout happens while waiting for group keys, thus re-trying handhake process. Timeout while waiting for groupKeys was leading to a situation where device that did lose key election wasn't re-attempting handshaking because already having keys (i.e. no CannotDecrypt event), then device was left Sole with no chance to enter the group again
authorEdouard Tisserant <edouard@pep-project.org>
Tue, 24 Jan 2017 13:27:29 +0100
changeset 15557ffa6cf9d054
parent 1554 a62835de9daf
child 1556 cf1858982be2
Sync: added transmission of Beacon when timeout happens while waiting for group keys, thus re-trying handhake process. Timeout while waiting for groupKeys was leading to a situation where device that did lose key election wasn't re-attempting handshaking because already having keys (i.e. no CannotDecrypt event), then device was left Sole with no chance to enter the group again
sync/devicegroup.fsm
sync/generated/sync_fsm.c
     1.1 --- a/sync/devicegroup.fsm	Tue Jan 24 08:24:36 2017 +0100
     1.2 +++ b/sync/devicegroup.fsm	Tue Jan 24 13:27:29 2017 +0100
     1.3 @@ -94,6 +94,7 @@
     1.4              on Cancel go Sole;
     1.5              on Timeout {
     1.6                  do notifyTimeout(expected);
     1.7 +                do sendBeacon;
     1.8                  go Sole;
     1.9              }
    1.10          }
     2.1 --- a/sync/generated/sync_fsm.c	Tue Jan 24 08:24:36 2017 +0100
     2.2 +++ b/sync/generated/sync_fsm.c	Tue Jan 24 13:27:29 2017 +0100
     2.3 @@ -318,6 +318,12 @@
     2.4                          return (int) invalid_out_of_memory;
     2.5                      if (status != PEP_STATUS_OK)
     2.6                          return (int) invalid_action;
     2.7 +                    DEBUG_LOG("FSM action", "sync_fsm.c, state=HandshakingSole, event=Timeout", "action=sendBeacon")
     2.8 +                    status = sendBeacon(session, state, NULL, NULL);
     2.9 +                    if (status == PEP_OUT_OF_MEMORY)
    2.10 +                        return (int) invalid_out_of_memory;
    2.11 +                    if (status != PEP_STATUS_OK)
    2.12 +                        return (int) invalid_action;
    2.13                      if(session->sync_state_payload){
    2.14                          free_identity((Identity)session->sync_state_payload);
    2.15                          session->sync_state_payload = NULL;