mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Fix bad logic flow in WC_NO_RNG
case.
This commit is contained in:
@@ -567,13 +567,14 @@ int mp_prime_is_prime_ex(mp_int* a, int t, int* result, WC_RNG* rng)
|
|||||||
res = MEMORY_E;
|
res = MEMORY_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res == MP_OKAY) {
|
||||||
#ifndef WC_NO_RNG
|
#ifndef WC_NO_RNG
|
||||||
if (res == MP_OKAY && rng != NULL) {
|
/* A NULL rng will return as bad function arg */
|
||||||
res = wc_RNG_GenerateBlock(rng, ptrB, sizeB);
|
res = wc_RNG_GenerateBlock(rng, ptrB, sizeB);
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
res = NOT_COMPILED_IN;
|
res = NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (res == MP_OKAY) {
|
if (res == MP_OKAY) {
|
||||||
res = ltc_get_lsb_bin_from_mp_int(ptrA, a, &sizeA);
|
res = ltc_get_lsb_bin_from_mp_int(ptrA, a, &sizeA);
|
||||||
|
Reference in New Issue
Block a user