sync/sync.fsm
author Volker Birk <vb@pep-project.org>
Thu, 16 Jan 2020 15:04:04 +0100
branchsync
changeset 4337 7e8015c705ae
parent 4289 79af186cae4e
child 4338 7a9de0786596
permissions -rw-r--r--
explicit debug messages in fsm
vb@2831
     1
// This file is under BSD License 2.0
vb@2831
     2
vb@2831
     3
// Sync protocol for p≡p
vb@3512
     4
// Copyright (c) 2016-2019, p≡p foundation
vb@2831
     5
vb@2831
     6
// Written by Volker Birk
vb@2831
     7
vb@2831
     8
include ./fsm.yml2
vb@2831
     9
vb@2831
    10
protocol Sync 1 {
vb@2831
    11
    // all messages have a timestamp, time out and are removed after timeout
vb@2831
    12
andreas@3892
    13
    fsm KeySync 1, threshold=300 {
vb@2831
    14
        version 1, 2;
vb@2913
    15
vb@2831
    16
        state InitState {
vb@2831
    17
            on Init {
vb@2831
    18
                if deviceGrouped
vb@2831
    19
                    go Grouped;
vb@4051
    20
                do newChallengeAndNegotiationBase;
vb@4051
    21
                send Beacon;
vb@2831
    22
                go Sole;
vb@2831
    23
            }
vb@2831
    24
        }
vb@2831
    25
vb@2908
    26
        state Sole timeout=off {
vb@2831
    27
            on Init {
vb@3605
    28
                do showBeingSole;
vb@2831
    29
            }
vb@2831
    30
vb@3601
    31
            on KeyGen {
vb@2865
    32
                send Beacon;
vb@3601
    33
            }
vb@2831
    34
vb@3601
    35
            on CannotDecrypt { // cry baby
vb@2865
    36
                send Beacon;
vb@3601
    37
            }
vb@2831
    38
vb@2831
    39
            on Beacon {
vb@3514
    40
                if sameChallenge {
vb@4337
    41
                    debug > this is our own Beacon; ignore
vb@2907
    42
                }
vb@3514
    43
                else {
vb@3825
    44
                    if weAreOfferer {
vb@3779
    45
                        do useOwnChallenge;
vb@3514
    46
                        send Beacon;
vb@3514
    47
                    }
vb@3825
    48
                    else /* we are requester */ {
vb@3781
    49
                        do openNegotiation;
vb@3518
    50
                        do tellWeAreNotGrouped;
vb@3825
    51
                        // requester is sending NegotiationRequest
vb@3556
    52
                        send NegotiationRequest;
vb@3605
    53
                        do useOwnChallenge;
vb@3514
    54
                    }
vb@2902
    55
                }
vb@2831
    56
            }
vb@2831
    57
vb@4130
    58
            // we get this from another sole device
vb@3601
    59
            on NegotiationRequest {
vb@3779
    60
                if sameChallenge { // challenge accepted
vb@3779
    61
                    if sameNegotiation {
vb@3601
    62
                        // this is our own NegotiationRequest; ignore
vb@3601
    63
                    }
vb@3601
    64
                    else {
vb@3779
    65
                        do storeNegotiation;
vb@3825
    66
                        // offerer is accepting by confirming NegotiationOpen
vb@3601
    67
                        send NegotiationOpen;
vb@4130
    68
                        go HandshakingOfferer;
vb@3601
    69
                    }
vb@2831
    70
                }
vb@2831
    71
            }
vb@3341
    72
vb@4130
    73
            // we get this from an existing device group
vb@4130
    74
            on NegotiationRequestGrouped {
vb@4130
    75
                if sameChallenge { // challenge accepted
vb@4130
    76
                    do storeNegotiation;
vb@4130
    77
                    // offerer is accepting by confirming NegotiationOpen
vb@4130
    78
                    send NegotiationOpen;
vb@4130
    79
                    go HandshakingToJoin;
vb@4130
    80
                }
vb@4130
    81
            }
vb@4130
    82
vb@3779
    83
            on NegotiationOpen if sameNegotiationAndPartner {
vb@3825
    84
                // requester is receiving NegotiationOpen
vb@3791
    85
                do storeNegotiation;
vb@3825
    86
                go HandshakingRequester;
vb@3509
    87
            }
vb@2831
    88
        }
vb@2831
    89
vb@2831
    90
        // handshaking without existing Device group
vb@3825
    91
        state HandshakingOfferer timeout=600 {
vb@3470
    92
            on Init
vb@2831
    93
                do showSoleHandshake;
vb@2831
    94
vb@2831
    95
            // Cancel is Rollback
vb@2831
    96
            on Cancel {
vb@2865
    97
                send Rollback;
vb@2831
    98
                go Sole;
vb@2831
    99
            }
vb@2831
   100
vb@3779
   101
            on Rollback if sameNegotiationAndPartner
vb@2831
   102
                go Sole;
vb@2831
   103
vb@2831
   104
            // Reject is CommitReject
vb@2831
   105
            on Reject {
vb@2865
   106
                send CommitReject;
vb@2831
   107
                do disable;
vb@2831
   108
                go End;
vb@2831
   109
            }
vb@2831
   110
vb@3779
   111
            on CommitReject if sameNegotiationAndPartner {
vb@2831
   112
                do disable;
vb@2831
   113
                go End;
vb@2831
   114
            }
vb@2831
   115
vb@3509
   116
            // Accept means init Phase1Commit
vb@2831
   117
            on Accept {
vb@3516
   118
                do trustThisKey;
vb@3825
   119
                send CommitAcceptOfferer;
vb@3825
   120
                go HandshakingPhase1Offerer;
vb@3509
   121
            }
vb@3509
   122
vb@3825
   123
            // got a CommitAccept from requester
vb@3825
   124
            on CommitAcceptRequester if sameNegotiationAndPartner
vb@3825
   125
                go HandshakingPhase2Offerer;
vb@3509
   126
        }
vb@3509
   127
vb@3509
   128
        // handshaking without existing Device group
vb@3825
   129
        state HandshakingRequester timeout=600 {
vb@3509
   130
            on Init
vb@3509
   131
                do showSoleHandshake;
vb@3509
   132
vb@3509
   133
            // Cancel is Rollback
vb@3509
   134
            on Cancel {
vb@3509
   135
                send Rollback;
vb@3509
   136
                go Sole;
vb@3509
   137
            }
vb@3509
   138
vb@3779
   139
            on Rollback if sameNegotiationAndPartner
vb@3509
   140
                go Sole;
vb@3509
   141
vb@3509
   142
            // Reject is CommitReject
vb@3509
   143
            on Reject {
vb@3509
   144
                send CommitReject;
vb@3509
   145
                do disable;
vb@3509
   146
                go End;
vb@3509
   147
            }
vb@3509
   148
vb@3779
   149
            on CommitReject if sameNegotiationAndPartner {
vb@3509
   150
                do disable;
vb@3509
   151
                go End;
vb@3509
   152
            }
vb@3509
   153
vb@3509
   154
            // Accept means init Phase1Commit
vb@3509
   155
            on Accept {
vb@3516
   156
                do trustThisKey;
vb@3825
   157
                send CommitAcceptRequester;
vb@3825
   158
                go HandshakingPhase1Requester;
vb@3509
   159
            }
vb@3509
   160
vb@3825
   161
            // got a CommitAccept from offerer
vb@3825
   162
            on CommitAcceptOfferer if sameNegotiationAndPartner
vb@3825
   163
                go HandshakingPhase2Requester;
vb@3509
   164
        }
vb@3509
   165
vb@3825
   166
        state HandshakingPhase1Offerer {
vb@3779
   167
            on Rollback if sameNegotiationAndPartner {
vb@3524
   168
                do untrustThisKey;
vb@3509
   169
                go Sole;
vb@3524
   170
            }
vb@3509
   171
            
vb@3779
   172
            on CommitReject if sameNegotiationAndPartner {
vb@3524
   173
                do untrustThisKey;
vb@3509
   174
                do disable;
vb@3509
   175
                go End;
vb@2831
   176
            }
vb@2831
   177
vb@3825
   178
            on CommitAcceptRequester if sameNegotiationAndPartner {
vb@3825
   179
                go FormingGroupOfferer;
vb@3550
   180
            }
vb@2831
   181
        }
vb@2831
   182
vb@3825
   183
        state HandshakingPhase1Requester {
vb@3779
   184
            on Rollback if sameNegotiationAndPartner {
vb@3524
   185
                do untrustThisKey;
vb@2831
   186
                go Sole;
vb@3524
   187
            }
vb@2831
   188
            
vb@3779
   189
            on CommitReject if sameNegotiationAndPartner {
vb@3524
   190
                do untrustThisKey;
vb@2831
   191
                do disable;
vb@2831
   192
                go End;
vb@2831
   193
            }
vb@2831
   194
vb@3825
   195
            on CommitAcceptOfferer if sameNegotiationAndPartner {
vb@3825
   196
                go FormingGroupRequester;
vb@3550
   197
            }
vb@2831
   198
        }
vb@2831
   199
vb@3825
   200
        state HandshakingPhase2Offerer {
vb@2831
   201
            on Cancel {
vb@2865
   202
                send Rollback;
vb@2831
   203
                go Sole;
vb@2831
   204
            }
vb@2831
   205
vb@2831
   206
            on Reject {
vb@2865
   207
                send CommitReject;
vb@2831
   208
                do disable;
vb@2831
   209
                go End;
vb@2831
   210
            }
vb@2831
   211
vb@3516
   212
            on Accept {
vb@4177
   213
                do trustThisKey;
vb@3825
   214
                send CommitAcceptOfferer;
vb@3825
   215
                go FormingGroupOfferer;
vb@3516
   216
            }
vb@2831
   217
        }
vb@2831
   218
vb@3825
   219
        state HandshakingPhase2Requester {
vb@3517
   220
            on Cancel {
vb@3517
   221
                send Rollback;
vb@3517
   222
                go Sole;
vb@3517
   223
            }
vb@3517
   224
vb@3517
   225
            on Reject {
vb@3517
   226
                send CommitReject;
vb@3517
   227
                do disable;
vb@3517
   228
                go End;
vb@3517
   229
            }
vb@3517
   230
vb@3517
   231
            on Accept {
vb@4177
   232
                do trustThisKey;
vb@3825
   233
                send CommitAcceptRequester;
vb@3825
   234
                go FormingGroupRequester;
vb@3517
   235
            }
vb@3517
   236
        }
vb@3517
   237
vb@3825
   238
        state FormingGroupOfferer {
vb@3517
   239
            on Init {
vb@3517
   240
                do prepareOwnKeys;
vb@3825
   241
                send OwnKeysOfferer; // we're not grouped yet, this is our own keys
vb@3517
   242
            }
vb@3517
   243
vb@3971
   244
            on Cancel {
vb@3971
   245
                send Rollback;
vb@3971
   246
                go Sole;
vb@3971
   247
            }
vb@3971
   248
vb@3971
   249
            on Rollback
vb@3971
   250
                go Sole;
vb@3971
   251
vb@4289
   252
            on OwnKeysRequester if sameNegotiationAndPartner {
vb@3520
   253
                do saveGroupKeys;
vb@3815
   254
                do receivedKeysAreDefaultKeys;
vb@3524
   255
                do showGroupCreated;
vb@3517
   256
                go Grouped;
vb@3517
   257
            }
vb@3517
   258
        }
vb@3517
   259
vb@3825
   260
        state FormingGroupRequester {
vb@3971
   261
            on Cancel {
vb@3971
   262
                send Rollback;
vb@3971
   263
                go Sole;
vb@3390
   264
            }
vb@2831
   265
vb@3971
   266
            on Rollback
vb@3971
   267
                go Sole;
vb@3971
   268
vb@4289
   269
            on OwnKeysOfferer if sameNegotiationAndPartner {
vb@3520
   270
                do saveGroupKeys;
vb@3971
   271
                do prepareOwnKeys;
vb@3815
   272
                do ownKeysAreDefaultKeys;
vb@3978
   273
                send OwnKeysRequester;
vb@3524
   274
                do showGroupCreated;
vb@2831
   275
                go Grouped;
vb@2831
   276
            }
vb@2831
   277
        }
vb@2831
   278
vb@3518
   279
        state Grouped timeout=off {
vb@3525
   280
            on Init {
vb@3781
   281
                do newChallengeAndNegotiationBase;
vb@3525
   282
                do showBeingInGroup;
vb@3525
   283
            }
vb@3518
   284
vb@4289
   285
            on GroupKeysUpdate if fromGroupMember // double check
vb@3518
   286
                do saveGroupKeys;
vb@3518
   287
vb@3543
   288
            on KeyGen {
vb@3543
   289
                do prepareOwnKeys;
vb@4251
   290
                send GroupKeysUpdate;
vb@3543
   291
            }
vb@3518
   292
vb@3518
   293
            on Beacon {
vb@3781
   294
                do openNegotiation;
vb@3518
   295
                do tellWeAreGrouped;
vb@4130
   296
                send NegotiationRequestGrouped;
vb@3605
   297
                do useOwnChallenge;
vb@3518
   298
            }
vb@3518
   299
vb@3791
   300
            on NegotiationOpen if sameNegotiationAndPartner {
vb@3791
   301
                do storeNegotiation;
vb@4132
   302
                do useThisKey;
vb@4130
   303
                send GroupHandshake;
vb@3518
   304
                go HandshakingGrouped;
vb@3791
   305
            }
vb@4140
   306
vb@4130
   307
            on GroupHandshake {
vb@4141
   308
                do storeNegotiation;
vb@4132
   309
                do storeThisKey;
vb@4130
   310
                go HandshakingGrouped;
vb@4130
   311
            }
vb@4140
   312
vb@4289
   313
            on GroupTrustThisKey if fromGroupMember // double check
vb@3524
   314
                do trustThisKey;
vb@4240
   315
vb@4289
   316
            on GroupKeyResetRequired {
vb@4289
   317
                do ledGroupKeyReset;
vb@4289
   318
                send GroupKeyReset;
vb@4289
   319
            }
vb@4240
   320
vb@4289
   321
            // this is for a leaving group member
vb@4240
   322
            on GroupKeyResetRequiredAndDisable {
vb@4287
   323
                send InitUnledGroupKeyReset;
vb@4287
   324
                go DisableOnInitUnledGroupKeyReset;
vb@4287
   325
            }
vb@4287
   326
vb@4287
   327
            on InitUnledGroupKeyReset {
vb@4287
   328
                // unled group key reset; new group keys will be elected
vb@4287
   329
                do unledGroupKeyReset;
vb@4287
   330
                send GroupKeyReset;
vb@4240
   331
            }
vb@4240
   332
vb@4289
   333
            on GroupKeyReset if fromGroupMember { // double check
vb@4287
   334
                do saveGroupKeys;
vb@4287
   335
                if isLedGroupKeyReset {
vb@4287
   336
                    // led group key reset is executed without questions
vb@4287
   337
                    do receivedKeysAreDefaultKeys;
vb@4287
   338
                }
vb@4287
   339
                else {
vb@4287
   340
                    // unled group key reset; election takes place
vb@4287
   341
                    if keyElectionWon {
vb@4287
   342
                        // this is already the case:
vb@4287
   343
                        // do ownKeysAreDefaultKeys;
vb@4287
   344
                    }
vb@4287
   345
                    else {
vb@4287
   346
                        do receivedKeysAreDefaultKeys;
vb@4287
   347
                    }
vb@4287
   348
                }
vb@4240
   349
            }
vb@3518
   350
        }
vb@3518
   351
vb@4287
   352
        state DisableOnInitUnledGroupKeyReset {
vb@4287
   353
            on InitUnledGroupKeyReset
vb@4244
   354
                do disable;
vb@4244
   355
        }
vb@4244
   356
vb@3519
   357
        // sole device handshaking with group
vb@3825
   358
        state HandshakingToJoin {
vb@2831
   359
            on Init
vb@2831
   360
                do showJoinGroupHandshake;
vb@2831
   361
vb@2831
   362
            // Cancel is Rollback
vb@2831
   363
            on Cancel {
vb@2865
   364
                send Rollback;
vb@2831
   365
                go Sole;
vb@2831
   366
            }
vb@2831
   367
vb@3779
   368
            on Rollback if sameNegotiationAndPartner
vb@2831
   369
                go Sole;
vb@2831
   370
vb@2831
   371
            // Reject is CommitReject
vb@2831
   372
            on Reject {
vb@2865
   373
                send CommitReject;
vb@2831
   374
                do disable;
vb@2831
   375
                go End;
vb@2831
   376
            }
vb@2831
   377
vb@3821
   378
            on CommitAcceptForGroup if sameNegotiationAndPartner
vb@3825
   379
                go HandshakingToJoinPhase2;
vb@3814
   380
vb@3779
   381
            on CommitReject if sameNegotiationAndPartner {
vb@2831
   382
                do disable;
vb@2831
   383
                go End;
vb@2831
   384
            }
vb@2831
   385
vb@2831
   386
            // Accept is Phase1Commit
vb@2831
   387
            on Accept {
vb@3516
   388
                do trustThisKey;
vb@2865
   389
                send CommitAccept;
vb@3825
   390
                go HandshakingToJoinPhase1;
vb@2831
   391
            }
vb@2831
   392
        }
vb@2831
   393
vb@3825
   394
        state HandshakingToJoinPhase1 {
vb@3779
   395
            on Rollback if sameNegotiationAndPartner
vb@2831
   396
                go Sole;
vb@2831
   397
            
vb@3779
   398
            on CommitReject if sameNegotiationAndPartner {
vb@2831
   399
                do disable;
vb@2831
   400
                go End;
vb@2831
   401
            }
vb@2831
   402
vb@3821
   403
            on CommitAcceptForGroup if sameNegotiationAndPartner
vb@3825
   404
                go JoiningGroup;
vb@2831
   405
        }
vb@2831
   406
vb@3825
   407
        state HandshakingToJoinPhase2 {
vb@2831
   408
            on Cancel {
vb@2865
   409
                send Rollback;
vb@2831
   410
                go Sole;
vb@2831
   411
            }
vb@2831
   412
vb@2831
   413
            on Reject {
vb@2865
   414
                send CommitReject;
vb@2831
   415
                do disable;
vb@2831
   416
                go End;
vb@2831
   417
            }
vb@2831
   418
vb@3516
   419
            on Accept {
vb@3516
   420
                do trustThisKey;
vb@4177
   421
                send CommitAccept;
vb@3825
   422
                go JoiningGroup;
vb@3516
   423
            }
vb@2831
   424
        }
vb@2831
   425
vb@3825
   426
        state JoiningGroup {
vb@4289
   427
            on GroupKeysForNewMember if sameNegotiationAndPartner {
vb@3521
   428
                do saveGroupKeys;
vb@3815
   429
                do receivedKeysAreDefaultKeys;
vb@3826
   430
                do prepareOwnKeys;
vb@4168
   431
                send GroupKeysAndClose;
vb@3524
   432
                do showDeviceAdded;
vb@3509
   433
                go Grouped;
vb@3509
   434
            }
vb@3509
   435
        }
vb@3509
   436
vb@2831
   437
        state HandshakingGrouped {
vb@2831
   438
            on Init
vb@2831
   439
                do showGroupedHandshake;
vb@2831
   440
    
vb@2831
   441
            // Cancel is Rollback
vb@2831
   442
            on Cancel {
vb@2865
   443
                send Rollback;
vb@2831
   444
                go Grouped;
vb@2831
   445
            }
vb@2831
   446
vb@3779
   447
            on Rollback if sameNegotiationAndPartner
vb@2831
   448
                go Grouped;
vb@2831
   449
vb@2831
   450
            // Reject is CommitReject
vb@2831
   451
            on Reject {
vb@2865
   452
                send CommitReject;
vb@2831
   453
                go Grouped;
vb@2831
   454
            }
vb@2831
   455
vb@3779
   456
            on CommitReject if sameNegotiationAndPartner
vb@2831
   457
                go Grouped;
vb@2831
   458
vb@2831
   459
            // Accept is Phase1Commit
vb@2831
   460
            on Accept {
vb@3516
   461
                do trustThisKey;
vb@2831
   462
                go HandshakingGroupedPhase1;
vb@2831
   463
            }
vb@2831
   464
vb@3779
   465
            on CommitAccept if sameNegotiationAndPartner
vb@3521
   466
                go HandshakingGroupedPhase2;
vb@2831
   467
vb@4289
   468
            on GroupTrustThisKey if fromGroupMember { // double check
vb@3524
   469
                do trustThisKey;
vb@4148
   470
                if sameNegotiation
vb@4148
   471
                    go Grouped;
vb@3524
   472
            }
vb@3524
   473
vb@4289
   474
            on GroupKeysUpdate if fromGroupMember // double check
vb@2831
   475
                do saveGroupKeys;
vb@2831
   476
        }
vb@2831
   477
vb@2831
   478
        state HandshakingGroupedPhase1 {
vb@4168
   479
            on Init {
vb@4168
   480
                send GroupTrustThisKey;
vb@4168
   481
                send CommitAcceptForGroup;
vb@4168
   482
            }
vb@4168
   483
vb@3779
   484
            on Rollback if sameNegotiationAndPartner
vb@2831
   485
                go Grouped;
vb@2831
   486
vb@3779
   487
            on CommitReject if sameNegotiationAndPartner
vb@2831
   488
                go Grouped;
vb@2831
   489
vb@3779
   490
            on CommitAccept if sameNegotiationAndPartner {
vb@3788
   491
                do prepareOwnKeys;
vb@4251
   492
                send GroupKeysForNewMember;
vb@4167
   493
                do showDeviceAccepted;
vb@2831
   494
                go Grouped;
vb@2831
   495
            }
vb@2831
   496
vb@4289
   497
            on GroupTrustThisKey if fromGroupMember // double check
vb@3524
   498
                do trustThisKey;
vb@3524
   499
vb@4289
   500
            on GroupKeysUpdate if fromGroupMember // double check
vb@2831
   501
                do saveGroupKeys;
vb@4168
   502
            
vb@4289
   503
            on GroupKeysAndClose if fromGroupMember { // double check
vb@4168
   504
                do saveGroupKeys;
vb@4168
   505
                go Grouped;
vb@4168
   506
            }
vb@2831
   507
        }
vb@2831
   508
vb@3521
   509
        state HandshakingGroupedPhase2 {
vb@2831
   510
            on Cancel {
vb@2865
   511
                send Rollback;
vb@2831
   512
                go Grouped;
vb@2831
   513
            }
vb@2831
   514
vb@2831
   515
            on Reject {
vb@2865
   516
                send CommitReject;
vb@2831
   517
                go Grouped;
vb@2831
   518
            }
vb@2831
   519
vb@2831
   520
            on Accept {
vb@3516
   521
                do trustThisKey;
vb@3523
   522
                send GroupTrustThisKey;
vb@3788
   523
                do prepareOwnKeys;
vb@4251
   524
                send GroupKeysForNewMember;
vb@4167
   525
                do showDeviceAccepted;
vb@2831
   526
                go Grouped;
vb@2831
   527
            }
vb@2831
   528
vb@4289
   529
            on GroupTrustThisKey if fromGroupMember // double check
vb@3524
   530
                do trustThisKey;
vb@3524
   531
vb@4289
   532
            on GroupKeysUpdate if fromGroupMember // double check
vb@2831
   533
                do saveGroupKeys;
vb@4168
   534
            
vb@4289
   535
            on GroupKeysAndClose if fromGroupMember { // double check
vb@4168
   536
                do saveGroupKeys;
vb@4168
   537
                go Grouped;
vb@4168
   538
            }
vb@2831
   539
        }
vb@2831
   540
 
vb@3384
   541
        external Accept 129;
vb@3384
   542
        external Reject 130;
vb@3384
   543
        external Cancel 131;
vb@2831
   544
vb@2867
   545
        // beacons are always broadcasted
vb@2867
   546
vb@2876
   547
        message Beacon 2, type=broadcast, security=unencrypted {
vb@2831
   548
            field TID challenge;
vb@2831
   549
            auto Version version;
vb@2831
   550
        }
vb@2831
   551
vb@3556
   552
        message NegotiationRequest 3, security=untrusted {
vb@2831
   553
            field TID challenge;
vb@2831
   554
            auto Version version;
vb@3550
   555
            field TID negotiation;
vb@2831
   556
            field bool is_group;
vb@2831
   557
        }
vb@2831
   558
vb@3556
   559
        message NegotiationOpen 4, security=untrusted {
vb@3379
   560
            auto Version version;
vb@3550
   561
            field TID negotiation;
vb@2831
   562
        }
vb@2831
   563
vb@2876
   564
        message Rollback 5, security=untrusted {
vb@3550
   565
            field TID negotiation;
vb@2831
   566
        }
vb@2831
   567
vb@2876
   568
        message CommitReject 6, security=untrusted {
vb@3550
   569
            field TID negotiation;
vb@3550
   570
        }
vb@3550
   571
vb@3825
   572
        message CommitAcceptOfferer 7, security=untrusted {
vb@3550
   573
            field TID negotiation;
vb@2831
   574
        }
vb@2831
   575
vb@3825
   576
        message CommitAcceptRequester 8, security=untrusted {
vb@3550
   577
            field TID negotiation;
vb@2831
   578
        }
vb@2831
   579
vb@3550
   580
        message CommitAccept 9, security=untrusted {
vb@3550
   581
            field TID negotiation;
vb@3550
   582
        }
vb@3550
   583
vb@3550
   584
        message CommitAcceptForGroup 10, security=untrusted {
vb@3550
   585
            field TID negotiation;
vb@3439
   586
        }
vb@3439
   587
vb@4289
   588
        // default: security=truste
vb@4289
   589
        // messages are only accepted when coming from the device group
vb@3550
   590
        message GroupTrustThisKey 11 {
vb@3523
   591
            field Hash key;
vb@4148
   592
            field TID negotiation;
vb@3523
   593
        }
vb@3523
   594
vb@3594
   595
        // trust in future
vb@4251
   596
        message GroupKeysForNewMember 12, security=attach_own_keys_for_new_member {
vb@3390
   597
            field IdentityList ownIdentities;
vb@2831
   598
        }
vb@2831
   599
vb@4251
   600
        message GroupKeysAndClose 13, security=attach_own_keys_for_new_member {
vb@3550
   601
            field IdentityList ownIdentities;
vb@3550
   602
        }
vb@3550
   603
vb@4251
   604
        message OwnKeysOfferer 14, security=attach_own_keys_for_new_member {
vb@4168
   605
            field IdentityList ownIdentities;
vb@4168
   606
        }
vb@4168
   607
vb@4251
   608
        message OwnKeysRequester 15, security=attach_own_keys_for_new_member {
vb@3390
   609
            field IdentityList ownIdentities;
vb@2831
   610
        }
vb@4130
   611
vb@4130
   612
        // grouped handshake
vb@4168
   613
        message NegotiationRequestGrouped 16, security=untrusted {
vb@4130
   614
            field TID challenge;
vb@4130
   615
            auto Version version;
vb@4130
   616
            field TID negotiation;
vb@4130
   617
            field bool is_group;
vb@4130
   618
        }
vb@4130
   619
vb@4168
   620
        message GroupHandshake 17 {
vb@4130
   621
            field TID negotiation;
vb@4132
   622
            field Hash key;
vb@4130
   623
        }
vb@4237
   624
vb@4251
   625
        // update group
vb@4251
   626
        message GroupKeysUpdate 18, security=attach_own_keys_for_group {
vb@4251
   627
            field IdentityList ownIdentities;
vb@4237
   628
        }
vb@4237
   629
vb@4287
   630
        // initiate unled group key reset
vb@4287
   631
        message InitUnledGroupKeyReset 19 {
vb@4251
   632
        }
vb@4251
   633
vb@4251
   634
        message GroupKeyReset 20, security=attach_own_keys_for_group {
vb@4237
   635
            field TID challenge;
vb@4287
   636
            // set this flag for led group key reset; delivered group keys will
vb@4287
   637
            // be accepted by all group members; if not set group keys will be
vb@4287
   638
            // elected
vb@4287
   639
            field bool led;
vb@4237
   640
            field IdentityList ownIdentities;
vb@4237
   641
        }
vb@2831
   642
    }
vb@2831
   643
}
vb@2831
   644