From 1d1657f11c229d0db303532ad8978b22f467730e Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Tue, 4 Jun 2019 16:03:28 +0300 Subject: [PATCH] Allow stub implementation of the context_save for now --- programs/ssl/ssl_client2.c | 7 +++++-- programs/ssl/ssl_server2.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 3456dd3df..37aecc8b0 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -2925,8 +2925,11 @@ send_request: opt.serialize = 0; mbedtls_printf( " Serializing live connection..." ); - if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ) ) - != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ) + ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ); + + /* Allow stub implementation returning 0 for now */ + if( ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL && + ret != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_context_save returned " "-0x%x\n\n", -ret ); diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 173593bdd..cae278521 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -3936,8 +3936,11 @@ data_exchange: opt.serialize = 0; mbedtls_printf( " Serializing live connection..." ); - if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ) ) - != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ) + ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ); + + /* Allow stub implementation returning 0 for now */ + if( ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL && + ret != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_context_save returned " "-0x%x\n\n", -ret );