aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-12-16 19:52:45 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-12-16 19:52:45 +0000
commit736488c0aedfb197e6dd889704223253f08b0bdb (patch)
tree5da2fbb7e1611b645d87a207b94836cd5a18f6b4
parent2c4cb78ec4ce8c9340085613f99a3df3bbfe475f (diff)
downloadanubis-736488c0aedfb197e6dd889704223253f08b0bdb.tar.gz
anubis-736488c0aedfb197e6dd889704223253f08b0bdb.tar.bz2
Updated
-rw-r--r--ChangeLog18
-rw-r--r--TODO15
-rw-r--r--src/gsasl_srv.c11
-rw-r--r--src/headers.h6
-rw-r--r--src/rcfile.c54
5 files changed, 96 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index f49dcf3..4a7d8b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-12-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
+
+ * (TODO): updated
+ * configure.ac: set "M4_DEFS -DWITH_GSASL"
+ * src/esmtp.c: Completely rewritten using gsasl
+ * src/extern.h (anon_token,authorization_id,authentication_id)
+ (auth_password,auth_service,auth_hostname,generic_service_name)
+ (auth_passcode,auth_realm): New variables.
+ * src/gsasl_srv.c: Updated
+ * src/headers.h: Updated
+ * src/stream.c (stream_readline): Minor fix
+ * src/tunnel.c (collect_body): delete AUTH part.
+ * testsuite/mta.c: minor indentation fix
+ * testsuite/etc/Makefile.am: Change $(RCFILES) std.pat:
+ * Makefile.am: dependency to $(RCFILES) std.pat: Makefile.am
+ * testsuite/etc/target.in.in: Conditionally include -c and -k.
+ * testsuite/lib/anubis.exp (sanubis_pat): Fix TLS/GSASL usage
+
2004-12-15 Sergey Poznyakoff
* configure.ac: Bail out if required SQL libraries are not
diff --git a/TODO b/TODO
index 3842cd1..3d36944 100644
--- a/TODO
+++ b/TODO
@@ -2,9 +2,20 @@
TO DO
=====
+* Urgent: Get rid of static buffers (recvline et al.) Use dynamically
+allocated buffers instead.
+
+* Urgent: Get rid of global vs. local variable mess. Most horrible
+example are remote_client and remote_server variables that are often
+duplicated as autos/arguments. These all should be automatic variables.
+
+* Urgent: Write general-purpose (e)smtp io functions and use them throughout
+the code (take anubisusr.c as an example)
+
+* Urgent: Remove duplicated functions: place them all into a library
+
* anubisusr.c: Provide (configuration file||command line||envar) options
-to hold authentication credentials. Turn off echo when asking for
-security-sensitive info.
+to hold authentication credentials.
* New action commands
** `reject' action command
diff --git a/src/gsasl_srv.c b/src/gsasl_srv.c
index 010d7f7..bffc374 100644
--- a/src/gsasl_srv.c
+++ b/src/gsasl_srv.c
@@ -32,7 +32,7 @@ static ANUBIS_LIST *anubis_mech_list;
/* Converts the auth method list from a textual representation to
a ANUBIS_LIST of string values */
-static ANUBIS_LIST *
+ANUBIS_LIST *
auth_method_list (char *input)
{
char *p;
@@ -84,8 +84,8 @@ anubis_set_mech_list (ANUBIS_LIST * list)
/* Capability list handling */
-static int
-name_cmp (void *item, void *data)
+int
+anubis_name_cmp (void *item, void *data)
{
return strcmp (item, data);
}
@@ -107,7 +107,8 @@ auth_gsasl_capa_init ()
{
size_t size = strlen (listmech);
ANUBIS_LIST *mech = auth_method_list (listmech);
- ANUBIS_LIST *p = list_intersect (mech, anubis_mech_list, name_cmp);
+ ANUBIS_LIST *p = list_intersect (mech, anubis_mech_list,
+ anubis_name_cmp);
auth_list_to_string (p, listmech, size);
list_destroy (&p, NULL, NULL);
list_destroy (&mech, anubis_free_list_item, NULL);
@@ -236,7 +237,7 @@ cb_validate (Gsasl_session_ctx * ctx,
if (usr->smtp_authid == NULL
&& anubis_get_db_record (authentication_id, usr) != ANUBIS_DB_SUCCESS)
return GSASL_AUTHENTICATION_ERROR;
-
+
if (usr->smtp_authid == NULL
|| strcmp (usr->smtp_authid, authentication_id)
|| strcmp (usr->smtp_passwd, password))
diff --git a/src/headers.h b/src/headers.h
index 86d4a28..da75a72 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -389,7 +389,7 @@ char *exec_argv (int *, char *, char **, char *, char *, int);
void cleanup_children (void);
/* esmtp.c */
-void esmtp_auth (NET_STREAM, char *);
+int esmtp_auth (NET_STREAM *, char *);
/* misc.c */
int anubis_free_list_item (void *item, void *data);
@@ -574,6 +574,10 @@ void anubis_set_mech_list (ANUBIS_LIST * list);
void install_gsasl_stream (Gsasl_session_ctx * sess_ctx, NET_STREAM * stream);
#endif
+/* gsasl_srv.c */
+int anubis_name_cmp (void *item, void *data);
+ANUBIS_LIST *auth_method_list (char *input);
+
/* xdatabase.c */
int xdatabase (char *command);
void xdatabase_capability (char *reply, size_t reply_size);
diff --git a/src/rcfile.c b/src/rcfile.c
index bcfc377..918c586 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -245,6 +245,15 @@ process_rcfile (int method)
#define KW_READ_ENTIRE_BODY 16
#define KW_LOCAL_DOMAIN 17
#define KW_MODE 18
+#define KW_ESMTP_ANONYMOUS_TOKEN 19
+#define KW_ESMTP_AUTH_ID 20
+#define KW_ESMTP_AUTHZ_ID 21
+#define KW_ESMTP_PASSWORD 22
+#define KW_ESMTP_SERVICE 23
+#define KW_ESMTP_HOSTNAME 24
+#define KW_ESMTP_GENERIC_SERVICE 25
+#define KW_ESMTP_PASSCODE 26
+#define KW_ESMTP_REALM 27
char **
list_to_argv (ANUBIS_LIST * list)
@@ -401,6 +410,42 @@ control_parser (int method, int key, ANUBIS_LIST * arglist,
}
break;
+ case KW_ESMTP_ANONYMOUS_TOKEN:
+ anon_token = strdup (arg);
+ break;
+
+ case KW_ESMTP_AUTH_ID:
+ authentication_id = strdup (arg);
+ break;
+
+ case KW_ESMTP_AUTHZ_ID:
+ authorization_id = strdup (arg);
+ break;
+
+ case KW_ESMTP_PASSWORD:
+ auth_password = strdup (arg);
+ break;
+
+ case KW_ESMTP_SERVICE:
+ auth_service = strdup (arg);
+ break;
+
+ case KW_ESMTP_HOSTNAME:
+ auth_hostname = strdup (arg);
+ break;
+
+ case KW_ESMTP_GENERIC_SERVICE:
+ generic_service_name = strdup (arg);
+ break;
+
+ case KW_ESMTP_PASSCODE:
+ auth_passcode = strdup (arg);
+ break;
+
+ case KW_ESMTP_REALM:
+ auth_realm = strdup (arg);
+ break;
+
case KW_LOCAL_DOMAIN:
anubis_domain = strdup (arg);
break;
@@ -507,6 +552,15 @@ struct rc_kwdef control_kw[] = {
{ "local-mta", KW_LOCAL_MTA },
{ "tracefile", KW_TRACEFILE },
{ "esmtp-auth", KW_ESMTP_AUTH, KWF_HIDDEN },
+ { "esmtp-anonymous-token", KW_ESMTP_ANONYMOUS_TOKEN, KWF_HIDDEN },
+ { "esmtp-auth-id", KW_ESMTP_AUTH_ID, KWF_HIDDEN },
+ { "esmtp-authz-id", KW_ESMTP_AUTHZ_ID, KWF_HIDDEN },
+ { "esmtp-password", KW_ESMTP_PASSWORD, KWF_HIDDEN },
+ { "esmtp-service", KW_ESMTP_SERVICE, KWF_HIDDEN },
+ { "esmtp-hostname", KW_ESMTP_HOSTNAME, KWF_HIDDEN },
+ { "esmtp-generic-service", KW_ESMTP_SERVICE, KWF_HIDDEN },
+ { "esmtp-passcode", KW_ESMTP_PASSCODE, KWF_HIDDEN },
+ { "esmtp-realm", KW_ESMTP_REALM, KWF_HIDDEN },
#ifdef USE_SOCKS_PROXY
{ "socks-proxy", KW_SOCKS_PROXY },
{ "socks-v4", KW_SOCKS_V4 },

Return to:

Send suggestions and report system problems to the System administrator.