mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 08:54:23 +01: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
|
||||
|
||||
#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)
|
||||
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_CID_OUT_LEN_MAX;
|
||||
#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;
|
||||
#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)
|
||||
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_CID_IN_LEN_MAX;
|
||||
#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;
|
||||
#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,
|
||||
uint32_t in_buf_new_len,
|
||||
uint32_t out_buf_new_len )
|
||||
size_t in_buf_new_len,
|
||||
size_t out_buf_new_len )
|
||||
{
|
||||
int modified = 0;
|
||||
size_t written_in = 0, iv_offset_in = 0, len_offset_in = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user