Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3675)
BN_CTX_start(ctx);
t = BN_CTX_get(ctx);
+ if (t == NULL)
+ goto err;
for (i = 0; i < 1000; i++) {
if (!BN_rand(Xq, nbits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ANY))
int ret = 0;
BN_CTX_start(ctx);
- if (!Xp1)
+ if (Xp1 == NULL)
Xp1 = BN_CTX_get(ctx);
- if (!Xp2)
+ if (Xp2 == NULL)
Xp2 = BN_CTX_get(ctx);
+ if (Xp1 == NULL || Xp2 == NULL)
+ goto error;
if (!BN_rand(Xp1, 101, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
goto error;
BN_CTX_start(ctx);
Xp = BN_CTX_get(ctx);
Xq = BN_CTX_get(ctx);
+ if (Xq == NULL)
+ goto error;
if (!BN_X931_generate_Xpq(Xp, Xq, bits, ctx))
goto error;