Wrapped new unit test API with FIPS macros

This commit is contained in:
Tesfa Mael
2019-04-24 10:02:20 -07:00
parent 6b51f2d5b2
commit edef75c70f
2 changed files with 16 additions and 4 deletions

View File

@ -22701,10 +22701,12 @@ static void test_wc_ecc_get_curve_id_from_name(void)
#endif /* HAVE_ECC */
}
#if defined(OPENSSL_EXTRA)
#if defined(OPENSSL_EXTRA) && defined(HAVE_ECC) && \
!defined(HAVE_SELFTEST) && \
!(defined(HAVE_FIPS) || defined(HAVE_FIPS_VERSION))
static void test_wc_ecc_get_curve_id_from_dp_params(void)
{
#ifdef HAVE_ECC
int id;
int curve_id;
int ret = 0;
@ -22739,9 +22741,8 @@ static void test_wc_ecc_get_curve_id_from_dp_params(void)
AssertIntEQ(id, BAD_FUNC_ARG);
printf(resultFmt, passed);
#endif /* HAVE_ECC */
}
#endif /* OPENSSL_EXTRA */
#endif /* defined(OPENSSL_EXTRA) && defined(HAVE_ECC) */
static void test_wc_ecc_get_curve_id_from_params(void)
{
@ -24689,6 +24690,10 @@ void ApiTest(void)
test_wolfSSL_EVP_get_cipherbynid();
test_wolfSSL_EC();
test_wolfSSL_ECDSA_SIG();
#endif
#if defined(OPENSSL_EXTRA) && defined(HAVE_ECC) && \
!defined(HAVE_SELFTEST) && \
!(defined(HAVE_FIPS) || defined(HAVE_FIPS_VERSION))
test_wc_ecc_get_curve_id_from_dp_params();
#endif

View File

@ -3296,6 +3296,13 @@ int wc_ecc_get_curve_id_from_params(int fieldSize,
return ecc_sets[idx].id;
}
/* Returns the curve id in ecc_sets[] that corresponds
* to a given domain parameters pointer.
*
* dp domain parameters pointer
*
* return curve id, from ecc_sets[] on success, negative on error
*/
int wc_ecc_get_curve_id_from_dp_params(const ecc_set_type* dp)
{
int idx;