early-access version 1503
This commit is contained in:
@@ -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;
|
||||
@@ -114,26 +114,13 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void pk_parse_key( char *key_data, char *result_str, int result )
|
||||
void pk_parse_key( data_t * buf, 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 )
|
||||
{
|
||||
TEST_ASSERT( 1 );
|
||||
}
|
||||
TEST_ASSERT( mbedtls_pk_parse_key( &pk, buf->x, buf->len, NULL, 0 ) == result );
|
||||
|
||||
exit:
|
||||
mbedtls_pk_free( &pk );
|
||||
|
Reference in New Issue
Block a user