summaryrefslogtreecommitdiff
path: root/thirdparty/openssl/crypto/bn/bn_x931p.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-01-13 13:39:08 +0100
committerRémi Verschelde <rverschelde@gmail.com>2018-01-13 13:39:08 +0100
commit00abb1f201cbe1e40c2eef30819be115d3d04d10 (patch)
tree7eb36871dd7af02db7d2f59482644a56bc79d7bb /thirdparty/openssl/crypto/bn/bn_x931p.c
parentde0b31edd5b36b8c8016b7ca50c1823f2efbfa74 (diff)
openssl: Update to pristine 1.0.2n (security update)
Diffstat (limited to 'thirdparty/openssl/crypto/bn/bn_x931p.c')
-rw-r--r--thirdparty/openssl/crypto/bn/bn_x931p.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/thirdparty/openssl/crypto/bn/bn_x931p.c b/thirdparty/openssl/crypto/bn/bn_x931p.c
index efa48bdf87..f444af3fea 100644
--- a/thirdparty/openssl/crypto/bn/bn_x931p.c
+++ b/thirdparty/openssl/crypto/bn/bn_x931p.c
@@ -217,6 +217,8 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
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, 1, 0))
@@ -255,10 +257,12 @@ int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
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, 0, 0))
goto error;