The chatty approach for the avatar data transfer was intended as a
security feature to add explicit delays to the transfer and prevent
amplification attacks among authenticated friends. This was deemed
unnecessary in the code review and, therefore, replaced by a simpler
approach that sends all data in a single burst.
Support for other formats was deemed unnecessary in the code review
and therefore removed. The value for the constant TOX_AVATARFORMAT_PNG
is now set in stone; if the other formats become needed again in the
future, this commit shall be reverted and the enum values reordered to
keep compatibility.
Add a protocol and the APIs to straightforwardly support user avatars
in client applications. The protocol is designed to transfer avatars
in background, between friends only, and minimize network load by
providing a lightweight avatar notification for local cache validation.
Strict safeguards are imposed to avoid damage from non-cooperative or
malicious users and to limit network usage.
The complete documentation is available in docs/Avatars.md and sample
code is available in testing/test_avatars.c.
Code and documentation are released under the GNU GPLv3 or later, as
described in the file COPYING.
with only the first byte set to 1 instead of 0 and the public key set
to the one of the reciever as a valid response packet.
This breaks network compatibility with all previous cores.
Cookie now contains the dht public key of the peer which makes
more sense than including the real public key of the reciever.
It means we no longer have to rely entirely on onion_client to
find the dht public key of the other peer.
There should be no more delay between a peer closing their client
and their friend being notified of them going offline. (unless the
kill packet is lost)
Wrote down more of the protocol.
Padding support has been added and implemented which will make it
possible for us to pad packets to mitigate length related attacks.
Removed a bunch of useless space from various structs.
pack_nodes() and unpack_nodes() are now used to transmit lists of
nodes for the DHT and onion parts. They provide a way to transmit
both ipv6 and ipv4 nodes in the same packet in a portable way that
takes as little space as possible without compression.
Using pack_nodes, merged the send nodes and send nodes ipv6 packets
into one packet greatly reducing the risk of amplification attacks.
oniondata_registerhandler(...) can be used to register different packet
types to handle them and send_onion_data(...) can be used to send these
packets.