Browse Source

ignore ReceiverRating in Sync

ENGINE-877 Release_2.1.10
Volker Birk 1 year ago
parent
commit
d4daf0ff04
3 changed files with 25 additions and 8 deletions
  1. +19
    -2
      sync/gen_statemachine.ysl2
  2. +1
    -1
      sync/sync.fsm
  3. +5
    -5
      test/src/LotsOfKeysTest.cc

+ 19
- 2
sync/gen_statemachine.ysl2 View File

@ -415,6 +415,16 @@ tstylesheet {
if (!(session && fsm > None && message_type > None))
return PEP_ILLEGAL_VALUE;
||
if "fsm/message[@security='ignore']" {
|
|> // ignore
|> switch (message_type) {
for "fsm/message[@security='ignore']" {
|>> case «../@name»_PR_«yml:mixedCase(@name)»:
|>>> return PEP_STATUS_OK;
}
|> }
}
if "fsm/message[@ratelimit>0]" {
||
@ -506,7 +516,7 @@ tstylesheet {
break;
// these go anycast; previously used address is sticky (unicast)
`` for "fsm/message[@type='anycast']" |>> case «../@name»_PR_«yml:mixedCase(@name)»:
`` for "fsm/message[@type='anycast' and @security!='ignore']" |>> case «../@name»_PR_«yml:mixedCase(@name)»:
// if we have a comm_partner fixed send it there
if (session->«yml:lcase(@name)»_state.comm_partner.identity) {
pEp_identity *channel = identity_dup(session->«yml:lcase(@name)»_state.comm_partner.identity);
@ -1162,7 +1172,7 @@ tstylesheet {
||
}
for "message[@security!='unencrypted' and @security!='untrusted']" {
for "message[@security!='unencrypted' and @security!='untrusted' and @security!='ignore']" {
if "position()=1" |>> // these messages must come through a trusted channel
||
case «../@name»_PR_«yml:mixedCase(@name)»:
@ -1182,6 +1192,13 @@ tstylesheet {
||
}
for "message[@security='ignore']"
||
case «../@name»_PR_«yml:mixedCase(@name)»:
free_«../../@name»_message(msg);
return PEP_STATUS_OK;
||
||
default:
status = PEP_«yml:ucase(ancestor::protocol/@name)»_ILLEGAL_MESSAGE;


+ 1
- 1
sync/sync.fsm View File

@ -685,7 +685,7 @@ protocol Sync 1 {
// decrypt_message() to mark a previously computed rating. It is only
// valid when signed with an own key.
message ReceiverRating 22, security=unencrypted {
message ReceiverRating 22, security=ignore {
field Rating rating;
}
}


+ 5
- 5
test/src/LotsOfKeysTest.cc View File

@ -59,10 +59,10 @@ ggsave("/tmp/pep-benchmark.pdf", width = 4, height = 4)
#define REPITIONS 3
// 10^x, x=0.5.. step 0.5.
const int exp[] = { 3, 10, 31, 100, 316, 1000, 3162, 10000, 31622,
const int _exp[] = { 3, 10, 31, 100, 316, 1000, 3162, 10000, 31622,
100000, 316227, 1000000, 3162277, 10000000,
31622776, 100000000, 316227766, 1000000000 };
#define BENCHMARKS (sizeof(exp) / sizeof(exp[0]))
#define BENCHMARKS (sizeof(_exp) / sizeof(_exp[0]))
struct stats {
FILE *fp;
@ -257,10 +257,10 @@ TEST_F(LotsOfKeysTest, check) {
}
bool do_benchmark = false;
for (int i = 0; i < sizeof(exp) / sizeof(exp[0]); i ++) {
if (key + 1 == exp[i]) {
for (int i = 0; i < sizeof(_exp) / sizeof(_exp[0]); i ++) {
if (key + 1 == _exp[i]) {
do_benchmark = true;
} else if (key + 1 < exp[i]) {
} else if (key + 1 < _exp[i]) {
break;
}
}


Loading…
Cancel
Save