]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: Moved ssl=required checking to login-common.
authorTimo Sirainen <tss@iki.fi>
Mon, 10 Aug 2009 02:00:30 +0000 (22:00 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 10 Aug 2009 02:00:30 +0000 (22:00 -0400)
--HG--
branch : HEAD

src/imap-login/client-authenticate.c
src/login-common/client-common-auth.c
src/pop3-login/client-authenticate.c

index 0285bc415bcbba3437eb7741446c0de80ed0ff44..e2492d0727cf4c19024767cbb0672c6b2b6eca8e 100644 (file)
@@ -125,7 +125,6 @@ imap_client_auth_begin(struct imap_client *imap_client, const char *mech_name,
 int cmd_authenticate(struct imap_client *imap_client,
                     const struct imap_arg *args)
 {
-       struct client *client = &imap_client->common;
        const char *mech_name, *init_resp = NULL;
 
        /* we want only one argument: authentication mechanism name */
@@ -139,17 +138,6 @@ int cmd_authenticate(struct imap_client *imap_client,
                init_resp = IMAP_ARG_STR(&args[1]);
        }
 
-       if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
-               if (client->set->verbose_auth) {
-                       client_log(client, "Login failed: "
-                                  "SSL required for authentication");
-               }
-               client->auth_attempts++;
-               client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
-                       "Authentication not allowed until SSL/TLS is enabled.");
-               return 1;
-       }
-
        mech_name = IMAP_ARG_STR(&args[0]);
        if (*mech_name == '\0')
                return -1;
index 6277c2ec6d844c9c1739401fa559b79876e41873..557e6b3ea552e5fe5fac7e3c9bfbe4c60f628ef7 100644 (file)
@@ -426,6 +426,18 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
 int client_auth_begin(struct client *client, const char *mech_name,
                      const char *init_resp)
 {
+       if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
+               if (client->set->verbose_auth) {
+                       client_log(client, "Login failed: "
+                                  "SSL required for authentication");
+               }
+               client->auth_attempts++;
+               client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
+                       "Authentication not allowed until SSL/TLS is enabled.");
+               return 1;
+       }
+
+
        client_ref(client);
        client->auth_initializing = TRUE;
        sasl_server_auth_begin(client, login_protocol, mech_name,
index 2f08dec5807e0fd85df90eedd04c999e7408ed37..e10c8a799be3685d07800ecf3c762dc003ad7fbc 100644 (file)
@@ -77,17 +77,6 @@ bool cmd_auth(struct pop3_client *pop3_client, const char *args)
        const struct auth_mech_desc *mech;
        const char *mech_name, *p;
 
-       if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
-               if (client->set->verbose_auth) {
-                       client_log(client, "Login failed: "
-                                  "SSL required for authentication");
-               }
-               client->auth_attempts++;
-               client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
-                       "Authentication not allowed until SSL/TLS is enabled.");
-               return TRUE;
-       }
-
        if (*args == '\0') {
                /* Old-style SASL discovery, used by MS Outlook */
                unsigned int i, count;