3 ms·
It is surprising to me that modern browsers don't pad TLS (in TLS 1.3 padding is "free" in the sense that you don't need any extra bytes to say "this is padding
by tialaramex 7y ago
It is surprising to me that modern browsers don't pad TLS (in TLS 1.3 padding is "free" in the sense that you don't need any extra bytes to say "this is padding") to fill the last packet.
Supposing MSS is 1500 for a link, how much longer can it conceivably take to send say 1500 bytes including 120 bytes of padding versus 1380 bytes?
- toast0 7y agoSoftware layering makes this much harder than it should be, but it's a good concept. One potential pitfall is that an unfortunate number of networks still have poor path MTU detection, so padding that makes the packets larger than any previously sent packet in the stream may result in a packet too large to transit the network. Then you're at the mercy of ICMP delivery or path MTU blackhole detection, which tends to be slow and isn't enabled on Android (!).
- tialaramex 7y agoSomewhere, one of the layers is picking a packet size. Probably the OS TCP stack. What I'd want to do as a TLS implementation concerned about hiding exact lengths is use that packet length for my final packet regardless of how much is actually inside it. Yes if the MTU is bogus and causes fragmentation or dropped packets that's bad, but I'm comfortable it also happened to every other packet sent, I'm only making things go from terrible to slightly more terrible, not from good to bad, and only for people who've got problems.
- toast0 7y ago> Yes if the MTU is bogus and causes fragmentation or dropped packets that's bad, but I'm comfortable it also happened to every other packet sent, I'm only making things go from terrible to slightly more terrible, not from good to bad, and only for people who've got problems. Certainly, this would only affect people who have problems, which is low, but if you're always padding all requests up to the full MTU, it has the potential to make things go from almost always working, to never working. Looking at tcpdump with a real browser to one of my sites, firefox is only sending pretty short packets, everything is less than 512 bytes. But if you pad out to the full MTU, and the network is broken, those large packets may all be dropped, and the ICMPs either supressed filtered or so rate limited that they never get seen. Users on these networks with this padding would not be able to make https requests to most servers, but would be able to make connections to services where they have taken special effort to avoid MTU problems. Special efforts like: Google and Facebook clamp the maximum MSS they send to 1380 and 1400 for IPv4; FreeBSD used to return the client MSS in SYN+ACK if it was smaller than the locally configured MSS, but that was removed with this commit: https://github.com/freebsd/freebsd/commit/e1f9aeedee0bae92811248f9fcefa92ccb7be91f#diff-f3fd9f911dd76ffd9fbd0c8bfb458a61 https://github.com/freebsd/freebsd/commit/e1f9aeedee0bae9281...