Skip to content

Commit 58f3d3e

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 36b2813 commit 58f3d3e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-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` | | | :white_check_mark: |
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,14 @@ entry! {
17021702
}
17031703
}
17041704

1705+
entry! {
1706+
pub fn _SSL_SESSION_get0_hostname(_sess: *const SSL_SESSION) -> *const c_char {
1707+
// TODO: this could be implemented accurately by storing the SNI
1708+
// of the originating connection (but only for TLS1.2) in the `SslSession`
1709+
ptr::null()
1710+
}
1711+
}
1712+
17051713
entry! {
17061714
pub fn _d2i_SSL_SESSION(
17071715
a: *mut *mut SSL_SESSION,

0 commit comments

Comments
 (0)