# HG changeset patch # User Ivo Smits # Date 1369408002 -7200 # Node ID 3f04a72ce03556172dc441002dca83ce3921dd59 # Parent 671d640390f2c1aec13f2dc4ec5a3bc1448fa38c Salty protocol: move local sending timestamp forward if remote has a newer timestamp diff -r 671d640390f2 -r 3f04a72ce035 src/proto.salty.c --- a/src/proto.salty.c Fri May 17 16:10:58 2013 +0200 +++ b/src/proto.salty.c Fri May 24 17:06:42 2013 +0200 @@ -415,6 +415,10 @@ memcpy(d->dataremotekey, raw + 32 + 1, 32); memcpy(d->dataremotenonce, raw + 32 + 1 + 32, 24); uint64 lexpectts = decodeuint64(raw + 32 + 1 + 32 + 24 + 32 + 24); + if (lexpectts > d->controlencodetime) { + fprintf(stderr, "Remote expects newer control timestamp (%llu > %llu), moving forward.\n", lexpectts, d->controlencodetime); + d->controlencodetime = lexpectts; + } struct qt_proto_data_salty_keyset* enckey = &d->datalocalkeys[lkeyid]; if (memcmp(enckey->publickey, raw + 32 + 1 + 32 + 24, 32) || memcmp(enckey->nonce, raw + 32 + 1 + 32 + 24 + 32, 20)) { dosendkeyupdate |= 2;