Intermediate hexify out change

This commit is contained in:
Azim Khan 2017-05-30 14:23:15 +01:00 committed by Mohammad Azim Khan
parent 9079170f6e
commit f1aaec9888
39 changed files with 780 additions and 1563 deletions

View file

@ -10,7 +10,7 @@
*/
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C:MBEDTLS_FS_IO */
void pk_parse_keyfile_rsa( char *key_file, char *password, int result )
void pk_parse_keyfile_rsa( char * key_file, char * password, int result )
{
mbedtls_pk_context ctx;
int res;
@ -39,7 +39,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C:MBEDTLS_FS_IO */
void pk_parse_public_keyfile_rsa( char *key_file, int result )
void pk_parse_public_keyfile_rsa( char * key_file, int result )
{
mbedtls_pk_context ctx;
int res;
@ -64,7 +64,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_ECP_C */
void pk_parse_public_keyfile_ec( char *key_file, int result )
void pk_parse_public_keyfile_ec( char * key_file, int result )
{
mbedtls_pk_context ctx;
int res;
@ -89,7 +89,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_ECP_C */
void pk_parse_keyfile_ec( char *key_file, char *password, int result )
void pk_parse_keyfile_ec( char * key_file, char * password, int result )
{
mbedtls_pk_context ctx;
int res;
@ -113,21 +113,18 @@ exit:
}
/* END_CASE */
/* BEGIN_CASE */
void pk_parse_key( char *key_data, char *result_str, int result )
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
void pk_parse_key( uint8_t * buf, uint32_t data_len, char * result_str,
int result )
{
mbedtls_pk_context pk;
unsigned char buf[2000];
unsigned char output[2000];
int data_len;
((void) result_str);
mbedtls_pk_init( &pk );
memset( buf, 0, 2000 );
memset( output, 0, 2000 );
data_len = unhexify( buf, key_data );
TEST_ASSERT( mbedtls_pk_parse_key( &pk, buf, data_len, NULL, 0 ) == ( result ) );
if( ( result ) == 0 )