]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: client-common-auth - Move delayed final reply handling fully to sasl...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 10 Oct 2023 00:03:17 +0000 (02:03 +0200)
committerstephan.bosch <stephan.bosch@open-xchange.com>
Mon, 23 Oct 2023 15:50:54 +0000 (15:50 +0000)
src/login-common/client-common-auth.c
src/login-common/sasl-server.c
src/login-common/sasl-server.h

index 927122296cbf70e9f5911ac7ffcfa6c9b653e381..2b4ee707ba1c7ff2d879a4b0f1831728fba624e8 100644 (file)
@@ -806,12 +806,8 @@ void client_auth_respond(struct client *client, const char *response)
        if (!client_does_custom_io(client))
                io_remove(&client->io);
 
-       /* This has to happen before * handling, otherwise
-          client can abort failed request. */
-       if (client->final_response) {
-               sasl_server_auth_delayed_final(client);
+       if (sasl_server_auth_handle_delayed_final(client))
                return;
-       }
        if (strcmp(response, "*") == 0) {
                sasl_server_auth_abort(client);
                return;
index affb3e8bd7995d1f01e8b6f280e5c90d29007424..0415c539669461133aaf749421b104f8317e9d03 100644 (file)
@@ -621,11 +621,17 @@ void sasl_server_auth_abort(struct client *client)
                                SASL_SERVER_REPLY_AUTH_ABORTED);
 }
 
-void sasl_server_auth_delayed_final(struct client *client)
+bool sasl_server_auth_handle_delayed_final(struct client *client)
 {
+       /* This has to happen before * handling, otherwise
+          client can abort failed request. */
+       if (!client->final_response)
+               return FALSE;
        client->final_response = FALSE;
        client->authenticating = FALSE;
        client->auth_client_continue_pending = FALSE;
        call_client_callback(client, client->delayed_final_reply,
                             NULL, client->final_args);
+
+       return TRUE;
 }
index d73e3f625848bdbe7eae5d00a57a698d23dc7093..704dde7b72614fa8494932621d92c000a49b7114 100644 (file)
@@ -37,11 +37,12 @@ void sasl_server_auth_begin(struct client *client, const char *mech_name,
                            enum sasl_server_auth_flags flags,
                            const char *initial_resp_base64,
                            sasl_server_callback_t *callback);
-void sasl_server_auth_delayed_final(struct client *client);
 void sasl_server_auth_failed(struct client *client, const char *reason,
        const char *code) ATTR_NULL(3);
 /* Called when client asks for SASL authentication to be aborted by sending
    "*" line. */
 void sasl_server_auth_abort(struct client *client);
 
+bool sasl_server_auth_handle_delayed_final(struct client *client);
+
 #endif