From 036152e6a550ccb929310b1f6f4c161fb80284fa Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 23 Oct 2015 18:14:14 -0400 Subject: [PATCH] Fix incorrect error-handling in BN_div_recp. See upstream's e90f1d9b74275c11e3492e521e46f4b1afa6f883. Change-Id: I68470acb97dac59e586b1c72aad50de6bd0156cb Reviewed-on: https://boringssl-review.googlesource.com/6342 Reviewed-by: Adam Langley --- crypto/bn/exponentiation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/bn/exponentiation.c b/crypto/bn/exponentiation.c index ef188128..9cefa624 100644 --- a/crypto/bn/exponentiation.c +++ b/crypto/bn/exponentiation.c @@ -285,10 +285,10 @@ static int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, goto err; } - if (BN_ucmp(m, &(recp->N)) < 0) { + if (BN_ucmp(m, &recp->N) < 0) { BN_zero(d); if (!BN_copy(r, m)) { - return 0; + goto err; } BN_CTX_end(ctx); return 1;