mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 02:23:32 -04:00
Skip checking on maximum fragment length during handshake
MbedTLS currently does not support maximum fragment length during handshake so we skip it for now. Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
9aec1c71f2
commit
419f841511
@ -3472,6 +3472,10 @@ int mbedtls_ssl_get_max_out_record_payload(const mbedtls_ssl_context *ssl)
|
|||||||
{
|
{
|
||||||
size_t max_len = MBEDTLS_SSL_OUT_CONTENT_LEN;
|
size_t max_len = MBEDTLS_SSL_OUT_CONTENT_LEN;
|
||||||
|
|
||||||
|
if (ssl == NULL || ssl->conf == NULL) {
|
||||||
|
return max_len;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) && \
|
#if !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) && \
|
||||||
!defined(MBEDTLS_SSL_RECORD_SIZE_LIMIT) && \
|
!defined(MBEDTLS_SSL_RECORD_SIZE_LIMIT) && \
|
||||||
!defined(MBEDTLS_SSL_PROTO_DTLS)
|
!defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||||
@ -3479,11 +3483,15 @@ int mbedtls_ssl_get_max_out_record_payload(const mbedtls_ssl_context *ssl)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
|
#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
|
||||||
|
/* MbedTLS currently does not support maximum fragment length
|
||||||
|
during handshake so we skip it for now. */
|
||||||
|
if (ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER) {
|
||||||
const size_t mfl = mbedtls_ssl_get_output_max_frag_len(ssl);
|
const size_t mfl = mbedtls_ssl_get_output_max_frag_len(ssl);
|
||||||
|
|
||||||
if (max_len > mfl) {
|
if (max_len > mfl) {
|
||||||
max_len = mfl;
|
max_len = mfl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_RECORD_SIZE_LIMIT)
|
#if defined(MBEDTLS_SSL_RECORD_SIZE_LIMIT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user