aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-06 05:28:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-06 05:28:08 +0800
commit691be72a02067c25b8770d890f06658b7cc12c86 (patch)
tree8e213d25c310bb00c79ec41fce46f3ff88ab3bc1
parent4d126fb6748040e58f4d47966f4f832e66814811 (diff)
downloadgsoc2013-evolution-691be72a02067c25b8770d890f06658b7cc12c86.tar.gz
gsoc2013-evolution-691be72a02067c25b8770d890f06658b7cc12c86.tar.zst
gsoc2013-evolution-691be72a02067c25b8770d890f06658b7cc12c86.zip
Don't return NULL if the token is non-NULL. This is why:
2001-03-05 Jeffrey Stedfast <fejj@ximian.com> * camel-sasl-plain.c (plain_challenge): Don't return NULL if the token is non-NULL. This is why: sending : AUTH PLAIN received: 334 ok. go on. <-- this is why sending : ZGZPaQpAZ214Lm5ldBBnb29jYXI= received: 235 {mp005-rz3} go ahead * camel-sasl.c (camel_sasl_authtype): Add the PLAIN type here. (camel_sasl_authtype_list): And here too. * camel-sasl-plain.c: Initialize the camel_sasl_plain_authtype. * camel-sasl-plain.h: extern the camel_sasl_plain_authtype. svn path=/trunk/; revision=8562
-rw-r--r--camel/ChangeLog17
-rw-r--r--camel/camel-sasl-plain.c18
-rw-r--r--camel/camel-sasl-plain.h2
-rw-r--r--camel/camel-sasl.c3
4 files changed, 37 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index faa4e4f074..802f264de5 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,22 @@
2001-03-05 Jeffrey Stedfast <fejj@ximian.com>
+ * camel-sasl-plain.c (plain_challenge): Don't return NULL if the
+ token is non-NULL. This is why:
+
+ sending : AUTH PLAIN
+ received: 334 ok. go on. <-- this is why
+ sending : ZGZPaQpAZ214Lm5ldBBnb29jYXI=
+ received: 235 {mp005-rz3} go ahead
+
+ * camel-sasl.c (camel_sasl_authtype): Add the PLAIN type here.
+ (camel_sasl_authtype_list): And here too.
+
+ * camel-sasl-plain.c: Initialize the camel_sasl_plain_authtype.
+
+ * camel-sasl-plain.h: extern the camel_sasl_plain_authtype.
+
+2001-03-05 Jeffrey Stedfast <fejj@ximian.com>
+
* providers/imap/camel-imap-store.c (imap_connect): i18n'd some
strings in here.
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
index e4e4612dc8..5fb0c97469 100644
--- a/camel/camel-sasl-plain.c
+++ b/camel/camel-sasl-plain.c
@@ -25,6 +25,16 @@
#include "camel-service.h"
#include <string.h>
+CamelServiceAuthType camel_sasl_plain_authtype = {
+ N_("PLAIN"),
+
+ N_("This option will connect to the server using a "
+ "the PLAIN SASL mechanism if the server supports it."),
+
+ "PLAIN",
+ TRUE
+};
+
static CamelSaslClass *parent_class = NULL;
/* Returns the class for a CamelSaslPlain */
@@ -68,21 +78,23 @@ plain_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
GByteArray *buf = NULL;
CamelURL *url = sasl->service->url;
+#if 0
if (token) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Authentication failed."));
return NULL;
}
-
+#endif
+
g_return_val_if_fail (url->passwd != NULL, NULL);
-
+
/* FIXME: make sure these are "UTF8-SAFE" */
buf = g_byte_array_new ();
g_byte_array_append (buf, "", 1);
g_byte_array_append (buf, url->user, strlen (url->user));
g_byte_array_append (buf, "", 1);
g_byte_array_append (buf, url->passwd, strlen (url->passwd));
-
+
sasl->authenticated = TRUE;
return buf;
diff --git a/camel/camel-sasl-plain.h b/camel/camel-sasl-plain.h
index 94efb317f9..1e93ae5c7a 100644
--- a/camel/camel-sasl-plain.h
+++ b/camel/camel-sasl-plain.h
@@ -50,6 +50,8 @@ typedef struct _CamelSaslPlainClass {
/* Standard Camel function */
CamelType camel_sasl_plain_get_type (void);
+extern CamelServiceAuthType camel_sasl_plain_authtype;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index d4590c5325..978104de90 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -219,6 +219,7 @@ camel_sasl_authtype_list (void)
#ifdef HAVE_KRB4
types = g_list_prepend (types, &camel_sasl_kerberos4_authtype);
#endif
+ types = g_list_prepend (types, &camel_sasl_plain_authtype);
return types;
}
@@ -241,6 +242,8 @@ camel_sasl_authtype (const char *mechanism)
else if (!strcmp (mechanism, "KERBEROS_V4"))
return &camel_sasl_kerberos4_authtype;
#endif
+ else if (!strcmp (mechanism, "PLAIN"))
+ return &camel_sasl_plain_authtype;
else
return NULL;
}