summaryrefslogtreecommitdiff
path: root/src/tls/s6-tlsd-io.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/s6-tlsd-io.c
parentd5ce828c97505e429e0cc87b5e87da4f7d291ad4 (diff)
downloads6-networking-02afa553cc33400ead38ac85f8f7f2f3fe79f49d.tar.xz
Server-side SNI, libtls version
Implementation for bearssl coming soon.
Diffstat (limited to 'src/tls/s6-tlsd-io.c')
-rw-r--r--src/tls/s6-tlsd-io.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tls/s6-tlsd-io.c b/src/tls/s6-tlsd-io.c
index 060537a..f4a58ce 100644
--- a/src/tls/s6-tlsd-io.c
+++ b/src/tls/s6-tlsd-io.c
@@ -13,7 +13,7 @@
#include <s6-networking/config.h>
-#define USAGE "s6-tlsd-io [ -v verbosity ] [ -d notif ] [ -S | -s ] [ -Y | -y ] [ -K timeout ] fdr fdw"
+#define USAGE "s6-tlsd-io [ -v verbosity ] [ -d notif ] [ -S | -s ] [ -Y | -y ] [ -K timeout ] [ -k snilevel ] fdr fdw"
#define dieusage() strerr_dieusage(100, USAGE)
static inline void doit (int *, tain_t const *tto, uint32_t, uint32_t, unsigned int, unsigned int) gccattr_noreturn ;
@@ -66,7 +66,7 @@ static inline void doit (int *fds, tain_t const *tto, uint32_t preoptions, uint3
#endif
#endif
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
tain_t tto ;
int fds[4] = { 0, 1, 0, 1 } ;
@@ -81,7 +81,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
unsigned int t = 0 ;
for (;;)
{
- int opt = subgetopt_r(argc, argv, "d:SsYyv:K:", &l) ;
+ int opt = subgetopt_r(argc, argv, "d:SsYyv:K:k:", &l) ;
if (opt == -1) break ;
switch (opt)
{
@@ -92,6 +92,14 @@ int main (int argc, char const *const *argv, char const *const *envp)
case 'Y' : preoptions |= 1 ; preoptions &= ~2 ; break ;
case 'y' : preoptions |= 3 ; break ;
case 'K' : if (!uint0_scan(l.arg, &t)) dieusage() ; break ;
+ case 'k' :
+ {
+ unsigned int snilevel ;
+ if (!uint0_scan(l.arg, &snilevel)) dieusage() ;
+ if (snilevel) preoptions |= 4 ;
+ if (snilevel >= 2) preoptions |= 8 ;
+ break ;
+ }
default : dieusage() ;
}
}