diff options
author | Andrzej Kurek <andrzej.kurek@arm.com> | 2018-04-24 06:32:44 -0400 |
---|---|---|
committer | Andrzej Kurek <andrzej.kurek@arm.com> | 2018-04-24 06:33:49 -0400 |
commit | 078014aebecfc9c21f9e9264cf57cb1d35ed1a5c (patch) | |
tree | 07754e512151997143fecbedee206b345959ca9e | |
parent | bb6661479f935e3900c7530e63cdb14c90163a02 (diff) | |
download | mbedtls-archive/iotssl-1401-record-compression-2.1.zip mbedtls-archive/iotssl-1401-record-compression-2.1.tar.gz mbedtls-archive/iotssl-1401-record-compression-2.1.tar.bz2 |
Change variable bytes_written to header_bytes in record decompressionarchive/iotssl-1401-record-compression-2.1
The name is changed to better reflect the input, decompression case
-rw-r--r-- | library/ssl_tls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 9462587..5fc5be3 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -2134,7 +2134,7 @@ static int ssl_decompress_buf( mbedtls_ssl_context *ssl ) { int ret; unsigned char *msg_post = ssl->in_msg; - ptrdiff_t bytes_written = ssl->in_msg - ssl->in_buf; + ptrdiff_t header_bytes = ssl->in_msg - ssl->in_buf; size_t len_pre = ssl->in_msglen; unsigned char *msg_pre = ssl->compress_buf; @@ -2155,7 +2155,7 @@ static int ssl_decompress_buf( mbedtls_ssl_context *ssl ) ssl->transform_in->ctx_inflate.avail_in = len_pre; ssl->transform_in->ctx_inflate.next_out = msg_post; ssl->transform_in->ctx_inflate.avail_out = MBEDTLS_SSL_BUFFER_LEN - - bytes_written; + header_bytes; ret = inflate( &ssl->transform_in->ctx_inflate, Z_SYNC_FLUSH ); if( ret != Z_OK ) @@ -2165,7 +2165,7 @@ static int ssl_decompress_buf( mbedtls_ssl_context *ssl ) } ssl->in_msglen = MBEDTLS_SSL_BUFFER_LEN - - ssl->transform_in->ctx_inflate.avail_out - bytes_written; + ssl->transform_in->ctx_inflate.avail_out - header_bytes; MBEDTLS_SSL_DEBUG_MSG( 3, ( "after decompression: msglen = %d, ", ssl->in_msglen ) ); |