Fix MBEDTLS_PRIVATE wrapping in tests and sample programs.

Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
Mateusz Starzyk 2021-05-27 14:57:03 +02:00
parent b4a012929d
commit 55768f26fc
8 changed files with 7 additions and 21 deletions

View File

@ -17,8 +17,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else

View File

@ -17,8 +17,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
@ -231,7 +229,7 @@ int main( void )
mbedtls_ssl_cache_set );
#endif
mbedtls_ssl_conf_ca_chain( &conf, srvcert.next, NULL );
mbedtls_ssl_conf_ca_chain( &conf, srvcert.MBEDTLS_PRIVATE(next), NULL );
if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &srvcert, &pkey ) ) != 0 )
{
printf( " failed\n ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret );

View File

@ -18,8 +18,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
@ -252,13 +250,13 @@ int main( void )
addr.sin_addr.s_addr = *((char *) &ret) == ret ? ADDR_LE : ADDR_BE;
ret = 0;
if( ( server_fd.fd = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 )
if( ( server_fd.MBEDTLS_PRIVATE(fd) = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 )
{
ret = socket_failed;
goto exit;
}
if( connect( server_fd.fd,
if( connect( server_fd.MBEDTLS_PRIVATE(fd),
(const struct sockaddr *) &addr, sizeof( addr ) ) < 0 )
{
ret = connect_failed;

View File

@ -17,8 +17,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else

View File

@ -17,8 +17,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
@ -195,7 +193,7 @@ int main( void )
mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg );
mbedtls_ssl_conf_dbg( &conf, my_debug, stdout );
mbedtls_ssl_conf_ca_chain( &conf, srvcert.next, NULL );
mbedtls_ssl_conf_ca_chain( &conf, srvcert.MBEDTLS_PRIVATE(next), NULL );
if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &srvcert, &pkey ) ) != 0 )
{
mbedtls_printf( " failed! mbedtls_ssl_conf_own_cert returned %d\n\n", ret );

View File

@ -21,8 +21,6 @@
* be set before config.h, which pulls in glibc's features.h indirectly.
* Harmless on other platforms. */
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#define _POSIX_C_SOURCE 200112L
#define _XOPEN_SOURCE 600

View File

@ -17,8 +17,6 @@
* limitations under the License.
*/
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
@ -217,7 +215,7 @@ int main( void )
mbedtls_ssl_cache_set );
#endif
mbedtls_ssl_conf_ca_chain( &conf, srvcert.next, NULL );
mbedtls_ssl_conf_ca_chain( &conf, srvcert.MBEDTLS_PRIVATE(next), NULL );
if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &srvcert, &pkey ) ) != 0 )
{
mbedtls_printf( " failed\n ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret );

View File

@ -805,7 +805,7 @@ int sni_callback( void *p_info, mbedtls_ssl_context *ssl,
return( mbedtls_ssl_set_hs_own_cert( ssl, cur->cert, cur->key ) );
}
cur = cur->MBEDTLS_PRIVATE(next);
cur = cur->next;
}
return( -1 );
@ -921,7 +921,7 @@ int psk_callback( void *p_info, mbedtls_ssl_context *ssl,
return( mbedtls_ssl_set_hs_psk( ssl, cur->key, cur->key_len ) );
}
cur = cur->MBEDTLS_PRIVATE(next);
cur = cur->next;
}
return( -1 );