commit | ff160a8c24551f3887aa96f9467fd27a0a3b049c | [log] [tgz] |
---|---|---|
author | poliudian-iv <poliudian-iv@yandex-team.ru> | Wed Oct 01 18:21:13 2025 +0300 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Oct 06 06:14:55 2025 -0700 |
tree | 29c4756db5b610a247ce14ebd70a2526562f2506 | |
parent | 88d0c0f4772f3abe74f4f1012fe580fa85bab417 [diff] |
Add additional check, as contract of function Change-Id: I3e6e886f83468ff7bab784a69bedc6940c3fa689 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/82467 Reviewed-by: Adam Langley <agl@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/bn/exponentiation.cc.inc b/crypto/fipsmodule/bn/exponentiation.cc.inc index a6c7d55..e537476 100644 --- a/crypto/fipsmodule/bn/exponentiation.cc.inc +++ b/crypto/fipsmodule/bn/exponentiation.cc.inc
@@ -343,7 +343,7 @@ void bn_mod_inverse0_prime_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, const BN_MONT_CTX *mont) { - if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS || num == 0) { abort(); }