Skip to content

Commit adbe733

Browse files
committed
tlshd: Match ingress certificates with defined TLS session tags
TLS session tags are defined in /etc/tlshd/tags.d. Each tag one or more filter expressions that match against fields in the x.509 certificate presented by a client peer. When a handshake is successful, tlshd parses the peer's certificate and applies the filters to the fields in the certificate. When the tag's set of filters all match, the tag's name is added to the tag list for the session. A subsequent patch will pass the list to the kernel upon handshake completion. Suggested-by: Benjamin Coddington <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent c790da2 commit adbe733

File tree

4 files changed

+761
-0
lines changed

4 files changed

+761
-0
lines changed

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ AC_CHECK_LIB([gnutls], [gnutls_get_system_config_file],
8888
AC_CHECK_LIB([gnutls], [gnutls_psk_allocate_client_credentials2],
8989
[AC_DEFINE([HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2], [1],
9090
[Define to 1 if you have the gnutls_psk_allocate_client_credentials2 function.])])
91+
AC_CHECK_LIB([glib-2.0], [g_pattern_spec_match],
92+
[AC_DEFINE([HAVE_GLIB_G_PATTERN_SPEC_MATCH], [1],
93+
[Define to 1 if you have the g_pattern_spec_match function.])])
94+
AC_CHECK_LIB([glib-2.0], [g_pattern_spec_match_string],
95+
[AC_DEFINE([HAVE_GLIB_G_PATTERN_SPEC_MATCH_STRING], [1],
96+
[Define to 1 if you have the g_pattern_spec_match_string function.])])
9197

9298
AC_MSG_CHECKING(for ML-DSA support in gnutls)
9399
AC_COMPILE_IFELSE(

src/tlshd/server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ static void tlshd_tls13_server_x509_handshake(struct tlshd_handshake_parms *parm
460460
}
461461
}
462462

463+
tlshd_tags_match_session(session);
464+
463465
gnutls_deinit(session);
464466

465467
out_free_certs:

0 commit comments

Comments
 (0)