From 8fcc755cf5a39149e135e561cb8349c513b5ae05 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 18 Aug 2016 13:42:19 -0400 Subject: [PATCH] Don't add ERR_R_INTERNAL_ERROR to BN_R_NO_INVERSE. This was causing some Android breakage. The real bug is actually entirely in Android for getting its error-handling code wrong and not handling multiple errors. I'll fix that. (See b/30917411.) That said, BN_R_NO_INVERSE is a perfectly legitimate reason for those operations to fail, so ERR_R_INTERNAL_ERROR isn't really a right thing to push in front anyway. We're usually happy enough with single-error returns (I'm still a little skeptical of this queue idea), so let's just leave it at that. Change-Id: I469b6e2b5987c6baec343e2cfa52bdcb6dc42879 Reviewed-on: https://boringssl-review.googlesource.com/10483 Commit-Queue: David Benjamin Commit-Queue: Adam Langley Reviewed-by: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/bn/gcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/crypto/bn/gcd.c b/crypto/bn/gcd.c index a27bde3fb..a1ed5d915 100644 --- a/crypto/bn/gcd.c +++ b/crypto/bn/gcd.c @@ -434,11 +434,9 @@ BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, const BIGNUM *n, if (no_branch || !BN_is_odd(n)) { if (!bn_mod_inverse_general(out, &no_inverse, a, n, ctx)) { - OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); goto err; } } else if (!BN_mod_inverse_odd(out, &no_inverse, a, n, ctx)) { - OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); goto err; }