diff --git a/AUTHORS b/AUTHORS index 51a48fb47a..379c4f316c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,6 +31,7 @@ Ralph Giles Riku Voipio Robert Nagy Ryan Yoakum +Satender Saroha Sarah Thompson Saul Kravitz Silviu Caragea diff --git a/webrtc/base/opensslidentity.cc b/webrtc/base/opensslidentity.cc index 58a0cd8ade..0ebf20bd6b 100644 --- a/webrtc/base/opensslidentity.cc +++ b/webrtc/base/opensslidentity.cc @@ -61,6 +61,13 @@ static EVP_PKEY* MakeKey(const KeyParams& key_params) { } else if (key_params.type() == KT_ECDSA) { if (key_params.ec_curve() == EC_NIST_P256) { EC_KEY* ec_key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + + // Ensure curve name is included when EC key is serialized. + // Without this call, OpenSSL versions before 1.1.0 will create + // certificates that don't work for TLS. + // This is a no-op for BoringSSL and OpenSSL 1.1.0+ + EC_KEY_set_asn1_flag(ec_key, OPENSSL_EC_NAMED_CURVE); + if (!pkey || !ec_key || !EC_KEY_generate_key(ec_key) || !EVP_PKEY_assign_EC_KEY(pkey, ec_key)) { EVP_PKEY_free(pkey); diff --git a/webrtc/base/opensslstreamadapter.cc b/webrtc/base/opensslstreamadapter.cc index 0e7a2927ec..3b3aa5d219 100644 --- a/webrtc/base/opensslstreamadapter.cc +++ b/webrtc/base/opensslstreamadapter.cc @@ -20,6 +20,7 @@ #include #ifndef OPENSSL_IS_BORINGSSL #include +#include #endif #include