diff options
author | Jack Lloyd <[email protected]> | 2018-11-10 13:03:49 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-11-10 13:03:49 -0500 |
commit | b1e1e618eac3ca317414a57269b1b4b28cc10098 (patch) | |
tree | adfce0943ad253e6dbf685beb74d779d5f60bcb6 /src/lib/pubkey/rsa | |
parent | f44e319a3deed4cadc9f9ea20a00dac67bb17827 (diff) |
Avoid an implausible integer overflow flagged by Coverity [ci skip]
Diffstat (limited to 'src/lib/pubkey/rsa')
-rw-r--r-- | src/lib/pubkey/rsa/rsa.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index ec3c35ef1..d7d6a939e 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -375,7 +375,12 @@ class RSA_Public_Operation m_monty_n(std::make_shared<Montgomery_Params>(m_n)) {} - size_t get_max_input_bits() const { return (m_n.bits() - 1); } + size_t get_max_input_bits() const + { + const size_t n_bits = m_n.bits(); + BOTAN_ASSERT_NOMSG(n_bits >= 384); + return n_bits - 1; + } protected: BigInt public_op(const BigInt& m) const |