dovecot-2.0: *-login: Moved ssl=required checking to login-common.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 10 05:00:37 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/1c01e6bf1090
changeset: 9757:1c01e6bf1090
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Aug 09 22:00:30 2009 -0400
description:
*-login: Moved ssl=required checking to login-common.

diffstat:

3 files changed, 12 insertions(+), 23 deletions(-)
src/imap-login/client-authenticate.c  |   12 ------------
src/login-common/client-common-auth.c |   12 ++++++++++++
src/pop3-login/client-authenticate.c  |   11 -----------

diffs (72 lines):

diff -r e30495ae11de -r 1c01e6bf1090 src/imap-login/client-authenticate.c
--- a/src/imap-login/client-authenticate.c	Sun Aug 09 21:53:14 2009 -0400
+++ b/src/imap-login/client-authenticate.c	Sun Aug 09 22:00:30 2009 -0400
@@ -125,7 +125,6 @@ int cmd_authenticate(struct imap_client 
 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 */
@@ -137,17 +136,6 @@ int cmd_authenticate(struct imap_client 
 		    args[2].type != IMAP_ARG_EOL)
 			return -1;
 		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]);
diff -r e30495ae11de -r 1c01e6bf1090 src/login-common/client-common-auth.c
--- a/src/login-common/client-common-auth.c	Sun Aug 09 21:53:14 2009 -0400
+++ b/src/login-common/client-common-auth.c	Sun Aug 09 22:00:30 2009 -0400
@@ -426,6 +426,18 @@ int client_auth_begin(struct client *cli
 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,
diff -r e30495ae11de -r 1c01e6bf1090 src/pop3-login/client-authenticate.c
--- a/src/pop3-login/client-authenticate.c	Sun Aug 09 21:53:14 2009 -0400
+++ b/src/pop3-login/client-authenticate.c	Sun Aug 09 22:00:30 2009 -0400
@@ -77,17 +77,6 @@ bool cmd_auth(struct pop3_client *pop3_c
 	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;


More information about the dovecot-cvs mailing list