From 34749f47da6106fce8ac80d6a85e780a7cf22834 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 22 Jan 2016 15:43:23 -1000 Subject: [PATCH] Remove unnecessary assignment of |e| in |rsa_setup_blinding|. After its initial assignment, |e| is immediately reassigned another value and so the initial assignment from |BN_CTX_get| is useless. If that were not the case, then the |BN_free(e)| at the end of the function would be very bad. Change-Id: Id63a172073501c8ac157db9188a22f55ee36b205 Reviewed-on: https://boringssl-review.googlesource.com/6951 Reviewed-by: David Benjamin --- crypto/rsa/blinding.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crypto/rsa/blinding.c b/crypto/rsa/blinding.c index d21633f8..5addddc0 100644 --- a/crypto/rsa/blinding.c +++ b/crypto/rsa/blinding.c @@ -415,13 +415,6 @@ BN_BLINDING *rsa_setup_blinding(RSA *rsa, BN_CTX *in_ctx) { ctx = in_ctx; } - BN_CTX_start(ctx); - e = BN_CTX_get(ctx); - if (e == NULL) { - OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); - goto err; - } - if (rsa->e == NULL) { e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); if (e == NULL) { @@ -450,7 +443,6 @@ BN_BLINDING *rsa_setup_blinding(RSA *rsa, BN_CTX *in_ctx) { } err: - BN_CTX_end(ctx); if (in_ctx == NULL) { BN_CTX_free(ctx); }