Repository navigation
Only use the OpenSSL ENGINE API when built with PKCS#11 support - #139
Open
ricardosalveti wants to merge 1 commit into
Open
ricardosalveti wants to merge 1 commit into
ricardosalveti wants to merge 1 commit into
Conversation
OpenSSL 4.0 removed the ENGINE implementation from libcrypto and only keeps the declarations in engine.h, so linking libaktualizr fails on the engine-backed key loading in Crypto::RSAPSSSign(): crypto.cc:149: undefined reference to 'ENGINE_load_private_key' That path can only be reached when aktualizr is built with BUILD_P11, since the P11 engine is the only source of a non-null engine. Compile it only in that case, so builds without PKCS#11 support link against OpenSSL 4.0 while nothing changes for builds with it or with OpenSSL 3.x. A BUILD_P11 build against OpenSSL 4.0 now fails early with a clear compile-time error instead of an undefined reference at link time. Moving the PKCS#11 support itself to OpenSSL providers is a separate task. Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
This was referenced Sep 9, 2026
ricardosalveti
added a commit
to uptane/meta-updater
that referenced
this pull request
Sep 10, 2026
OpenSSL 4.0 returns a const X509_NAME pointer from X509_get_subject_name() and removed the ENGINE API from libcrypto, so libaktualizr fails to compile and then to link: crypto.cc:625:45: error: invalid conversion from 'const X509_NAME*' to 'X509_NAME*' [-fpermissive] crypto.cc:149: undefined reference to 'ENGINE_load_private_key' Add the const fix submitted as uptane/aktualizr#138 and the patch submitted as uptane/aktualizr#139 that only compiles the engine-backed key loading with BUILD_P11. Builds without the hsm feature now link against OpenSSL 4.0; builds with it fail early at compile time until the PKCS#11 support is ported to OpenSSL providers. Assisted-by: Claude Code:claude-fable-5-1 Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSSL 4.0 removed the ENGINE implementation from libcrypto and only keeps the declarations in engine.h, so linking libaktualizr fails on the engine-backed key loading in Crypto::RSAPSSSign():
crypto.cc:149: undefined reference to 'ENGINE_load_private_key'
That path can only be reached when aktualizr is built with BUILD_P11, since the P11 engine is the only source of a non-null engine. Compile it only in that case, so builds without PKCS#11 support link against OpenSSL 4.0 while nothing changes for builds with it or with OpenSSL 3.x. A BUILD_P11 build against OpenSSL 4.0 now fails early with a clear compile-time error instead of an undefined reference at link time. Moving the PKCS#11 support itself to OpenSSL providers is a separate task.