by sitkack · 12y ago · 0 comments
This is the coding style
https://github.com/irungentoo/toxcore/commit/84c28337d248bad...
this is openssl all over again
https://github.com/irungentoo/toxcore/commit/1d6c3934736c369...
> memcpy(packet + 1, &con->ping_request_id, sizeof(uint64_t));
Copying multi-byte values into a network packet is a typical error made by novice developers - this will bite you hard as soon as somebody compiles the code on a Big Endian machine. Even if you might get away with this on opaque elements like a ping ID, the general approach should not be followed.
In all cases where it does matter, the values are converted.
Tox has been confirmed working on big endian machines by many people.
I'm not sure what you're trying to point out with those links. How is this related to openssl?
Read the code. Dig through the commit logs. This is the wrong choice on about every level. The best encryption won't save you when you have code like this.
What did we not learn about OpenSSL?
It's quite readable and has yet to tangle itself in the ifdef mess that is openssl.