forked from wolfSSL/wolfssl
Added checks to initial returns and free rng
This commit is contained in:
17
tests/api.c
17
tests/api.c
@@ -16122,7 +16122,9 @@ static int test_wc_curve448_make_key (void)
|
||||
printf(testingFmt, "wc_curve448_make_key()");
|
||||
|
||||
ret = wc_curve448_init(&key);
|
||||
ret = wc_InitRng(&rng);
|
||||
if (ret == 0) {
|
||||
ret = wc_InitRng(&rng);
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
||||
ret = wc_curve448_make_key(&rng, CURVE448_KEY_SIZE, &key);
|
||||
@@ -16161,6 +16163,10 @@ static int test_wc_curve448_make_key (void)
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (wc_FreeRng(&rng) != 0 && ret == 0) {
|
||||
ret = WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
|
||||
printf(resultFmt, ret == 0 ? passed : failed);
|
||||
wc_curve448_free(&key);
|
||||
@@ -16185,8 +16191,9 @@ static int test_wc_curve448_import_private_raw_ex(void)
|
||||
printf(testingFmt, "wc_curve448_import_private_raw_ex()");
|
||||
|
||||
ret = wc_curve448_init(&key);
|
||||
|
||||
ret = wc_InitRng(&rng);
|
||||
if (ret == 0) {
|
||||
ret = wc_InitRng(&rng);
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
||||
ret = wc_curve448_make_key(&rng, CURVE448_KEY_SIZE, &key);
|
||||
@@ -16244,6 +16251,10 @@ static int test_wc_curve448_import_private_raw_ex(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (wc_FreeRng(&rng) != 0 && ret == 0) {
|
||||
ret = WOLFSSL_FATAL_ERROR;
|
||||
}
|
||||
|
||||
printf(resultFmt, ret == 0 ? passed : failed);
|
||||
wc_curve448_free(&key);
|
||||
|
||||
|
Reference in New Issue
Block a user