summaryrefslogtreecommitdiff
path: root/thirdparty/mbedtls/library/camellia.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-20 12:32:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-20 12:32:46 +0200
commitcd7b25588b2e3e5d464b87d7391db0d8c5a3ac7a (patch)
tree628f6ec3ed622ccdfdbf44f5abc42b861cf8a968 /thirdparty/mbedtls/library/camellia.c
parent313c88ef39bb0935b4e9e2ed44ca5e1a1e66b431 (diff)
mbedtls: Update to upstream version 2.16.11
Diffstat (limited to 'thirdparty/mbedtls/library/camellia.c')
-rw-r--r--thirdparty/mbedtls/library/camellia.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/thirdparty/mbedtls/library/camellia.c b/thirdparty/mbedtls/library/camellia.c
index 40d62121bf..6cf265e578 100644
--- a/thirdparty/mbedtls/library/camellia.c
+++ b/thirdparty/mbedtls/library/camellia.c
@@ -973,9 +973,11 @@ int mbedtls_camellia_self_test( int verbose )
unsigned char nonce_counter[16];
unsigned char stream_block[16];
#endif
+ int ret = 1;
mbedtls_camellia_context ctx;
+ mbedtls_camellia_init( &ctx );
memset( key, 0, 32 );
for( j = 0; j < 6; j++ ) {
@@ -1005,8 +1007,7 @@ int mbedtls_camellia_self_test( int verbose )
{
if( verbose != 0 )
mbedtls_printf( "failed\n" );
-
- return( 1 );
+ goto exit;
}
}
@@ -1058,8 +1059,7 @@ int mbedtls_camellia_self_test( int verbose )
{
if( verbose != 0 )
mbedtls_printf( "failed\n" );
-
- return( 1 );
+ goto exit;
}
}
@@ -1102,8 +1102,7 @@ int mbedtls_camellia_self_test( int verbose )
{
if( verbose != 0 )
mbedtls_printf( "failed\n" );
-
- return( 1 );
+ goto exit;
}
}
else
@@ -1118,8 +1117,7 @@ int mbedtls_camellia_self_test( int verbose )
{
if( verbose != 0 )
mbedtls_printf( "failed\n" );
-
- return( 1 );
+ goto exit;
}
}
@@ -1131,7 +1129,11 @@ int mbedtls_camellia_self_test( int verbose )
mbedtls_printf( "\n" );
#endif /* MBEDTLS_CIPHER_MODE_CTR */
- return( 0 );
+ ret = 0;
+
+exit:
+ mbedtls_camellia_free( &ctx );
+ return( ret );
}
#endif /* MBEDTLS_SELF_TEST */