Skip to content

Commit f6e33fd

Browse files
committed
SSL_SESSION_get0_hostname: stub that returns null
Due to CVE-2025-23419 fedora's nginx now calls this to learn the session's original SNI value. For more faithful keeping with the OpenSSL API, we could also store this for TLS1.2 and return it here, but we don't do that currently so pretend there is no SNI for TLS1.2 sessions.
1 parent 2e9f0d5 commit f6e33fd

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

MATRIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
| `SSL_SESSION_free` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
220220
| `SSL_SESSION_get0_alpn_selected` | | | |
221221
| `SSL_SESSION_get0_cipher` | | | |
222-
| `SSL_SESSION_get0_hostname` | | | |
222+
| `SSL_SESSION_get0_hostname` | | | :exclamation: [^stub] |
223223
| `SSL_SESSION_get0_id_context` | | | |
224224
| `SSL_SESSION_get0_peer` | | | |
225225
| `SSL_SESSION_get0_ticket` | | | |

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ const ENTRYPOINTS: &[&str] = &[
178178
"SSL_select_next_proto",
179179
"SSL_sendfile",
180180
"SSL_SESSION_free",
181+
"SSL_SESSION_get0_hostname",
181182
"SSL_SESSION_get_id",
182183
"SSL_SESSION_get_time",
183184
"SSL_SESSION_get_timeout",

src/entry.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,12 @@ type SSL_custom_ext_free_cb_ex = Option<
22162216
),
22172217
>;
22182218

2219+
// TODO: this could be implemented accurately by storing the SNI
2220+
// of the originating connection (but only for TLS1.2) in the `SslSession`
2221+
entry_stub! {
2222+
pub fn _SSL_SESSION_get0_hostname(_sess: *const SSL_SESSION) -> *const c_char;
2223+
}
2224+
22192225
// ---------------------
22202226

22212227
#[cfg(test)]

0 commit comments

Comments
 (0)