Changes:
5b4be7d2738de5874f2e302157a0b726fe7bd4a6 Reserve 16k fragment buffer only when it is actually required.
b33ef68e6a3e2be1171e5a9f5b6156af424489ec Fix handshake status not being set if increase_bm_data_size fails
If it fails due to a malloc somewhere in bigint.c, we will still crash (although with a less obvious crash message). If it fails in increase_bm_data_size, axTLS will handle this and report that connection has been aborted. This error will be passed on to the user, so that an application can recover and attempt to reconnect.
Changelog:
324c2fdade3f39b4c7fb7fbe707f4a313023ecd3 Terminate connection if increase_bm_data_size fails
96fbb39f21d3af7ca3e4dee78f8c45c4e2e652b5 Update README.md
c18bb56e6100177cfa0bef3c90708efb9d7a071d Add travis CI
9eaeca3a030692bdf949b89d80705061b516f70b Postpone freeing of X509 context to the first data exchange after handshake
28869ea94b3b1cabfbe8679d962adc12ba0b28db Use free followed by malloc instead of realloc when increasing raw buffer
43a90bcf3559ed145db9286f28bdcd8b07832b51 Merge pull request #8 from slaff/feature/lwipr-compat
66e1a5f423c0ee25d4318968ea14384887d287aa Merge pull request #7 from slaff/feature/sni
1154d0a985cc442f39f5e6b3678a7d4ffca5db31 Changed the code to reserve bytes for hostname only if needed.
63da8991c2878f2a7cd526667f9e23adc9dca1c9 Added SNI ( https://en.wikipedia.org/wiki/Server_Name_Indication ) support.
7c38865f66cfdd0884183619b0d1e89b8717cb01 Restructured the lwip raw comat code. Added replacements for the time functions on ESP8266.
885ff3e8f0455d48acbc5e67557602e9d548fd81 Merge pull request #6 from slaff/feature/lwip-raw
d78e7a07998f456d452a760d478d1518b009fd4a Initial version of axTLS integration with lwip raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP).
Print::printf would allocate 1460 bytes on the stack, which in some cases would overflow the stack. Additionally it didn't handle (rare) cases when vsnprintf needed a buffer longer than 1460 bytes. This change makes default stack-allocated buffer 64 bytes long, and checks the result returned by vsnprintf. If a buffer longer than 64 bytes is needed, it is allocated on the heap.
Calling String::reserve() causes a crash if String object was in invalidated state. Per the comment on the method's declaration in ESP_SSD1306.h, This method was supposed to recover invalidated strings. This change fixes the edge case bug in String::changeBuffer() which is the root cause of the crash exposed from String::reserve().
Following test code was used to reproduce the problem and also to validate the fix:
String result;
while(true){
char c = 'A';
result += c; // the loop will cause malloc() to fail at some point.
if (result.c_str()==0)
{
Serial.println("String INVALIDATED!!!!!");
result.reserve(0); // before fix, this would crash.
Serial.println("Trying to empty....");
result="";
Serial.println("Emptied!!!!");
break;
}
}