From: Pekka Riikonen Date: Wed, 11 Apr 2001 20:15:54 +0000 (+0000) Subject: updates. X-Git-Tag: SILC.0.1~27 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=2293a8fbbf37c116fc38dbcd9012cf176d25f60a updates. --- diff --git a/CHANGES b/CHANGES index 7e4fd78e..25a47e4d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,18 @@ +Wed Apr 11 22:10:15 EEST 2001 Pekka Riikonen + + * Disable force sending of packets when REKEY protocol is active. + We must assure that no packet is sent directly when rekey is + performed. All packets must be sent through packet queue. + Added macro SILC_SERVER_IS_REKEY to silcd/server.h and + SILC_CLIENT_IS_REKEY to lib/silcclient/client.h. Affected + function is silc_[server/client]_packet_send_real to check + the situation. + + * Replaced the SIM paths from example config files to + /usr/local/modules. Also, make install creates now + /usr/local/silc/logs directory to hold all the SILC server + logs. + Wed Apr 11 16:59:59 EEST 2001 Pekka Riikonen * Made the configure.in.pre work on Solaris. Patch by salo. diff --git a/Makefile.am b/Makefile.am index 2f848f0c..b07aebcc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,16 +32,18 @@ EXTRA_DIST = CHANGES CREDITS # Installing of SILC into the system # +etcdir = @ETCDIR@ modulesdir = $(prefix)/@MODULESDIR@ helpdir = $(prefix)/@HELPDIR@ docdir = $(prefix)/@DOCDIR@ -etcdir = @ETCDIR@ +logsdir = $(prefix)/@LOGSDIR@ install-dirs: -mkdir -p $(etcdir) -mkdir -p $(modulesdir) -mkdir -p $(helpdir) -mkdir -p $(docdir) + -mkdir -p $(logsdir) generate-server-key: -$(sbindir)/silcd -C $(etcdir) @@ -50,8 +52,13 @@ sim-install: -cp -fR $(srcdir)/lib/silcsim/modules/*.so $(modulesdir)/ doc-install: - -cp -fR $(srcdir)/doc/* $(docdir)/ + $(INSTALL_DATA) $(srcdir)/doc/CodingStyle $(docdir)/ + $(INSTALL_DATA) $(srcdir)/doc/FAQ $(docdir)/ + $(INSTALL_DATA) $(srcdir)/doc/example* $(docdir)/ + $(INSTALL_DATA) $(srcdir)/doc/*.txt $(docdir)/ $(INSTALL_DATA) $(srcdir)/COPYING $(docdir)/ + $(INSTALL_DATA) $(srcdir)/CHANGES $(docdir)/ + $(INSTALL_DATA) $(srcdir)/CREDITS $(docdir)/ $(INSTALL_DATA) $(srcdir)/README $(docdir)/ $(INSTALL_DATA) $(srcdir)/INSTALL $(docdir)/ $(INSTALL_DATA) $(srcdir)/TODO $(docdir)/ @@ -60,6 +67,7 @@ etc-install: -@if test '!' -f $(etcdir)/silcd.conf ; then \ $(INSTALL_DATA) $(srcdir)/doc/example_silcd.conf \ $(etcdir)/silcd.conf; \ + chmod go= $(etcdir)/silcd.conf; \ fi -@if test '!' -f $(etcdir)/silc.conf ; then \ $(INSTALL_DATA) $(srcdir)/doc/example_silc.conf \ diff --git a/apps/silcd/packet_send.c b/apps/silcd/packet_send.c index a88eedbe..a08c5eb0 100644 --- a/apps/silcd/packet_send.c +++ b/apps/silcd/packet_send.c @@ -35,6 +35,11 @@ int silc_server_packet_send_real(SilcServer server, { int ret; + /* If rekey protocol is active we must assure that all packets are + sent through packet queue. */ + if (SILC_SERVER_IS_REKEY(sock)) + force_send = FALSE; + /* Send the packet */ ret = silc_packet_send(sock, force_send); if (ret != -2) diff --git a/apps/silcd/server.h b/apps/silcd/server.h index e62c6b92..613d64ea 100644 --- a/apps/silcd/server.h +++ b/apps/silcd/server.h @@ -79,6 +79,11 @@ do { \ silc_free(__fmt__); \ } while(0); +/* Check whether rekey protocol is active */ +#define SILC_SERVER_IS_REKEY(sock) \ + (sock->protocol && sock->protocol->protocol && \ + sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY) + /* Prototypes */ int silc_server_alloc(SilcServer *new_server); void silc_server_free(SilcServer server); diff --git a/configure.in.pre b/configure.in.pre index 082b165b..ec985142 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -126,7 +126,7 @@ AC_CHECK_HEADERS(dlfcn.h, # # Default installation destination -AC_PREFIX_DEFAULT(/usr/local/silc/) +AC_PREFIX_DEFAULT(/usr/local/silc) # etc directory ETCDIR="/etc/silc" @@ -192,6 +192,22 @@ AC_ARG_WITH(simdir, ) AC_SUBST(MODULESDIR) +# Logs directory +LOGSDIR="logs" +AC_ARG_WITH(logsdir, +[ --with-logsdir[=PATH] Directory for Server logs [PREFIX/logs]], +[ case "$withval" in + no) + ;; + yes) + ;; + *) + LOGSDIR="$withwal" + ;; + esac ], +) +AC_SUBST(LOGSDIR) + # Debug checking AC_MSG_CHECKING(for enabled debugging) AC_ARG_ENABLE(debug, @@ -212,7 +228,7 @@ esac ], CFLAGS="-O2 -g $CFLAGS" # SOCKS4 support checking AC_MSG_CHECKING(whether to support SOCKS4) AC_ARG_WITH(socks4, -[ --with-socks4[=PATH] Compile with SOCKS4 support.], +[ --with-socks4[=PATH] Compile with SOCKS4 support], [ case "$withval" in no) AC_MSG_RESULT(no) @@ -246,7 +262,7 @@ AC_ARG_WITH(socks4, # SOCKS5 support checking AC_MSG_CHECKING(whether to support SOCKS5) AC_ARG_WITH(socks5, -[ --with-socks5[=PATH] Compile with SOCKS5 support.], +[ --with-socks5[=PATH] Compile with SOCKS5 support], [ case "$withval" in no) AC_MSG_RESULT(no) @@ -348,7 +364,7 @@ esac ], [ AC_ARG_WITH(silcd-config-file, [ --with-silcd-config-file[=PATH] Use PATH as default configuration file in SILC - server.], + server [/etc/silc/silcd.conf]], [ AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval") ]) # XXX diff --git a/doc/example_silc.conf b/doc/example_silc.conf index 6b88d812..71fce70c 100644 --- a/doc/example_silc.conf +++ b/doc/example_silc.conf @@ -6,16 +6,16 @@ # If the cipher is builtin the maybe omitted. # [cipher] -aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 -aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 -aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 -twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 -twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 -twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 -mars-256-cbc:../lib/silcsim/modules/mars.sim.so:32:16 -mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16 -mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16 -none:../lib/silcsim/modules/none.sim.so:0:0 +aes-256-cbc:/usr/local/silc/silc/modules/aes.sim.so:32:16 +aes-192-cbc:/usr/local/silc/modules/aes.sim.so:24:16 +aes-128-cbc:/usr/local/silc/modules/aes.sim.so:16:16 +twofish-256-cbc:/usr/local/silc/modules/twofish.sim.so:32:16 +twofish-192-cbc:/usr/local/silc/modules/twofish.sim.so:24:16 +twofish-128-cbc:/usr/local/silc/modules/twofish.sim.so:16:16 +mars-256-cbc:/usr/local/silc/modules/mars.sim.so:32:16 +mars-192-cbc:/usr/local/silc/modules/mars.sim.so:24:16 +mars-128-cbc:/usr/local/silc/modules/mars.sim.so:16:16 +none:/usr/local/silc/modules/none.sim.so:0:0 # # Configured hash functions. diff --git a/doc/example_silcd.conf b/doc/example_silcd.conf index a3b878a4..c149bc00 100644 --- a/doc/example_silcd.conf +++ b/doc/example_silcd.conf @@ -6,16 +6,16 @@ # If the cipher is builtin the maybe omitted. # [Cipher] -aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 -aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 -aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 -twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 -twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 -twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 -mars-256-cbc:../lib/silcsim/modules/mars.sim.so:32:16 -mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16 -mars-128-cbc:../lib/silcsim/modules/mars.sim.so:16:16 -none:../lib/silcsim/modules/none.sim.so:0:0 +aes-256-cbc:/usr/local/silc/modules/aes.sim.so:32:16 +aes-192-cbc:/usr/local/silc/modules/aes.sim.so:24:16 +aes-128-cbc:/usr/local/silc/modules/aes.sim.so:16:16 +twofish-256-cbc:/usr/local/silc/modules/twofish.sim.so:32:16 +twofish-192-cbc:/usr/local/silc/modules/twofish.sim.so:24:16 +twofish-128-cbc:/usr/local/silc/modules/twofish.sim.so:16:16 +mars-256-cbc:/usr/local/silc/modules/mars.sim.so:32:16 +mars-192-cbc:/usr/local/silc/modules/mars.sim.so:24:16 +mars-128-cbc:/usr/local/silc/modules/mars.sim.so:16:16 +none:/usr/local/silc/modules/none.sim.so:0:0 # # Configured hash functions. @@ -106,10 +106,10 @@ lassi.kuo.fi.ssh.com:10.2.1.6:Kuopio, Finland:706 # fatallogile:: # [Logging] -infologfile:silcd.log:10000 -#warninglogfile:/var/log/silcd_warning.log:10000 -#errorlogfile:ERROR.log:10000 -#fatallogfile:/var/log/silcd_error.log: +infologfile:/usr/local/silc/logs/silcd.log:10000 +#warninglogfile:/usr/local/silc/logs/silcd_warning.log:10000 +#errorlogfile:/usr/local/silc/logs/error.log:10000 +#fatallogfile:/usr/local/silc/logs/silcd_error.log: # # Connection classes. diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index a43baa11..12900bd1 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -585,6 +585,11 @@ int silc_client_packet_send_real(SilcClient client, { int ret; + /* If rekey protocol is active we must assure that all packets are + sent through packet queue. */ + if (SILC_CLIENT_IS_REKEY(sock)) + force_send = FALSE; + /* Send the packet */ ret = silc_packet_send(sock, force_send); if (ret != -2) diff --git a/lib/silcclient/client.h b/lib/silcclient/client.h index b16e308f..4730a65a 100644 --- a/lib/silcclient/client.h +++ b/lib/silcclient/client.h @@ -232,6 +232,11 @@ do { \ (__sock) = (__x)->conns[__i]->sock; \ } while(0) +/* Check whether rekey protocol is active */ +#define SILC_CLIENT_IS_REKEY(sock) \ + (sock->protocol && sock->protocol->protocol && \ + sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_REKEY) + /* Prototypes (some of the prototypes are defined in the silcapi.h) */ void silc_client_packet_send(SilcClient client,