summaryrefslogtreecommitdiff
path: root/src/tls
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-05-20 10:55:18 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-05-20 10:55:18 +0000
commit4aae040b1a8aecddcd0e1e959c77bb262fe6b850 (patch)
tree37c985cc6ff250ec486c3eaa09428eb5bf08cdb2 /src/tls
parent6780eee3e0dbe37640f72ed1e37a95c506e23f8c (diff)
downloads6-networking-4aae040b1a8aecddcd0e1e959c77bb262fe6b850.tar.xz
Add an x509 engine wrapping minimal. NOT FUNCTIONAL, FOR TESTING.
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/s6-tlsc-io.c8
-rw-r--r--src/tls/s6-tlsd-io.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/tls/s6-tlsc-io.c b/src/tls/s6-tlsc-io.c
index 7c92d96..3c9df58 100644
--- a/src/tls/s6-tlsc-io.c
+++ b/src/tls/s6-tlsc-io.c
@@ -43,11 +43,11 @@ static inline void doit (int *fds, tain_t const *tto, uint32_t preoptions, uint3
#include <s6-networking/sbearssl.h>
-static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cb_context_t *cbarg)
+static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *cbarg)
{
if (cbarg->notif)
{
- if (!sbearssl_send_environment(ctx, cbarg->notif)) return 0 ;
+ if (!sbearssl_send_environment(ctx, cbarg)) return 0 ;
fd_close(cbarg->notif) ;
}
return 1 ;
@@ -55,8 +55,10 @@ static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cb_conte
static inline void doit (int *fds, tain_t const *tto, uint32_t preoptions, uint32_t options, unsigned int verbosity, char const *servername, unsigned int notif)
{
+ sbearssl_handshake_cbarg cbarg = SBEARSSL_HANDSHAKE_CBARG_ZERO ;
if (!random_init()) strerr_diefu1sys(111, "initialize random device") ;
- sbearssl_client_init_and_run(fds, tto, preoptions, options, verbosity, servername, &handshake_cb, notif) ;
+ cbarg.notif = notif ;
+ sbearssl_client_init_and_run(fds, tto, preoptions, options, verbosity, servername, &handshake_cb, &cbarg) ;
}
#else
diff --git a/src/tls/s6-tlsd-io.c b/src/tls/s6-tlsd-io.c
index 01f0d74..060537a 100644
--- a/src/tls/s6-tlsd-io.c
+++ b/src/tls/s6-tlsd-io.c
@@ -41,11 +41,11 @@ static inline void doit (int *fds, tain_t const *tto, uint32_t preoptions, uint3
#include <s6-networking/sbearssl.h>
-static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cb_context_t *cbarg)
+static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *cbarg)
{
if (cbarg->notif)
{
- if (!sbearssl_send_environment(ctx, cbarg->notif)) return 0 ;
+ if (!sbearssl_send_environment(ctx, cbarg)) return 0 ;
fd_close(cbarg->notif) ;
}
return 1 ;
@@ -53,8 +53,10 @@ static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cb_conte
static inline void doit (int *fds, tain_t const *tto, uint32_t preoptions, uint32_t options, unsigned int verbosity, unsigned int notif)
{
+ sbearssl_handshake_cbarg cbarg = SBEARSSL_HANDSHAKE_CBARG_ZERO ;
if (!random_init()) strerr_diefu1sys(111, "initialize random device") ;
- sbearssl_server_init_and_run(fds, tto, preoptions, options, verbosity, &handshake_cb, notif) ;
+ cbarg.notif = notif ;
+ sbearssl_server_init_and_run(fds, tto, preoptions, options, verbosity, &handshake_cb, &cbarg) ;
}
#else