Avoid an infinite loop in BN_GF2m_mod_inv
authorMatt Caswell <matt@openssl.org>
Wed, 6 Dec 2023 11:09:53 +0000 (11:09 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 12 Dec 2023 16:08:59 +0000 (16:08 +0000)
commit9c1b8f17ce2471ca37ee3936d07aed29aab10975
tree1eda2fd32922732dfcab329dc5bba02d943b1fd1
parentff279597692f9f19dca5b147944d3d96f2e109f8
Avoid an infinite loop in BN_GF2m_mod_inv

If p is set to 1 when calling BN_GF2m_mod_inv then an infinite loop will
result. Calling this function set 1 when applications call this directly
is a non-sensical value - so this would be considered a bug in the caller.

It does not seem possible to cause OpenSSL internal callers of
BN_GF2m_mod_inv to call it with a value of 1.

So, for the above reasons, this is not considered a security issue.
Reported by Bing Shi.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/22960)
crypto/bn/bn_gf2m.c