]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-urlauth: imap-urlauth-worker - Fully perform client-to-server VERSION handshake...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 21 Feb 2023 01:42:50 +0000 (02:42 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Mar 2023 07:14:54 +0000 (07:14 +0000)
src/imap-urlauth/imap-urlauth-worker.c

index 63b345a41fd2dc4cb5615d762da1a3a712525243..a1ba880e665dbe726a767982348e4c5265e19d09 100644 (file)
@@ -69,7 +69,6 @@ struct client {
 
        bool finished:1;
        bool waiting_input:1;
-       bool version_received:1;
        bool access_received:1;
        bool access_anonymous:1;
 };
@@ -758,7 +757,7 @@ static int client_ctrl_read_fds(struct client *client)
 
 static int client_ctrl_handshake(struct client *client)
 {
-       if (client->version_received)
+       if (client->conn_ctrl.version_received)
                return 1;
 
        const char *line;
@@ -767,16 +766,12 @@ static int client_ctrl_handshake(struct client *client)
        if (line == NULL)
                return 0;
 
-       if (!version_string_verify(line, "imap-urlauth-worker",
-                       IMAP_URLAUTH_WORKER_PROTOCOL_MAJOR_VERSION)) {
-               e_error(client->event,
-                       "imap-urlauth-worker client not compatible with this server "
-                       "(mixed old and new binaries?) %s", line);
-               client_abort(client, "Control session aborted: Version mismatch");
+       if (connection_handshake_args_default(
+               &client->conn_ctrl, t_strsplit_tabescaped(line)) < 0) {
+               client_abort(client, "Control session aborted: "
+                            "Received bad VERSION line");
                return -1;
        }
-
-       client->version_received = TRUE;
        return 1;
 }