Implement pk_check_pair() for RSA-alt
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function
index 352169c..c88d365 100644
--- a/tests/suites/test_suite_pk.function
+++ b/tests/suites/test_suite_pk.function
@@ -83,18 +83,27 @@
/* BEGIN_CASE depends_on:POLARSSL_PK_PARSE_C */
void pk_check_pair( char *pub_file, char *prv_file, int ret )
{
- pk_context pub, prv;
+ pk_context pub, prv, alt;
pk_init( &pub );
pk_init( &prv );
+ pk_init( &alt );
TEST_ASSERT( pk_parse_public_keyfile( &pub, pub_file ) == 0 );
TEST_ASSERT( pk_parse_keyfile( &prv, prv_file, NULL ) == 0 );
TEST_ASSERT( pk_check_pair( &pub, &prv ) == ret );
+ 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 );
+ }
+
pk_free( &pub );
pk_free( &prv );
+ pk_free( &alt );
}
/* END_CASE */