igrr / axtls-8266

axTLS port for ESP8266
Other
79 stars 33 forks source link

Fix handling of padded TLS fragments in handshake #58

Closed earlephilhower closed 6 years ago

earlephilhower commented 6 years ago

When multiple handshake messages are sent in a single fragment, there may be some padding (i.e. pkt_size will be larger than the amount of bytes processed). When this happens, the old code would only advance the working pointer to the end of processed data, which would not be the start of the next packet per the sent pkt_size, causing handshake failure.

Now simply advance the working pointer to the next packet irrespective of how many bytes in the current one were processed in the server_hello message.

earlephilhower commented 6 years ago

https://github.com/esp8266/Arduino/issues/3661 is the reason for this PR. I have no idea why it says CI failed, as far as I can see everything built just fine...

earlephilhower commented 6 years ago

The CI build was busted due to an update to test/common.sh in the Arduino repo. Including the fix for it here as it's pretty trivial.

earlephilhower commented 6 years ago

@igrr Thanks! Would you like to rebuild and commit the new library for the Arduino core? I can do it, if needed, but didn't want to step on your toes.

Thx -EFP3

igrr commented 6 years ago

Thanks for the reminder @earlephilhower, created https://github.com/esp8266/Arduino/pull/5125.