-
Notifications
You must be signed in to change notification settings - Fork 44
ThaliCore: Data corruption causes SSL to crash #1963
Comments
The first problem is caused by the buffer size used on the receiving side: There is still a problem with replicating large attachments: after the first 9 chunks (total of 144 KBytes) has been send and successfully received, the 10th chunk is sent but never received. |
Upon further investigation, it turned out that the increased buffer size didn't "fix" the SSL error, it simply changed the way the underneath bug shows up. On the sender side, the node layer calls In that case, the chunk is appended to |
Fixing the |
I've implemented a fix that has improved things but not fixed all the issues. |
Something smells very wrong about those numbers. By MBPS do you mean Megabytes or Megabits? Because even on Wifi the iPhone shouldn't get much about 250 Mbps (as in bits, not Bytes). And on MPCF I wouldn't personally expect much more than 10 Mbps (although that is just a theory, I don't know the actual limit). But I would be worried about any tests showing 130 MBPS - 300 MBPS. |
@yaronyg those are the numbers shown by ThaliTestApp: |
I provided fix for calculating transfer rate. Also, keep in my mind that this is based on each phone's timestamps, so you need to make sure their clocks are synchronised, otherwise you could even get negative numbers. |
There was a serious bug in ThaliCore that has been fixed in this branch |
Reporter by Enrico:
It looks like a data corruption, probably caused by a bug in ThaliCore. When the replication starts, the SSL handshaking completes successfully and the first device starts sending the attachment to the second device in chucks of 16384 bytes each. The second device receives the first few chunks and decrypts them without errors. Then, usually it's the 5th chunk, a chunk arrives with a length of 16394 byes that is clearly wrong, since only 16384 were sent. The first 16032 bytes of the chunk are OK, but the last 352 bytes are different from the last 352 bytes sent, plus there are 8 extra bytes. At that point the SSL routine, that decrypts the chunk, returns an error. It doesn't look like it's a bug in SSL or in JXcore, I guess it's a bug in the transmission/reception of the chunk.
The text was updated successfully, but these errors were encountered: