diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2022-04-09 19:01:52 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2022-04-09 19:01:52 +0000 |
commit | c45631e0d8d2de6f44c618408a187645fe48e16e (patch) | |
tree | cff4ec7e469b140bf15f19bea0110d5eb1cf450e /src | |
parent | b51c1b1911e97c552d99f8a00698bbae30229ce0 (diff) | |
download | s6-networking-c45631e0d8d2de6f44c618408a187645fe48e16e.tar.xz |
Prepare for 2.5.1.1; adapt to skalibs-2.12.0.0
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/clock/s6-taiclock.c | 3 | ||||
-rw-r--r-- | src/sbearssl/sbearssl_client_init_and_run.c | 3 | ||||
-rw-r--r-- | src/sbearssl/sbearssl_server_init_and_run.c | 3 | ||||
-rw-r--r-- | src/tls/s6-tlsc-io.c | 3 | ||||
-rw-r--r-- | src/tls/s6-tlsd-io.c | 3 |
5 files changed, 3 insertions, 12 deletions
diff --git a/src/clock/s6-taiclock.c b/src/clock/s6-taiclock.c index 2bc0470..6701f9e 100644 --- a/src/clock/s6-taiclock.c +++ b/src/clock/s6-taiclock.c @@ -33,7 +33,7 @@ int tain_exchange (int s, ip46 const *ip, uint16_t port, tain *serversays, tain ssize_t r ; uint16_t dummyport ; tain_pack(query+4, &STAMP) ; - random_string(query+20, N-20) ; /* cookie */ + random_buf(query+20, N-20) ; /* cookie */ r = socket_sendnb46_g(s, query, N, ip, port, deadline) ; if (r < 0) return 0 ; if (r < N) return (errno = EPIPE, 0) ; @@ -95,7 +95,6 @@ int main (int argc, char const *const *argv) } if (!argc) dieusage() ; if (!ip46_scan(argv[0], &ipremote)) dieusage() ; - if (!random_init()) strerr_diefu1sys(111, "init random generator") ; sock = socket_udp46(ip46_is6(&ipremote)) ; if (sock < 0) strerr_diefu1sys(111, "socket_udp") ; diff --git a/src/sbearssl/sbearssl_client_init_and_run.c b/src/sbearssl/sbearssl_client_init_and_run.c index a7d91e4..ab9d12d 100644 --- a/src/sbearssl/sbearssl_client_init_and_run.c +++ b/src/sbearssl/sbearssl_client_init_and_run.c @@ -79,8 +79,7 @@ void sbearssl_client_init_and_run (int *fds, tain const *tto, uint32_t preoption } br_ssl_engine_add_flags(&cc.eng, BR_OPT_NO_RENEGOTIATION) ; - random_string((char *)buf, 32) ; - random_finish() ; + random_buf((char *)buf, 32) ; br_ssl_engine_inject_entropy(&cc.eng, buf, 32) ; br_ssl_engine_set_buffer(&cc.eng, buf, sizeof(buf), 1) ; if (!br_ssl_client_reset(&cc, servername, 0)) diff --git a/src/sbearssl/sbearssl_server_init_and_run.c b/src/sbearssl/sbearssl_server_init_and_run.c index 984e54e..41d4d9e 100644 --- a/src/sbearssl/sbearssl_server_init_and_run.c +++ b/src/sbearssl/sbearssl_server_init_and_run.c @@ -82,8 +82,7 @@ void sbearssl_server_init_and_run (int *fds, tain const *tto, uint32_t preoption sbearssl_sctx_init_full_generic(&sc) ; sbearssl_sctx_set_policy_sni(&sc, &pol) ; - random_string((char *)buf, 32) ; - random_finish() ; + random_buf((char *)buf, 32) ; br_ssl_engine_inject_entropy(&sc.eng, buf, 32) ; br_ssl_engine_set_buffer(&sc.eng, buf, sizeof(buf), 1) ; diff --git a/src/tls/s6-tlsc-io.c b/src/tls/s6-tlsc-io.c index 0070f8e..98e80e9 100644 --- a/src/tls/s6-tlsc-io.c +++ b/src/tls/s6-tlsc-io.c @@ -39,8 +39,6 @@ static inline void doit (int *fds, tain const *tto, uint32_t preoptions, uint32_ #include <bearssl.h> -#include <skalibs/random.h> - #include <s6-networking/sbearssl.h> static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *cbarg) @@ -56,7 +54,6 @@ static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *c static inline void doit (int *fds, tain 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") ; cbarg.notif = notif ; sbearssl_client_init_and_run(fds, tto, preoptions, options, verbosity, servername, &handshake_cb, &cbarg) ; } diff --git a/src/tls/s6-tlsd-io.c b/src/tls/s6-tlsd-io.c index c8641b2..d013606 100644 --- a/src/tls/s6-tlsd-io.c +++ b/src/tls/s6-tlsd-io.c @@ -37,8 +37,6 @@ static inline void doit (int *fds, tain const *tto, uint32_t preoptions, uint32_ #else #ifdef S6_NETWORKING_USE_BEARSSL -#include <skalibs/random.h> - #include <s6-networking/sbearssl.h> static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *cbarg) @@ -54,7 +52,6 @@ static int handshake_cb (br_ssl_engine_context *ctx, sbearssl_handshake_cbarg *c static inline void doit (int *fds, tain 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") ; cbarg.notif = notif ; sbearssl_server_init_and_run(fds, tto, preoptions, options, verbosity, &handshake_cb, &cbarg) ; } |