-/* $OpenBSD: relay.c,v 1.234 2017/11/28 00:17:56 claudio Exp $ */
+/* $OpenBSD: relay.c,v 1.235 2017/11/28 01:24:22 claudio Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
if (con->se_in.tls != NULL)
tls_close(con->se_in.tls);
tls_free(con->se_in.tls);
+ tls_free(con->se_in.tls_ctx);
tls_config_free(con->se_in.tls_cfg);
free(con->se_in.tlscert);
if (con->se_in.s != -1) {
if (con->se_out.tls != NULL)
tls_close(con->se_out.tls);
tls_free(con->se_out.tls);
+ tls_free(con->se_out.tls_ctx);
tls_config_free(con->se_out.tls_cfg);
free(con->se_out.tlscert);
if (con->se_out.s != -1) {
relay_tls_inspect_create(struct relay *rlay, struct ctl_relay_event *cre)
{
struct tls_config *tls_cfg;
- struct tls *tls;
+ struct tls *tls = NULL;
const char *fake_key;
int fake_keylen;
}
cre->tls_cfg = tls_cfg;
+ cre->tls_ctx = tls;
return (tls);
err:
tls_config_free(tls_cfg);
errstr = "could not accept the TLS connection";
goto err;
}
- if (cre->tlscert != NULL)
- tls_free(tls_server);
flag = EV_READ;
} else {
cre->tls = tls_client();
-/* $OpenBSD: relayd.h,v 1.245 2017/11/27 23:21:16 claudio Exp $ */
+/* $OpenBSD: relayd.h,v 1.246 2017/11/28 01:24:22 claudio Exp $ */
/*
* Copyright (c) 2006 - 2016 Reyk Floeter <reyk@openbsd.org>
struct tls *tls;
struct tls_config *tls_cfg;
+ struct tls *tls_ctx;
uint8_t *tlscert;
size_t tlscert_len;