summaryrefslogtreecommitdiff
path: root/src/tls/s6tls_exec_tlsdio.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-05-28 01:05:56 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-05-28 01:05:56 +0000
commit02afa553cc33400ead38ac85f8f7f2f3fe79f49d (patch)
treed0d22ad521d9d3b8e28af128bae0ec796b35ff74 /src/tls/s6tls_exec_tlsdio.c
parentd5ce828c97505e429e0cc87b5e87da4f7d291ad4 (diff)
downloads6-networking-02afa553cc33400ead38ac85f8f7f2f3fe79f49d.tar.xz
Server-side SNI, libtls version
Implementation for bearssl coming soon.
Diffstat (limited to 'src/tls/s6tls_exec_tlsdio.c')
-rw-r--r--src/tls/s6tls_exec_tlsdio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tls/s6tls_exec_tlsdio.c b/src/tls/s6tls_exec_tlsdio.c
index 3007cf0..f3bc999 100644
--- a/src/tls/s6tls_exec_tlsdio.c
+++ b/src/tls/s6tls_exec_tlsdio.c
@@ -6,15 +6,16 @@
#include <s6-networking/config.h>
#include "s6tls-internal.h"
-void s6tls_exec_tlsdio (int const *fds, uint32_t options, unsigned int verbosity, unsigned int kimeout)
+void s6tls_exec_tlsdio (int const *fds, uint32_t options, unsigned int verbosity, unsigned int kimeout, unsigned int snilevel)
{
- char const *newargv[13] ;
+ char const *newargv[15] ;
unsigned int m = 0 ;
char fmtv[UINT_FMT] ;
char fmtd[UINT_FMT] ;
char fmtk[UINT_FMT] ;
char fmtr[UINT_FMT] ;
char fmtw[UINT_FMT] ;
+ char fmti[UINT_FMT] ;
newargv[m++] = S6_NETWORKING_BINPREFIX "s6-tlsd-io" ;
if (verbosity != 1)
@@ -38,6 +39,12 @@ void s6tls_exec_tlsdio (int const *fds, uint32_t options, unsigned int verbosity
newargv[m++] = fmtk ;
fmtk[uint_fmt(fmtk, kimeout)] = 0 ;
}
+ if (snilevel)
+ {
+ newargv[m++] = "-k" ;
+ newargv[m++] = fmti ;
+ fmti[uint_fmt(fmti, snilevel)] = 0 ;
+ }
newargv[m++] = "--" ;
newargv[m++] = fmtr ;
fmtr[uint_fmt(fmtr, fds[0])] = 0 ;