Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2016-03-20 11:39:37 +0300
committerDavid Benjamin <davidben@google.com>2016-03-20 20:09:51 +0300
commit7cf6085b00e194877b88b72d710d1aea6cb03e20 (patch)
treeb87866a4445d42e8e388e4c3b4d5e3c55a390218 /crypto/rsa
parent35673b945dcbf240093f1f0b286e889d31c4d8f9 (diff)
Check for |BN_CTX_new| failure in |mod_exp|.
As far as I can tell, this is the last place within libcrypto where this type of check is missing. Change-Id: I3d09676abab8c9f6c4e87214019a382ec2ba90ee Reviewed-on: https://boringssl-review.googlesource.com/7519 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_impl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_impl.c b/crypto/rsa/rsa_impl.c
index 8dd59dc4..d98ca0da 100644
--- a/crypto/rsa/rsa_impl.c
+++ b/crypto/rsa/rsa_impl.c
@@ -636,6 +636,11 @@ static int 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 (r1 == NULL ||
+ m1 == NULL ||
+ vrfy == NULL) {
+ goto err;
+ }
{
BIGNUM local_p, local_q;