Skip to content

Commit 140be0b

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 8cef022 commit 140be0b

File tree

4 files changed

+638
-0
lines changed

4 files changed

+638
-0
lines changed

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ AC_CHECK_LIB([gnutls], [gnutls_get_system_config_file],
8282
AC_CHECK_LIB([gnutls], [gnutls_psk_allocate_client_credentials2],
8383
[AC_DEFINE([HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2], [1],
8484
[Define to 1 if you have the gnutls_psk_allocate_client_credentials2 function.])])
85+
AC_CHECK_LIB([glib-2.0], [g_pattern_spec_match],
86+
[AC_DEFINE([HAVE_GLIB_G_PATTERN_SPEC_MATCH], [1],
87+
[Define to 1 if you have the g_pattern_spec_match function.])])
88+
8589
AC_SUBST([AM_CPPFLAGS])
8690

8791
AC_CONFIG_FILES([Makefile \

src/tlshd/server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ static void tlshd_tls13_server_x509_handshake(struct tlshd_handshake_parms *parm
311311
}
312312
}
313313

314+
tlshd_tags_match_session(session);
315+
314316
gnutls_deinit(session);
315317

316318
out_free_certs:

0 commit comments

Comments
 (0)