agree on who's first sync
authorVolker Birk <vb@pep-project.org>
Mon, 25 Mar 2019 11:33:52 +0100
branchsync
changeset 3389d5d388d3b227
parent 3388 3b6c5e1ee490
child 3390 a0204afa04e3
agree on who's first
sync/cond_act_sync.yml2
sync/gen_statemachine.ysl2
sync/sync.fsm
     1.1 --- a/sync/cond_act_sync.yml2	Fri Mar 22 21:56:46 2019 +0100
     1.2 +++ b/sync/cond_act_sync.yml2	Mon Mar 25 11:33:52 2019 +0100
     1.3 @@ -40,11 +40,12 @@
     1.4  condition keyElectionWon
     1.5  ||
     1.6      pEp_identity *from = session->sync_state.common.from;
     1.7 +    char *signature_fpr = session->sync_state.common.signature_fpr;
     1.8  
     1.9 -    assert(from && from->fpr && from->fpr[0] && from->address &&
    1.10 -            from->address[0] && from->user_id && from->user_id[0]);
    1.11 -    if (!(from && from->fpr && from->fpr[0] && from->address &&
    1.12 -            from->address[0] && from->user_id && from->user_id[0]))
    1.13 +    assert(from && from->address && from->address[0] && from->user_id &&
    1.14 +            from->user_id[0]);
    1.15 +    if (!(from && from->address && from->address[0] && from->user_id &&
    1.16 +            from->user_id[0]))
    1.17          return PEP_ILLEGAL_VALUE;
    1.18  
    1.19      pEp_identity *me = NULL;
    1.20 @@ -59,8 +60,8 @@
    1.21          return PEP_ILLEGAL_VALUE;
    1.22      }
    1.23  
    1.24 -    size_t len = MIN(strlen(from->fpr), strlen(me->fpr));
    1.25 -    *result = strncasecmp(from->fpr, me->fpr, len) > 0;
    1.26 +    size_t len = MIN(strlen(signature_fpr), strlen(me->fpr));
    1.27 +    *result = strncasecmp(signature_fpr, me->fpr, len) > 0;
    1.28      free_identity(me);
    1.29  ||
    1.30  
     2.1 --- a/sync/gen_statemachine.ysl2	Fri Mar 22 21:56:46 2019 +0100
     2.2 +++ b/sync/gen_statemachine.ysl2	Mon Mar 25 11:33:52 2019 +0100
     2.3 @@ -3,7 +3,7 @@
     2.4  
     2.5  // generate state machine code
     2.6  
     2.7 -// Copyleft (c) 2016 - 2018, p≡p foundation
     2.8 +// Copyleft (c) 2016 - 2019, p≡p foundation
     2.9  
    2.10  // Written by Volker Birk
    2.11  
     3.1 --- a/sync/sync.fsm	Fri Mar 22 21:56:46 2019 +0100
     3.2 +++ b/sync/sync.fsm	Mon Mar 25 11:33:52 2019 +0100
     3.3 @@ -1,7 +1,7 @@
     3.4  // This file is under BSD License 2.0
     3.5  
     3.6  // Sync protocol for p≡p
     3.7 -// Copyright (c) 2016 - 2018, p≡p foundation
     3.8 +// Copyright (c) 2016 - 2019, p≡p foundation
     3.9  
    3.10  // Written by Volker Birk
    3.11