aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog22
-rw-r--r--camel/camel-sasl-anonymous.c10
-rw-r--r--camel/camel-sasl-anonymous.h4
-rw-r--r--camel/camel-sasl-cram-md5.c3
-rw-r--r--camel/camel-sasl-digest-md5.c3
-rw-r--r--camel/camel-sasl-kerberos4.c1
-rw-r--r--camel/camel-sasl-plain.c16
-rw-r--r--camel/camel-sasl-plain.h2
-rw-r--r--camel/camel-sasl.c7
-rw-r--r--camel/camel-service.h10
-rw-r--r--camel/providers/imap/camel-imap-store.c1
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c5
12 files changed, 73 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index cd0adf82d0..6fd06a1488 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,25 @@
+2001-04-01 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-sasl-plain.c:
+ * camel-sasl-anonymous.c:
+ * camel-sasl-digest-md5.c:
+ * camel-sasl-cram-md5.c:
+ * camel-sasl-kerberos4.c: Updated the authtype values.
+
+ * camel-service.h: Added another field to CamelServiceAuthType
+ that specifies whether or not the mechanism supports "quick auth"
+ which means that the client can send the initial challenge in the
+ AUTH request.
+
+ * camel-sasl.c (camel_sasl_new): Add support for LOGIN.
+ (camel_sasl_authtype_list): Here too.
+ (camel_sasl_authtype): And finally here.
+
+ * camel-sasl-plain.c: Define camel_sasl_login_authtype.
+
+ * providers/smtp/camel-smtp-transport.c (smtp_auth): Only unref
+ the SASL object if it exists.
+
2001-03-30 Dan Winship <danw@ximian.com>
* providers/pop3/camel-pop3-store.c (connect_to_server,
diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c
index 5626d4647f..e24bb50182 100644
--- a/camel/camel-sasl-anonymous.c
+++ b/camel/camel-sasl-anonymous.c
@@ -29,6 +29,16 @@
#include "camel-internet-address.h"
#include <string.h>
+CamelServiceAuthType camel_sasl_anonymous_authtype = {
+ N_("Anonymous"),
+
+ N_("This option will connect to the server using an anonymous login."),
+
+ "ANONYMOUS",
+ FALSE,
+ TRUE
+};
+
static CamelSaslClass *parent_class = NULL;
/* Returns the class for a CamelSaslAnonymous */
diff --git a/camel/camel-sasl-anonymous.h b/camel/camel-sasl-anonymous.h
index 3b27aeb183..267f338f87 100644
--- a/camel/camel-sasl-anonymous.h
+++ b/camel/camel-sasl-anonymous.h
@@ -59,7 +59,9 @@ typedef struct _CamelSaslAnonymousClass {
CamelType camel_sasl_anonymous_get_type (void);
/* public methods */
-CamelSasl * camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info);
+CamelSasl *camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info);
+
+extern CamelServiceAuthType camel_sasl_anonymous_authtype;
#ifdef __cplusplus
}
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
index 3d3bae36e1..7f559ddc68 100644
--- a/camel/camel-sasl-cram-md5.c
+++ b/camel/camel-sasl-cram-md5.c
@@ -38,7 +38,8 @@ CamelServiceAuthType camel_sasl_cram_md5_authtype = {
"secure CRAM-MD5 password, if the server supports it."),
"CRAM-MD5",
- TRUE
+ TRUE,
+ FALSE
};
static CamelSaslClass *parent_class = NULL;
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index fa0d9a8175..a8aa6340c2 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -45,7 +45,8 @@ CamelServiceAuthType camel_sasl_digest_md5_authtype = {
"secure DIGEST-MD5 password, if the server supports it."),
"DIGEST-MD5",
- TRUE
+ TRUE,
+ FALSE
};
static CamelSaslClass *parent_class = NULL;
diff --git a/camel/camel-sasl-kerberos4.c b/camel/camel-sasl-kerberos4.c
index 1698ffe870..72dcd34e0c 100644
--- a/camel/camel-sasl-kerberos4.c
+++ b/camel/camel-sasl-kerberos4.c
@@ -43,6 +43,7 @@ CamelServiceAuthType camel_sasl_kerberos4_authtype = {
"Kerberos 4 authentication."),
"KERBEROS_V4",
+ FALSE,
FALSE
};
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
index aea5199b68..958a30e962 100644
--- a/camel/camel-sasl-plain.c
+++ b/camel/camel-sasl-plain.c
@@ -30,11 +30,23 @@
CamelServiceAuthType camel_sasl_plain_authtype = {
N_("Password"),
-
+
N_("This option will connect to the server using a "
"simple password."),
-
+
"PLAIN",
+ TRUE,
+ FALSE
+};
+
+CamelServiceAuthType camel_sasl_login_authtype = {
+ N_("NT Login"),
+
+ N_("This option will connect to the server using a "
+ "simple password."),
+
+ "LOGIN",
+ TRUE,
TRUE
};
diff --git a/camel/camel-sasl-plain.h b/camel/camel-sasl-plain.h
index 1e93ae5c7a..047fc6b6a7 100644
--- a/camel/camel-sasl-plain.h
+++ b/camel/camel-sasl-plain.h
@@ -52,6 +52,8 @@ CamelType camel_sasl_plain_get_type (void);
extern CamelServiceAuthType camel_sasl_plain_authtype;
+extern CamelServiceAuthType camel_sasl_login_authtype;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index 7ab6b41a76..1044d58c21 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -191,7 +191,7 @@ camel_sasl_new (const char *service_name, const char *mechanism, CamelService *s
else if (!strcmp (mechanism, "KERBEROS_V4"))
sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_KERBEROS4_TYPE);
#endif
- else if (!strcmp (mechanism, "PLAIN"))
+ else if (!strcmp (mechanism, "PLAIN") || !strcmp (mechanism, "LOGIN"))
sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_PLAIN_TYPE);
else
return NULL;
@@ -220,9 +220,10 @@ camel_sasl_authtype_list (gboolean include_plain)
#ifdef HAVE_KRB4
types = g_list_prepend (types, &camel_sasl_kerberos4_authtype);
#endif
+ types = g_list_prepend (types, &camel_sasl_login_authtype);
if (include_plain)
types = g_list_prepend (types, &camel_sasl_plain_authtype);
-
+
return types;
}
@@ -246,6 +247,8 @@ camel_sasl_authtype (const char *mechanism)
#endif
else if (!strcmp (mechanism, "PLAIN"))
return &camel_sasl_plain_authtype;
+ else if (!strcmp (mechanism, "LOGIN"))
+ return &camel_sasl_login_authtype;
else
return NULL;
}
diff --git a/camel/camel-service.h b/camel/camel-service.h
index 7850aca4e6..9c180e5d98 100644
--- a/camel/camel-service.h
+++ b/camel/camel-service.h
@@ -83,8 +83,14 @@ typedef struct {
/* query_auth_types returns a GList of these */
typedef struct {
- char *name, *description, *authproto;
- gboolean need_password;
+ char *name; /* user-friendly name */
+ char *description;
+ char *authproto;
+
+ gboolean need_password; /* needs a password to authenticate */
+
+ gboolean quick_login; /* client can send initial challenge to
+ * speed up the authentication procedure */
} CamelServiceAuthType;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index ca38182e0b..21211616ae 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1189,6 +1189,7 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
}
}
}
+
if (need_inbox) {
CamelURL *url;
char *uri;
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index f2c344ebba..af41b2f5b9 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -735,7 +735,7 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
goto lose;
/* eat whtspc */
- for (challenge = respbuf + 4; isspace (*challenge); challenge++);
+ for (challenge = respbuf + 4; *challenge && isspace (*challenge); challenge++);
challenge = camel_sasl_challenge_base64 (sasl, challenge, ex);
g_free (respbuf);
@@ -778,7 +778,8 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
_("Bad authentication response from server.\n"));
}
- camel_object_unref (CAMEL_OBJECT (sasl));
+ if (sasl)
+ camel_object_unref (CAMEL_OBJECT (sasl));
return FALSE;
}