sync in 3rd device sync
authorVolker Birk <vb@pep-project.org>
Thu, 14 Nov 2019 14:38:03 +0100
branchsync
changeset 416840db89ff0fcb
parent 4167 88b578fec7a5
child 4169 d605633f9a6f
child 4177 5b25ba07c7e9
sync in 3rd device
sync/sync.fsm
     1.1 --- a/sync/sync.fsm	Thu Nov 14 12:51:57 2019 +0100
     1.2 +++ b/sync/sync.fsm	Thu Nov 14 14:38:03 2019 +0100
     1.3 @@ -387,7 +387,7 @@
     1.4                  do saveGroupKeys;
     1.5                  do receivedKeysAreDefaultKeys;
     1.6                  do prepareOwnKeys;
     1.7 -                send GroupKeys;
     1.8 +                send GroupKeysAndClose;
     1.9                  do showDeviceAdded;
    1.10                  go Grouped;
    1.11              }
    1.12 @@ -418,8 +418,6 @@
    1.13              // Accept is Phase1Commit
    1.14              on Accept {
    1.15                  do trustThisKey;
    1.16 -                send GroupTrustThisKey;
    1.17 -                send CommitAcceptForGroup;
    1.18                  go HandshakingGroupedPhase1;
    1.19              }
    1.20  
    1.21 @@ -437,6 +435,11 @@
    1.22          }
    1.23  
    1.24          state HandshakingGroupedPhase1 {
    1.25 +            on Init {
    1.26 +                send GroupTrustThisKey;
    1.27 +                send CommitAcceptForGroup;
    1.28 +            }
    1.29 +
    1.30              on Rollback if sameNegotiationAndPartner
    1.31                  go Grouped;
    1.32  
    1.33 @@ -450,14 +453,16 @@
    1.34                  go Grouped;
    1.35              }
    1.36  
    1.37 -            on GroupTrustThisKey {
    1.38 +            on GroupTrustThisKey
    1.39                  do trustThisKey;
    1.40 -                if sameNegotiation
    1.41 -                    go Grouped;
    1.42 -            }
    1.43  
    1.44              on GroupKeys
    1.45                  do saveGroupKeys;
    1.46 +            
    1.47 +            on GroupKeysAndClose {
    1.48 +                do saveGroupKeys;
    1.49 +                go Grouped;
    1.50 +            }
    1.51          }
    1.52  
    1.53          state HandshakingGroupedPhase2 {
    1.54 @@ -480,14 +485,16 @@
    1.55                  go Grouped;
    1.56              }
    1.57  
    1.58 -            on GroupTrustThisKey {
    1.59 +            on GroupTrustThisKey
    1.60                  do trustThisKey;
    1.61 -                if sameNegotiation
    1.62 -                    go Grouped;
    1.63 -            }
    1.64  
    1.65              on GroupKeys
    1.66                  do saveGroupKeys;
    1.67 +            
    1.68 +            on GroupKeysAndClose {
    1.69 +                do saveGroupKeys;
    1.70 +                go Grouped;
    1.71 +            }
    1.72          }
    1.73   
    1.74          external Accept 129;
    1.75 @@ -548,23 +555,27 @@
    1.76              field IdentityList ownIdentities;
    1.77          }
    1.78  
    1.79 -        message OwnKeysOfferer 13, security=attach_own_keys {
    1.80 +        message GroupKeysAndClose 13, security=attach_own_keys {
    1.81              field IdentityList ownIdentities;
    1.82          }
    1.83  
    1.84 -        message OwnKeysRequester 14, security=attach_own_keys {
    1.85 +        message OwnKeysOfferer 14, security=attach_own_keys {
    1.86 +            field IdentityList ownIdentities;
    1.87 +        }
    1.88 +
    1.89 +        message OwnKeysRequester 15, security=attach_own_keys {
    1.90              field IdentityList ownIdentities;
    1.91          }
    1.92  
    1.93          // grouped handshake
    1.94 -        message NegotiationRequestGrouped 15, security=untrusted {
    1.95 +        message NegotiationRequestGrouped 16, security=untrusted {
    1.96              field TID challenge;
    1.97              auto Version version;
    1.98              field TID negotiation;
    1.99              field bool is_group;
   1.100          }
   1.101  
   1.102 -        message GroupHandshake 16 {
   1.103 +        message GroupHandshake 17 {
   1.104              field TID negotiation;
   1.105              field Hash key;
   1.106          }