diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bn/bn_x931p.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/bn/bn_x931p.c b/crypto/bn/bn_x931p.c index f444af3fea..116620a138 100644 --- a/crypto/bn/bn_x931p.c +++ b/crypto/bn/bn_x931p.c @@ -223,8 +223,10 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx) for (i = 0; i < 1000; i++) { if (!BN_rand(Xq, nbits, 1, 0)) goto err; + /* Check that |Xp - Xq| > 2^(nbits - 100) */ - BN_sub(t, Xp, Xq); + if (!BN_sub(t, Xp, Xq)) + goto err; if (BN_num_bits(t) > (nbits - 100)) break; } |