]> git.ipfire.org Git - thirdparty/curl.git/commit
tls: fix incomplete mTLS config in conn reuse and session cache
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Tue, 19 May 2026 09:47:50 +0000 (11:47 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 19 May 2026 22:02:33 +0000 (00:02 +0200)
commit7541ae569d82fb308a5e2d94916027da4fa3ba3e
treeea683ab1b2cbbf50c22d415d8340f213e743b7a2
parenta4dca608e185e2831dcf18ca0c0149484a554206
tls: fix incomplete mTLS config in conn reuse and session cache

cert_type, key, key_type, key_passwd and key_blob lived in
ssl_config_data but not in ssl_primary_config, so they were invisible to
match_ssl_primary_config() and to the TLS session cache peer key.

Two easy handles sharing a connection pool could reuse each other's
authenticated connections when they differed only on SSLKEY, SSLKEYTYPE,
KEYPASSWD, SSLCERTTYPE or SSLKEYBLOB. The second handle would silently
inherit the first handle's authenticated identity.

Promote all five fields into ssl_primary_config so the conn-reuse
predicate and session cache key cover the complete client credential
set. Also replace the fixed ":CCERT" session cache marker with the
actual clientcert path so sessions are not shared across different
client certificates.

Verified by test 3303 and 3304

Reported-By: Joshua Rogers (AISLE Research)
Closes #21667
19 files changed:
lib/ldap.c
lib/urldata.h
lib/vssh/libssh.c
lib/vssh/libssh2.c
lib/vtls/gtls.c
lib/vtls/mbedtls.c
lib/vtls/openssl.c
lib/vtls/rustls.c
lib/vtls/schannel.c
lib/vtls/vtls.c
lib/vtls/vtls_scache.c
lib/vtls/vtls_scache.h
lib/vtls/wolfssl.c
tests/data/Makefile.am
tests/data/test3303 [new file with mode: 0644]
tests/data/test3304 [new file with mode: 0644]
tests/unit/Makefile.inc
tests/unit/unit3303.c [new file with mode: 0644]
tests/unit/unit3304.c [new file with mode: 0644]