Skip to content

Commit 4c75ec8

Browse files
committed
tlshd: Read TLS session tag configuration information
TLS session tags are defined in files that reside in /etc/tlshd/tags.d/*.{yaml,yml}. On daemon start-up, the tag definitions are read into a data structure that is shared with forked children processes. Unfortunately the libyaml parser is nothing more than a token emitter. A nicer API exists in libcyaml, but that library does not appear to be available in many distributions. Thus the new tag config file parsing code implements a full finite state parser of the session tags files. Session tag configuration errors are reported but are not fatal. Nothing is done with these tags yet, and documentation is added in a subsequent patch. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 822b884 commit 4c75ec8

File tree

4 files changed

+1020
-2
lines changed

4 files changed

+1020
-2
lines changed

src/tlshd/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ sbin_PROGRAMS = tlshd
2323
tlshd_CFLAGS = -Werror -Wall -Wextra $(LIBGNUTLS_CFLAGS) \
2424
$(LIBKEYUTILS_CFLAGS) $(GLIB_CFLAGS) $(LIBNL3_CFLAGS) \
2525
$(LIBNL_GENL3_CFLAGS) $(LIBYAML_CFLAGS)
26-
tlshd_SOURCES = client.c config.c handshake.c keyring.c ktls.c log.c \
27-
main.c netlink.c netlink.h server.c tlshd.h quic.c
26+
tlshd_SOURCES = client.c config.c handshake.c keyring.c ktls.c \
27+
log.c main.c netlink.c netlink.h quic.c server.c \
28+
tags.c tlshd.h
2829
tlshd_LDADD = $(LIBGNUTLS_LIBS) $(LIBKEYUTILS_LIBS) $(GLIB_LIBS) \
2930
$(LIBNL3_LIBS) $(LIBNL_GENL3_LIBS) $(LIBYAML_LIBS)
3031

src/tlshd/config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ bool tlshd_config_init(const gchar *pathname)
106106
tlshd_keyring_link_session(".nfs");
107107
tlshd_keyring_link_session(".nfsd");
108108

109+
/* Eventually the tags directory might become a tlshd config option */
110+
tlshd_tags_read_configuration("/etc/tlshd/tags.d");
109111
return true;
110112
}
111113

112114
void tlshd_config_shutdown(void)
113115
{
116+
tlshd_tags_shutdown();
114117
g_key_file_free(tlshd_configuration);
115118
}
116119

0 commit comments

Comments
 (0)