@@ -24918,6 +24918,7 @@ static int test_wc_ecc_export_x963_ex(void)
2491824918 XMEMSET(&key, 0, sizeof(ecc_key));
2491924919 XMEMSET(&rng, 0, sizeof(WC_RNG));
2492024920 XMEMSET(out, 0, outlen);
24921+ PRIVATE_KEY_UNLOCK();
2492124922
2492224923 ExpectIntEQ(wc_ecc_init(&key), 0);
2492324924 ExpectIntEQ(wc_InitRng(&rng), 0);
@@ -24958,6 +24959,7 @@ static int test_wc_ecc_export_x963_ex(void)
2495824959 ExpectIntEQ(wc_ecc_export_x963_ex(&key, out, &outlen, NOCOMP),
2495924960 ECC_BAD_ARG_E);
2496024961#endif
24962+ PRIVATE_KEY_LOCK();
2496124963
2496224964 DoExpectIntEQ(wc_FreeRng(&rng), 0);
2496324965 wc_ecc_free(&key);
@@ -25049,6 +25051,7 @@ static int test_wc_ecc_import_private_key(void)
2504925051 XMEMSET(&rng, 0, sizeof(WC_RNG));
2505025052 XMEMSET(privKey, 0, privKeySz);
2505125053 XMEMSET(x963Key, 0, x963KeySz);
25054+ PRIVATE_KEY_UNLOCK();
2505225055
2505325056 ExpectIntEQ(wc_ecc_init(&key), 0);
2505425057 ExpectIntEQ(wc_ecc_init(&keyImp), 0);
@@ -25071,6 +25074,7 @@ static int test_wc_ecc_import_private_key(void)
2507125074 x963KeySz, NULL), BAD_FUNC_ARG);
2507225075 ExpectIntEQ(wc_ecc_import_private_key(NULL, privKeySz, x963Key, x963KeySz,
2507325076 &keyImp), BAD_FUNC_ARG);
25077+ PRIVATE_KEY_LOCK();
2507425078
2507525079 DoExpectIntEQ(wc_FreeRng(&rng), 0);
2507625080 wc_ecc_free(&keyImp);
@@ -25101,6 +25105,7 @@ static int test_wc_ecc_export_private_only(void)
2510125105 XMEMSET(&key, 0, sizeof(ecc_key));
2510225106 XMEMSET(&rng, 0, sizeof(WC_RNG));
2510325107 XMEMSET(out, 0, outlen);
25108+ PRIVATE_KEY_UNLOCK();
2510425109
2510525110 ExpectIntEQ(wc_ecc_init(&key), 0);
2510625111 ExpectIntEQ(wc_InitRng(&rng), 0);
@@ -25115,6 +25120,7 @@ static int test_wc_ecc_export_private_only(void)
2511525120 ExpectIntEQ(wc_ecc_export_private_only(NULL, out, &outlen), BAD_FUNC_ARG);
2511625121 ExpectIntEQ(wc_ecc_export_private_only(&key, NULL, &outlen), BAD_FUNC_ARG);
2511725122 ExpectIntEQ(wc_ecc_export_private_only(&key, out, NULL), BAD_FUNC_ARG);
25123+ PRIVATE_KEY_LOCK();
2511825124
2511925125 DoExpectIntEQ(wc_FreeRng(&rng), 0);
2512025126 wc_ecc_free(&key);
@@ -25712,6 +25718,7 @@ static int test_wc_ecc_shared_secret_ssh(void)
2571225718 XMEMSET(&key2, 0, sizeof(ecc_key));
2571325719 XMEMSET(&rng, 0, sizeof(WC_RNG));
2571425720 XMEMSET(secret, 0, secretLen);
25721+ PRIVATE_KEY_UNLOCK();
2571525722
2571625723 /* Make keys */
2571725724 ExpectIntEQ(wc_ecc_init(&key), 0);
@@ -25751,6 +25758,7 @@ static int test_wc_ecc_shared_secret_ssh(void)
2575125758 key.type = ECC_PUBLICKEY;
2575225759 ExpectIntEQ(wc_ecc_shared_secret_ssh(&key, &key2.pubkey, secret,
2575325760 &secretLen), ECC_BAD_ARG_E);
25761+ PRIVATE_KEY_LOCK();
2575425762
2575525763 DoExpectIntEQ(wc_FreeRng(&rng), 0);
2575625764 wc_ecc_free(&key);
@@ -26678,6 +26686,7 @@ static int test_wc_EccPrivateKeyToDer(void)
2667826686
2667926687 XMEMSET(&eccKey, 0, sizeof(ecc_key));
2668026688 XMEMSET(&rng, 0, sizeof(WC_RNG));
26689+ PRIVATE_KEY_UNLOCK();
2668126690
2668226691 ExpectIntEQ(wc_InitRng(&rng), 0);
2668326692 ExpectIntEQ(wc_ecc_init(&eccKey), 0);
@@ -26718,6 +26727,7 @@ static int test_wc_EccPrivateKeyToDer(void)
2671826727 EVP_PKEY_free(pkey); /* EC_KEY should be free'd by free'ing pkey */
2671926728 }
2672026729#endif
26730+ PRIVATE_KEY_LOCK();
2672126731#endif
2672226732 return EXPECT_RESULT();
2672326733} /* End test_wc_EccPrivateKeyToDer*/
0 commit comments