Repository navigation
common,rgw: remove pre-OpenSSL-1.1 relic code - #70125
Conversation
All deleted logic in ceph_crypto.cc sat inside an
OPENSSL_VERSION_NUMBER < 0x10100000L fence: the include block for
conf.h/engine.h/err.h, the lock container and locking/thread-id
callbacks, and the bodies of the file-local ssl::init() and
ssl::shutdown(). The unfenced remnants deleted alongside it -- the
include lines, the empty static init()/shutdown() shells, and their
calls from the public wrappers -- are behavior-free on any
OpenSSL >= 1.1.0 build: empty static functions and includes with no
remaining consumer.
Explicit initialisation and cleanup have been unnecessary since
OpenSSL 1.1.0. OPENSSL_init_crypto(3):
As of version 1.1.0 OpenSSL will automatically allocate all
resources that it needs so no explicit initialisation is required.
Similarly it will also automatically deinitialise as required.
The individual calls the deleted code made were all deprecated in
1.1.0 in favour of that automatic lifecycle:
The OpenSSL_add_all_algorithms(), OpenSSL_add_all_ciphers(),
OpenSSL_add_all_digests(), and EVP_cleanup(), functions
were deprecated in OpenSSL 1.1.0 by OPENSSL_init_crypto() and should
not be used.
-- OpenSSL_add_all_algorithms(3)
The ERR_load_crypto_strings(), SSL_load_error_strings(), and
ERR_free_strings() functions were deprecated in OpenSSL 1.1.0 by
OPENSSL_init_crypto() and OPENSSL_init_ssl() and should not be used.
-- ERR_load_crypto_strings(3)
The OPENSSL_no_config() and OPENSSL_config() functions were
deprecated in OpenSSL 1.1.0 by OPENSSL_init_crypto().
-- OPENSSL_config(3)
ENGINE_cleanup() was deprecated in OpenSSL 1.1.0 by the automatic
cleanup done by OPENSSL_cleanup()
and should not be used.
-- ENGINE_add(3)
For the locking-callback registration, OpenSSL 3.0's
<openssl/crypto.h> states in the comment above the no-op
compatibility macros: "the locking callbacks are no longer used.
Consequently, the callback management functions can be safely
replaced with no-op macros."
The public ceph::crypto::init() and ceph::crypto::shutdown() are kept
with unchanged signatures as empty functions; they are called from
ceph_context.cc and test/crypto.cc.
The -Wdeprecated-declarations pragmas are intentionally retained to
keep this commit purely mechanical; they are removed later in the
series once the digest API rework lands (see the SetFlags relic
commit).
Signed-off-by: Mark Atwood <[email protected]>
Delete RGWSSLSetup, the rgw_ssl_locking_callback and rgw_ssl_thread_id_callback callbacks, both init_ssl() wrappers, fe_inits_ssl(), and the guards fencing them, plus the includes and dout defines that only they used. rgw_common.h stays: it declares rgw_setup_saved_curl_handles()/rgw_release_all_curl_handles(). setup_curl() keeps its public signature; the now-unused parameter is marked [[maybe_unused]]. The version fence was broken. The guard tested OPENSSL_API_COMPAT < 0x10100000L, but Ceph never defines OPENSSL_API_COMPAT anywhere, so the undefined token evaluated to 0 and the condition was true on every OpenSSL version - the shim was always compiled in (when WITH_CURL_OPENSSL), never actually version-gated. Compiled in, it still did nothing on any supported OpenSSL. Since 1.1.0 the callback registration calls are no-op compatibility macros; OpenSSL 3.0's <openssl/crypto.h> defines them under OPENSSL_NO_DEPRECATED_1_1_0 with this comment: "the locking callbacks are no longer used. Consequently, the callback management functions can be safely replaced with no-op macros." # define CRYPTO_num_locks() (1) # define CRYPTO_set_locking_callback(func) and CRYPTO_set_id_callback is likewise a no-op macro: # define CRYPTO_set_id_callback(func) fe_inits_ssl() existed only to strip CURL_GLOBAL_SSL from the curl_global_init() flags when the beast frontend had a certificate configured. CURL_GLOBAL_SSL has been a documented no-op since curl 7.57.0 - the deleted code's own comment said "TODO this flag is no op for curl > 7.57" - so passing CURL_GLOBAL_ALL unconditionally is behavior-identical on every supported platform. Signed-off-by: Mark Atwood <[email protected]>
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
16 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
adamemerson
left a comment
There was a problem hiding this comment.
Approved for RGW, but this should not merge without Sage's ack.
|
ok to test |
|
jenkins test make check arm64 |
|
@adamemerson Thanks for the review! Two CI items need org-member powers: (1) the checklist Verify re-run is awaiting workflow approval — https://github.com/ceph/ceph/actions/runs/29305439425 — the description now matches the current template; (2) could you re-issue |
|
This PR has been added to main integration testing by anuchaithra started 2026-07-17-06:18. |
|
jenkins test make check arm64 |
|
Don't merge this until the other review, I want to get our security engineer's ack. |
pr testing completed and approved by @ivancich |
mctaggatart
left a comment
There was a problem hiding this comment.
Short version: Looks good to me.
Reviewed with Claude Fable and summarized with IBM Project Bob with a manual review of the code as well. Full findings shared with Adam Emerson and available upon request.
Overall risk level: Low (with important caveats for FIPS deployments)
Short summary: This deletion-only PR removes pre-OpenSSL-1.1.0 initialization and locking code that is dead/no-op on modern OpenSSL. The change is behavior-neutral and improves security posture by eliminating complex legacy code with documented memory leaks and a broken version fence. However, the empty init() function creates latent FIPS misconfiguration risk by relying on implicit initialization instead of explicit, deterministic config loading.
Most important issues:
Medium: Empty init() function prevents deterministic FIPS provider activation (critical for compliance)
Low: No compile-time enforcement that OpenSSL >= 1.1.0 is used (thread-safety depends on this)
Informational: Broken OPENSSL_API_COMPAT fence pattern may exist elsewhere in codebase
@adamemerson , feel free to merge the pr upon ack. |
This removes two blocks of dead pre-OpenSSL-1.1.0 lifecycle code:
src/common/ceph_crypto.cc: the refcounted init/shutdown machinery(OpenSSL_add_all_algorithms, ERR_load_crypto_strings, locking/id
callbacks, OPENSSL_config, and the matching cleanup calls). All of it
is fenced
OPENSSL_VERSION_NUMBER < 0x10100000L; OpenSSL >= 1.1.0initializes and deinitializes itself (OPENSSL_init_crypto(3)). The
public
ceph::crypto::init()/shutdown()entry points stay as emptyfunctions, so the existing callers (ceph_context.cc, test/crypto.cc)
are untouched.
src/rgw/rgw_http_client_curl.cc: the libcurl locking-callback shim.Its version fence is broken — it tests
OPENSSL_API_COMPAT < 0x10100000L, but Ceph never defines OPENSSL_API_COMPAT, so theundefined token evaluates to 0 and the shim compiles on every OpenSSL
version. Since 1.1.0 the CRYPTO_set_locking_callback family expands
to no-op macros, so the code does nothing at runtime; this deletes it
outright rather than fixing the fence.
Per-line no-op justification and the OpenSSL man-page citations are in
the commit messages. The
-Wdeprecated-declarationspragmas inceph_crypto.cc are intentionally left in place: they still suppress
real warnings from the HMAC wrapper on OpenSSL 3 builds, which a
follow-up addresses.
This is the first installment of a tree-wide audit of deprecated and
obsolete OpenSSL API use in Ceph. The motivation is provider-based
FIPS configurations (OpenSSL's fips provider or any third-party
provider): legacy call shapes either bypass or half-bypass provider
dispatch. These two cleanups are behavior-neutral on every supported
build; follow-ups fix sites where the legacy shape is an actual
correctness problem. The same audit also flagged src/cls_crypto.cc and
src/cls_acl.cc, already removed on main by 43cf7eb.
Testing: these deletions were carried in a downstream 20.2.2-based
package build (full build clean; radosgw brought up and serving, with
no behavior delta observed on the touched paths). The rebase onto main
is textually identical apart from editor modelines. Deletion-only
otherwise; no functional change intended on any supported OpenSSL.
Checklist