mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	CAMELLIA: add missing context init/free
This fixes the self-test with alternative implementations. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									be89fea1a7
								
							
						
					
					
						commit
						c537aa83f4
					
				@ -942,9 +942,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++ ) {
 | 
			
		||||
@ -974,8 +976,7 @@ int mbedtls_camellia_self_test( int verbose )
 | 
			
		||||
        {
 | 
			
		||||
            if( verbose != 0 )
 | 
			
		||||
                mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
            return( 1 );
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -1027,8 +1028,7 @@ int mbedtls_camellia_self_test( int verbose )
 | 
			
		||||
            {
 | 
			
		||||
                if( verbose != 0 )
 | 
			
		||||
                    mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
                return( 1 );
 | 
			
		||||
                goto exit;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -1071,8 +1071,7 @@ int mbedtls_camellia_self_test( int verbose )
 | 
			
		||||
            {
 | 
			
		||||
                if( verbose != 0 )
 | 
			
		||||
                    mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
                return( 1 );
 | 
			
		||||
                goto exit;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
@ -1087,8 +1086,7 @@ int mbedtls_camellia_self_test( int verbose )
 | 
			
		||||
            {
 | 
			
		||||
                if( verbose != 0 )
 | 
			
		||||
                    mbedtls_printf( "failed\n" );
 | 
			
		||||
 | 
			
		||||
                return( 1 );
 | 
			
		||||
                goto exit;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -1100,7 +1098,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 */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user