aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-12 04:34:10 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-12 04:34:10 +0800
commit96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb (patch)
treee9446b437250db0db951be8e98c6bab1e936aa0b
parent10387f75191a34848c5b4657aa1ba0efdc167ce3 (diff)
downloadgsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar.gz
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar.bz2
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar.lz
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar.xz
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.tar.zst
gsoc2013-evolution-96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb.zip
Don't check the initial auth response until we get into the while-loop
2001-05-11 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/camel-smtp-transport.c (smtp_auth): Don't check the initial auth response until we get into the while-loop otherwise we have problems if the SASL mechanism supported a client initiated challenge (like PLAIN and LOGIN do). svn path=/trunk/; revision=9771
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c22
2 files changed, 20 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1c5e1de5f5..e79d88f11a 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/smtp/camel-smtp-transport.c (smtp_auth): Don't check
+ the initial auth response until we get into the while-loop
+ otherwise we have problems if the SASL mechanism supported a
+ client initiated challenge (like PLAIN and LOGIN do).
+
2001-05-11 Dan Winship <danw@ximian.com>
* camel-stream-null.c (camel_stream_null_new): Make this return
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 2d07a26b85..c081bd9a13 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -746,20 +746,24 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
}
g_free (cmdbuf);
- /* get the base64 encoded server challenge which should follow a 334 code */
respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
- if (!respbuf || strncmp (respbuf, "334", 3)) {
- g_free (respbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("AUTH request timed out: %s"),
- g_strerror (errno));
- goto lose;
- }
while (!camel_sasl_authenticated (sasl)) {
- if (!respbuf)
+ if (!respbuf) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("AUTH request timed out: %s"),
+ g_strerror (errno));
goto lose;
+ }
+
+ /* the server challenge/response should follow a 334 code */
+ if (strcmp (respbuf, "334")) {
+ g_free (respbuf);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("AUTH request failed."));
+ goto lose;
+ }
/* eat whtspc */
for (challenge = respbuf + 4; isspace (*challenge); challenge++);