+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,
#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 */
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
}
"secure CRAM-MD5 password, if the server supports it."),
"CRAM-MD5",
- TRUE
+ TRUE,
+ FALSE
};
static CamelSaslClass *parent_class = NULL;
"secure DIGEST-MD5 password, if the server supports it."),
"DIGEST-MD5",
- TRUE
+ TRUE,
+ FALSE
};
static CamelSaslClass *parent_class = NULL;
"Kerberos 4 authentication."),
"KERBEROS_V4",
+ FALSE,
FALSE
};
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
};
extern CamelServiceAuthType camel_sasl_plain_authtype;
+extern CamelServiceAuthType camel_sasl_login_authtype;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
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;
#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;
}
#endif
else if (!strcmp (mechanism, "PLAIN"))
return &camel_sasl_plain_authtype;
+ else if (!strcmp (mechanism, "LOGIN"))
+ return &camel_sasl_login_authtype;
else
return NULL;
}
/* 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;
}
}
}
+
if (need_inbox) {
CamelURL *url;
char *uri;
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);
_("Bad authentication response from server.\n"));
}
- camel_object_unref (CAMEL_OBJECT (sasl));
+ if (sasl)
+ camel_object_unref (CAMEL_OBJECT (sasl));
return FALSE;
}