diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-09-22 12:15:17 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-09-22 12:15:17 +0000 |
commit | 5d1471b09418f86e039f243817d3c1044650da07 (patch) | |
tree | 9da7e5ad931e89606ec4773b91e74f7b51aa54f7 /src | |
parent | f1d72092ed5ac85b44314d35e0933faa6622d967 (diff) | |
download | anubis-5d1471b09418f86e039f243817d3c1044650da07.tar.gz anubis-5d1471b09418f86e039f243817d3c1044650da07.tar.bz2 |
Got read of secure.client and secure.server globals
Diffstat (limited to 'src')
-rw-r--r-- | src/anubisusr.c | 1 | ||||
-rw-r--r-- | src/extern.h | 2 | ||||
-rw-r--r-- | src/quit.c | 7 | ||||
-rw-r--r-- | src/transmode.c | 7 | ||||
-rw-r--r-- | src/tunnel.c | 38 |
5 files changed, 22 insertions, 33 deletions
diff --git a/src/anubisusr.c b/src/anubisusr.c index 6ca93d1..50c397d 100644 --- a/src/anubisusr.c +++ b/src/anubisusr.c @@ -71,6 +71,7 @@ void error (const char *, ...); int send_line (char *buf); int smtp_get_reply (struct smtp_reply *repl); void smtp_free_reply (struct smtp_reply *repl); +static void smtp_quit (void); #define R_CONT 0x8000 #define R_CODEMASK 0xfff diff --git a/src/extern.h b/src/extern.h index 8cbd357..b8eebc0 100644 --- a/src/extern.h +++ b/src/extern.h @@ -77,8 +77,6 @@ struct message_struct #ifdef USE_SSL struct secure_struct { - NET_STREAM client; - NET_STREAM server; char *cafile; char *cert; char *key; @@ -63,17 +63,10 @@ quit (int code) { memset (session.mta_username, 0, sizeof (session.mta_username)); memset (session.mta_password, 0, sizeof (session.mta_password)); - -#ifdef USE_SSL - /*FIXME!!! */ - net_close_stream (&secure.client); - net_close_stream (&secure.server); -#endif #ifdef HAVE_SYSLOG if ((topt & T_DAEMON) && !(topt & T_FOREGROUND)) closelog (); #endif /* HAVE_SYSLOG */ - free_mem (); exit (code); } diff --git a/src/transmode.c b/src/transmode.c index 0568155..067996c 100644 --- a/src/transmode.c +++ b/src/transmode.c @@ -136,13 +136,6 @@ anubis_transparent_mode (NET_STREAM * psd_client, struct sockaddr_in *addr) smtp_session_transparent (); alarm (0); -#ifdef USE_SSL - net_close_stream (&secure.client); - net_close_stream (&secure.server); - secure.server = 0; - secure.client = 0; -#endif - net_close_stream (&sd_server); net_close_stream (psd_client); *psd_client = NULL; diff --git a/src/tunnel.c b/src/tunnel.c index d489b06..d441429 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -445,6 +445,8 @@ static int handle_starttls (char *command) { #ifdef USE_SSL + NET_STREAM stream; + if (topt & T_SSL_FINISHED) { if (topt & T_SSL_ONEWAY) @@ -468,6 +470,7 @@ handle_starttls (char *command) if (!(topt & T_LOCAL_MTA)) { + NET_STREAM stream; char reply[LINEBUFFER + 1]; swrite (CLIENT, remote_server, "STARTTLS" CRLF); @@ -482,14 +485,14 @@ handle_starttls (char *command) return 0; } - secure.client = start_ssl_client (remote_server, - secure.cafile, - options.termlevel > NORMAL); - if (!secure.client) + stream = start_ssl_client (remote_server, + secure.cafile, + options.termlevel > NORMAL); + if (!stream) return 0; - remote_server = (void *) secure.client; + remote_server = stream; } - + /* Make the TLS/SSL connection with SMTP client (client connected with the Tunnel). @@ -522,16 +525,16 @@ handle_starttls (char *command) check_filemode (secure.key); swrite (SERVER, remote_client, "220 2.0.0 Ready to start TLS" CRLF); - secure.server = start_ssl_server (remote_client, - secure.cafile, - secure.cert, - secure.key, options.termlevel > NORMAL); - if (!secure.server) + stream = start_ssl_server (remote_client, + secure.cafile, + secure.cert, + secure.key, options.termlevel > NORMAL); + if (!stream) { swrite (SERVER, remote_client, "454 4.3.3 TLS not available" CRLF); return 0; } - remote_client = secure.server; + remote_client = stream; topt |= T_SSL_FINISHED; #else swrite (SERVER, remote_client, "503 5.5.0 TLS not available" CRLF); @@ -599,6 +602,7 @@ handle_ehlo (char *command, char *reply, size_t reply_size) if ((topt & T_SSL_ONEWAY) && (topt & T_STARTTLS) && !(topt & T_SSL_FINISHED)) { + NET_STREAM stream; char ehlo[128]; char newreply[LINEBUFFER + 1]; @@ -627,17 +631,17 @@ handle_ehlo (char *command, char *reply, size_t reply_size) return 1; } - secure.client = start_ssl_client (remote_server, - secure.cafile, - options.termlevel > NORMAL); - if (!secure.client) + stream = start_ssl_client (remote_server, + secure.cafile, + options.termlevel > NORMAL); + if (!stream) { topt &= ~T_SSL_ONEWAY; swrite (SERVER, remote_client, reply); return 1; } - remote_server = (void *) secure.client; + remote_server = stream; topt |= T_SSL_FINISHED; /* |