Skip to content

Match the const of X509V3_EXT_V2I in the alternative name methods (4.1.0) - #21

Merged
Algunenano merged 1 commit into
ClickHouse/openssl-4.1.0from
cfi-const-subject-alt-v2i-4.1.0
Nov 23, 2026
Merged

Algunenano merged 1 commit into
ClickHouse/openssl-4.1.0from
cfi-const-subject-alt-v2i-4.1.0

Conversation

@Algunenano

Copy link
Copy Markdown
Member

v2i_subject_alt and v2i_issuer_alt (crypto/x509/v3_san.c) take a non-const X509V3_EXT_METHOD *, but do_ext_nconf calls them through X509V3_EXT_V2I, whose method parameter is const. ClickHouse builds OpenSSL with Clang CFI and -fsanitize-cfi-icall-generalize-pointers, which treats all pointer types alike but keeps the const of the pointee, so X509V3_EXT_conf_nid(nullptr, nullptr, NID_subject_alt_name, ...) traps with SIGILL (seen when the ACME client builds its certificate signing request).

Both functions only pass method on to v2i_GENERAL_NAME, which already takes it as const. Upstream master still has the same signatures, and other X509V3_EXT_METHOD callbacks have the same mismatch; this changes only the ones ClickHouse reaches.

`v2i_subject_alt` and `v2i_issuer_alt` take a non-const `X509V3_EXT_METHOD *`, but
`do_ext_nconf` calls them through `X509V3_EXT_V2I`, which takes a `const` one. Clang CFI
with `-fsanitize-cfi-icall-generalize-pointers` treats pointer types alike but keeps the
`const` of the pointee, so creating a subject alternative name extension with
`X509V3_EXT_conf_nid` traps. Both functions only pass the method to `v2i_GENERAL_NAME`,
which already takes it as `const`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Algunenano
Algunenano merged commit 93abcc4 into ClickHouse/openssl-4.1.0 Nov 23, 2026
40 of 238 checks passed
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.

1 participant