mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-30 07:06:53 +00:00
Use size_t instead of uint32_t for ssl I/O buffer lengths
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
4a0637981b
commit
069fa96cd7
|
@ -275,26 +275,26 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
|
#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
|
||||||
static inline uint32_t mbedtls_ssl_get_output_buflen( const mbedtls_ssl_context *ctx )
|
static inline size_t mbedtls_ssl_get_output_buflen( const mbedtls_ssl_context *ctx )
|
||||||
{
|
{
|
||||||
#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
|
#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
|
||||||
return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx )
|
return mbedtls_ssl_get_output_max_frag_len( ctx )
|
||||||
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
|
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
|
||||||
+ MBEDTLS_SSL_CID_OUT_LEN_MAX;
|
+ MBEDTLS_SSL_CID_OUT_LEN_MAX;
|
||||||
#else
|
#else
|
||||||
return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx )
|
return mbedtls_ssl_get_output_max_frag_len( ctx )
|
||||||
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
|
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t mbedtls_ssl_get_input_buflen( const mbedtls_ssl_context *ctx )
|
static inline size_t mbedtls_ssl_get_input_buflen( const mbedtls_ssl_context *ctx )
|
||||||
{
|
{
|
||||||
#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
|
#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID)
|
||||||
return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx )
|
return mbedtls_ssl_get_input_max_frag_len( ctx )
|
||||||
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
|
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD
|
||||||
+ MBEDTLS_SSL_CID_IN_LEN_MAX;
|
+ MBEDTLS_SSL_CID_IN_LEN_MAX;
|
||||||
#else
|
#else
|
||||||
return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx )
|
return mbedtls_ssl_get_input_max_frag_len( ctx )
|
||||||
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
|
+ MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,8 +262,8 @@ static int resize_buffer( unsigned char **buffer, size_t len_new, size_t *len_ol
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_buffer_resizing( mbedtls_ssl_context *ssl, int downsizing,
|
static void handle_buffer_resizing( mbedtls_ssl_context *ssl, int downsizing,
|
||||||
uint32_t in_buf_new_len,
|
size_t in_buf_new_len,
|
||||||
uint32_t out_buf_new_len )
|
size_t out_buf_new_len )
|
||||||
{
|
{
|
||||||
int modified = 0;
|
int modified = 0;
|
||||||
size_t written_in = 0, iv_offset_in = 0, len_offset_in = 0;
|
size_t written_in = 0, iv_offset_in = 0, len_offset_in = 0;
|
||||||
|
|
Loading…
Reference in a new issue