projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ff7f5e
)
Fix possible crash in X931 code.
author
Bernd Edlinger
<bernd.edlinger@hotmail.de>
Tue, 13 Jun 2017 20:34:30 +0000
(22:34 +0200)
committer
Rich Salz
<rsalz@openssl.org>
Wed, 14 Jun 2017 13:45:50 +0000
(09:45 -0400)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3675)
(cherry picked from commit
5419dadd4bd1f7abbfa23326ca766d2c143f257c
)
crypto/bn/bn_x931p.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_x931p.c
b/crypto/bn/bn_x931p.c
index efa48bdf87724abd79a4ca7c6733cf9473b56e6a..f444af3feabd91802e4c797803a2c12ee13bf1ae 100644
(file)
--- a/
crypto/bn/bn_x931p.c
+++ b/
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;