openssl/crypto/ec
Billy Brumley 30c22fa8b1 [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.

This PR allows EC_GROUP_set_generator to compute the cofactor for all
curves of cryptographic interest. Steering scalar multiplication to more
SCA-robust code.

This issue affects persisted private keys in explicit parameter form,
where the (optional) cofactor field is zero or absent.

It also affects curves not built-in to the library, but constructed
programatically with explicit parameters, then calling
EC_GROUP_set_generator with a nonsensical value (NULL, zero).

The very old scalar multiplication code is known to be vulnerable to
local uarch attacks, outside of the OpenSSL threat model. New results
suggest the code path is also vulnerable to traditional wall clock
timing attacks.

CVE-2019-1547

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/9781)
2019-09-07 03:57:52 +03:00
..
asm make ecp_nistz256_point_add_vis3() local 2019-08-09 09:12:42 +01:00
curve448 Update copyright year 2019-05-28 14:49:38 +02:00
build.info Add ec/asm/x25519-ppc64.pl module. 2018-07-26 14:01:49 +02:00
curve25519.c Fixed linux_x86_icc compiler errors in EC code related to __uint128_t/__int128_t 2019-04-11 08:42:10 +10:00
ec2_oct.c Update copyright year 2019-05-28 14:49:38 +02:00
ec2_smpl.c Added NULL check to BN_clear() & BN_CTX_end() 2019-03-19 07:28:39 +01:00
ec_ameth.c Update copyright year 2019-05-28 14:49:38 +02:00
ec_asn1.c Use the new non-curve type specific EC functions internally 2018-07-31 09:08:38 +01:00
ec_check.c Copyright consolidation 06/10 2016-05-17 14:51:04 -04:00
ec_curve.c Use the new non-curve type specific EC functions internally 2018-07-31 09:08:38 +01:00
ec_cvt.c Update copyright year 2018-09-11 13:45:17 +01:00
ec_err.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-20 19:54:19 +02:00
ec_key.c Fix segfault in RSA_free() (and DSA/DH/EC_KEY) 2018-09-05 15:22:35 +03:00
ec_kmeth.c Update copyright year 2018-09-11 13:45:17 +01:00
ec_lcl.h Fix Typos 2019-07-31 19:48:30 +02:00
ec_lib.c [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it 2019-09-07 03:57:52 +03:00
ec_mult.c Update copyright year 2019-05-28 14:49:38 +02:00
ec_oct.c Deprecate the EC curve type specific functions in 1.2.0 2018-07-31 09:08:50 +01:00
ec_pmeth.c Update copyright year 2019-05-28 14:49:38 +02:00
ec_print.c Update copyright year 2018-04-17 15:18:40 +02:00
ecdh_kdf.c EVP module documentation pass 2018-10-17 13:31:59 +03:00
ecdh_ossl.c make RSA and DSA operations throw MISSING_PRIVATE_KEY if needed, adapt ECDSA 2019-07-31 17:07:44 +03:00
ecdsa_ossl.c make RSA and DSA operations throw MISSING_PRIVATE_KEY if needed, adapt ECDSA 2019-07-31 17:07:44 +03:00
ecdsa_sign.c Useless includes 2016-06-18 16:30:24 -04:00
ecdsa_vrf.c Useless includes 2016-06-18 16:30:24 -04:00
eck_prn.c Update copyright year 2018-09-11 13:45:17 +01:00
ecp_mont.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-20 19:54:19 +02:00
ecp_nist.c SCA hardening for mod. field inversion in EC_GROUP 2019-02-20 19:54:19 +02:00
ecp_nistp224.c [ec/ecp_nistp*.c] restyle: use {} around else too 2019-09-07 02:21:13 +03:00
ecp_nistp256.c [ec/ecp_nistp*.c] restyle: use {} around else too 2019-09-07 02:21:13 +03:00
ecp_nistp521.c [ec/ecp_nistp*.c] restyle: use {} around else too 2019-09-07 02:21:13 +03:00
ecp_nistputil.c Fix various mistakes in ec_GFp_nistp_recode_scalar_bits comment. 2019-05-31 18:26:19 -04:00
ecp_nistz256.c Added NULL check to BN_clear() & BN_CTX_end() 2019-03-19 07:28:39 +01:00
ecp_nistz256_table.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00
ecp_oct.c Update copyright year 2018-09-11 13:45:17 +01:00
ecp_smpl.c Added NULL check to BN_clear() & BN_CTX_end() 2019-03-19 07:28:39 +01:00
ecx_meth.c Fix Typos 2019-07-31 19:48:30 +02:00