summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_pk1.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-03-05 13:26:45 +0000
committerMatt Caswell <matt@openssl.org>2019-03-07 14:53:28 +0000
commitd5e37fc871be6910db931790b70323c78b332dff (patch)
treeebed4fe1fd0fed7dac3f032b066bf3b14c8b89ea /crypto/rsa/rsa_pk1.c
parent56ff0f643482b19f7b2d7ed532dfb94ed3a4e294 (diff)
Avoid an underflow in ecp_nistp521.c
The function felem_diff_128_64 in ecp_nistp521.c substracts the number |in| from |out| mod p. In order to avoid underflow it first adds 32p mod p (which is equivalent to 0 mod p) to |out|. The comments and variable naming suggest that the original author intended to add 64p mod p. In fact it has been shown that with certain unusual co-ordinates it is possible to cause an underflow in this function when only adding 32p mod p while performing a point double operation. By changing this to 64p mod p the underflow is avoided. It turns out to be quite difficult to construct points that satisfy the underflow criteria although this has been done and the underflow demonstrated. However none of these points are actually on the curve. Finding points that satisfy the underflow criteria and are also *on* the curve is considered significantly more difficult. For this reason we do not believe that this issue is currently practically exploitable and therefore no CVE has been assigned. This only impacts builds using the enable-ec_nistp_64_gcc_128 Configure option. With thanks to Bo-Yin Yang, Billy Brumley and Dr Liu for their significant help in investigating this issue. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8405) (cherry picked from commit 13fbce17fc9f02e2401fc3868f3f8e02d6647e5f)
Diffstat (limited to 'crypto/rsa/rsa_pk1.c')
0 files changed, 0 insertions, 0 deletions