The branch master has been updated via 5419dadd4bd1f7abbfa23326ca766d2c143f257c (commit) via 5625567f9c7daaa2e2689647e10e4c5d7370718f (commit) via fb0a64126b8c11a6961dfa1323c3602b591af7df (commit) from abea494cf75061650deecf584adc2cd293ce322d (commit)
- Log ----------------------------------------------------------------- commit 5419dadd4bd1f7abbfa23326ca766d2c143f257c Author: Bernd Edlinger <bernd.edlin...@hotmail.de> Date: Tue Jun 13 22:34:30 2017 +0200 Fix possible crash in X931 code. Reviewed-by: Rich Salz <rs...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3675) commit 5625567f9c7daaa2e2689647e10e4c5d7370718f Author: Bernd Edlinger <bernd.edlin...@hotmail.de> Date: Tue Jun 13 22:08:03 2017 +0200 Fix another possible crash in rsa_ossl_mod_exp. Reviewed-by: Rich Salz <rs...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3675) commit fb0a64126b8c11a6961dfa1323c3602b591af7df Author: Bernd Edlinger <bernd.edlin...@hotmail.de> Date: Tue Jun 13 21:22:45 2017 +0200 Fix a possible crash in dsa_builtin_paramgen2. Reviewed-by: Rich Salz <rs...@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3675) ----------------------------------------------------------------------- Summary of changes: crypto/bn/bn_x931p.c | 8 ++++++-- crypto/dsa/dsa_gen.c | 2 ++ crypto/rsa/rsa_ossl.c | 2 ++ crypto/rsa/rsa_x931g.c | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crypto/bn/bn_x931p.c b/crypto/bn/bn_x931p.c index 40734cb..8bfbcac 100644 --- a/crypto/bn/bn_x931p.c +++ b/crypto/bn/bn_x931p.c @@ -178,6 +178,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, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ANY)) @@ -216,10 +218,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, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) goto error; diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 3efeab8..e58ad8d 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -376,6 +376,8 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N, } else { p = BN_CTX_get(ctx); q = BN_CTX_get(ctx); + if (q == NULL) + goto err; } if (!BN_lshift(test, BN_value_one(), L - 1)) diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c index 5e0ad92..92c4be1 100644 --- a/crypto/rsa/rsa_ossl.c +++ b/crypto/rsa/rsa_ossl.c @@ -608,6 +608,8 @@ static int rsa_ossl_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) r1 = BN_CTX_get(ctx); m1 = BN_CTX_get(ctx); vrfy = BN_CTX_get(ctx); + if (vrfy == NULL) + goto err; { BIGNUM *p = BN_new(), *q = BN_new(); diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c index 9dd993f..877ee22 100644 --- a/crypto/rsa/rsa_x931g.c +++ b/crypto/rsa/rsa_x931g.c @@ -153,6 +153,8 @@ int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, 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; _____ openssl-commits mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits