Minor fixes to x509_get_name() test function

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2022-10-19 17:13:57 +01:00
parent 078250eb56
commit 01dd548025

View File

@ -824,7 +824,7 @@ void mbedtls_x509_get_name( char * rdn_sequence, int exp_ret )
unsigned char *name;
unsigned char *p;
size_t name_len;
mbedtls_x509_name head;
mbedtls_x509_name head = { 0 };
mbedtls_x509_name *allocated, *prev;
int ret;
@ -832,12 +832,9 @@ void mbedtls_x509_get_name( char * rdn_sequence, int exp_ret )
p = name;
ret = mbedtls_x509_get_name( &p, ( name + name_len ), &head );
if( ret == 0 )
{
allocated = head.next;
head.next = NULL;
prev = NULL;
while( allocated != NULL )
{
@ -848,7 +845,7 @@ void mbedtls_x509_get_name( char * rdn_sequence, int exp_ret )
}
}
TEST_ASSERT( ret == exp_ret );
TEST_EQUAL( ret, exp_ret );
mbedtls_free( name );
}