Add missing cases to RSA parameter validation test
@@ -302,6 +302,12 @@ void rsa_invalid_param( )
valid_mode,
0, sizeof( buf ), buf,
NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_rsassa_pkcs1_v15_sign( &ctx, NULL, NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1,
+ 0, NULL,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_rsassa_pss_sign( NULL, NULL, NULL,
@@ -323,6 +329,12 @@ void rsa_invalid_param( )
valid_mode,
0, sizeof( buf ), buf,
NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_rsassa_pss_sign( &ctx, NULL, NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1,
+ 0, NULL,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_pkcs1_verify( NULL, NULL, NULL,
@@ -344,6 +356,11 @@ void rsa_invalid_param( )
valid_mode,
0, sizeof( buf ), buf,
NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_pkcs1_verify( &ctx, NULL, NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1, 0, NULL,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_rsassa_pkcs1_v15_verify( NULL, NULL,
@@ -369,6 +386,13 @@ void rsa_invalid_param( )
valid_mode,
0, sizeof( buf ), buf,
NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx, NULL,
+ NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1,
+ 0, NULL,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_rsassa_pss_verify( NULL, NULL, NULL,
@@ -390,6 +414,12 @@ void rsa_invalid_param( )
valid_mode,
0, sizeof( buf ),
buf, NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_rsassa_pss_verify( &ctx, NULL, NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1,
+ 0, NULL,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_rsassa_pss_verify_ext( NULL, NULL, NULL,
@@ -417,6 +447,13 @@ void rsa_invalid_param( )
0, sizeof( buf ),
buf, 0, 0,
NULL ) );
+ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
+ mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, NULL,
+ valid_mode,
+ MBEDTLS_MD_SHA1,
+ 0, NULL,
+ 0, 0,
+ buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
mbedtls_rsa_copy( NULL, &ctx ) );
