e0b150f96b
This commit introduces a compile time constant MBEDTLS_SSL_DTLS_MAX_BUFFERING to mbedtls/config.h which allows the user to control the cumulative size of all heap buffer allocated for the purpose of reassembling and buffering handshake messages. It is put to use by introducing a new field `total_bytes_buffered` to the buffering substructure of `mbedtls_ssl_handshake_params` that keeps track of the total size of heap allocated buffers for the purpose of reassembly and buffering at any time. It is increased whenever a handshake message is buffered or prepared for reassembly, and decreased when a buffered or fully reassembled message is copied into the input buffer and passed to the handshake logic layer. This commit does not yet include future epoch record buffering into account; this will be done in a subsequent commit. Also, it is now conceivable that the reassembly of the next expected handshake message fails because too much buffering space has already been used up for future messages. This case currently leads to an error, but instead, the stack should get rid of buffered messages to be able to buffer the next one. This will need to be implemented in one of the next commits. |
||
---|---|---|
.. | ||
mbedtls | ||
.gitignore | ||
CMakeLists.txt |