... sync
authorVolker Birk <vb@pep.foundation>
Thu, 23 Aug 2018 07:33:29 +0200
branchsync
changeset 28786163c699dd69
parent 2877 70189b383730
child 2879 1b90ffed2d89
...
sync/gen_statemachine.ysl2
     1.1 --- a/sync/gen_statemachine.ysl2	Thu Aug 23 07:16:54 2018 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Thu Aug 23 07:33:29 2018 +0200
     1.3 @@ -361,7 +361,6 @@
     1.4  
     1.5                      // these go anycast; previously used address is sticky (unicast)
     1.6                      `` for "fsm/message[@type='anycast']" |>> case «../@name»__payload_PR_«yml:mixedCase(@name)»:
     1.7 -                    {
     1.8                          if (!session->«yml:lcase(@name)»_state.common.from `> |`|
     1.9                              (session->«yml:lcase(@name)»_state.common.from->flags &
    1.10                              PEP_idf_not_for_«yml:lcase(@name)»)) {
    1.11 @@ -395,7 +394,6 @@
    1.12                                  goto the_end;
    1.13                              }
    1.14                          }
    1.15 -                    }
    1.16  
    1.17                      default:
    1.18                          status = PEP_«yml:ucase(@name)»_ILLEGAL_MESSAGE;
    1.19 @@ -403,17 +401,31 @@
    1.20                  }
    1.21  
    1.22                  for (identity_list *li = channels; li && li->ident ; li = li->next) {
    1.23 +                    message *_m = NULL;
    1.24 +
    1.25                      status = base_prepare_message(
    1.26                              li->ident,
    1.27                              li->ident,
    1.28                              data,
    1.29                              size,
    1.30 -                            &m
    1.31 +                            &_m
    1.32                          );
    1.33                      if (status)
    1.34                          goto the_end;
    1.35                      data = NULL;
    1.36  
    1.37 +                    switch (message_type) {
    1.38 +                    `` for "fsm/message[@security='unencrypted']" |>>> case «../@name»__payload_PR_«yml:mixedCase(@name)»:
    1.39 +                            m = _m;
    1.40 +                            break;
    1.41 +
    1.42 +                        default:
    1.43 +                            status = encrypt_message(session, _m, NULL, &m, PEP_enc_PEP, 0);
    1.44 +                            if (status)
    1.45 +                                goto the_end;
    1.46 +                            free_message(_m);
    1.47 +                    }
    1.48 +
    1.49                      status = session->messageToSend(session->«yml:lcase(@name)»_obj, m);
    1.50                      m = NULL;
    1.51                  }