Remove unnecessary |BN_CTX_start|/|BN_CTX_end| in |BN_mod_exp_mont_consttime|. Since the function doesn't call |BN_CTX_get|, it doesn't need to call |BN_CTX_start|/|BN_CTX_end|. Change-Id: I6cb954d3fee2959bdbc81b9b97abc52bb6f7704c Reviewed-on: https://boringssl-review.googlesource.com/7469 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/bn/exponentiation.c b/crypto/bn/exponentiation.c index 953fce1..bb7a2f4 100644 --- a/crypto/bn/exponentiation.c +++ b/crypto/bn/exponentiation.c
@@ -928,8 +928,6 @@ return BN_one(rr); } - BN_CTX_start(ctx); - /* Allocate a montgomery context if it was not supplied by the caller. */ if (mont == NULL) { new_mont = BN_MONT_CTX_new(); @@ -1230,7 +1228,6 @@ OPENSSL_cleanse(powerbuf, powerbufLen); OPENSSL_free(powerbufFree); } - BN_CTX_end(ctx); return (ret); }