MBEDTLS_SSL_CHK_BUF_READ_PTR macro
This macro checks if the remaining length in an input buffer is greater or equal than a needed length. If it is not the case, it returns #MBEDTLS_ERR_SSL_DECODE_ERROR error and pends a #MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR alert message. This is a function-like macro. It is guaranteed to evaluate each argument exactly once.
Arguments
cur
Pointer to the current position in the buffer.
end
Pointer to one past the end of the buffer.
need
Needed length in bytes.
![]()
#define MBEDTLS_SSL_CHK_BUF_READ_PTR(cur, end, need) \![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 2);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, supported_sig_algs_len);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, supported_sig_algs_end, 2);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 2);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, server_name_list_len);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, server_name_list_end, 3);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, server_name_list_end,![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 4);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, protocol_name_list_len);![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, protocol_name_list_end,![]()
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 2);