commit | 04eb147f75b64a568e8572e634e9034f25f720ad | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@google.com> | Fri Aug 15 16:46:21 2025 -0400 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Aug 21 13:20:27 2025 -0700 |
tree | d468733d956019964f8ee35a8bb641d79b6faf0b | |
parent | 57a6e5dfd1885b978a09e7abbe318e9ea1bb4bcf [diff] |
Pull the EC_GROUP_new_by_curve_name up into EVP_PKEY_CTX_set_ec_paramgen_curve_nid ec_pkey_meth, and thus every all of EC EVP_PKEY logic, currently depends on all supported curves by way of EC_GROUP_new_by_curve_name. In reality, the only call pattern which depends on every curve is "paramgem", when callers do: EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr); EVP_PKEY_paramgen_init(ctx); EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_X9_62_prime256v1); EVP_PKEY_paramgen(ctx, &key); This is a really roundabout way to get at a basically static object. EVP is kinda cumbersome. The other pattern is keygen when you don't already have an object that represents the curve, since OpenSSL does not provide such a thing. EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr); EVP_PKEY_keygen_init(ctx); EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_X9_62_prime256v1); EVP_PKEY_keygen(ctx, &key); That one is harder to avoid because EVP does not provide a better way to do this. Ideally our API would look more like EVP_generate_ec_key(EC_group_p256()), or perhaps EVP_PKEY_generate(EVP_pkey_ec_p256()) or something. Either way, we can lift the dependency to EVP_PKEY_CTX_set_ec_paramgen_curve_nid which is the function that actually pulls in all curves, and then folks who don't use that pattern aren't impacted. The other thing I considered was to make EVP_PKEY_CTX_new_id(EVP_PKEY_EC) use a different method table from EVP_PKEY_CTX_new(pkey), but this was really easy. (We can do this because our EVP_PKEY_CTRL_* constants are completely internal. We don't have to implement the same hooks that upstream does.) Bug: 42290364 Change-Id: Ib223b966d1a48527088e1bb13435ac6dc2c11749 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81509 Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Lily Chen <chlily@google.com> Commit-Queue: Lily Chen <chlily@google.com>
BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.
Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.
Programs ship their own copies of BoringSSL when they use it and we update everything as needed when deciding to make API changes. This allows us to mostly avoid compromises in the name of compatibility. It works for us, but it may not work for you.
BoringSSL arose because Google used OpenSSL for many years in various ways and, over time, built up a large number of patches that were maintained while tracking upstream OpenSSL. As Google's product portfolio became more complex, more copies of OpenSSL sprung up and the effort involved in maintaining all these patches in multiple places was growing steadily.
Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's not part of the NDK) and a number of other apps/programs.
Project links:
To file a security issue, use the Chromium process and mention in the report this is for BoringSSL. You can ignore the parts of the process that are specific to Chromium/Chrome.
There are other files in this directory which might be helpful: