ignore ReceiverRating in Sync Release_2.1 Release_2.1.10
authorVolker Birk <vb@pep-project.org>
Thu, 03 Dec 2020 11:13:28 +0100
branchRelease_2.1
changeset 5222aaffc7213827
parent 5209 7b144cd67e87
child 5223 ee68dc45a254
ignore ReceiverRating in Sync
sync/gen_statemachine.ysl2
sync/sync.fsm
test/src/LotsOfKeysTest.cc
     1.1 --- a/sync/gen_statemachine.ysl2	Fri Nov 27 11:19:52 2020 +0100
     1.2 +++ b/sync/gen_statemachine.ysl2	Thu Dec 03 11:13:28 2020 +0100
     1.3 @@ -415,6 +415,16 @@
     1.4                  if (!(session && fsm > None && message_type > None))
     1.5                      return PEP_ILLEGAL_VALUE;
     1.6              ||
     1.7 +            if "fsm/message[@security='ignore']" {
     1.8 +                |
     1.9 +                |> // ignore
    1.10 +                |> switch (message_type) {
    1.11 +                    for "fsm/message[@security='ignore']" {
    1.12 +                        |>> case «../@name»_PR_«yml:mixedCase(@name)»:
    1.13 +                        |>>> return PEP_STATUS_OK;
    1.14 +                    }
    1.15 +                |> }
    1.16 +            }
    1.17              if "fsm/message[@ratelimit>0]" {
    1.18              ||
    1.19  
    1.20 @@ -506,7 +516,7 @@
    1.21                          break;
    1.22  
    1.23                      // these go anycast; previously used address is sticky (unicast)
    1.24 -                    `` for "fsm/message[@type='anycast']" |>> case «../@name»_PR_«yml:mixedCase(@name)»:
    1.25 +                    `` for "fsm/message[@type='anycast' and @security!='ignore']" |>> case «../@name»_PR_«yml:mixedCase(@name)»:
    1.26                          // if we have a comm_partner fixed send it there
    1.27                          if (session->«yml:lcase(@name)»_state.comm_partner.identity) {
    1.28                              pEp_identity *channel = identity_dup(session->«yml:lcase(@name)»_state.comm_partner.identity);
    1.29 @@ -1162,7 +1172,7 @@
    1.30  
    1.31          ||
    1.32          }
    1.33 -        for "message[@security!='unencrypted' and @security!='untrusted']" {
    1.34 +        for "message[@security!='unencrypted' and @security!='untrusted' and @security!='ignore']" {
    1.35          if "position()=1" |>> // these messages must come through a trusted channel
    1.36          ||
    1.37                  case «../@name»_PR_«yml:mixedCase(@name)»:
    1.38 @@ -1182,6 +1192,13 @@
    1.39  
    1.40          ||
    1.41          }
    1.42 +        for "message[@security='ignore']"
    1.43 +        ||
    1.44 +                case «../@name»_PR_«yml:mixedCase(@name)»:
    1.45 +                    free_«../../@name»_message(msg);
    1.46 +                    return PEP_STATUS_OK;
    1.47 +
    1.48 +        ||
    1.49          ||
    1.50                  default:
    1.51                      status = PEP_«yml:ucase(ancestor::protocol/@name)»_ILLEGAL_MESSAGE;
     2.1 --- a/sync/sync.fsm	Fri Nov 27 11:19:52 2020 +0100
     2.2 +++ b/sync/sync.fsm	Thu Dec 03 11:13:28 2020 +0100
     2.3 @@ -685,7 +685,7 @@
     2.4          // decrypt_message() to mark a previously computed rating. It is only
     2.5          // valid when signed with an own key.
     2.6  
     2.7 -        message ReceiverRating 22, security=unencrypted {
     2.8 +        message ReceiverRating 22, security=ignore {
     2.9              field Rating rating;
    2.10          }
    2.11      }
     3.1 --- a/test/src/LotsOfKeysTest.cc	Fri Nov 27 11:19:52 2020 +0100
     3.2 +++ b/test/src/LotsOfKeysTest.cc	Thu Dec 03 11:13:28 2020 +0100
     3.3 @@ -59,10 +59,10 @@
     3.4  #define REPITIONS 3
     3.5  
     3.6  // 10^x, x=0.5.. step 0.5.
     3.7 -const int exp[] = { 3, 10, 31, 100, 316, 1000, 3162, 10000, 31622,
     3.8 +const int _exp[] = { 3, 10, 31, 100, 316, 1000, 3162, 10000, 31622,
     3.9                      100000, 316227, 1000000, 3162277, 10000000,
    3.10                      31622776, 100000000, 316227766, 1000000000 };
    3.11 -#define BENCHMARKS (sizeof(exp) / sizeof(exp[0]))
    3.12 +#define BENCHMARKS (sizeof(_exp) / sizeof(_exp[0]))
    3.13  
    3.14  struct stats {
    3.15      FILE *fp;
    3.16 @@ -257,10 +257,10 @@
    3.17          }
    3.18  
    3.19          bool do_benchmark = false;
    3.20 -        for (int i = 0; i < sizeof(exp) / sizeof(exp[0]); i ++) {
    3.21 -            if (key + 1 == exp[i]) {
    3.22 +        for (int i = 0; i < sizeof(_exp) / sizeof(_exp[0]); i ++) {
    3.23 +            if (key + 1 == _exp[i]) {
    3.24                  do_benchmark = true;
    3.25 -            } else if (key + 1 < exp[i]) {
    3.26 +            } else if (key + 1 < _exp[i]) {
    3.27                  break;
    3.28              }
    3.29          }