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 <alangley@gmail.com>
This commit is contained in:
David Benjamin 2015-10-23 18:14:14 -04:00 committed by Adam Langley
parent 0ea470fdb2
commit 036152e6a5

View File

@ -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;