mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-22 09:40:09 +00:00
Move declarations to top in ssl_helpers.c
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
parent
ec4c91ecc1
commit
932126525a
@ -926,13 +926,14 @@ int mbedtls_ssl_write_fragment(mbedtls_ssl_context *ssl,
|
|||||||
int *written,
|
int *written,
|
||||||
const int expected_fragments)
|
const int expected_fragments)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
/* Verify that calling mbedtls_ssl_write with a NULL buffer and zero length is
|
/* Verify that calling mbedtls_ssl_write with a NULL buffer and zero length is
|
||||||
* a valid no-op for TLS connections. */
|
* a valid no-op for TLS connections. */
|
||||||
if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) {
|
if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) {
|
||||||
TEST_ASSERT(mbedtls_ssl_write(ssl, NULL, 0) == 0);
|
TEST_ASSERT(mbedtls_ssl_write(ssl, NULL, 0) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = mbedtls_ssl_write(ssl, buf + *written, buf_len - *written);
|
ret = mbedtls_ssl_write(ssl, buf + *written, buf_len - *written);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
*written += ret;
|
*written += ret;
|
||||||
}
|
}
|
||||||
@ -972,13 +973,14 @@ int mbedtls_ssl_read_fragment(mbedtls_ssl_context *ssl,
|
|||||||
int *read, int *fragments,
|
int *read, int *fragments,
|
||||||
const int expected_fragments)
|
const int expected_fragments)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
/* Verify that calling mbedtls_ssl_write with a NULL buffer and zero length is
|
/* Verify that calling mbedtls_ssl_write with a NULL buffer and zero length is
|
||||||
* a valid no-op for TLS connections. */
|
* a valid no-op for TLS connections. */
|
||||||
if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) {
|
if (ssl->conf->transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) {
|
||||||
TEST_ASSERT(mbedtls_ssl_read(ssl, NULL, 0) == 0);
|
TEST_ASSERT(mbedtls_ssl_read(ssl, NULL, 0) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = mbedtls_ssl_read(ssl, buf + *read, buf_len - *read);
|
ret = mbedtls_ssl_read(ssl, buf + *read, buf_len - *read);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
(*fragments)++;
|
(*fragments)++;
|
||||||
*read += ret;
|
*read += ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user