openssl/crypto/ec
Matt Caswell 13fbce17fc 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)
2019-03-07 14:42:33 +00:00
..
asm Fix some CFI issues in x86_64 assembly 2019-02-17 23:39:51 +01:00
curve448 Remove unnecessary trailing whitespace 2019-02-05 16:25:11 +01:00
build.info Build: Remove BEGINRAW / ENDRAW / OVERRIDE 2019-01-31 16:19:49 +01:00
curve25519.c curve25519.c: improve formula alignment 2018-12-06 19:38:13 +01:00
ec2_oct.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec2_smpl.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ec_ameth.c Fix the default digest algorthm of SM2 2019-02-27 10:05:17 +08:00
ec_asn1.c constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 2019-03-06 16:10:09 +00:00
ec_check.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_curve.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_cvt.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_err.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ec_key.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_kmeth.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_lcl.h Rearrange the inclusion of curve448/curve448_lcl.h 2019-02-25 19:38:06 +01:00
ec_lib.c Add EC_GROUP_get0_field 2019-02-15 16:43:18 +02:00
ec_mult.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_oct.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ec_pmeth.c constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 2019-03-06 16:10:09 +00:00
ec_print.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecdh_kdf.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecdh_ossl.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecdsa_ossl.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecdsa_sign.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecdsa_vrf.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
eck_prn.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecp_mont.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecp_nist.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecp_nistp224.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecp_nistp256.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecp_nistp521.c Avoid an underflow in ecp_nistp521.c 2019-03-07 14:42:33 +00:00
ecp_nistputil.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecp_nistz256.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecp_nistz256_table.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecp_oct.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecp_smpl.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-17 21:02:36 +02:00
ecx_meth.c Rearrange the inclusion of curve448/curve448_lcl.h 2019-02-25 19:38:06 +01:00