mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
wolfcrypt/test/test.c: fix return code in pbkdf2_test(), add DEBUG_WOLFSSL gates on keysize report in ecc_test_curve(), and add missing PRIVATE_KEY_UNLOCK()s in cryptocb_test() for fips-dev coverage.
This commit is contained in:
@@ -24692,7 +24692,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pbkdf2_test(void)
|
|||||||
salt, (int)sizeof(salt), iterations,
|
salt, (int)sizeof(salt), iterations,
|
||||||
kLen, WC_SHA256, HEAP_HINT, devId);
|
kLen, WC_SHA256, HEAP_HINT, devId);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return WC_TEST_RET_ENC_EC(ret);
|
||||||
|
|
||||||
if (XMEMCMP(derived, verify, sizeof(verify)) != 0)
|
if (XMEMCMP(derived, verify, sizeof(verify)) != 0)
|
||||||
return WC_TEST_RET_ENC_NC;
|
return WC_TEST_RET_ENC_NC;
|
||||||
@@ -28505,13 +28505,14 @@ static wc_test_ret_t ecc_test_curve(WC_RNG* rng, int keySize, int curve_id)
|
|||||||
WOLFSSL_MSG_EX("ecc_test_curve keySize = %d", keySize);
|
WOLFSSL_MSG_EX("ecc_test_curve keySize = %d", keySize);
|
||||||
|
|
||||||
#if FIPS_VERSION3_GE(6,0,0)
|
#if FIPS_VERSION3_GE(6,0,0)
|
||||||
|
#ifdef DEBUG_WOLFSSL
|
||||||
printf("keySize is %d\n", keySize);
|
printf("keySize is %d\n", keySize);
|
||||||
|
#endif
|
||||||
if (keySize < WC_ECC_FIPS_GEN_MIN) {
|
if (keySize < WC_ECC_FIPS_GEN_MIN) {
|
||||||
goto skip_A;
|
goto skip_A;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
ret = ecc_test_curve_size(rng, keySize, ECC_TEST_VERIFY_COUNT, curve_id,
|
ret = ecc_test_curve_size(rng, keySize, ECC_TEST_VERIFY_COUNT, curve_id,
|
||||||
NULL);
|
NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@@ -50577,8 +50578,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
|
|||||||
PRIVATE_KEY_LOCK();
|
PRIVATE_KEY_LOCK();
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ED25519
|
#ifdef HAVE_ED25519
|
||||||
|
PRIVATE_KEY_UNLOCK();
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = ed25519_test();
|
ret = ed25519_test();
|
||||||
|
PRIVATE_KEY_LOCK();
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CURVE25519
|
#ifdef HAVE_CURVE25519
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
@@ -50634,8 +50637,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
|
|||||||
#endif
|
#endif
|
||||||
#ifndef NO_PWDBASED
|
#ifndef NO_PWDBASED
|
||||||
#if defined(HAVE_PBKDF2) && !defined(NO_SHA256) && !defined(NO_HMAC)
|
#if defined(HAVE_PBKDF2) && !defined(NO_SHA256) && !defined(NO_HMAC)
|
||||||
|
PRIVATE_KEY_UNLOCK();
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = pbkdf2_test();
|
ret = pbkdf2_test();
|
||||||
|
PRIVATE_KEY_LOCK();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(WOLFSSL_CMAC) && !defined(NO_AES)
|
#if defined(WOLFSSL_CMAC) && !defined(NO_AES)
|
||||||
|
Reference in New Issue
Block a user