Skip to content

crypto: take a const X509_NAME from X509_get_subject_name - #138

Open
ricardosalveti wants to merge 1 commit into
uptane:masterfrom
ricardosalveti:const
Open

ricardosalveti wants to merge 1 commit into
uptane:masterfrom
ricardosalveti:const

Conversation

@ricardosalveti

Copy link
Copy Markdown
Collaborator

OpenSSL 4.0 constified X509_get_subject_name(), so assigning its result to an X509_NAME * no longer compiles.

The name is only read here, and X509_set_issuer_name() already accepts a const name, so a const local builds against both 3.x and 4.x.

OpenSSL 4.0 constified X509_get_subject_name(), so assigning its result
to an X509_NAME * no longer compiles.

The name is only read here, and X509_set_issuer_name() already accepts a
const name, so a const local builds against both 3.x and 4.x.

Assisted-by: Claude Code:claude-opus-5

Signed-off-by: Daiane Angolini <daiane.angolini@oss.qualcomm.com>
Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants