diff options
author | Gilles Chehade <gilles@poolp.org> | 2019-09-05 21:26:35 +0200 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2019-09-05 21:26:35 +0200 |
commit | 995e802fcd4f2b80cf167878deb6ed71558a559a (patch) | |
tree | e9141841b434b858d92d7ef6c331e6062f398376 /smtpd/smtp_client.c | |
parent | sync (diff) | |
download | OpenSMTPD-995e802fcd4f2b80cf167878deb6ed71558a559a.tar.xz OpenSMTPD-995e802fcd4f2b80cf167878deb6ed71558a559a.zip |
sync
Diffstat (limited to 'smtpd/smtp_client.c')
-rw-r--r-- | smtpd/smtp_client.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/smtpd/smtp_client.c b/smtpd/smtp_client.c index ac707a12..7a26e954 100644 --- a/smtpd/smtp_client.c +++ b/smtpd/smtp_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_client.c,v 1.10 2019/06/12 17:42:53 eric Exp $ */ +/* $OpenBSD: smtp_client.c,v 1.11 2019/09/02 20:05:21 eric Exp $ */ /* * Copyright (c) 2018 Eric Faurot <eric@openbsd.org> @@ -185,6 +185,12 @@ smtp_cert_verified(struct smtp_client *proto, int verified) } void +smtp_set_tls(struct smtp_client *proto, void *ctx) +{ + io_start_tls(proto->io, ctx); +} + +void smtp_quit(struct smtp_client *proto) { if (proto->state != STATE_READY) @@ -500,7 +506,7 @@ smtp_client_response(struct smtp_client *proto, const char *line) smtp_client_state(proto, STATE_AUTH); } else - io_start_tls(proto->io, proto->params.tls_ctx); + smtp_require_tls(proto->tag, proto); break; case STATE_AUTH_PLAIN: @@ -610,7 +616,7 @@ smtp_client_io(struct io *io, int evt, void *arg) case IO_CONNECTED: if (proto->params.tls_req == TLS_SMTPS) { io_set_write(io); - io_start_tls(proto->io, proto->params.tls_ctx); + smtp_require_tls(proto->tag, proto); } else smtp_client_state(proto, STATE_BANNER); |