Add datagram mode to the SPTPS protocol.

* Everything is identical except the headers of the records.
* Instead of sending explicit message length and having an implicit sequence
  number, datagram mode has an implicit message length and an explicit sequence
  number.
* The sequence number is used to set the most significant bytes of the counter.
This commit is contained in:
Guus Sliepen 2012-03-18 16:42:02 +01:00
parent 03e06fd43a
commit 3a4fe104a0
4 changed files with 130 additions and 12 deletions

View file

@ -144,7 +144,7 @@ bool id_h(connection_t *c, char *request) {
else
snprintf(label, sizeof label, "tinc TCP key expansion %s %s", c->name, myself->name);
return sptps_start(&c->sptps, c, c->outgoing, myself->connection->ecdsa, c->ecdsa, label, sizeof label, send_meta_sptps, receive_meta_sptps);
return sptps_start(&c->sptps, c, c->outgoing, false, myself->connection->ecdsa, c->ecdsa, label, sizeof label, send_meta_sptps, receive_meta_sptps);
} else {
return send_metakey(c);
}