]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: mech - Move MAX_MECH_NAME_LEN to auth-sasl and add prefix
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 30 Oct 2023 02:11:31 +0000 (03:11 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Oct 2025 08:41:22 +0000 (08:41 +0000)
src/auth/auth-request-handler.c
src/auth/auth-sasl.h
src/auth/mech.h

index 6e007852be18b405f798d731b2c641d5a53f643e..241a5eef658ef2a389f3047e8e5bc4626a105593 100644 (file)
@@ -11,6 +11,7 @@
 #include "strescape.h"
 #include "str-sanitize.h"
 #include "master-interface.h"
+#include "auth-sasl.h"
 #include "auth-penalty.h"
 #include "auth-request.h"
 #include "auth-token.h"
@@ -593,7 +594,8 @@ int auth_request_handler_auth_begin(struct auth_request_handler *handler,
                        e_error(handler->conn->conn.event,
                                "BUG: Authentication client %u requested invalid "
                                "authentication mechanism %s (DOVECOT-TOKEN required)",
-                               handler->client_pid, str_sanitize(args[1], MAX_MECH_NAME_LEN));
+                               handler->client_pid,
+                               str_sanitize(args[1], AUTH_SASL_MAX_MECH_NAME_LEN));
                        return -1;
                }
        } else {
@@ -604,7 +606,7 @@ int auth_request_handler_auth_begin(struct auth_request_handler *handler,
                        e_error(handler->conn->conn.event,
                                "BUG: Authentication client %u requested unsupported "
                                "authentication mechanism %s", handler->client_pid,
-                               str_sanitize(args[1], MAX_MECH_NAME_LEN));
+                               str_sanitize(args[1], AUTH_SASL_MAX_MECH_NAME_LEN));
                        return -1;
                }
        }
index 692832a999a4397eaec910791e831073c711e83a..30b71be944dac48d08509b6f9be245b0b7fcb045 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef AUTH_SASL_H
 #define AUTH_SASL_H
 
+/* Used only for string sanitization. */
+#define AUTH_SASL_MAX_MECH_NAME_LEN 64
+
 struct auth_sasl_mech_module {
        const char *mech_name;
 };
index 905d9e08575a1b4ecaf383add50e3f295701b3c9..ffd7838da94ef328f70fabe224a3c44ad8ce4259 100644 (file)
@@ -9,9 +9,6 @@ struct auth_request;
 #include "auth-request.h"
 #include "auth-request-handler.h"
 
-/* Used only for string sanitization. */
-#define MAX_MECH_NAME_LEN 64
-
 enum mech_passdb_need {
        /* Mechanism doesn't need a passdb at all */
        MECH_PASSDB_NEED_NOTHING = 0,