mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Fix dependency issues
This commit is contained in:
parent
a1efcb084f
commit
7c13d69cb5
2 changed files with 13 additions and 1 deletions
|
|
@ -1,6 +1,10 @@
|
|||
/* BEGIN_HEADER */
|
||||
#include <polarssl/pk.h>
|
||||
|
||||
/* For error codes */
|
||||
#include <polarssl/ecp.h>
|
||||
#include <polarssl/rsa.h>
|
||||
|
||||
static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len );
|
||||
|
||||
#define RSA_KEY_SIZE 512
|
||||
|
|
@ -80,7 +84,7 @@ exit:
|
|||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_PK_PARSE_C */
|
||||
/* BEGIN_CASE depends_on:POLARSSL_PK_PARSE_C:POLARSSL_FS_IO */
|
||||
void pk_check_pair( char *pub_file, char *prv_file, int ret )
|
||||
{
|
||||
pk_context pub, prv, alt;
|
||||
|
|
@ -94,12 +98,14 @@ void pk_check_pair( char *pub_file, char *prv_file, int ret )
|
|||
|
||||
TEST_ASSERT( pk_check_pair( &pub, &prv ) == ret );
|
||||
|
||||
#if defined(POLARSSL_RSA_C)
|
||||
if( pk_get_type( &prv ) == POLARSSL_PK_RSA )
|
||||
{
|
||||
TEST_ASSERT( pk_init_ctx_rsa_alt( &alt, pk_rsa( prv ),
|
||||
rsa_decrypt_func, rsa_sign_func, rsa_key_len_func ) == 0 );
|
||||
TEST_ASSERT( pk_check_pair( &pub, &alt ) == ret );
|
||||
}
|
||||
#endif
|
||||
|
||||
pk_free( &pub );
|
||||
pk_free( &prv );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue