From ae64d277b8204c156a30d2e8b6a958e5a31f2a7f Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Tue, 29 Jun 2021 12:41:03 +0000 Subject: Explicitly clear TLS secrets afer handshake No need to keep them at runtime; do so unconditionally for the sake of simplicity. Declare TLS config globally so ircConnect() can clear it and declare both client and config statically as they are not used outside the irc.c module. --- irc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irc.c b/irc.c index 61d74bb..c308e46 100644 --- a/irc.c +++ b/irc.c @@ -43,12 +43,13 @@ #include "chat.h" -struct tls *client; +static struct tls *client; +static struct tls_config *config; void ircConfig( bool insecure, const char *trust, const char *cert, const char *priv ) { - struct tls_config *config = tls_config_new(); + config = tls_config_new(); if (!config) errx(EX_SOFTWARE, "tls_config_new"); int error; @@ -167,6 +168,7 @@ int ircConnect(const char *bindHost, const char *host, const char *port) { } while (error == TLS_WANT_POLLIN || error == TLS_WANT_POLLOUT); if (error) errx(EX_PROTOCOL, "tls_handshake: %s", tls_error(client)); + tls_config_clear_keys(config); return sock; } -- cgit 1.4.1 8b35f8fe4'>tree commit diff
path: root/bin/klon.c (unfollow)
Commit message (Collapse)Author
2018-08-26Add NetBSD to install.shJune McEnroe
2018-08-24Show hostname in title over SSHJune McEnroe
2018-08-23Alias bc='bc -l'June McEnroe
2018-08-20Update usage of scheme in READMEJune McEnroe
2018-08-20Use scheme.h in fbatt and fbclockJune McEnroe
2018-08-20Generate scheme.hJune McEnroe
2018-08-20Add dependencies on gfx.hJune McEnroe
2018-08-18Add Blondie — Heart of GlassJune McEnroe
Why didn't I know about this song? I love it.
2018-08-18Set FCEDIT=$EDITORJune McEnroe
2018-08-18Only post commits with bodies to MastodonJune McEnroe
2018-08-18Run tf/cfg link script with /bin/shJune McEnroe
2018-08-18Run {,s,t}up with /bin/shJune McEnroe
2018-08-18Use whence instead of typeJune McEnroe
type is an alias for whence -v and is more for human consumption.
2018-08-18Cut off path components until right prompt fitsJune McEnroe
Keeps paths valid (from somehwere) rather than abrupt truncation.
2018-08-17Add "private" alias to source encrypted fileJune McEnroe
Why is there no easy way to *edit* an encrypted file?
2018-08-17Add vim mapping to add a #includeJune McEnroe