summaryrefslogtreecommitdiffstats
path: root/src/login-common
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:32:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:32:03 +0000
commita7ef3cd3c7d32e8799ad0a397fc57e8c347463cf (patch)
treebf1501b7b11bd1ca1c7b4b4df5be689e1f7c750f /src/login-common
parentReleasing progress-linux version 1:2.3.21+dfsg1-3~progress7.99u1. (diff)
downloaddovecot-a7ef3cd3c7d32e8799ad0a397fc57e8c347463cf.tar.xz
dovecot-a7ef3cd3c7d32e8799ad0a397fc57e8c347463cf.zip
Merging upstream version 1:2.3.21.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/login-common')
-rw-r--r--src/login-common/client-common.c11
-rw-r--r--src/login-common/client-common.h8
2 files changed, 16 insertions, 3 deletions
diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c
index fc44d2b..17765fb 100644
--- a/src/login-common/client-common.c
+++ b/src/login-common/client-common.c
@@ -566,9 +566,14 @@ int client_init_ssl(struct client *client)
"Failed to initialize SSL server context: %s", error);
return -1;
}
- if (io_stream_create_ssl_server(ssl_ctx, &ssl_set,
- &client->input, &client->output,
- &client->ssl_iostream, &error) < 0) {
+ if (client->v.iostream_change_pre != NULL)
+ client->v.iostream_change_pre(client);
+ int ret = io_stream_create_ssl_server(ssl_ctx, &ssl_set,
+ &client->input, &client->output,
+ &client->ssl_iostream, &error);
+ if (client->v.iostream_change_post != NULL)
+ client->v.iostream_change_post(client);
+ if (ret < 0) {
e_error(client->event,
"Failed to initialize SSL connection: %s", error);
ssl_iostream_context_unref(&ssl_ctx);
diff --git a/src/login-common/client-common.h b/src/login-common/client-common.h
index a21dea1..1bc57f0 100644
--- a/src/login-common/client-common.h
+++ b/src/login-common/client-common.h
@@ -129,6 +129,14 @@ struct client_vfuncs {
void (*notify_starttls)(struct client *client,
bool success, const char *text);
void (*starttls)(struct client *client);
+
+ /* Called just before client iostreams are changed (e.g. STARTTLS).
+ iostream_change_post() is guaranteed to be called. */
+ void (*iostream_change_pre)(struct client *client);
+ /* Called just after client iostreams may have changed. Nothing may
+ have happened in case of unexpected errors. */
+ void (*iostream_change_post)(struct client *client);
+
void (*input)(struct client *client);
bool (*sasl_filter_mech)(struct client *client,
struct auth_mech_desc *mech);