[Pkg-silc-commits] r186 - in /silc-server/branches/upstream/current: ./ apps/ apps/silcd/ doc/ doc/examples/ includes/ lib/ lib/contrib/ lib/silcapputil/ lib/silcasn1/ lib/silccore/ lib/silccrypt/ lib/silchttp/ lib/silcmath/ lib/silcsim/ lib/silcske/ lib/silcskr/ lib/silcutil/ lib/silcutil/unix/ lib/silcvcard/

micah at users.alioth.debian.org micah at users.alioth.debian.org
Sat Nov 24 19:00:24 UTC 2007


Author: micah
Date: Sat Nov 24 19:00:23 2007
New Revision: 186

URL: http://svn.debian.org/wsvn/pkg-silc/?sc=1&rev=186
Log:
[svn-upgrade] Integrating new upstream version, silc-server (1.1)

Added:
    silc-server/branches/upstream/current/apps/silcd/silc-server.spec
Removed:
    silc-server/branches/upstream/current/lib/silcsim/
    silc-server/branches/upstream/current/lib/silcvcard/
Modified:
    silc-server/branches/upstream/current/CHANGES
    silc-server/branches/upstream/current/Makefile.am
    silc-server/branches/upstream/current/Makefile.in
    silc-server/branches/upstream/current/TODO
    silc-server/branches/upstream/current/apps/Makefile.am
    silc-server/branches/upstream/current/apps/Makefile.in
    silc-server/branches/upstream/current/apps/silcd/Makefile.am
    silc-server/branches/upstream/current/apps/silcd/Makefile.in
    silc-server/branches/upstream/current/apps/silcd/command_reply.c
    silc-server/branches/upstream/current/apps/silcd/idlist.c
    silc-server/branches/upstream/current/apps/silcd/idlist.h
    silc-server/branches/upstream/current/apps/silcd/packet_receive.c
    silc-server/branches/upstream/current/apps/silcd/packet_send.c
    silc-server/branches/upstream/current/apps/silcd/server.c
    silc-server/branches/upstream/current/apps/silcd/server_query.c
    silc-server/branches/upstream/current/apps/silcd/server_util.c
    silc-server/branches/upstream/current/apps/silcd/serverconfig.c
    silc-server/branches/upstream/current/apps/silcd/silcd.c
    silc-server/branches/upstream/current/configure
    silc-server/branches/upstream/current/configure.ac
    silc-server/branches/upstream/current/doc/Makefile.am
    silc-server/branches/upstream/current/doc/Makefile.in
    silc-server/branches/upstream/current/doc/example_silcd.conf
    silc-server/branches/upstream/current/doc/example_silcd.conf.in
    silc-server/branches/upstream/current/doc/examples/silcd.prv
    silc-server/branches/upstream/current/doc/examples/silcd.pub
    silc-server/branches/upstream/current/doc/silcalgs.conf
    silc-server/branches/upstream/current/doc/silcd.conf.5
    silc-server/branches/upstream/current/includes/Makefile.am
    silc-server/branches/upstream/current/includes/Makefile.in
    silc-server/branches/upstream/current/includes/silc.h
    silc-server/branches/upstream/current/includes/silc.h.in
    silc-server/branches/upstream/current/includes/silcdistdefs.h
    silc-server/branches/upstream/current/includes/silcversion.h.in
    silc-server/branches/upstream/current/lib/Makefile.am
    silc-server/branches/upstream/current/lib/Makefile.in
    silc-server/branches/upstream/current/lib/contrib/Makefile.am
    silc-server/branches/upstream/current/lib/contrib/Makefile.in
    silc-server/branches/upstream/current/lib/silcapputil/Makefile.am
    silc-server/branches/upstream/current/lib/silcapputil/Makefile.in
    silc-server/branches/upstream/current/lib/silcasn1/Makefile.am
    silc-server/branches/upstream/current/lib/silcasn1/Makefile.in
    silc-server/branches/upstream/current/lib/silccore/Makefile.am
    silc-server/branches/upstream/current/lib/silccore/Makefile.in
    silc-server/branches/upstream/current/lib/silccore/silcattrs.c
    silc-server/branches/upstream/current/lib/silccore/silcpacket.c
    silc-server/branches/upstream/current/lib/silccore/silcpacket.h
    silc-server/branches/upstream/current/lib/silccrypt/Makefile.am
    silc-server/branches/upstream/current/lib/silccrypt/Makefile.in
    silc-server/branches/upstream/current/lib/silccrypt/aes.c
    silc-server/branches/upstream/current/lib/silccrypt/silcpk.c
    silc-server/branches/upstream/current/lib/silchttp/Makefile.am
    silc-server/branches/upstream/current/lib/silchttp/Makefile.in
    silc-server/branches/upstream/current/lib/silcmath/Makefile.am
    silc-server/branches/upstream/current/lib/silcmath/Makefile.in
    silc-server/branches/upstream/current/lib/silcske/Makefile.am
    silc-server/branches/upstream/current/lib/silcske/Makefile.in
    silc-server/branches/upstream/current/lib/silcske/silcconnauth.c
    silc-server/branches/upstream/current/lib/silcske/silcske.c
    silc-server/branches/upstream/current/lib/silcskr/Makefile.am
    silc-server/branches/upstream/current/lib/silcskr/Makefile.in
    silc-server/branches/upstream/current/lib/silcskr/silcskr.c
    silc-server/branches/upstream/current/lib/silcutil/Makefile.am
    silc-server/branches/upstream/current/lib/silcutil/Makefile.in
    silc-server/branches/upstream/current/lib/silcutil/silcatomic.h
    silc-server/branches/upstream/current/lib/silcutil/silcconfig.c
    silc-server/branches/upstream/current/lib/silcutil/silcnet.h
    silc-server/branches/upstream/current/lib/silcutil/silcschedule.c
    silc-server/branches/upstream/current/lib/silcutil/unix/silcunixnet.c
    silc-server/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c
    silc-server/branches/upstream/current/silcdefs.h.in

Modified: silc-server/branches/upstream/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/CHANGES?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/CHANGES (original)
+++ silc-server/branches/upstream/current/CHANGES Sat Nov 24 19:00:23 2007
@@ -1,3 +1,161 @@
+Thu Nov 15 18:03:53 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Reprocess JOIN command synchronously after resolving channel
+	  user list.  Affected file is lib/silcclient/command_reply.c.
+
+	* In JOIN command reply check if the channel key is already
+	  saved.  If it is we have received new key from server while
+	  resolving user and must not save the old key.  Affected file
+	  is lib/silcclient/command_reply.c.
+
+	* Remove all channel keys and hmacs after giving LEAVE command.
+	  Affected file is lib/silcclient/command_reply.c.
+
+Tue Nov 13 18:24:56 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Added missing channel unreferencing in CMODE, CUMODE,
+	  TOPIC, INVITE, BAN and KICK command replies.  Affected
+	  file is lib/silcclient/command_reply.c.
+
+Sun Nov 11 23:04:54 EET 2007 Pekka Riikonen <priikone at silcnet.org>
+
+	* Free stream data and abort ongoing protocols correctly
+	  for primary router connections receiving end of stream.
+	  Affected file is apps/silcd/server.c.
+
+Sun Nov 11 16:02:12 EET 2007 Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Server 1.1 Beta4.
+
+Sun Nov 11 14:15:48 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Toolkit 1.1.5.
+
+Sun Nov 11 11:22:35 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed connection authentication with public keys to use
+	  correct public key as responder.  Affected file is
+	  lib/silcske/silcconnauth.c.
+
+	* Fixed public key authentication in server.  Affected file is
+	  apps/silcd/serverconfig.c.
+
+	* Fixed OPER and SILCOPER public key authentication.  Affected
+	  file is apps/silcd/server.c.
+
+	* Fixed prefer_passphrase_auth flag in server.  Fixed
+	  disconnection of unauthenticated connection.  Affected file is
+	  apps/silcd/server.c.
+
+	* Fixed client resuming in server.  Affected file is
+	  apps/silcd/packet_receive.c.
+
+	* Fixed IDENTIFY and WHOWAS command reply to correctly update
+	  client entries (fixes a crash).  Affected file is
+	  apps/silcd/command_reply.c.
+
+Tue Nov  6 16:39:20 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Client 1.1.3.
+
+Mon Nov  5 23:07:58 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Zero tail of CTR mode IV in IV Included mode.  Change does
+	  not cause compatibility issues.  Affected file is
+	  lib/silcske/silcske.c.
+
+Mon Nov  5 22:24:25 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Toolkit 1.1.4.
+
+	* Fixed CTR mode rekey.  Affected file is lib/silcske/silcske.c.
+
+	* Rewrote the IV Included CTR mode encryption/decryption in
+	  packet engine.  Affected file is lib/silccore/silcpacket.c.
+
+Sun Nov  4 15:20:25 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Removed module_path and module options from the server
+	  config file format.  Affected file is apps/silcd/serverconfig.c.
+
+	* Fixed non-IPv6 compilation error.  Affected file is
+	  lib/silcutil/unix/silcunixnet.c.
+
+Sat Nov  3 23:23:38 EET 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Do not free packet engine before uninitializing scheduler.
+	  Do not disconnct already disconnected streams.  Affected
+	  files are in apps/silcd/.
+
+	* Fixed setting correct ID for re-encrypted channel messages
+	  in router-to-router connections.  Affected file is
+	  apps/silcd/packet_send.c.
+
+Sun Sep 30 15:16:18 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed channel private key deleting when deleting the channel.
+	  Affected file is lib/silcclient/client_channel.c.
+
+Sun Sep  9 17:52:49 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Toolkit 1.1.3.
+
+	* Fixed possible buffer overflows from SILC Config code.
+	  Patch from Jérémy Bobbio.  Affected file is
+	  lib/silcutil/silcconfig.c.
+
+Sun Aug 26 12:28:49 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed TIMEOUT handling in user info resolving during JOINing,
+	  fixes crash.  Affected file is lib/silcclient/client_notify.c.
+
+	* Fixed mandatory UN and HN SILC public key identifier checking
+	  (both must be present).  Affected file is
+	  lib/silccrypt/silcpk.c.
+
+Tue Aug  7 20:56:06 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed alignment issues with 64-bit CPUs.  Affected files
+	  are lib/silcutil/silcschedule.c and unix/silcunixschedule.c.
+
+	* Added "There are now xx nick's" to "are xx nicks".  Affected
+	  file is apps/irssi/src/fe-common/silc/module-formats.c.
+
+Sat Aug 4 18:37:22 EEST 2007 Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed USERS command user mode handling (integer overflow).
+	  Affected file is lib/silcclient/command_reply.c.
+
+Thu Jul 19 21:08:49 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* Fixed big-endian issues from aes implementation.  Affected
+	  files are lib/silccrypt/aes.c.
+
+	* Fixed lib/silcutil/silcatomic.h compilation on IA64.  Patch
+	  from Jérémy Bobbio.
+
+	* Fixed public key identifier parsing to check lengths
+	  correctly.  Affected file is lib/silccrypt/silcpk.c.
+
+Wed Jul  4 08:06:38 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Toolkit 1.1.2.
+
+	* SILC Client 1.1.2.
+
+Mon Jul  2 17:28:47 CEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* In silc_client_free check that scheduler is allocated before
+	  trying to free it.  Affected file is lib/silcclient/client.c.
+
+	* Fixed buffer overflow in NICK_CHANGE notify.  The destination
+	  buffer for old nickname was too small.  Affected file is
+	  lib/silclient/client_notify.c.
+
+Sun Jul  1 19:15:15 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
+
+	* SILC Server 1.1 Beta1.
+
 Sun Jul  1 12:40:06 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
 
 	* Added support for rekey with PFS when using CTR mode
@@ -57,7 +215,7 @@
 	* Use SILC_VERIFY to assert that silc_rwlock_wrlock can be
 	  called only once per thread on Unix.  Affected file is
 	  lib/silcutil/unix/silcunixthread.c.  Added same for mutex
-	  as well.   Documented same on the API in 
+	  as well.   Documented same on the API in
 	  lib/silcutil/silcmutex.h.
 
 	* Fixed USERS command reply write-lock unlocking.  Affected file
@@ -80,7 +238,7 @@
 	  apps/irssi/src/core/modules-load.c
 
 	* Don't delete hilight entry (because it's just a pointer, not a
-	  copy).  Affected file is 
+	  copy).  Affected file is
 	  apps/irssi/src/fe-common/silc/fe-silc-messages.c
 
 Mon Jun 11 22:10:17 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
@@ -131,7 +289,7 @@
 
 Wed Jun  6 18:33:05 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
 
-	* Added notify callback to silc_schedule_init which can be used to 
+	* Added notify callback to silc_schedule_init which can be used to
 	  set a notify callback for scheduler which is called when task is
 	  added to scheduler or deleted from scheduler.  Affected file
 	  is lib/silcutil/silcschedule.[ch].
@@ -140,7 +298,7 @@
 	  was very short.  Affected file is lib/silcutil/silcschedule.c.
 
 	* Rewrote the SILC scheduler handling in SILC Client to not poll
-	  every few msecs but to use the new notify callback.  Affected 
+	  every few msecs but to use the new notify callback.  Affected
 	  file is apps/irssi/src/silc/core/silc-core.c.
 
 	* Fixed SFTP client library read buffer size which was too small.
@@ -316,7 +474,7 @@
 	  better.  Affected file is lib/silccilent/client_entry.c.
 
 	* Added "foo#2 appears as foo" support to SILC Client when user
-	  leaves or quits and one formatted nickname remain.  Affected file 
+	  leaves or quits and one formatted nickname remain.  Affected file
 	  is apps/irssi/src/silc/core/client_ops.c.
 
 	* Send SilcChannelEntry to application in SILC_NOTIFY_TYPE_SIGNOFF.
@@ -378,7 +536,7 @@
 Tue May 15 23:55:41 EEST 2007  Pekka Riikonen <priikone at silcnet.org>
 
 	* Added SILC_VERIFY macro which is equivalent to SILC_ASSERT
-	  but is compiled always in.  Affected file is 
+	  but is compiled always in.  Affected file is
 	  lib/silcutil/silclog.h.
 
 	* Use SILC_VERIFY in FSM macros instead of SILC_ASSERT which is
@@ -457,7 +615,7 @@
 	  on WIN32.  Affected files are lib/silcutil/silclog_i.h and
 	  silclog.c.
 
-	* Rewrote WIN32 SILC Scheduler.  It now handles non-blocking file 
+	* Rewrote WIN32 SILC Scheduler.  It now handles non-blocking file
 	  descriptors and sockets better.  Though, room for optimization
 	  remains.  Affected file is lib/silcutil/win32/silcwin32schedule.c.
 

Modified: silc-server/branches/upstream/current/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/Makefile.am (original)
+++ silc-server/branches/upstream/current/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./Makefile.ad file in the source tree.
 
 # Source: ./Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/Makefile.in (original)
+++ silc-server/branches/upstream/current/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./Makefile.ad file in the source tree.
 
 # Source: ./Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/TODO
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/TODO?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/TODO (original)
+++ silc-server/branches/upstream/current/TODO Sat Nov 24 19:00:23 2007
@@ -9,38 +9,32 @@
 apps/silcd, The SILC Server	****PARTLY DONE****
 ===========================
 
- o Port all code to use SILC Toolkit 1.1 APIs.
-
- o Dynamic connection support for INFO and MOTD commands.
-
- o Dynamic connection support for JOIN command.  Accept channel name
-   strings of format channel at server.
-
- o Fix/test GETKEY.
-
- o Fix/test MOTD.
+ o Fix/test GETKEY. (***DONE)
+
+ o Fix/test MOTD. (***DONE)
+
+ o Rewrite rehash, HUP.
+
+ o Heartbeat-keepalive.
+
+ o Port all code to use SILC Toolkit 1.1 APIs. (***DONE)
 
  o Remove protocol.[ch].  (***DONE)
 
- o Rewrite connecting accepting. (***TESTING NEEDED)
-
- o Rewrite async connecting. (***TESTING NEEDED)
-
- o Connecting from SILC router to SILC server.
-
- o Rewrite rehash, HUP.
-
- o Heartbeat-keepalive.
-
- o Test backup router resuming protocol.
-
- o Check all packet receive routines that they call silc_packet_free.
+ o Rewrite connecting accepting. (***DONE)
+
+ o Rewrite async connecting. (***DONE)
+
+ o Test backup router resuming protocol. (***DONE)
+
+ o Check all packet receive routines that they call silc_packet_free. 
+   (***DONE)
 
  o Add Web statistics module using lib/silchttp.  Give out server
    statistics. (***DONE)
 
 
-SILC Client	****PARTLY DONE****
+SILC Client	****DONE****
 ===========
 
  o Porting to new Toolkit API and new Client Library API (***DONE)
@@ -48,7 +42,7 @@
  o Improve help files, especially /cmode, /cumode and /key. (***DONE)
 
 
-lib/silcclient, The Client Library	***PARTLY DONE****
+lib/silcclient, The Client Library	***DONE****
 ==================================
 
  o silcclient.h clean up and API rewrites. (***DONE)
@@ -60,8 +54,6 @@
    freeing, finding, etc. rewrite.  Also making them reference counted for
    multi threads use. (***DONE)
 
- o Rewrite silc_client_get_clients_by_channel.
-
  o Rewrite client side WHOIS command (for whois -details). (***DONE)
 
  o Finish all the missing SILC packet processings, rewrites. (***DONE)
@@ -85,25 +77,25 @@
  o Starting key exchange directly, rewrite. (***DONE)
 
  o Channel messages, channel private keys, channel entires, channel
-   search, etc. rewrite. (***TESTING NEEDED)
+   search, etc. rewrite. (***DONE)
 
  o For many APIs leave the hash context allocations to the caller instead
    of using client->sha1hash and client->md5hash, or some kind of thread
    safe (no locking) concept. (***DONE)
 
- o Key agreement rewrite. (***TESTING NEEDED)
+ o Key agreement rewrite. (***DONE)
 
  o Connecting to remote client (***DONE)
 
- o Private message waiting API (in threads) (***TESING NEEDED)
-
- o client_attrs.c, attributes rewrite. (***TESTING NEEDED)
+ o Private message waiting API (in threads) (***TESTING NEEDED)
+
+ o client_attrs.c, attributes rewrite. (***DONE)
 
  o No SilcBuffer lists back to application in command_reply operations.
    Convert them all to real lists and/or structures for easier use.
    (***DONE)
 
- o Nickname formatting rewrite. (***TESTING NEEDED)
+ o Nickname formatting rewrite. (***DONE)
 
  o UDP connections. (***TESTING NEEDED)
 
@@ -114,7 +106,7 @@
  o Porting to use the new util library. (***DONE)
 
 
-lib/silccore/silcpacket.[ch]	****PARTLY DONE****
+lib/silccore/silcpacket.[ch]	****DONE****
 ============================
 
  o SilcPacketEngine. (***DONE)
@@ -143,10 +135,10 @@
    be. (***DONE)
 
 
-lib/silcske/silcske.[ch] 	***PARTLY DONE****
+lib/silcske/silcske.[ch] 	***DONE****
 ========================
 
- o Responder rekey (***TESTING NEEDED)
+ o Responder rekey (***DONE)
 
  o IV Included flag support in SKE (***DONE)
 
@@ -156,7 +148,7 @@
  o SilcConnAuth header file documentation. (***DONE)
 
 
-lib/silccrypt			****PARTLY DONE****
+lib/silccrypt			****DONE****
 =============
 
  o Implement PKCS #1 sign/verify with hash OID. (***TESTING NEEDED)
@@ -176,12 +168,12 @@
  o Assembler AES (***DONE)
 
 
-lib/silcutil			****PARTLY DONE****
+lib/silcutil			****DONE****
 ============
 
  o The regex code from lib/contrib might compile fine on all platforms.
    No need to make it silcutil/unix/ specific.  Add them to generic
-   silcutil.c. (***TESTNG NEEDED)
+   silcutil.c. (***DONE)
 
  o Silc FD Stream to WIN32 (lib/silcutil/silcfdstream.h) (***TESTING NEEDED)
 
@@ -224,7 +216,7 @@
  o Add abstract SilcStream. (***DONE)
 
 
-lib/silcutil/silcsocketstream.[ch]	****PARTY DONE****
+lib/silcutil/silcsocketstream.[ch]	****DONE****
 ==================================
 
  o Add SilcSocketStream (***DONE)
@@ -234,7 +226,7 @@
  o Test QoS after the changes made to socket stream
 
 
-lib/silcutil/silcschedule*.[ch]		****PARTLY DONE****
+lib/silcutil/silcschedule*.[ch]		****DONE****
 ===============================
 
  o Scheduler can be optimized for FD tasks by changing the fd_queue
@@ -262,7 +254,7 @@
  o Change SILC_TASK_CALLBACK to non-static, and remove the macro
    SILC_TASK_CALLBACK_GLOBAL. (***DONE)
 
- o SILC Schedule API changes to WIN32. (***TESTING NEEDED)
+ o SILC Schedule API changes to WIN32. (***DONE)
 
 
 lib/silcutil/silcasync.[ch]	****DONE****
@@ -287,7 +279,7 @@
  o SILC Finite State Machine API.  Replaces SILC Protocol API (***DONE)
 
 
-lib/silcutil/silcnet*, lib/silcutil/*/silc*net*		****PARTLY DONE****
+lib/silcutil/silcnet*, lib/silcutil/*/silc*net*		****DONE****
 ===============================================
 
  o Add UDP interface (***DONE)
@@ -297,17 +289,17 @@
  o New network interfaces (***DONE)
 
 
-lib/silcmath			****PARTLY DONE****
-============
-
- o Test on x86_64.
+lib/silcmath			****DONE****
+============
+
+ o Test on x86_64. (***TESTING NEEDED)
 
  o Change LTM and TFM function names when importing to SILC tree to avoid
    rare linking problems on system that has same named symbols already in
    the system. (***DONE)
 
 
-lib/silcutil/symbian/		****PARTLY DONE****
+lib/silcutil/symbian/		****DONE****
 =====================
 
   o lib/silcutil/symbian routines missing or not completed.

Modified: silc-server/branches/upstream/current/apps/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/Makefile.am (original)
+++ silc-server/branches/upstream/current/apps/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./apps/Makefile.ad file in the source tree.
 
 # Source: ./apps/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/apps/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/Makefile.in (original)
+++ silc-server/branches/upstream/current/apps/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./apps/Makefile.ad file in the source tree.
 
 # Source: ./apps/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/apps/silcd/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/Makefile.am (original)
+++ silc-server/branches/upstream/current/apps/silcd/Makefile.am Sat Nov 24 19:00:23 2007
@@ -39,7 +39,7 @@
 LIBS = $(SILC_COMMON_LIBS)
 LDADD =
 
-EXTRA_DIST = *.h
+EXTRA_DIST = silc-server.spec *.h
 
 install-dirs-server:
 	-mkdir -p $(docdir)

Modified: silc-server/branches/upstream/current/apps/silcd/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/Makefile.in (original)
+++ silc-server/branches/upstream/current/apps/silcd/Makefile.in Sat Nov 24 19:00:23 2007
@@ -297,7 +297,7 @@
 	server_http.c
 
 LDADD = 
-EXTRA_DIST = *.h
+EXTRA_DIST = silc-server.spec *.h
 
 #
 # INCLUDE defines

Modified: silc-server/branches/upstream/current/apps/silcd/command_reply.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/command_reply.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/command_reply.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/command_reply.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: command_reply.c,v 1.116.2.2 2007/06/10 19:32:58 priikone Exp $ */
+/* $Id: command_reply.c,v 1.116.2.3 2007/11/11 11:22:58 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "server_internal.h"
@@ -515,7 +515,7 @@
     if (!nickname) {
       SILC_LOG_ERROR(("Malformed nickname '%s' received in WHOWAS reply "
 		      "from %s",
-		      hostname ? hostname : "", nick));
+		      nick, hostname ? hostname : ""));
       return FALSE;
     }
 
@@ -534,12 +534,10 @@
     client->data.status |= SILC_IDLIST_STATUS_RESOLVED;
     client->data.status &= ~SILC_IDLIST_STATUS_RESOLVING;
 
-    /* Remove the old cache entry and create a new one */
-    silc_idcache_del_by_context(global ? server->global_list->clients :
-				server->local_list->clients, client, NULL);
-    silc_idcache_add(global ? server->global_list->clients :
-		     server->local_list->clients, nickname, client->id,
-		     client);
+    /* Update cache entry */
+    silc_idcache_update_by_context(global ? server->global_list->clients :
+				   server->local_list->clients, client, NULL,
+				   nickname, TRUE);
   }
 
   /* If client is global and is not on any channel then add that we'll
@@ -675,17 +673,13 @@
 	  return FALSE;
 	}
 
-	/* Remove the old cache entry */
-	silc_idcache_del_by_context(global ? server->global_list->clients :
-				    server->local_list->clients, client, NULL);
-
 	silc_free(client->nickname);
 	client->nickname = strdup(nick);
 
-	/* Add new cache entry */
-	silc_idcache_add(global ? server->global_list->clients :
-			 server->local_list->clients, name, client->id,
-			 client);
+	/* Update the context */
+	silc_idcache_update_by_context(global ? server->global_list->clients :
+				       server->local_list->clients, client,
+				       NULL, name, TRUE);
       }
 
       if (info) {

Modified: silc-server/branches/upstream/current/apps/silcd/idlist.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/idlist.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/idlist.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/idlist.c Sat Nov 24 19:00:23 2007
@@ -17,7 +17,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: idlist.c,v 1.89.2.2 2007/07/01 16:06:58 priikone Exp $ */
+/* $Id: idlist.c,v 1.89.2.3 2007/11/11 11:25:44 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "idlist.h"
@@ -55,8 +55,6 @@
 
   if (idata->hash)
     silc_hash_free(idata->hash);
-  if (idata->public_key)
-    silc_pkcs_public_key_free(idata->public_key);
 
   idata->hash = NULL;
   idata->public_key = NULL;
@@ -338,6 +336,8 @@
   }
 
   client = silc_calloc(1, sizeof(*client));
+  if (!client)
+    return NULL;
   client->nickname = nickname;
   client->username = username ? strdup(username) : NULL;
   client->userinfo = userinfo;

Modified: silc-server/branches/upstream/current/apps/silcd/idlist.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/idlist.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/idlist.h (original)
+++ silc-server/branches/upstream/current/apps/silcd/idlist.h Sat Nov 24 19:00:23 2007
@@ -554,6 +554,7 @@
   const char *hostname;
   const char *ip;
   SilcUInt16 port;
+  SilcConnectionType conn_type;
 } *SilcUnknownEntry;
 
 /* Prototypes */

Modified: silc-server/branches/upstream/current/apps/silcd/packet_receive.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/packet_receive.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/packet_receive.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/packet_receive.c Sat Nov 24 19:00:23 2007
@@ -3433,6 +3433,8 @@
   SilcPublicKey public_key;
   const char *cipher, *hostname, *ip;
 
+  SILC_LOG_DEBUG(("Resuming client"));
+
   silc_socket_stream_get_info(silc_packet_stream_get_stream(sock),
 			      NULL, &hostname, &ip, NULL);
 
@@ -3696,6 +3698,7 @@
     /* Take new keys and stuff into use in the old entry */
     silc_idlist_del_data(detached_client);
     silc_idlist_add_data(detached_client, idata);
+    idata->public_key = NULL;
 
     if (detached_client->data.public_key) {
       /* Add the resumed client's public key back to repository. */
@@ -3807,14 +3810,17 @@
       silc_buffer_free(nidp);
     }
 
-    /* Add the client again to the ID cache to get it to correct list */
-    if (!silc_idcache_del_by_context(server->local_list->clients, client,
-				     NULL))
-      silc_idcache_del_by_context(server->global_list->clients, client, NULL);
-    silc_free(client->id);
-    *client->id = client_id;
-    silc_idcache_add(server->local_list->clients, nicknamec,
-		     client->id, client);
+    /* Update entry */
+    if (!silc_idcache_update_by_context(server->local_list->clients, client,
+					&client_id, NULL, FALSE))
+      silc_idcache_update_by_context(server->global_list->clients, client,
+				     &client_id, NULL, FALSE);
+
+    /* Move entry to local list if it is in global list */
+    if (silc_idcache_find_by_context(server->global_list->clients, client,
+				     &id_cache))
+      silc_idcache_move(server->global_list->clients,
+			server->local_list->clients, id_cache);
 
     /* Send some nice info to the client */
     silc_server_send_connect_notifys(server, sock, client);
@@ -3975,15 +3981,18 @@
 	server_entry->server_type == SILC_ROUTER)
       local = FALSE;
 
-    /* Change the client to correct list. */
-    if (!silc_idcache_del_by_context(server->local_list->clients,
-				     detached_client, NULL))
-      silc_idcache_del_by_context(server->global_list->clients,
-				  detached_client, NULL);
-    silc_idcache_add(local && server->server_type == SILC_ROUTER ?
-		     server->local_list->clients :
-		     server->global_list->clients, nicknamec,
-		     detached_client->id, detached_client);
+    /* Move entry to correct list */
+    if (local && server->server_type == SILC_ROUTER) {
+      if (silc_idcache_find_by_context(server->global_list->clients,
+				       detached_client, &id_cache))
+	silc_idcache_move(server->global_list->clients,
+			  server->local_list->clients, id_cache);
+    } else {
+      if (silc_idcache_find_by_context(server->local_list->clients,
+				       detached_client, &id_cache))
+	silc_idcache_move(server->local_list->clients,
+			  server->global_list->clients, id_cache);
+    }
 
     /* Change the owner of the client */
     detached_client->router = server_entry;

Modified: silc-server/branches/upstream/current/apps/silcd/packet_send.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/packet_send.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/packet_send.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/packet_send.c Sat Nov 24 19:00:23 2007
@@ -295,7 +295,7 @@
   int k;
 
   /* This doesn't send channel message packets */
-  assert(type != SILC_PACKET_CHANNEL_MESSAGE);
+  SILC_ASSERT(type != SILC_PACKET_CHANNEL_MESSAGE);
 
   /* If there are global users in the channel we will send the message
      first to our router for further routing. */
@@ -399,6 +399,8 @@
 static SilcBool
 silc_server_packet_relay_to_channel_encrypt(SilcServer server,
 					    SilcPacketStream sender,
+					    void *sender_id,
+					    SilcIdType sender_type,
 					    SilcChannelEntry channel,
 					    unsigned char *data,
 					    unsigned int data_len)
@@ -451,8 +453,9 @@
 
     memcpy(iv, data + (data_len - iv_len - mac_len), iv_len);
 
-    src_id.type = SILC_ID_SERVER;
-    src_id.u.server_id = *((SilcServerEntry)idata)->id;
+    SILC_ASSERT(sender_type == SILC_ID_CLIENT);
+    src_id.type = SILC_ID_CLIENT;
+    src_id.u.client_id = *((SilcClientID *)sender_id);
     dst_id.type = SILC_ID_CHANNEL;
     dst_id.u.channel_id = *channel->id;
 
@@ -502,6 +505,7 @@
      channel key. If the channel key does not exist, then we know we
      don't have a single local user on the channel. */
   if (!silc_server_packet_relay_to_channel_encrypt(server, sender_sock,
+						   sender_id, sender_type,
 						   channel, data,
 						   data_len))
     return;

Modified: silc-server/branches/upstream/current/apps/silcd/server.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/server.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/server.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/server.c Sat Nov 24 19:00:23 2007
@@ -103,12 +103,13 @@
        !(idata->status & SILC_IDLIST_STATUS_REGISTERED)) &&
       packet->type != SILC_PACKET_NEW_CLIENT &&
       packet->type != SILC_PACKET_NEW_SERVER &&
+      packet->type != SILC_PACKET_RESUME_CLIENT &&
       packet->type != SILC_PACKET_CONNECTION_AUTH_REQUEST &&
       packet->type != SILC_PACKET_DISCONNECT)
     return FALSE;
 
-  /* NEW_CLIENT and NEW_SERVER are accepted only without source ID
-     and for unregistered connection. */
+  /* NEW_CLIENT and NEW_SERVER are accepted only without source ID and
+     for unregistered connection. */
   if (packet->src_id && (packet->type == SILC_PACKET_NEW_CLIENT ||
 			 packet->type == SILC_PACKET_NEW_SERVER) &&
       (idata->status & SILC_IDLIST_STATUS_REGISTERED))
@@ -130,7 +131,8 @@
 	silc_id_str2id(packet->src_id, packet->src_id_len,
 		       packet->src_id_type, &client_id, sizeof(client_id))) {
       if (!SILC_ID_CLIENT_COMPARE(client->id, &client_id)) {
-	SILC_LOG_DEBUG(("Packet source is not same as sender"));
+	SILC_LOG_DEBUG(("Packet source is not same as sender, packet %s",
+			silc_get_packet_name(packet->type)));
 	return FALSE;
       }
     }
@@ -200,6 +202,7 @@
   if (server->router_conn && server->router_conn->sock == stream &&
       !server->router && server->standalone) {
     silc_server_create_connections(server);
+    silc_server_free_sock_user_data(server, stream, NULL);
   } else {
     /* If backup disconnected then mark that resuming will not be allowed */
      if (server->server_type == SILC_ROUTER && !server->backup_router &&
@@ -666,6 +669,10 @@
     }
   }
 
+  silc_schedule_task_del_by_context(server->schedule, server);
+  silc_schedule_uninit(server->schedule);
+  server->schedule = NULL;
+
   silc_idcache_free(server->local_list->clients);
   silc_idcache_free(server->local_list->servers);
   silc_idcache_free(server->local_list->channels);
@@ -682,10 +689,6 @@
   silc_dlist_uninit(server->expired_clients);
   silc_skr_free(server->repository);
   silc_packet_engine_stop(server->packet_engine);
-
-  silc_schedule_task_del_by_context(server->schedule, server);
-  silc_schedule_uninit(server->schedule);
-  server->schedule = NULL;
 
   silc_free(server->local_list);
   silc_free(server->global_list);
@@ -915,14 +918,18 @@
     }
   }
 
+  if (server->server_type != SILC_ROUTER) {
+    server->stat.servers = 1;
+    server->stat.cell_servers = 1;
+  } else {
+    server->stat.routers = 1;
+  }
+
   /* If we are normal server we'll retrieve network statisticial information
      once in a while from the router. */
   if (server->server_type != SILC_ROUTER)
     silc_schedule_task_add_timeout(server->schedule, silc_server_get_stats,
 				   server, 10, 0);
-
-  if (server->server_type == SILC_ROUTER)
-    server->stat.routers++;
 
   /* Start packet engine */
   server->packet_engine =
@@ -1202,6 +1209,9 @@
     while ((ps = silc_dlist_get(list))) {
       SilcIDListData idata = silc_packet_get_context(ps);
 
+      if (!silc_packet_stream_is_valid(ps))
+	continue;
+
       if (idata)
 	idata->status &= ~SILC_IDLIST_STATUS_DISABLED;
 
@@ -1227,6 +1237,8 @@
 				     silc_server_connect_router);
   silc_schedule_task_del_by_callback(server->schedule,
 				     silc_server_connect_to_router_retry);
+  silc_schedule_task_del_by_callback(server->schedule,
+				     silc_server_connect_to_router);
 
   silc_schedule_stop(server->schedule);
 
@@ -1330,9 +1342,9 @@
   SilcID remote_id;
   const char *ip;
 
-  SILC_LOG_DEBUG(("Connection authentication completed"));
-
-  sconn->op = NULL;
+  SILC_LOG_DEBUG(("Connection %p authentication completed", sconn));
+
+  entry->op = NULL;
 
   if (success == FALSE) {
     /* Authentication failed */
@@ -1372,6 +1384,12 @@
       silc_free(entry);
       return;
     }
+
+    /* Statistics */
+    server->stat.my_servers++;
+    if (server->server_type == SILC_ROUTER)
+      server->stat.servers++;
+    SILC_LOG_DEBUG(("my_servers %d", server->stat.my_servers));
 
     silc_idlist_add_data(id_entry, (SilcIDListData)entry);
     break;
@@ -1442,6 +1460,12 @@
     idata->status |= (SILC_IDLIST_STATUS_REGISTERED |
 		      SILC_IDLIST_STATUS_LOCAL);
     idata->sconn = sconn;
+
+    /* Statistics */
+    server->stat.my_routers++;
+    if (server->server_type == SILC_ROUTER)
+      server->stat.routers++;
+    SILC_LOG_DEBUG(("my_routers %d", server->stat.my_routers));
 
     if (!sconn->backup) {
       /* Mark this router our primary router if we're still standalone */
@@ -1528,7 +1552,6 @@
   /* Set the entry as packet stream context */
   silc_packet_set_context(sconn->sock, id_entry);
 
- out:
   /* Call the completion callback to indicate that we've connected to
      the router */
   if (sconn && sconn->callback)
@@ -1561,7 +1584,9 @@
   SilcHmac hmac_send, hmac_receive;
   SilcHash hash;
 
-  sconn->op = NULL;
+  SILC_LOG_DEBUG(("Connection %p, SKE completed", sconn));
+
+  entry->op = NULL;
 
   if (status != SILC_SKE_STATUS_OK) {
     /* SKE failed */
@@ -1635,7 +1660,7 @@
   entry->data.rekey = rekey;
 
   /* Start connection authentication */
-  sconn->op =
+  entry->op =
     silc_connauth_initiator(connauth, server->server_type == SILC_SERVER ?
 			    SILC_CONN_SERVER : SILC_CONN_ROUTER, auth_meth,
 			    auth_data, auth_data_len,
@@ -1698,7 +1723,7 @@
     params.flags |= SILC_SKE_SP_FLAG_PFS;
 
   /* Start SILC Key Exchange protocol */
-  SILC_LOG_DEBUG(("Starting key exchange protocol"));
+  SILC_LOG_DEBUG(("Starting key exchange protocol, connection %p", sconn));
   ske = silc_ske_alloc(server->rng, server->schedule, server->repository,
 		       server->public_key, server->private_key, sconn);
   if (!ske) {
@@ -1715,7 +1740,7 @@
   /* Start key exchange protocol */
   params.version = silc_version_string;
   params.timeout_secs = server->config->key_exchange_timeout;
-  sconn->op = silc_ske_initiator(ske, sconn->sock, &params, NULL);
+  entry->op = silc_ske_initiator(ske, sconn->sock, &params, NULL);
 }
 
 /* Timeout callback that will be called to retry connecting to remote
@@ -1782,7 +1807,7 @@
 
   switch (status) {
   case SILC_NET_OK:
-    SILC_LOG_DEBUG(("Connection to %s:%d established",
+    SILC_LOG_DEBUG(("Connection %p to %s:%d established", sconn,
 		    sconn->remote_host, sconn->remote_port));
 
     /* Continue with key exchange protocol */
@@ -2022,7 +2047,16 @@
     if (cconfig->publickeys)
       *repository = server->repository;
 
-    entry->data.conn_type = conn_type;
+    if (cconfig->publickeys) {
+      if (server->config->prefer_passphrase_auth) {
+	*repository = NULL;
+      } else {
+	*passphrase = NULL;
+	*passphrase_len = 0;
+      }
+    }
+
+    entry->conn_type = conn_type;
     return TRUE;
   }
 
@@ -2043,7 +2077,16 @@
     if (sconfig->publickeys)
       *repository = server->repository;
 
-    entry->data.conn_type = conn_type;
+    if (sconfig->publickeys) {
+      if (server->config->prefer_passphrase_auth) {
+	*repository = NULL;
+      } else {
+	*passphrase = NULL;
+	*passphrase_len = 0;
+      }
+    }
+
+    entry->conn_type = conn_type;
     return TRUE;
   }
 
@@ -2058,7 +2101,16 @@
     if (rconfig->publickeys)
       *repository = server->repository;
 
-    entry->data.conn_type = conn_type;
+    if (rconfig->publickeys) {
+      if (server->config->prefer_passphrase_auth) {
+	*repository = NULL;
+      } else {
+	*passphrase = NULL;
+	*passphrase_len = 0;
+      }
+    }
+
+    entry->conn_type = conn_type;
     return TRUE;
   }
 
@@ -2097,14 +2149,14 @@
 
   SILC_LOG_DEBUG(("Checking whether connection is allowed"));
 
-  switch (entry->data.conn_type) {
+  switch (entry->conn_type) {
   case SILC_CONN_CLIENT:
     {
       SilcClientEntry client;
       SilcServerConfigClient *conn = entry->cconfig.ref_ptr;
 
       /* Verify whether this connection is after all allowed to connect */
-      if (!silc_server_connection_allowed(server, sock, entry->data.conn_type,
+      if (!silc_server_connection_allowed(server, sock, entry->conn_type,
 					  &server->config->param,
 					  conn->param,
 					  silc_connauth_get_ske(connauth))) {
@@ -2157,6 +2209,7 @@
 	goto out;
       }
       entry->data.status |= SILC_IDLIST_STATUS_LOCAL;
+      entry->data.conn_type = SILC_CONN_CLIENT;
 
       /* Statistics */
       server->stat.my_clients++;
@@ -2184,6 +2237,7 @@
       }
 
       /* Add public key to repository */
+      SILC_LOG_DEBUG(("Add client public key to repository"));
       if (!silc_server_get_public_key_by_client(server, client, NULL))
 	silc_skr_add_public_key_simple(server->repository,
 				       entry->data.public_key,
@@ -2210,7 +2264,7 @@
 	 and we do not have connection to primary router, do not allow
 	 the connection. */
       if (server->server_type == SILC_BACKUP_ROUTER &&
-	  entry->data.conn_type == SILC_CONN_SERVER &&
+	  entry->conn_type == SILC_CONN_SERVER &&
 	  !SILC_PRIMARY_ROUTE(server)) {
 	SILC_LOG_INFO(("Will not accept server connection because we do "
 		       "not have primary router connection established"));
@@ -2222,10 +2276,10 @@
 	goto out;
       }
 
-      if (entry->data.conn_type == SILC_CONN_ROUTER) {
+      if (entry->conn_type == SILC_CONN_ROUTER) {
 	/* Verify whether this connection is after all allowed to connect */
 	if (!silc_server_connection_allowed(server, sock,
-					    entry->data.conn_type,
+					    entry->conn_type,
 					    &server->config->param,
 					    rconn ? rconn->param : NULL,
 					    silc_connauth_get_ske(connauth))) {
@@ -2257,10 +2311,10 @@
 	}
       }
 
-      if (entry->data.conn_type == SILC_CONN_SERVER) {
+      if (entry->conn_type == SILC_CONN_SERVER) {
 	/* Verify whether this connection is after all allowed to connect */
 	if (!silc_server_connection_allowed(server, sock,
-					    entry->data.conn_type,
+					    entry->conn_type,
 					    &server->config->param,
 					    srvconn ? srvconn->param : NULL,
 					    silc_connauth_get_ske(connauth))) {
@@ -2316,11 +2370,11 @@
       }
 
       SILC_LOG_DEBUG(("Remote host is %s",
-		      entry->data.conn_type == SILC_CONN_SERVER ?
+		      entry->conn_type == SILC_CONN_SERVER ?
 		      "server" : (backup_router ?
 				  "backup router" : "router")));
       SILC_LOG_INFO(("Connection %s (%s) is %s", entry->hostname,
-		     entry->ip, entry->data.conn_type == SILC_CONN_SERVER ?
+		     entry->ip, entry->conn_type == SILC_CONN_SERVER ?
 		     "server" : (backup_router ?
 				 "backup router" : "router")));
 
@@ -2329,15 +2383,15 @@
 	 server. We mark ourselves as router for this server if we really
 	 are router. */
       new_server =
-	silc_idlist_add_server((entry->data.conn_type == SILC_CONN_SERVER ?
+	silc_idlist_add_server((entry->conn_type == SILC_CONN_SERVER ?
 				server->local_list : (backup_router ?
 						      server->local_list :
 						      server->global_list)),
 			       NULL,
-			       (entry->data.conn_type == SILC_CONN_SERVER ?
+			       (entry->conn_type == SILC_CONN_SERVER ?
 				SILC_SERVER : SILC_ROUTER),
 			       NULL,
-			       (entry->data.conn_type == SILC_CONN_SERVER ?
+			       (entry->conn_type == SILC_CONN_SERVER ?
 				server->id_entry : (backup_router ?
 						    server->id_entry : NULL)),
 			       sock);
@@ -2349,6 +2403,7 @@
 	goto out;
       }
       entry->data.status |= SILC_IDLIST_STATUS_LOCAL;
+      entry->data.conn_type = entry->conn_type;
 
       id_entry = (void *)new_server;
 
@@ -2488,6 +2543,8 @@
   idata->public_key = silc_pkcs_public_key_copy(prop->public_key);
   pk = silc_pkcs_public_key_encode(idata->public_key, &pk_len);
   silc_hash_make(server->sha1hash, pk, pk_len, idata->fingerprint);
+
+  silc_hash_alloc(silc_hash_get_name(prop->hash), &idata->hash);
 
   SILC_LOG_DEBUG(("Starting connection authentication"));
   server->stat.auth_attempts++;

Modified: silc-server/branches/upstream/current/apps/silcd/server_query.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/server_query.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/server_query.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/server_query.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: server_query.c,v 1.30.2.3 2007/06/24 17:08:09 priikone Exp $ */
+/* $Id: server_query.c,v 1.30.2.5 2007/11/18 09:48:43 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "server_internal.h"
@@ -397,11 +397,11 @@
        returned error. */
     if (query->nick_server[0] && !query->dynamic_retry &&
 	!silc_server_num_sockets_by_remote(server, query->nick_server,
-					   query->nick_server, 1334, type)) {
+					   query->nick_server, 706, type)) {
       SILC_LOG_DEBUG(("Retry query by connecting to %s:%d",
 		      query->nick_server, 706));
       silc_server_create_connection(server, FALSE, TRUE, query->nick_server,
-				    1334, silc_server_query_connected,
+				    706, silc_server_query_connected,
 				    query);
       query->dynamic_retry = TRUE;
       query->resolved = FALSE;
@@ -1516,6 +1516,7 @@
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   SilcStatus status;
   unsigned char *tmp;
+  char *tmp2;
   SilcUInt32 len;
   SilcBuffer idp;
   int i, k, valid_count;
@@ -1642,8 +1643,8 @@
 	    hsock = entry->connection;
 	    silc_strncat(uh, sizeof(uh), "@", 1);
 	    silc_socket_stream_get_info(silc_packet_stream_get_stream(hsock),
-					NULL, (const char **)&tmp, NULL, NULL);
-	    silc_strncat(uh, sizeof(uh), tmp, strlen(tmp));
+					NULL, (const char **)&tmp2, NULL, NULL);
+	    silc_strncat(uh, sizeof(uh), tmp2, strlen(tmp2));
 	  }
 
 	  if (idata->conn_type == SILC_CONN_CLIENT)
@@ -1733,9 +1734,9 @@
 	    hsock = entry->connection;
 	    silc_strncat(uh, sizeof(uh), "@", 1);
 	    silc_socket_stream_get_info(silc_packet_stream_get_stream(hsock),
-					NULL, (const char **)&tmp,
+					NULL, (const char **)&tmp2,
 					NULL, NULL);
-	    silc_strncat(uh, sizeof(uh), tmp, strlen(tmp));
+	    silc_strncat(uh, sizeof(uh), tmp2, strlen(tmp2));
 	  }
 
 	  silc_server_send_command_reply(server, cmd->sock, query->querycmd,

Modified: silc-server/branches/upstream/current/apps/silcd/server_util.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/server_util.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/server_util.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/server_util.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: server_util.c,v 1.83.2.3 2007/07/01 16:06:58 priikone Exp $ */
+/* $Id: server_util.c,v 1.83.2.4 2007/11/11 11:25:44 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "server_internal.h"
@@ -1111,6 +1111,13 @@
   silc_skr_find_set_context(find, key_context);
   silc_skr_find(server->repository, server->schedule,
 		find, find_callback, &public_key);
+
+#ifdef SILC_DEBUG
+  if (public_key)
+    SILC_LOG_DEBUG(("Found public key"));
+  else
+    SILC_LOG_DEBUG(("Public key not found"));
+#endif /* SILC_DEBUG */
 
   return public_key;
 }

Modified: silc-server/branches/upstream/current/apps/silcd/serverconfig.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/serverconfig.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/serverconfig.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/serverconfig.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: serverconfig.c,v 1.78.2.4 2007/07/01 16:06:58 priikone Exp $ */
+/* $Id: serverconfig.c,v 1.78.2.6 2007/11/11 11:20:21 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "server_internal.h"
@@ -183,8 +183,8 @@
   return TRUE;
 }
 
-static SilcBool my_parse_publickeydir(const char *dirname, void **auth_data,
-				      SilcSKRKeyUsage usage)
+static int my_parse_publickeydir(const char *dirname, void **auth_data,
+				 SilcSKRKeyUsage usage)
 {
   int total = 0;
   struct dirent *get_file;
@@ -193,7 +193,7 @@
   if (!(dp = opendir(dirname))) {
     SILC_SERVER_LOG_ERROR(("Error while parsing config file: "
 			   "Could not open directory \"%s\"", dirname));
-    return FALSE;
+    return -1;
   }
 
   /* errors are not considered fatal */
@@ -216,14 +216,14 @@
       SILC_SERVER_LOG_ERROR(("Error stating file %s: %s", buf,
 			     strerror(errno)));
     } else if (S_ISREG(check_file.st_mode)) {
-      my_parse_authdata(SILC_AUTH_PUBLIC_KEY, buf, auth_data, NULL,
-			usage, NULL);
-      total++;
+      if (my_parse_authdata(SILC_AUTH_PUBLIC_KEY, buf, auth_data, NULL,
+			    usage, NULL))
+	total++;
     }
   }
 
   SILC_LOG_DEBUG(("Tried to load %d public keys in \"%s\"", total, dirname));
-  return TRUE;
+  return total;
 }
 
 /* Callbacks */
@@ -233,11 +233,7 @@
   SilcServerConfig config = (SilcServerConfig) context;
   int got_errno = 0;
 
-  if (!strcmp(name, "module_path")) {
-    CONFIG_IS_DOUBLE(config->module_path);
-    config->module_path = (*(char *)val ? strdup((char *) val) : NULL);
-  }
-  else if (!strcmp(name, "prefer_passphrase_auth")) {
+  if (!strcmp(name, "prefer_passphrase_auth")) {
     config->prefer_passphrase_auth = *(SilcBool *)val;
   }
   else if (!strcmp(name, "require_reverse_lookup")) {
@@ -380,10 +376,6 @@
     CONFIG_IS_DOUBLE(tmp->name);
     tmp->name = strdup((char *) val);
   }
-  else if (!strcmp(name, "module")) {
-    CONFIG_IS_DOUBLE(tmp->module);
-    tmp->module = (*(char *)val ? strdup((char *) val) : NULL);
-  }
   else if (!strcmp(name, "keylength")) {
     tmp->key_length = *(SilcUInt32 *)val;
   }
@@ -396,7 +388,6 @@
 
  got_err:
   silc_free(tmp->name);
-  silc_free(tmp->module);
   silc_free(tmp);
   config->tmp = NULL;
   return got_errno;
@@ -428,10 +419,6 @@
     CONFIG_IS_DOUBLE(tmp->name);
     tmp->name = strdup((char *) val);
   }
-  else if (!strcmp(name, "module")) {
-    CONFIG_IS_DOUBLE(tmp->module);
-    tmp->module = (*(char *)val ? strdup((char *) val) : NULL);
-  }
   else if (!strcmp(name, "blocklength")) {
     tmp->block_length = *(int *)val;
   }
@@ -444,7 +431,6 @@
 
  got_err:
   silc_free(tmp->name);
-  silc_free(tmp->module);
   silc_free(tmp);
   config->tmp = NULL;
   return got_errno;
@@ -881,18 +867,22 @@
   else if (!strcmp(name, "publickey")) {
     if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
 			   (void *)&config->server->repository, NULL,
+			   SILC_SKR_USAGE_AUTH |
 			   SILC_SKR_USAGE_KEY_AGREEMENT, NULL)) {
       got_errno = SILC_CONFIG_EPRINTLINE;
       goto got_err;
     }
+    tmp->publickeys = TRUE;
   }
   else if (!strcmp(name, "publickeydir")) {
-    if (!my_parse_publickeydir((char *) val,
-			       (void *)&config->server->repository,
-			       SILC_SKR_USAGE_KEY_AGREEMENT)) {
+    if (my_parse_publickeydir((char *) val,
+			      (void *)&config->server->repository,
+			      SILC_SKR_USAGE_AUTH |
+			      SILC_SKR_USAGE_KEY_AGREEMENT) < 0) {
       got_errno = SILC_CONFIG_EPRINTLINE;
       goto got_err;
     }
+    tmp->publickeys = TRUE;
   }
   else if (!strcmp(name, "params")) {
     CONFIG_IS_DOUBLE(tmp->param);
@@ -960,6 +950,7 @@
       got_errno = SILC_CONFIG_EPRINTLINE;
       goto got_err;
     }
+    tmp->publickeys = TRUE;
   }
   else
     return SILC_CONFIG_EINTERNAL;
@@ -1057,10 +1048,12 @@
     CONFIG_IS_DOUBLE(tmp->publickeys);
     if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
 			   (void *)&config->server->repository, NULL,
+			   SILC_SKR_USAGE_AUTH |
 			   SILC_SKR_USAGE_KEY_AGREEMENT, NULL)) {
       got_errno = SILC_CONFIG_EPRINTLINE;
       goto got_err;
     }
+    tmp->publickeys = TRUE;
   }
   else if (!strcmp(name, "params")) {
     CONFIG_IS_DOUBLE(tmp->param);
@@ -1134,10 +1127,12 @@
     CONFIG_IS_DOUBLE(tmp->publickeys);
     if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
 			   (void *)&config->server->repository, NULL,
+			   SILC_SKR_USAGE_AUTH |
 			   SILC_SKR_USAGE_KEY_AGREEMENT, NULL)) {
       got_errno = SILC_CONFIG_EPRINTLINE;
       goto got_err;
     }
+    tmp->publickeys = TRUE;
   }
   else if (!strcmp(name, "params")) {
     CONFIG_IS_DOUBLE(tmp->param);
@@ -1188,7 +1183,6 @@
 
 /* known config options tables */
 static const SilcConfigTable table_general[] = {
-  { "module_path",		SILC_CONFIG_ARG_STRE,	fetch_generic,	NULL },
   { "prefer_passphrase_auth",	SILC_CONFIG_ARG_TOGGLE,	fetch_generic,	NULL },
   { "require_reverse_lookup",	SILC_CONFIG_ARG_TOGGLE,	fetch_generic,	NULL },
   { "connections_max",		SILC_CONFIG_ARG_INT,	fetch_generic,	NULL },
@@ -1225,7 +1219,6 @@
 
 static const SilcConfigTable table_cipher[] = {
   { "name",		SILC_CONFIG_ARG_STR,	fetch_cipher,	NULL },
-  { "module",		SILC_CONFIG_ARG_STRE,	fetch_cipher,	NULL },
   { "keylength",	SILC_CONFIG_ARG_INT,	fetch_cipher,	NULL },
   { "blocklength",	SILC_CONFIG_ARG_INT,	fetch_cipher,	NULL },
   { 0, 0, 0, 0 }
@@ -1233,7 +1226,6 @@
 
 static const SilcConfigTable table_hash[] = {
   { "name",		SILC_CONFIG_ARG_STR,	fetch_hash,	NULL },
-  { "module",		SILC_CONFIG_ARG_STRE,	fetch_hash,	NULL },
   { "blocklength",	SILC_CONFIG_ARG_INT,	fetch_hash,	NULL },
   { "digestlength",	SILC_CONFIG_ARG_INT,	fetch_hash,	NULL },
   { 0, 0, 0, 0 }
@@ -1612,7 +1604,6 @@
   SILC_LOG_DEBUG(("Freeing config context"));
 
   /* Destroy general config stuff */
-  silc_free(config->module_path);
   silc_free(config->debug_string);
   silc_free(config->param.version_protocol);
   silc_free(config->param.version_software);
@@ -1666,12 +1657,10 @@
   SILC_SERVER_CONFIG_LIST_DESTROY(SilcServerConfigCipher,
 				  config->cipher)
     silc_free(di->name);
-    silc_free(di->module);
     silc_free(di);
   }
   SILC_SERVER_CONFIG_LIST_DESTROY(SilcServerConfigHash, config->hash)
     silc_free(di->name);
-    silc_free(di->module);
     silc_free(di);
   }
   SILC_SERVER_CONFIG_LIST_DESTROY(SilcServerConfigHmac, config->hmac)

Added: silc-server/branches/upstream/current/apps/silcd/silc-server.spec
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/silc-server.spec?rev=186&op=file
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/silc-server.spec (added)
+++ silc-server/branches/upstream/current/apps/silcd/silc-server.spec Sat Nov 24 19:00:23 2007
@@ -1,0 +1,51 @@
+Summary: SILC Server
+Name: silc-server
+Version: 1.1
+Release: 0.fc8
+License: GPL
+Group: Applications/Communications
+URL: http://silcnet.org/
+Source0: silc-server-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+BuildRequires: silc-toolkit-devel
+Requires: silc-toolkit >= 1.1
+
+%description
+SILC (Secure Internet Live Conferencing) is a protocol which provides
+secure conferencing services on the Internet over insecure channel.
+
+%prep
+%setup -q
+
+%build
+%configure --prefix=%{_prefix} \
+           --mandir=%{_mandir} \
+           --infodir=%{_infodir} \
+           --bindir=%{_bindir} \
+           --sbindir=%{_sbindir} \
+           --datadir=%{_datadir} \
+           --enable-ipv6
+make -j4
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+mv $RPM_BUILD_ROOT/%{_datadir}/doc/silc-server \
+  $RPM_BUILD_ROOT/%{_datadir}/doc/silc-server-%version
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (755,root,root,755)
+%{_sbindir}/*
+%defattr (644,root,root,755)
+%{_sysconfdir}/silcd.conf
+%{_sysconfdir}/silcalgs.conf
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+%doc %{_datadir}/doc
+
+%changelog
+* Sun Nov 18 2007 - Pekka Riikonen <priikone at silcnet.org>
+- Initial version

Modified: silc-server/branches/upstream/current/apps/silcd/silcd.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/apps/silcd/silcd.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/apps/silcd/silcd.c (original)
+++ silc-server/branches/upstream/current/apps/silcd/silcd.c Sat Nov 24 19:00:23 2007
@@ -22,7 +22,7 @@
  * This is the main program for the SILC daemon. This parses command
  * line arguments and creates the server object.
  */
-/* $Id: silcd.c,v 1.65.2.2 2007/07/01 16:06:58 priikone Exp $ */
+/* $Id: silcd.c,v 1.65.2.3 2007/11/03 21:24:13 priikone Exp $ */
 
 #include "serverincludes.h"
 #include "server_internal.h"
@@ -245,9 +245,7 @@
 
 SILC_TASK_CALLBACK(stop_server)
 {
-  /* Stop scheduler, the program will stop eventually after noticing
-     that the scheduler is down. */
-  silc_schedule_stop(silcd->schedule);
+  silc_server_stop(silcd);
 }
 
 /* Dump server statistics into a file into /tmp directory */
@@ -754,8 +752,7 @@
      and we will exit. */
   silc_server_run(silcd);
 
-  /* Stop the server and free it. */
-  silc_server_stop(silcd);
+  /* Free server */
   silc_server_config_destroy(silcd->config);
   silc_server_free(silcd);
 

Modified: silc-server/branches/upstream/current/configure
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/configure?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/configure (original)
+++ silc-server/branches/upstream/current/configure Sat Nov 24 19:00:23 2007
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for Server 1.1-beta1.
+# Generated by GNU Autoconf 2.61 for Server 1.1.
 #
 # Report bugs to <silc-devel at lists.silcnet.org>.
 #
@@ -728,8 +728,8 @@
 # Identity of this package.
 PACKAGE_NAME='Server'
 PACKAGE_TARNAME='silc-server'
-PACKAGE_VERSION='1.1-beta1'
-PACKAGE_STRING='Server 1.1-beta1'
+PACKAGE_VERSION='1.1'
+PACKAGE_STRING='Server 1.1'
 PACKAGE_BUGREPORT='silc-devel at lists.silcnet.org'
 
 # Factoring default headers for most tests.
@@ -907,8 +907,6 @@
 PKG_CONFIG
 SILC_CFLAGS
 SILC_LIBS
-SILC_SIM_TRUE
-SILC_SIM_FALSE
 SILC_MP_GMP_TRUE
 SILC_MP_GMP_FALSE
 SILC_MP_SILCMATH_TRUE
@@ -1476,7 +1474,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Server 1.1-beta1 to adapt to many kinds of systems.
+\`configure' configures Server 1.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1547,7 +1545,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Server 1.1-beta1:";;
+     short | recursive ) echo "Configuration of Server 1.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1587,7 +1585,6 @@
                                  for SILC Server [/etc/silc/silcd.conf]
   --with-silcd-pid-file=FILE     use FILE as default pid file for SILC
                                  Server [/var/run/silcd.pid]
-  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]
 
 Some influential environment variables:
   CC          C compiler command
@@ -1671,7 +1668,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Server configure 1.1-beta1
+Server configure 1.1
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1685,7 +1682,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Server $as_me 1.1-beta1, which was
+It was created by Server $as_me 1.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2501,7 +2498,7 @@
 
 # Define the identity of the package.
  PACKAGE='silc-server'
- VERSION='1.1-beta1'
+ VERSION='1.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5005,7 +5002,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5008 "configure"' > conftest.$ac_ext
+  echo '#line 5005 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7736,11 +7733,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7739: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7736: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7743: \$? = $ac_status" >&5
+   echo "$as_me:7740: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8004,11 +8001,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8007: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8004: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8011: \$? = $ac_status" >&5
+   echo "$as_me:8008: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8108,11 +8105,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8111: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8108: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8115: \$? = $ac_status" >&5
+   echo "$as_me:8112: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9573,7 +9570,7 @@
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 9576 "configure"' > conftest.$ac_ext
+    echo '#line 9573 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -10437,7 +10434,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10440 "configure"
+#line 10437 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10537,7 +10534,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10540 "configure"
+#line 10537 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12876,11 +12873,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12879: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12876: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12883: \$? = $ac_status" >&5
+   echo "$as_me:12880: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -12980,11 +12977,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12983: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12980: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12987: \$? = $ac_status" >&5
+   echo "$as_me:12984: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13516,7 +13513,7 @@
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 13519 "configure"' > conftest.$ac_ext
+    echo '#line 13516 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -14574,11 +14571,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14577: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14574: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14581: \$? = $ac_status" >&5
+   echo "$as_me:14578: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14678,11 +14675,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14681: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14678: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14685: \$? = $ac_status" >&5
+   echo "$as_me:14682: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16123,7 +16120,7 @@
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 16126 "configure"' > conftest.$ac_ext
+    echo '#line 16123 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -16900,11 +16897,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16903: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16900: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16907: \$? = $ac_status" >&5
+   echo "$as_me:16904: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17168,11 +17165,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17171: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17168: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17175: \$? = $ac_status" >&5
+   echo "$as_me:17172: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17272,11 +17269,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17275: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17272: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17279: \$? = $ac_status" >&5
+   echo "$as_me:17276: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18737,7 +18734,7 @@
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 18740 "configure"' > conftest.$ac_ext
+    echo '#line 18737 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -25791,7 +25788,11 @@
 
 
   if test "x$NASM" != "xno"; then
-    SILC_ASSEMBLER="$NASM -O2 -felf"
+    if test x$cpu_x86_64 = xtrue; then
+      SILC_ASSEMBLER="$NASM -O2 -felf64"
+    else
+      SILC_ASSEMBLER="$NASM -O2 -felf"
+    fi
     have_assembler=true
   fi
 
@@ -25837,7 +25838,11 @@
 
 
   if test "x$YASM" != "xno"; then
-    SILC_ASSEMBLER="$YASM -Xgnu -felf"
+    if test x$cpu_x86_64 = xtrue; then
+      SILC_ASSEMBLER="$YASM -Xgnu -felf64"
+    else
+      SILC_ASSEMBLER="$YASM -Xgnu -felf"
+    fi
     have_assembler=true
   fi
 fi
@@ -27309,17 +27314,486 @@
   fi
 fi
 
-# SIM support checking
-# XXX These needs to be changed as more supported platforms appear.
-# XXX This probably needs to be made platform dependant check.
+
+# SOCKS4 support checking
 #
-sim_support=false
-{ echo "$as_me:$LINENO: checking for SIM support" >&5
-echo $ECHO_N "checking for SIM support... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: " >&5
-echo "${ECHO_T}" >&6; }
-
-for ac_header in dlfcn.h
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+{ echo "$as_me:$LINENO: checking whether to support SOCKS4" >&5
+echo $ECHO_N "checking whether to support SOCKS4... $ECHO_C" >&6; }
+
+# Check whether --with-socks4 was given.
+if test "${with_socks4+set}" = set; then
+  withval=$with_socks4;
+    case "$withval" in
+      no)
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+      *)
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        socks=4
+
+        if test -d "$withval/include"; then
+          CFLAGS="$CFLAGS -I$withval/include"
+        fi
+        if test -d "$withval/lib"; then
+          LDFLAGS="$LDFLAGS -L$withval/lib"
+        fi
+
+        LIBS="-lsocks $LIBS"
+        ;;
+    esac
+
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+        Rconnect();
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+        { { echo "$as_me:$LINENO: error: Could not find SOCKS4 library." >&5
+echo "$as_me: error: Could not find SOCKS4 library." >&2;}
+   { (exit 1); exit 1; }; }
+        LIBS="$SAVE_LIBS"
+        CFLAGS="$SAVE_CFLAGS"
+        LDFLAGS="$SAVE_LDFLAGS"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+# SOCKS5 support checking
+#
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+{ echo "$as_me:$LINENO: checking whether to support SOCKS5" >&5
+echo $ECHO_N "checking whether to support SOCKS5... $ECHO_C" >&6; }
+
+# Check whether --with-socks5 was given.
+if test "${with_socks5+set}" = set; then
+  withval=$with_socks5;
+    case "$withval" in
+      no)
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+      *)
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        socks=5
+
+        if test -d "$withval/include"; then
+          CFLAGS="$CFLAGS -I$withval/include"
+        fi
+        if test -d "$withval/lib"; then
+          LDFLAGS="$LDFLAGS -L$withval/lib"
+        fi
+
+        LIBS="-lsocks5 $LIBS"
+        ;;
+    esac
+
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+        SOCKSconnect();
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+        { { echo "$as_me:$LINENO: error: Could not find SOCKS5 library." >&5
+echo "$as_me: error: Could not find SOCKS5 library." >&2;}
+   { (exit 1); exit 1; }; }
+        LIBS="$SAVE_LIBS"
+        CFLAGS="$SAVE_CFLAGS"
+        LDFLAGS="$SAVE_LDFLAGS"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+if test "x$socks" = "x4"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SOCKS
+_ACEOF
+
+  CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
+fi
+
+if test "x$socks" = "x5"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SOCKS
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define SOCKS5
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rconnect SOCKSconnect
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rgetsockname SOCKSgetsockname
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rgetpeername SOCKSgetpeername
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rbind SOCKSbind
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Raccept SOCKSaccept
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rlisten SOCKSlisten
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rselect SOCKSselect
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rrecvfrom SOCKSrecvfrom
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rsendto SOCKSsendto
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rrecv SOCKSrecv
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rsend SOCKSsend
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rread SOCKSread
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rwrite SOCKSwrite
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rrresvport SOCKSrresvport
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rshutdown SOCKSshutdown
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rlisten SOCKSlisten
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rclose SOCKSclose
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rdup SOCKSdup
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rdup2 SOCKSdup2
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rfclose SOCKSfclose
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Rgethostbyname SOCKSgethostbyname
+_ACEOF
+
+fi
+
+# MP library checking. First check whether user wants to use GMP and use
+# it if found. If not or not defined then compile the default library in the
+# source tree.
+#
+mp_gmp=false
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+{ echo "$as_me:$LINENO: checking whether to search for GMP" >&5
+echo $ECHO_N "checking whether to search for GMP... $ECHO_C" >&6; }
+
+# Check whether --with-gmp was given.
+if test "${with_gmp+set}" = set; then
+  withval=$with_gmp;
+    case "$withval" in
+      no)
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+      *)
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+        if test -d "$withval/include"; then
+          CFLAGS="$CFLAGS -I$withval/include"
+        fi
+        if test -d "$withval/lib"; then
+          LDFLAGS="$LDFLAGS -L$withval/lib"
+        fi
+
+        LIBS="-lgmp $LIBS"
+        ;;
+    esac
+
+    { echo "$as_me:$LINENO: checking for __gmpz_init in -lgmp" >&5
+echo $ECHO_N "checking for __gmpz_init in -lgmp... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gmp___gmpz_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgmp  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char __gmpz_init ();
+int
+main ()
+{
+return __gmpz_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gmp___gmpz_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_gmp___gmpz_init=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5
+echo "${ECHO_T}$ac_cv_lib_gmp___gmpz_init" >&6; }
+if test $ac_cv_lib_gmp___gmpz_init = yes; then
+
+        mp_gmp=true
+
+cat >>confdefs.h <<\_ACEOF
+#define SILC_MP_GMP
+_ACEOF
+
+        { echo "$as_me:$LINENO: result: Using GMP as a MP library." >&5
+echo "${ECHO_T}Using GMP as a MP library." >&6; }
+
+else
+
+        LIBS="$SAVE_LIBS"
+        CFLAGS="$SAVE_CFLAGS"
+        LDFLAGS="$SAVE_LDFLAGS"
+
+fi
+
+
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+ if test x$mp_gmp = xtrue; then
+  SILC_MP_GMP_TRUE=
+  SILC_MP_GMP_FALSE='#'
+else
+  SILC_MP_GMP_TRUE='#'
+  SILC_MP_GMP_FALSE=
+fi
+
+ if test x$mp_gmp = xfalse; then
+  SILC_MP_SILCMATH_TRUE=
+  SILC_MP_SILCMATH_FALSE='#'
+else
+  SILC_MP_SILCMATH_TRUE='#'
+  SILC_MP_SILCMATH_FALSE=
+fi
+
+if test x$mp_gmp = xfalse; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SILC_MP_SILCMATH
+_ACEOF
+
+  { echo "$as_me:$LINENO: result: Using SILC Math as a MP library." >&5
+echo "${ECHO_T}Using SILC Math as a MP library." >&6; }
+fi
+
+# iconv support
+#
+check_iconv=true
+has_iconv=false
+SAVE_LIBS="$LIBS"
+SAVE_CFLAGS="$CFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+SAVE_CPPFLAGS="$CPPFLAGS"
+{ echo "$as_me:$LINENO: checking whether to implicit search for libiconv" >&5
+echo $ECHO_N "checking whether to implicit search for libiconv... $ECHO_C" >&6; }
+
+# Check whether --with-iconv was given.
+if test "${with_iconv+set}" = set; then
+  withval=$with_iconv;
+    case "${withval}" in
+      no)
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+for ac_header in iconv.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -27459,19 +27933,33 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+            { echo "$as_me:$LINENO: checking for iconv" >&5
+echo $ECHO_N "checking for iconv... $ECHO_C" >&6; }
+if test "${ac_cv_func_iconv+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define iconv to an innocuous variant, in case <limits.h> declares iconv.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define iconv innocuous_iconv
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char iconv (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef iconv
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -27479,11 +27967,18 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char dlopen ();
+char iconv ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_iconv || defined __stub___iconv
+choke me
+#endif
+
 int
 main ()
 {
-return dlopen ();
+return iconv ();
   ;
   return 0;
 }
@@ -27506,105 +28001,21 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_dl_dlopen=yes
+  ac_cv_func_iconv=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_dl_dlopen=no
+	ac_cv_func_iconv=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define SILC_SIM
-_ACEOF
-
-        sim_support=true
-        LIBS="$LIBS -ldl"
-
-else
-
-        { echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
-echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_c_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_c_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_c_dlopen" >&6; }
-if test $ac_cv_lib_c_dlopen = yes; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define SILC_SIM
-_ACEOF
-
-            sim_support=true
-
-fi
-
-
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5
+echo "${ECHO_T}$ac_cv_func_iconv" >&6; }
+if test $ac_cv_func_iconv = yes; then
+  has_iconv=true
 fi
 
 
@@ -27612,500 +28023,24 @@
 
 done
 
-
- if test x$sim_support = xtrue; then
-  SILC_SIM_TRUE=
-  SILC_SIM_FALSE='#'
-else
-  SILC_SIM_TRUE='#'
-  SILC_SIM_FALSE=
-fi
-
-if test x$sim_support = xtrue; then
-  { echo "$as_me:$LINENO: result: Enabled SIM support." >&5
-echo "${ECHO_T}Enabled SIM support." >&6; }
-  __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
-else
-  { echo "$as_me:$LINENO: result: No SIM support found." >&5
-echo "${ECHO_T}No SIM support found." >&6; }
-fi
-
-# SOCKS4 support checking
-#
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-{ echo "$as_me:$LINENO: checking whether to support SOCKS4" >&5
-echo $ECHO_N "checking whether to support SOCKS4... $ECHO_C" >&6; }
-
-# Check whether --with-socks4 was given.
-if test "${with_socks4+set}" = set; then
-  withval=$with_socks4;
-    case "$withval" in
-      no)
-        { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+        check_iconv=false
         ;;
       *)
         { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
-        socks=4
-
-        if test -d "$withval/include"; then
+        if test -d $withval/include; then
+          CPPFLAGS="$CPPFLAGS -I$withval/include"
           CFLAGS="$CFLAGS -I$withval/include"
         fi
-        if test -d "$withval/lib"; then
+        if test -d $withval/lib; then
           LDFLAGS="$LDFLAGS -L$withval/lib"
         fi
-
-        LIBS="-lsocks $LIBS"
         ;;
     esac
 
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-        Rconnect();
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-        { { echo "$as_me:$LINENO: error: Could not find SOCKS4 library." >&5
-echo "$as_me: error: Could not find SOCKS4 library." >&2;}
-   { (exit 1); exit 1; }; }
-        LIBS="$SAVE_LIBS"
-        CFLAGS="$SAVE_CFLAGS"
-        LDFLAGS="$SAVE_LDFLAGS"
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-
-# SOCKS5 support checking
-#
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-{ echo "$as_me:$LINENO: checking whether to support SOCKS5" >&5
-echo $ECHO_N "checking whether to support SOCKS5... $ECHO_C" >&6; }
-
-# Check whether --with-socks5 was given.
-if test "${with_socks5+set}" = set; then
-  withval=$with_socks5;
-    case "$withval" in
-      no)
-        { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-        ;;
-      *)
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-        socks=5
-
-        if test -d "$withval/include"; then
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d "$withval/lib"; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-
-        LIBS="-lsocks5 $LIBS"
-        ;;
-    esac
-
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-        SOCKSconnect();
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-        { { echo "$as_me:$LINENO: error: Could not find SOCKS5 library." >&5
-echo "$as_me: error: Could not find SOCKS5 library." >&2;}
-   { (exit 1); exit 1; }; }
-        LIBS="$SAVE_LIBS"
-        CFLAGS="$SAVE_CFLAGS"
-        LDFLAGS="$SAVE_LDFLAGS"
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-
-if test "x$socks" = "x4"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define SOCKS
-_ACEOF
-
-  CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
-fi
-
-if test "x$socks" = "x5"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define SOCKS
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define SOCKS5
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rconnect SOCKSconnect
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rgetsockname SOCKSgetsockname
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rgetpeername SOCKSgetpeername
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rbind SOCKSbind
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Raccept SOCKSaccept
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rlisten SOCKSlisten
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rselect SOCKSselect
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rrecvfrom SOCKSrecvfrom
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rsendto SOCKSsendto
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rrecv SOCKSrecv
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rsend SOCKSsend
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rread SOCKSread
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rwrite SOCKSwrite
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rrresvport SOCKSrresvport
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rshutdown SOCKSshutdown
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rlisten SOCKSlisten
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rclose SOCKSclose
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rdup SOCKSdup
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rdup2 SOCKSdup2
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rfclose SOCKSfclose
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define Rgethostbyname SOCKSgethostbyname
-_ACEOF
-
-fi
-
-# MP library checking. First check whether user wants to use GMP and use
-# it if found. If not or not defined then compile the default library in the
-# source tree.
-#
-mp_gmp=false
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-{ echo "$as_me:$LINENO: checking whether to search for GMP" >&5
-echo $ECHO_N "checking whether to search for GMP... $ECHO_C" >&6; }
-
-# Check whether --with-gmp was given.
-if test "${with_gmp+set}" = set; then
-  withval=$with_gmp;
-    case "$withval" in
-      no)
-        { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-        ;;
-      *)
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-        if test -d "$withval/include"; then
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d "$withval/lib"; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-
-        LIBS="-lgmp $LIBS"
-        ;;
-    esac
-
-    { echo "$as_me:$LINENO: checking for __gmpz_init in -lgmp" >&5
-echo $ECHO_N "checking for __gmpz_init in -lgmp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_gmp___gmpz_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgmp  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char __gmpz_init ();
-int
-main ()
-{
-return __gmpz_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_gmp___gmpz_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_gmp___gmpz_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5
-echo "${ECHO_T}$ac_cv_lib_gmp___gmpz_init" >&6; }
-if test $ac_cv_lib_gmp___gmpz_init = yes; then
-
-        mp_gmp=true
-
-cat >>confdefs.h <<\_ACEOF
-#define SILC_MP_GMP
-_ACEOF
-
-        { echo "$as_me:$LINENO: result: Using GMP as a MP library." >&5
-echo "${ECHO_T}Using GMP as a MP library." >&6; }
-
-else
-
-        LIBS="$SAVE_LIBS"
-        CFLAGS="$SAVE_CFLAGS"
-        LDFLAGS="$SAVE_LDFLAGS"
-
-fi
-
-
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-
- if test x$mp_gmp = xtrue; then
-  SILC_MP_GMP_TRUE=
-  SILC_MP_GMP_FALSE='#'
-else
-  SILC_MP_GMP_TRUE='#'
-  SILC_MP_GMP_FALSE=
-fi
-
- if test x$mp_gmp = xfalse; then
-  SILC_MP_SILCMATH_TRUE=
-  SILC_MP_SILCMATH_FALSE='#'
-else
-  SILC_MP_SILCMATH_TRUE='#'
-  SILC_MP_SILCMATH_FALSE=
-fi
-
-if test x$mp_gmp = xfalse; then
-
-cat >>confdefs.h <<\_ACEOF
-#define SILC_MP_SILCMATH
-_ACEOF
-
-  { echo "$as_me:$LINENO: result: Using SILC Math as a MP library." >&5
-echo "${ECHO_T}Using SILC Math as a MP library." >&6; }
-fi
-
-# iconv support
-#
-check_iconv=true
-has_iconv=false
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-SAVE_CPPFLAGS="$CPPFLAGS"
-{ echo "$as_me:$LINENO: checking whether to implicit search for libiconv" >&5
-echo $ECHO_N "checking whether to implicit search for libiconv... $ECHO_C" >&6; }
-
-# Check whether --with-iconv was given.
-if test "${with_iconv+set}" = set; then
-  withval=$with_iconv;
-    case "${withval}" in
-      no)
-        { echo "$as_me:$LINENO: result: no" >&5
+else
+
+    { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 
 for ac_header in iconv.h
@@ -28248,9 +28183,13 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-            { echo "$as_me:$LINENO: checking for iconv" >&5
-echo $ECHO_N "checking for iconv... $ECHO_C" >&6; }
-if test "${ac_cv_func_iconv+set}" = set; then
+
+for ac_func in iconv
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -28259,12 +28198,12 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define iconv to an innocuous variant, in case <limits.h> declares iconv.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define iconv innocuous_iconv
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char iconv (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -28274,7 +28213,7 @@
 # include <assert.h>
 #endif
 
-#undef iconv
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -28282,18 +28221,18 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char iconv ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined __stub_iconv || defined __stub___iconv
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
 #endif
 
 int
 main ()
 {
-return iconv ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -28316,47 +28255,47 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_func_iconv=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_func_iconv=no
+	eval "$as_ac_var=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5
-echo "${ECHO_T}$ac_cv_func_iconv" >&6; }
-if test $ac_cv_func_iconv = yes; then
-  has_iconv=true
-fi
-
-
-fi
-
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+            has_iconv=true
+            check_iconv=false
+
+fi
 done
 
-        check_iconv=false
-        ;;
-      *)
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-        if test -d $withval/include; then
-          CPPFLAGS="$CPPFLAGS -I$withval/include"
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d $withval/lib; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-        ;;
-    esac
-
-else
-
-    { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+
+fi
+
+done
+
+
+fi
+
+
+if test x$check_iconv = xtrue; then
+  { echo "$as_me:$LINENO: result: Searching for iconv..." >&5
+echo "${ECHO_T}Searching for iconv..." >&6; }
+
+  # XXX
+  unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
+
 
 for ac_header in iconv.h
 do
@@ -28498,56 +28437,27 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-
-for ac_func in iconv
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+      LIBS="$LIBS -liconv"
+      { echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; }
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+
+          #include <stdlib.h>
+          #include <iconv.h>
 
 int
 main ()
 {
-return $ac_func ();
+
+          iconv_t cd = iconv_open("", "");
+          iconv(cd, NULL, NULL, NULL, NULL);
+          iconv_close(cd);
+
   ;
   return 0;
 }
@@ -28570,46 +28480,60 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  eval "$as_ac_var=yes"
+
+          echo "yes"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ICONV
+_ACEOF
+
+          has_iconv=true
+          check_iconv=false
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+
+          echo "no"
+          LIBS="$SAVE_LIBS"
+          CFLAGS="$SAVE_CFLAGS"
+          LDFLAGS="$SAVE_LDFLAGS"
+          CPPFLAGS="$SAVE_CPPFLAGS"
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-            has_iconv=true
-            check_iconv=false
-
-fi
+
+fi
+
 done
 
-
-fi
-
-done
-
-
-fi
-
+fi
 
 if test x$check_iconv = xtrue; then
-  { echo "$as_me:$LINENO: result: Searching for iconv..." >&5
-echo "${ECHO_T}Searching for iconv..." >&6; }
-
-  # XXX
-  unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
+  # search for iconv library..
+  SAVE_LIBS="$LIBS"
+  SAVE_CFLAGS="$CFLAGS"
+  SAVE_LDFLAGS="$LDFLAGS"
+  SAVE_CPPFLAGS="$CPPFLAGS"
+
+  for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
+    if test x$has_iconv = xfalse; then
+      { echo "$as_me:$LINENO: result: searching in $dir..." >&5
+echo "${ECHO_T}searching in $dir..." >&6; }
+
+      if test -d $dir/include; then
+        CPPFLAGS="$CPPFLAGS -I$dir/include"
+        CFLAGS="$CFLAGS -I$dir/include"
+      fi
+      if test -d $dir/lib; then
+        LDFLAGS="$LDFLAGS -L$dir/lib"
+      fi
+
+      # XXX
+      unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
 
 
 for ac_header in iconv.h
@@ -28752,26 +28676,26 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-      LIBS="$LIBS -liconv"
-      { echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
+          LIBS="$LIBS -liconv"
+          { echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
 echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; }
-      cat >conftest.$ac_ext <<_ACEOF
+          cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-          #include <stdlib.h>
-          #include <iconv.h>
+              #include <stdlib.h>
+              #include <iconv.h>
 
 int
 main ()
 {
 
-          iconv_t cd = iconv_open("", "");
-          iconv(cd, NULL, NULL, NULL, NULL);
-          iconv_close(cd);
+              iconv_t cd = iconv_open("", "");
+              iconv(cd, NULL, NULL, NULL, NULL);
+              iconv_close(cd);
 
   ;
   return 0;
@@ -28796,62 +28720,169 @@
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
 
-          echo "yes"
+              echo "yes"
+              has_iconv=true
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ICONV
 _ACEOF
 
-          has_iconv=true
-          check_iconv=false
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-          echo "no"
-          LIBS="$SAVE_LIBS"
-          CFLAGS="$SAVE_CFLAGS"
-          LDFLAGS="$SAVE_LDFLAGS"
-          CPPFLAGS="$SAVE_CPPFLAGS"
+              echo "no"
+              has_iconv=false
+
+              LIBS="$SAVE_LIBS"
+              CFLAGS="$SAVE_CFLAGS"
+              LDFLAGS="$SAVE_LDFLAGS"
+              CPPFLAGS="$SAVE_CPPFLAGS"
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
+else
+
+           CFLAGS="$SAVE_CFLAGS"
+           LDFLAGS="$SAVE_LDFLAGS"
+           CPPFLAGS="$SAVE_CPPFLAGS"
+
 fi
 
 done
 
-fi
-
-if test x$check_iconv = xtrue; then
-  # search for iconv library..
+      fi
+    done
+fi
+
+if test x$has_iconv = xtrue; then
+  # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
+  # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
+  #     obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
+  #
+  { echo "$as_me:$LINENO: checking whether this iconv is good enough" >&5
+echo $ECHO_N "checking whether this iconv is good enough... $ECHO_C" >&6; }
+if test "${ac_iconv_good+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+
+        ac_iconv_good=yes
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+        #include <iconv.h>
+        int main() {
+          iconv_t cd;
+                  char buf[4];
+                  char *ob;
+          size_t obl;
+          ob = buf, obl = sizeof(buf);
+          return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
+                 (iconv(cd, 0, 0, &ob, &obl) ||
+                 !(ob == buf && obl == sizeof(buf)) ||
+                 iconv_close(cd)));
+        }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+        ac_iconv_good=yes
+
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+        ac_iconv_good=no
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_iconv_good" >&5
+echo "${ECHO_T}$ac_iconv_good" >&6; }
+
+  if test x$ac_iconv_good = xno; then
+    { echo "$as_me:$LINENO: result: Try using libiconv instead." >&5
+echo "${ECHO_T}Try using libiconv instead." >&6; }
+  fi
+fi
+
+# POSIX threads support
+#
+{ echo "$as_me:$LINENO: checking whether to search for POSIX threads" >&5
+echo $ECHO_N "checking whether to search for POSIX threads... $ECHO_C" >&6; }
+
+# Check whether --with-pthreads was given.
+if test "${with_pthreads+set}" = set; then
+  withval=$with_pthreads;
+    case "${withval}" in
+      no)
+        check_threads=false
+        ;;
+      *)
+        if test -d $withval/include; then
+          CPPFLAGS="$CPPFLAGS -I$withval/include"
+          CFLAGS="$CFLAGS -I$withval/include"
+        fi
+        if test -d $withval/lib; then
+          LDFLAGS="$LDFLAGS -L$withval/lib"
+        fi
+
+        check_threads=true
+        ;;
+    esac
+
+fi
+
+
+if test x$check_threads = xtrue; then
+  has_threads=false
   SAVE_LIBS="$LIBS"
   SAVE_CFLAGS="$CFLAGS"
   SAVE_LDFLAGS="$LDFLAGS"
   SAVE_CPPFLAGS="$CPPFLAGS"
 
-  for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
-    if test x$has_iconv = xfalse; then
-      { echo "$as_me:$LINENO: result: searching in $dir..." >&5
-echo "${ECHO_T}searching in $dir..." >&6; }
-
-      if test -d $dir/include; then
-        CPPFLAGS="$CPPFLAGS -I$dir/include"
-        CFLAGS="$CFLAGS -I$dir/include"
-      fi
-      if test -d $dir/lib; then
-        LDFLAGS="$LDFLAGS -L$dir/lib"
-      fi
-
-      # XXX
-      unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
-
-
-for ac_header in iconv.h
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+for ac_header in pthread.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -28991,27 +29022,32 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-          LIBS="$LIBS -liconv"
-          { echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
-echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; }
-          cat >conftest.$ac_ext <<_ACEOF
+      LIBS="$LIBS -lpthread"
+      { echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5
+echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-              #include <stdlib.h>
-              #include <iconv.h>
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_attr_init ();
 int
 main ()
 {
-
-              iconv_t cd = iconv_open("", "");
-              iconv(cd, NULL, NULL, NULL, NULL);
-              iconv_close(cd);
-
+return pthread_attr_init ();
   ;
   return 0;
 }
@@ -29034,168 +29070,123 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-
-              echo "yes"
-              has_iconv=true
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ICONV
-_ACEOF
-
-
+  ac_cv_lib_pthread_pthread_attr_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
-              echo "no"
-              has_iconv=false
-
-              LIBS="$SAVE_LIBS"
-              CFLAGS="$SAVE_CFLAGS"
-              LDFLAGS="$SAVE_LDFLAGS"
-              CPPFLAGS="$SAVE_CPPFLAGS"
-
+	ac_cv_lib_pthread_pthread_attr_init=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-
-else
-
-           CFLAGS="$SAVE_CFLAGS"
-           LDFLAGS="$SAVE_LDFLAGS"
-           CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-
-done
-
-      fi
-    done
-fi
-
-if test x$has_iconv = xtrue; then
-  # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
-  # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
-  #     obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
-  #
-  { echo "$as_me:$LINENO: checking whether this iconv is good enough" >&5
-echo $ECHO_N "checking whether this iconv is good enough... $ECHO_C" >&6; }
-if test "${ac_iconv_good+set}" = set; then
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6; }
+if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
+  has_threads=true
+else
+
+          # FreeBSD
+          case "${target}" in
+            *-*-freebsd*)
+              LIBS="$SAVE_LIBS -pthread"
+              { echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5
+echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6; }
+if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-
-        ac_iconv_good=yes
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-        #include <iconv.h>
-        int main() {
-          iconv_t cd;
-                  char buf[4];
-                  char *ob;
-          size_t obl;
-          ob = buf, obl = sizeof(buf);
-          return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
-                 (iconv(cd, 0, 0, &ob, &obl) ||
-                 !(ob == buf && obl == sizeof(buf)) ||
-                 iconv_close(cd)));
-        }
-
-_ACEOF
-rm -f conftest$ac_exeext
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_attr_init ();
+int
+main ()
+{
+return pthread_attr_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-        ac_iconv_good=yes
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_c_r_pthread_attr_init=yes
+else
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-
-        ac_iconv_good=no
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_iconv_good" >&5
-echo "${ECHO_T}$ac_iconv_good" >&6; }
-
-  if test x$ac_iconv_good = xno; then
-    { echo "$as_me:$LINENO: result: Try using libiconv instead." >&5
-echo "${ECHO_T}Try using libiconv instead." >&6; }
-  fi
-fi
-
-# POSIX threads support
-#
-{ echo "$as_me:$LINENO: checking whether to search for POSIX threads" >&5
-echo $ECHO_N "checking whether to search for POSIX threads... $ECHO_C" >&6; }
-
-# Check whether --with-pthreads was given.
-if test "${with_pthreads+set}" = set; then
-  withval=$with_pthreads;
-    case "${withval}" in
-      no)
-        check_threads=false
-        ;;
-      *)
-        if test -d $withval/include; then
-          CPPFLAGS="$CPPFLAGS -I$withval/include"
-          CFLAGS="$CFLAGS -I$withval/include"
-        fi
-        if test -d $withval/lib; then
-          LDFLAGS="$LDFLAGS -L$withval/lib"
-        fi
-
-        check_threads=true
-        ;;
-    esac
-
-fi
-
-
-if test x$check_threads = xtrue; then
-  has_threads=false
-  SAVE_LIBS="$LIBS"
-  SAVE_CFLAGS="$CFLAGS"
-  SAVE_LDFLAGS="$LDFLAGS"
-  SAVE_CPPFLAGS="$CPPFLAGS"
-
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	ac_cv_lib_c_r_pthread_attr_init=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5
+echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6; }
+if test $ac_cv_lib_c_r_pthread_attr_init = yes; then
+  has_threads=true
+else
+  LIBS="$SAVE_LIBS"
+fi
+
+              ;;
+            *)
+              LIBS="$SAVE_LIBS"
+              ;;
+          esac
+
+fi
+
+
+else
+
+      # search for pthread library..
+      for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
+        if test x$has_threads = xfalse; then
+          { echo "$as_me:$LINENO: result: searching in $dir..." >&5
+echo "${ECHO_T}searching in $dir..." >&6; }
+
+          if test -d $dir/include; then
+            CPPFLAGS="$CPPFLAGS -I$dir/include"
+            CFLAGS="$CFLAGS -I$dir/include"
+          fi
+          if test -d $dir/lib; then
+            LDFLAGS="$LDFLAGS -L$dir/lib"
+          fi
+
+          # XXX
+          unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
+
 
 for ac_header in pthread.h
 do
@@ -29337,312 +29328,6 @@
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-      LIBS="$LIBS -lpthread"
-      { echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5
-echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6; }
-if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_attr_init ();
-int
-main ()
-{
-return pthread_attr_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_pthread_pthread_attr_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pthread_pthread_attr_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6; }
-if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
-  has_threads=true
-else
-
-          # FreeBSD
-          case "${target}" in
-            *-*-freebsd*)
-              LIBS="$SAVE_LIBS -pthread"
-              { echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5
-echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc_r  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_attr_init ();
-int
-main ()
-{
-return pthread_attr_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_c_r_pthread_attr_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_c_r_pthread_attr_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5
-echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6; }
-if test $ac_cv_lib_c_r_pthread_attr_init = yes; then
-  has_threads=true
-else
-  LIBS="$SAVE_LIBS"
-fi
-
-              ;;
-            *)
-              LIBS="$SAVE_LIBS"
-              ;;
-          esac
-
-fi
-
-
-else
-
-      # search for pthread library..
-      for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
-        if test x$has_threads = xfalse; then
-          { echo "$as_me:$LINENO: result: searching in $dir..." >&5
-echo "${ECHO_T}searching in $dir..." >&6; }
-
-          if test -d $dir/include; then
-            CPPFLAGS="$CPPFLAGS -I$dir/include"
-            CFLAGS="$CFLAGS -I$dir/include"
-          fi
-          if test -d $dir/lib; then
-            LDFLAGS="$LDFLAGS -L$dir/lib"
-          fi
-
-          # XXX
-          unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
-
-
-for ac_header in pthread.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------------------- ##
-## Report this to silc-devel at lists.silcnet.org ##
-## ------------------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
               LIBS="$LIBS -lpthread"
               { echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5
 echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6; }
@@ -30500,11 +30185,9 @@
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
 
 ##
 ## Library versioning.
@@ -30529,13 +30212,13 @@
 LIB_BASE_VERSION=1.1
 
 # libsilc versions
-LIBSILC_CURRENT=2		# prev = 1
-LIBSILC_REVISION=0		# prev = 0
-LIBSILC_AGE=0			# prev = 0
+LIBSILC_CURRENT=3		# prev = 2
+LIBSILC_REVISION=0		# prev = 1
+LIBSILC_AGE=1			# prev = 1
 
 # libsilcclient versions
 LIBSILCCLIENT_CURRENT=2		# prev = 1
-LIBSILCCLIENT_REVISION=0	# prev = 0
+LIBSILCCLIENT_REVISION=0	# prev = 1
 LIBSILCCLIENT_AGE=0		# prev = 0
 
 # libsilcserver versions
@@ -30939,27 +30622,6 @@
 
 
 MODULESDIR="$silc_prefix/lib/modules"
-# SIM modules directory
-#
-
-# Check whether --with-simdir was given.
-if test "${with_simdir+set}" = set; then
-  withval=$with_simdir;
-    case "$withval" in
-      no|yes)
-        ;;
-      *)
-        MODULESDIR="$withval"
-        ;;
-    esac
-
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define SILC_MODULESDIR "$MODULESDIR"
-_ACEOF
-
 
 
 
@@ -30967,7 +30629,7 @@
 #
 # Makefile outputs
 #
-ac_config_files="$ac_config_files lib/Makefile lib/contrib/Makefile lib/silccore/Makefile lib/silcsim/Makefile lib/silcske/Makefile lib/silcutil/Makefile lib/silcutil/unix/Makefile lib/silcapputil/Makefile"
+ac_config_files="$ac_config_files lib/Makefile lib/contrib/Makefile lib/silccore/Makefile lib/silcske/Makefile lib/silcutil/Makefile lib/silcutil/unix/Makefile lib/silcapputil/Makefile"
 
 
 
@@ -30981,8 +30643,6 @@
 
 ac_config_files="$ac_config_files lib/silchttp/Makefile"
 
-
-ac_config_files="$ac_config_files lib/silcvcard/Makefile"
 
 
 fi	# compile_libs
@@ -31627,13 +31287,6 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${SILC_SIM_TRUE}" && test -z "${SILC_SIM_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"SILC_SIM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SILC_SIM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 if test -z "${SILC_MP_GMP_TRUE}" && test -z "${SILC_MP_GMP_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"SILC_MP_GMP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -32004,7 +31657,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Server $as_me 1.1-beta1, which was
+This file was extended by Server $as_me 1.1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -32057,7 +31710,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-Server config.status 1.1-beta1
+Server config.status 1.1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -32178,7 +31831,6 @@
     "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
     "lib/contrib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/contrib/Makefile" ;;
     "lib/silccore/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silccore/Makefile" ;;
-    "lib/silcsim/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcsim/Makefile" ;;
     "lib/silcske/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcske/Makefile" ;;
     "lib/silcutil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcutil/Makefile" ;;
     "lib/silcutil/unix/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcutil/unix/Makefile" ;;
@@ -32186,7 +31838,6 @@
     "lib/silcasn1/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcasn1/Makefile" ;;
     "lib/silcskr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcskr/Makefile" ;;
     "lib/silchttp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silchttp/Makefile" ;;
-    "lib/silcvcard/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcvcard/Makefile" ;;
     "lib/silccrypt/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silccrypt/Makefile" ;;
     "lib/silcmath/Makefile") CONFIG_FILES="$CONFIG_FILES lib/silcmath/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -32438,8 +32089,6 @@
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 SILC_CFLAGS!$SILC_CFLAGS$ac_delim
 SILC_LIBS!$SILC_LIBS$ac_delim
-SILC_SIM_TRUE!$SILC_SIM_TRUE$ac_delim
-SILC_SIM_FALSE!$SILC_SIM_FALSE$ac_delim
 SILC_MP_GMP_TRUE!$SILC_MP_GMP_TRUE$ac_delim
 SILC_MP_GMP_FALSE!$SILC_MP_GMP_FALSE$ac_delim
 SILC_MP_SILCMATH_TRUE!$SILC_MP_SILCMATH_TRUE$ac_delim
@@ -32488,7 +32137,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 87; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -33107,7 +32756,6 @@
 echo " etc directory .................: $ETCDIR"
 echo " man directory .................: $s_mandir"
 echo " doc directory .................: $DOCDIR"
-echo " SIM directory .................: $MODULESDIR"
 echo " include directory .............: $s_includedir"
 echo ""
 
@@ -33117,12 +32765,6 @@
 fi
 echo " Compile SILC Server ...........: $silcd"
 
-if test x$sim_support = xfalse; then
-  sim_support="no"
-else
-  sim_support="yes"
-fi
-echo " SIM support ...................: $sim_support"
 
 echo " IPv6 support ..................: $summary_ipv6"
 

Modified: silc-server/branches/upstream/current/configure.ac
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/configure.ac?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/configure.ac (original)
+++ silc-server/branches/upstream/current/configure.ac Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the configure.ad file in the source tree.
 
 # Source: configure.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 
@@ -23,7 +23,7 @@
 #  GNU General Public License for more details.
 #
 
-AC_INIT([Server], [1.1-beta1], [silc-devel at lists.silcnet.org], [silc-server])
+AC_INIT([Server], [1.1], [silc-devel at lists.silcnet.org], [silc-server])
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE
 AC_PREREQ(2.52)
@@ -341,13 +341,21 @@
 if test x$want_asm = xtrue; then
   AC_PATH_PROG([NASM], [nasm], [no])
   if test "x$NASM" != "xno"; then
-    SILC_ASSEMBLER="$NASM -O2 -felf"
+    if test x$cpu_x86_64 = xtrue; then
+      SILC_ASSEMBLER="$NASM -O2 -felf64"
+    else
+      SILC_ASSEMBLER="$NASM -O2 -felf"
+    fi
     have_assembler=true
   fi
 
   AC_PATH_PROG([YASM], [yasm], [no])
   if test "x$YASM" != "xno"; then
-    SILC_ASSEMBLER="$YASM -Xgnu -felf"
+    if test x$cpu_x86_64 = xtrue; then
+      SILC_ASSEMBLER="$YASM -Xgnu -felf64"
+    else
+      SILC_ASSEMBLER="$YASM -Xgnu -felf"
+    fi
     have_assembler=true
   fi
 fi
@@ -616,37 +624,6 @@
   fi
 fi
 
-# SIM support checking
-# XXX These needs to be changed as more supported platforms appear.
-# XXX This probably needs to be made platform dependant check.
-#
-sim_support=false
-AC_MSG_CHECKING(for SIM support)
-AC_MSG_RESULT()
-AC_CHECK_HEADERS(dlfcn.h,
-  [
-    AC_CHECK_LIB(dl, dlopen,
-      [
-        AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
-        sim_support=true
-        LIBS="$LIBS -ldl"
-      ],
-      [
-        AC_CHECK_LIB(c, dlopen,
-          [
-            AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
-            sim_support=true
-          ])
-      ])
-   ])
-
-AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
-if test x$sim_support = xtrue; then
-  AC_MSG_RESULT(Enabled SIM support.)
-  __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
-else
-  AC_MSG_RESULT(No SIM support found.)
-fi
 
 # SOCKS4 support checking
 #
@@ -1387,11 +1364,9 @@
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
 
 ##
 ## Library versioning.
@@ -1416,13 +1391,13 @@
 LIB_BASE_VERSION=1.1
 
 # libsilc versions
-LIBSILC_CURRENT=2		# prev = 1
-LIBSILC_REVISION=0		# prev = 0
-LIBSILC_AGE=0			# prev = 0
+LIBSILC_CURRENT=3		# prev = 2
+LIBSILC_REVISION=0		# prev = 1
+LIBSILC_AGE=1			# prev = 1
 
 # libsilcclient versions
 LIBSILCCLIENT_CURRENT=2		# prev = 1
-LIBSILCCLIENT_REVISION=0	# prev = 0
+LIBSILCCLIENT_REVISION=0	# prev = 1
 LIBSILCCLIENT_AGE=0		# prev = 0
 
 # libsilcserver versions
@@ -1467,20 +1442,6 @@
   ])
 
 MODULESDIR="$silc_prefix/lib/modules"
-# SIM modules directory
-#
-AC_ARG_WITH(simdir,
-  [[  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]]],
-  [
-    case "$withval" in
-      no|yes)
-        ;;
-      *)
-        MODULESDIR="$withval"
-        ;;
-    esac
-  ])
-AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
 AC_SUBST(MODULESDIR)
 
 
@@ -1492,7 +1453,6 @@
 lib/Makefile
 lib/contrib/Makefile
 lib/silccore/Makefile
-lib/silcsim/Makefile
 lib/silcske/Makefile
 lib/silcutil/Makefile
 lib/silcutil/unix/Makefile
@@ -1514,9 +1474,6 @@
 lib/silchttp/Makefile
 )
 
-AC_CONFIG_FILES(
-lib/silcvcard/Makefile
-)
 
 fi	# compile_libs
 
@@ -1683,7 +1640,6 @@
 echo " etc directory .................: $ETCDIR"
 echo " man directory .................: $s_mandir"
 echo " doc directory .................: $DOCDIR"
-echo " SIM directory .................: $MODULESDIR"
 echo " include directory .............: $s_includedir"
 echo ""
 
@@ -1693,12 +1649,6 @@
 fi
 echo " Compile SILC Server ...........: $silcd"
 
-if test x$sim_support = xfalse; then
-  sim_support="no"
-else
-  sim_support="yes"
-fi
-echo " SIM support ...................: $sim_support"
 
 echo " IPv6 support ..................: $summary_ipv6"
 

Modified: silc-server/branches/upstream/current/doc/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/Makefile.am (original)
+++ silc-server/branches/upstream/current/doc/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./doc/Makefile.ad file in the source tree.
 
 # Source: ./doc/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/doc/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/Makefile.in (original)
+++ silc-server/branches/upstream/current/doc/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./doc/Makefile.ad file in the source tree.
 
 # Source: ./doc/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/doc/example_silcd.conf
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/example_silcd.conf?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/example_silcd.conf (original)
+++ silc-server/branches/upstream/current/doc/example_silcd.conf Sat Nov 24 19:00:23 2007
@@ -32,11 +32,6 @@
 # for different connections.
 #
 General {
-	# This is the default path where to search modules.  If omitted
-	# built-in modules will be used.  Built-in modules will also be
-	# used if a module file cannot be located.
-	module_path = "/usr/local/lib/modules";
-
 	# If both passphrase and public key authentication is set for a
 	# connection the public key authentication is the preferred one
 	# to use.  Set this to `true' to prefer passphrase authentication
@@ -78,6 +73,17 @@
 	# Default keepalive frequency (seconds).  This can be overridden with
 	# with ConnectionParams.
 	keepalive_secs = 300;
+
+	# Dynamic router connections.  If this is set for normal SILC server
+	# the connection to primary router is not created untill it is actually
+	# needed.  Giving for example /WHOIS foobar at silcnet.org would then
+	# create connection to the primary router to resolve user foobar.
+	# On the other hand giving /WHOIS foobar would try to search the
+	# user foobar locally, without creating the connection.  Note that
+	# giving /JOIN foobar will also created the connection as current
+	# SILC Server version supports only global channels (all JOINs require
+	# connection to router, if one is configured).
+	#dynamic_server = true;
 
 	# Default reconnection parameters defines how the server reconnect
 	# to the remote if the connection was lost.  The reconnection phase

Modified: silc-server/branches/upstream/current/doc/example_silcd.conf.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/example_silcd.conf.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/example_silcd.conf.in (original)
+++ silc-server/branches/upstream/current/doc/example_silcd.conf.in Sat Nov 24 19:00:23 2007
@@ -32,11 +32,6 @@
 # for different connections.
 #
 General {
-	# This is the default path where to search modules.  If omitted
-	# built-in modules will be used.  Built-in modules will also be
-	# used if a module file cannot be located.
-	module_path = "@MODULESDIR@";
-
 	# If both passphrase and public key authentication is set for a
 	# connection the public key authentication is the preferred one
 	# to use.  Set this to `true' to prefer passphrase authentication
@@ -78,6 +73,17 @@
 	# Default keepalive frequency (seconds).  This can be overridden with
 	# with ConnectionParams.
 	keepalive_secs = 300;
+
+	# Dynamic router connections.  If this is set for normal SILC server
+	# the connection to primary router is not created untill it is actually
+	# needed.  Giving for example /WHOIS foobar at silcnet.org would then
+	# create connection to the primary router to resolve user foobar.
+	# On the other hand giving /WHOIS foobar would try to search the
+	# user foobar locally, without creating the connection.  Note that
+	# giving /JOIN foobar will also created the connection as current
+	# SILC Server version supports only global channels (all JOINs require
+	# connection to router, if one is configured).
+	#dynamic_server = true;
 
 	# Default reconnection parameters defines how the server reconnect
 	# to the remote if the connection was lost.  The reconnection phase

Modified: silc-server/branches/upstream/current/doc/examples/silcd.prv
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/examples/silcd.prv?rev=186&op=diff
==============================================================================
Binary files - no diff available.

Modified: silc-server/branches/upstream/current/doc/examples/silcd.pub
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/examples/silcd.pub?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/examples/silcd.pub (original)
+++ silc-server/branches/upstream/current/doc/examples/silcd.pub Sat Nov 24 19:00:23 2007
@@ -1,7 +1,9 @@
 -----BEGIN SILC PUBLIC KEY-----
-AAAA5wADcnNhAFBVTj1wcmlpa29uZSwgSE49c2lsYy5yYWtldHRpLm5ldCwgUk49UGVra2E
-gUmlpa29uZW4sIEU9cHJpaWtvbmVAc2lsYy5yYWtldHRpLm5ldAAAAAQAAAB/AAAAgCVP8Q
-JzCCCC3DUhJlTNABfFqvBIe+BheiAtpHc5D5+2dHqzoAQy99gTFlRGfnnqLvcz1YzYPjVEn
-+mbVEL6jddJZ2C1YwqzCGa5lG6dr4Un5QSU/uSgFoMY8wRjmfB1Cp/7/CgEFb20JeD/cS6s
-Tl86ElyTwi+NIwPMFePjlBkx
+AAABawADcnNhAFpVTj1wcmlpa29uZSwgSE49bG9jYWxob3N0LmxvY2FsZG9tYWluLCBSTj1
+QZWtrYSBSaWlrb25lbiwgRT1wcmlpa29uZUBsb2NhbGhvc3QubG9jYWxkb21haW4AAAAC//
+0AAAEAUAkEHrwD2RtMuyT/dtG/kyjz9lGS9zCPruDk8J4XhRpWTv6qL7PGM6Dd2m/+6REVf
+5zweY9JKzs3XU+lS1RL0WkCtNVmA1nUPrmKfztvhjQkVLj5zlZGAFmIAq5aLQqwJIf8xquy
+qgcJ0eF2cahnCONb+d2IImik2hMfffQkcGL2kMr7UQ+kJBM/mAeoIDQr/78b+vgWPBdTLsI
+7vhjLPyHXIBDYGawU8/oN4HYm2sSn+nqpmWtD41Z7GtuwQGivUGhAuAWeasG4RX1zQaNwTg
+a4Hm+do3sUuSczPawPcyA/2npp8SO2eTsLUPsWChI8kv6StBdLd/YUaig8EZN6YQ==
 -----END SILC PUBLIC KEY-----

Modified: silc-server/branches/upstream/current/doc/silcalgs.conf
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/silcalgs.conf?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/silcalgs.conf (original)
+++ silc-server/branches/upstream/current/doc/silcalgs.conf Sat Nov 24 19:00:23 2007
@@ -13,56 +13,55 @@
 #
 # Configured ciphers
 #
-# The "name" is unique name to the cipher. The "module" option can be either
-# absolute or relative to the "module_path", and it defines where the cipher
-# module is found.  If omitted the built-in cipher is used.  The "keylength"
-# defines the length of the key (bytes), and the "blocklength" defines the
-# block size of the cipher (bytes).
+# The "name" is unique name to the cipher.  The "keylength" defines the
+# length of the key (bytes), and the "blocklength" defines the block size
+# of the cipher (bytes).
 #
 cipher {
-	name = "aes-256-cbc";
-	module = "aes.sim.so";
+	name = "aes-256-ctr";
 	keylength = 32;
 	blocklength = 16;
 };
 cipher {
-	name = "aes-192-cbc";
-	module = "aes.sim.so";
+	name = "aes-256-cbc";
+	keylength = 32;
+	blocklength = 16;
+};
+cipher {
+	name = "aes-192-ctr";
 	keylength = 24;
 	blocklength = 16;
 };
 cipher {
+	name = "aes-192-cbc";
+	keylength = 24;
+	blocklength = 16;
+};
+cipher {
+	name = "aes-128-ctr";
+	keylength = 16;
+	blocklength = 16;
+};
+cipher {
 	name = "aes-128-cbc";
-	module = "aes.sim.so";
 	keylength = 16;
 	blocklength = 16;
 };
 cipher {
 	name = "twofish-256-cbc";
-	module = "twofish.sim.so";
 	keylength = 32;
 	blocklength = 16;
 };
 cipher {
 	name = "twofish-192-cbc";
-	module = "twofish.sim.so";
 	keylength = 24;
 	blocklength = 16;
 };
 cipher {
 	name = "twofish-128-cbc";
-	module = "twofish.sim.so";
 	keylength = 16;
 	blocklength = 16;
 };
-
-# "none" cipher should not be used
-#cipher {
-#	name = "none";
-#	module = "none.sim.so";
-#	keylength = 0;
-#	blocklength = 0;
-#};
 
 #
 # Configured hash functions
@@ -116,6 +115,6 @@
 #
 # Configured PKCS
 #
-PKCS { 
-	name = "rsa"; 
+PKCS {
+	name = "rsa";
 };

Modified: silc-server/branches/upstream/current/doc/silcd.conf.5
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/doc/silcd.conf.5?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/doc/silcd.conf.5 (original)
+++ silc-server/branches/upstream/current/doc/silcd.conf.5 Sat Nov 24 19:00:23 2007
@@ -21,18 +21,23 @@
 .PP 
 \fIGeneral\fP section contains global settings for the silcd\&.
 .PP 
-\fBmodule_path\fP
-.RS 
-Defines where SIM modules are located\&. If definition is omitted,
-built-in modules will be used\&. Also, if a module can not be located, a built-in
-module will be used in its place\&. The argument is a path to the directory the
-modules are in, for example \fB"/usr/local/silc/modules"\fP\&.
+\fBdynamic_server\fP
+.RS 
+Dynamic router connections\&.  If this is set for normal SILC server
+the connection to primary router is not created untill it is actually
+needed\&.  Giving for example \fI/WHOIS foobar at silcnet\&.org\fP would then
+create connection to the primary router to resolve user foobar\&.
+On the other hand giving \fI/WHOIS foobar\fP would try to search the
+user foobar locally, without creating the connection\&.  Note that
+giving \fI/JOIN foobar\fP will also created the connection as current
+SILC Server version supports only global channels (all JOINs require
+connection to router, if one is configured)\&.
 .RE 
 .PP 
 \fBprefer_passphrase_auth\fP
 .RS 
-If both public key and passphrase authentication are set for a 
-connection, public key authentication is by default preferred\&. Setting this 
+If both public key and passphrase authentication are set for a
+connection, public key authentication is by default preferred\&. Setting this
 value to \fItrue\fP causes silcd to prefer passphrase authentication in these
 cases\&.
 .RE 
@@ -53,7 +58,7 @@
 \fBconnections_max_per_host\fP
 .RS 
 Maximum number of incoming connections from any single host\&. This
-setting can be overridden on a connection-specific basis with 
+setting can be overridden on a connection-specific basis with
 \fIConnectionParams\fP\&.
 .RE 
 .PP 
@@ -88,7 +93,7 @@
 Defines the interval, in seconds, how often the session key will be
 regenerated\&. This setting only applies to the connection initiator, as rekey
 is always performed by the initiating party\&. Setting has effect only when
-the server acts as an initiator, and can be overridden with 
+the server acts as an initiator, and can be overridden with
 \fIConnectionParams\fP\&.
 .RE 
 .PP 
@@ -96,7 +101,7 @@
 .RS 
 Boolean value to determine, whether key-exchange is performed with
 Perfect Forward Secrecy (PFS) or without\&. If set to \fItrue\fP, the rekey
-process will be somewhat slower, but more secure since the key is 
+process will be somewhat slower, but more secure since the key is
 entirely regenerated\&. Can be overridden with \fIConnectionParams\fP\&.
 .RE 
 .PP 
@@ -158,13 +163,13 @@
 .PP 
 \fBqos_limit_sec\fP
 .RS 
-This value defines the timeout, in seconds, for the delay of received 
+This value defines the timeout, in seconds, for the delay of received
 data in case it was left in a QoS queue\&.
 .RE 
 .PP 
 \fBqos_limit_usec\fP
 .RS 
-This value defines the timeout, in microseconds, for the delay of 
+This value defines the timeout, in microseconds, for the delay of
 received data for received data in case it was left in a QoS queue\&.
 .RE 
 .PP 
@@ -294,7 +299,7 @@
 .SH "SUBSECTION: Fatals" 
 Each of these subsections has the same attributes, \fIFile\fP and \fISize\fP\&.
 Different levels of problems are logged to their respective channels
-(\fIInfo\fP, \fIWarnings\fP, \fIErrors\fP, \fIFatals\fP), depending on their need 
+(\fIInfo\fP, \fIWarnings\fP, \fIErrors\fP, \fIFatals\fP), depending on their need
 of attention\&.
 .PP 
 \fBFile\fP
@@ -312,22 +317,22 @@
 .SH "SECTION: ConnectionParams" 
 .PP 
 This section defines connection parameters\&. Each connection may have its own
-set of \fIConnectionParams\fP but having one is in no way mandatory\&. If no 
-separate parameters have been assigned, the defaults and the ones  from 
+set of \fIConnectionParams\fP but having one is in no way mandatory\&. If no
+separate parameters have been assigned, the defaults and the ones  from
 \fIGeneral\fP section will be used\&. A silcd configuration may have any number of
 \fIConnectionParams\fP sections\&.
 .PP 
 \fBname\fP
 .RS 
-This is a unique name that separates \fBthis\fP particular 
-\fIConnectionParams\fP section from all the others\&. It is also the name with 
-which settings are referred to a given set of parameters\&. This field is 
+This is a unique name that separates \fBthis\fP particular
+\fIConnectionParams\fP section from all the others\&. It is also the name with
+which settings are referred to a given set of parameters\&. This field is
 mandatory\&.
 .RE 
 .PP 
 \fBconnections_max\fP
 .RS 
-Limits how many concurrent connections are allowed\&. Any further 
+Limits how many concurrent connections are allowed\&. Any further
 connections are simply refused\&. Note that this setting can not override the
 figure given in \fIGeneral\fP section\&.
 .RE 
@@ -396,7 +401,7 @@
 \fBanonymous\fP
 .RS 
 This boolean setting has meaning only to client connections\&. If set to
-\fItrue\fP, client connections using this \fIConnectionParams\fP block will have 
+\fItrue\fP, client connections using this \fIConnectionParams\fP block will have
 their username and host scrambled\&. The client will also have an anonymous mode
 set to it\&.
 .RE 
@@ -437,7 +442,7 @@
 \fBHost\fP
 .RS 
 An address or wildcarded set of addresses, either in numeric IP-address
-fashion or as hostnames\&. For example \fI"10\&.1\&.*"\fP or 
+fashion or as hostnames\&. For example \fI"10\&.1\&.*"\fP or
 \fI"*\&.mydomain\&.domain\&.org"\fP\&.
 .RE 
 .PP 
@@ -559,7 +564,7 @@
 .PP 
 \fBHost\fP
 .RS 
-Either FQDN or a strict IP-address to the origin of connection\&. 
+Either FQDN or a strict IP-address to the origin of connection\&.
 This field is optional\&.
 .RE 
 .PP 
@@ -585,7 +590,7 @@
 .RE 
 .PP 
 .SH "SECTION: Deny" 
-This section defines denied incoming connections\&. They apply equally to both 
+This section defines denied incoming connections\&. They apply equally to both
 client and server connections, so make sure you know what you add here\&. Each
 \fIDeny\fP section covers one instance of denied connection(s)\&. There may be any
 number of \fIDeny\fP sections\&.

Modified: silc-server/branches/upstream/current/includes/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/Makefile.am (original)
+++ silc-server/branches/upstream/current/includes/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./includes/Makefile.ad file in the source tree.
 
 # Source: ./includes/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/includes/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/Makefile.in (original)
+++ silc-server/branches/upstream/current/includes/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./includes/Makefile.ad file in the source tree.
 
 # Source: ./includes/Makefile.ad
-# Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/includes/silc.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/silc.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/silc.h (original)
+++ silc-server/branches/upstream/current/includes/silc.h Sat Nov 24 19:00:23 2007
@@ -63,7 +63,7 @@
 
 /* Compilation time defines, for third-party software */
 #define __SILC_HAVE_PTHREAD 1
-#define __SILC_HAVE_SIM 1
+
 
 
 #if defined(HAVE_SILCDEFS_H)
@@ -262,8 +262,8 @@
 #include "silcfsm.h"
 #include "silcsocketstream.h"
 #include "silcfdstream.h"
-#include "silcvcard.h"
 #include "silcmime.h"
+
 
 #include "silcasn1.h"
 #include "silcber.h"

Modified: silc-server/branches/upstream/current/includes/silc.h.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/silc.h.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/silc.h.in (original)
+++ silc-server/branches/upstream/current/includes/silc.h.in Sat Nov 24 19:00:23 2007
@@ -262,8 +262,8 @@
 #include "silcfsm.h"
 #include "silcsocketstream.h"
 #include "silcfdstream.h"
-#include "silcvcard.h"
 #include "silcmime.h"
+
 
 #include "silcasn1.h"
 #include "silcber.h"

Modified: silc-server/branches/upstream/current/includes/silcdistdefs.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/silcdistdefs.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/silcdistdefs.h (original)
+++ silc-server/branches/upstream/current/includes/silcdistdefs.h Sat Nov 24 19:00:23 2007
@@ -1,7 +1,7 @@
 /*
   Automatically generated by Autodist 1.3.2.  Do not edit.
 
-  Generated: Sun Jul  1 19:05:57 EEST 2007 by priikone
+  Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
   Distribution: Server
   License: 
 */
@@ -21,9 +21,7 @@
 #define SILC_DIST_MATH 1
 #define SILC_DIST_SERVER 1
 #define SILC_DIST_SILC 1
-#define SILC_DIST_SIM 1
 #define SILC_DIST_SKR 1
 #define SILC_DIST_TMA 1
-#define SILC_DIST_VCARD 1
 
 #endif /* _SILC_DISTDEFS_H */

Modified: silc-server/branches/upstream/current/includes/silcversion.h.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/includes/silcversion.h.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/includes/silcversion.h.in (original)
+++ silc-server/branches/upstream/current/includes/silcversion.h.in Sat Nov 24 19:00:23 2007
@@ -26,7 +26,7 @@
 
 /* Version check macro.  Use this to check that package is of specific
    version compile time.  Use the __SILC_XXX_VERSION below in comparison. */
-#define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8)
+#define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8))
 @__SILC_PACKAGE_VERSION@
 
 #define SILC_VERSION_STRING "@VERSION@"

Modified: silc-server/branches/upstream/current/lib/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/Makefile.ad file in the source tree.
 
 # Source: ./lib/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 
@@ -11,7 +11,7 @@
 #
 #  Author: Pekka Riikonen <priikone at silcnet.org>
 #
-#  Copyright (C) 2000 - 2005 Pekka Riikonen
+#  Copyright (C) 2000 - 2005, 2007 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -26,17 +26,31 @@
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 # SILC Library dirs
-SILCLIB_DIRS =	contrib	silccore	silcutil	silcapputil	silccrypt	silcskr	silcmath	silcsim	silcasn1	silcske	silchttp	silcvcard
+SILCLIB_DIRS =	contrib	silccore	silcutil	silcapputil	silccrypt	silcskr	silcmath	silcasn1	silcske	silchttp
 if SILC_ENABLE_SHARED
+if SILC_WIN32
+LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir) -export-dynamic -no-undefined
+else
 LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+endif
 LIBTOOL_SILC_VERSION = -version-info $(LIBSILC_CURRENT):$(LIBSILC_REVISION):$(LIBSILC_AGE)
 LIBTOOL_SILCCLIENT_VERSION = -version-info $(LIBSILCCLIENT_CURRENT):$(LIBSILCCLIENT_REVISION):$(LIBSILCCLIENT_AGE)
 LIBTOOL_SILCSERVER_VERSION = -version-info $(LIBSILCSERVER_CURRENT):$(LIBSILCSERVER_REVISION):$(LIBSILCSERVER_AGE)
 else
 LIBTOOL_OPTS=
-LIBTOOL_SILC_VERSION = 
-LIBTOOL_SILCCLIENT_VERSION = 
-LIBTOOL_SILCSERVER_VERSION = 
+LIBTOOL_SILC_VERSION =
+LIBTOOL_SILCCLIENT_VERSION =
+LIBTOOL_SILCSERVER_VERSION =
+endif
+
+if SILC_WIN32
+SILC_LINK_LIBS=$(LIBS)
+SILCCLIENT_LINK_LIBS=$(LIBS) -lsilc
+SILCSERVER_LIBS=$(LIBS) -lsilc
+else
+SILC_LINK_LIBS=
+SILCCLIENT_LINK_LIBS=
+SILCSERVER_LIBS=
 endif
 
 SILCLIB = libsilc.a
@@ -63,7 +77,7 @@
 LIBSILC_AGE=@LIBSILC_AGE@
 
 libsilc.a:
-	find $(SILCLIB_DIRS) -type f -name *.lo | xargs	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS)	$(LIBTOOL_SILC_VERSION)	$(LIBTOOL_OPTS) -o libsilc.la
+	find $(SILCLIB_DIRS) -type f -name *.lo | xargs	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILC_LINK_LIBS)	$(LIBTOOL_SILC_VERSION)	$(LIBTOOL_OPTS) -o libsilc.la
 
 
 

Modified: silc-server/branches/upstream/current/lib/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/Makefile.ad file in the source tree.
 
 # Source: ./lib/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 
@@ -27,7 +27,7 @@
 #
 #  Author: Pekka Riikonen <priikone at silcnet.org>
 #
-#  Copyright (C) 2000 - 2005 Pekka Riikonen
+#  Copyright (C) 2000 - 2005, 2007 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -274,15 +274,22 @@
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 # SILC Library dirs
-SILCLIB_DIRS = contrib	silccore	silcutil	silcapputil	silccrypt	silcskr	silcmath	silcsim	silcasn1	silcske	silchttp	silcvcard
+SILCLIB_DIRS = contrib	silccore	silcutil	silcapputil	silccrypt	silcskr	silcmath	silcasn1	silcske	silchttp
 @SILC_ENABLE_SHARED_FALSE at LIBTOOL_OPTS = 
- at SILC_ENABLE_SHARED_TRUE@LIBTOOL_OPTS = -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+ at SILC_ENABLE_SHARED_TRUE@@SILC_WIN32_FALSE at LIBTOOL_OPTS = -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+ at SILC_ENABLE_SHARED_TRUE@@SILC_WIN32_TRUE at LIBTOOL_OPTS = -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir) -export-dynamic -no-undefined
 @SILC_ENABLE_SHARED_FALSE at LIBTOOL_SILC_VERSION = 
 @SILC_ENABLE_SHARED_TRUE at LIBTOOL_SILC_VERSION = -version-info $(LIBSILC_CURRENT):$(LIBSILC_REVISION):$(LIBSILC_AGE)
 @SILC_ENABLE_SHARED_FALSE at LIBTOOL_SILCCLIENT_VERSION = 
 @SILC_ENABLE_SHARED_TRUE at LIBTOOL_SILCCLIENT_VERSION = -version-info $(LIBSILCCLIENT_CURRENT):$(LIBSILCCLIENT_REVISION):$(LIBSILCCLIENT_AGE)
 @SILC_ENABLE_SHARED_FALSE at LIBTOOL_SILCSERVER_VERSION = 
 @SILC_ENABLE_SHARED_TRUE at LIBTOOL_SILCSERVER_VERSION = -version-info $(LIBSILCSERVER_CURRENT):$(LIBSILCSERVER_REVISION):$(LIBSILCSERVER_AGE)
+ at SILC_WIN32_FALSE@SILC_LINK_LIBS = 
+ at SILC_WIN32_TRUE@SILC_LINK_LIBS = $(LIBS)
+ at SILC_WIN32_FALSE@SILCCLIENT_LINK_LIBS = 
+ at SILC_WIN32_TRUE@SILCCLIENT_LINK_LIBS = $(LIBS) -lsilc
+ at SILC_WIN32_FALSE@SILCSERVER_LIBS = 
+ at SILC_WIN32_TRUE@SILCSERVER_LIBS = $(LIBS) -lsilc
 SILCLIB = libsilc.a
 SUBDIRS = $(SILCLIB_DIRS) $(SILCSERVERLIB_DIRS) $(SILCCLIENTLIB_DIRS)
 CLEANFILES = libsilc.a $(SILCCLIENTLIB) $(SILCSERVERLIB)
@@ -622,7 +629,7 @@
 	$(MAKE) remove $(SILCLIB) $(SILCSERVERLIB) $(SILCCLIENTLIB)
 
 libsilc.a:
-	find $(SILCLIB_DIRS) -type f -name *.lo | xargs	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS)	$(LIBTOOL_SILC_VERSION)	$(LIBTOOL_OPTS) -o libsilc.la
+	find $(SILCLIB_DIRS) -type f -name *.lo | xargs	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILC_LINK_LIBS)	$(LIBTOOL_SILC_VERSION)	$(LIBTOOL_OPTS) -o libsilc.la
 
 install-data-hook:
 

Modified: silc-server/branches/upstream/current/lib/contrib/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/contrib/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/contrib/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/contrib/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/contrib/Makefile.ad file in the source tree.
 
 # Source: ./lib/contrib/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 
@@ -35,11 +35,7 @@
 
 STRINGPREP = nfkc.c rfc3454.c stringprep.c
 
-if SILC_WIN32
-libcontrib_la_SOURCES = getopti.c $(STRINGPREP)
-else
 libcontrib_la_SOURCES = getopti.c $(STRINGPREP) $(REGEX)
-endif
 
 EXTRA_DIST = *.c *.h
 

Modified: silc-server/branches/upstream/current/lib/contrib/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/contrib/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/contrib/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/contrib/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/contrib/Makefile.ad file in the source tree.
 
 # Source: ./lib/contrib/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 
@@ -111,10 +111,8 @@
 	stringprep.c regexpr.c
 am__objects_1 = nfkc.lo rfc3454.lo stringprep.lo
 @HAVE_REGEX_FALSE at am__objects_2 = regexpr.lo
- at SILC_WIN32_FALSE@am_libcontrib_la_OBJECTS = getopti.lo \
- at SILC_WIN32_FALSE@	$(am__objects_1) $(am__objects_2)
- at SILC_WIN32_TRUE@am_libcontrib_la_OBJECTS = getopti.lo \
- at SILC_WIN32_TRUE@	$(am__objects_1)
+am_libcontrib_la_OBJECTS = getopti.lo $(am__objects_1) \
+	$(am__objects_2)
 libcontrib_la_OBJECTS = $(am_libcontrib_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
 depcomp =
@@ -288,8 +286,7 @@
 @HAVE_REGEX_FALSE at REGEX = regexpr.c
 @HAVE_REGEX_TRUE at REGEX = 
 STRINGPREP = nfkc.c rfc3454.c stringprep.c
- at SILC_WIN32_FALSE@libcontrib_la_SOURCES = getopti.c $(STRINGPREP) $(REGEX)
- at SILC_WIN32_TRUE@libcontrib_la_SOURCES = getopti.c $(STRINGPREP)
+libcontrib_la_SOURCES = getopti.c $(STRINGPREP) $(REGEX)
 EXTRA_DIST = *.c *.h
 
 #

Modified: silc-server/branches/upstream/current/lib/silcapputil/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcapputil/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcapputil/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcapputil/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcapputil/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcapputil/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcapputil/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcapputil/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcapputil/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcapputil/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcapputil/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcapputil/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcasn1/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcasn1/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcasn1/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcasn1/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcasn1/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcasn1/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcasn1/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcasn1/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcasn1/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcasn1/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcasn1/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcasn1/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silccore/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccore/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccore/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silccore/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silccore/Makefile.ad file in the source tree.
 
 # Source: ./lib/silccore/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silccore/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccore/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccore/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silccore/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silccore/Makefile.ad file in the source tree.
 
 # Source: ./lib/silccore/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silccore/silcattrs.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccore/silcattrs.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccore/silcattrs.c (original)
+++ silc-server/branches/upstream/current/lib/silccore/silcattrs.c Sat Nov 24 19:00:23 2007
@@ -17,7 +17,7 @@
 
 */
 /* Implementation of Attribute Payload routines */
-/* $Id: silcattrs.c,v 1.24.2.1 2007/05/28 18:23:09 priikone Exp $ */
+/* $Id: silcattrs.c,v 1.24.2.2 2007/11/04 09:20:20 priikone Exp $ */
 
 #include "silc.h"
 #include "silcattrs.h"
@@ -57,13 +57,6 @@
 
     case SILC_ATTRIBUTE_USER_INFO:
       {
-	SilcVCard vcard = object;
-	if (object_size != sizeof(*vcard))
-	  return NULL;
-	str = silc_vcard_encode(vcard, &object_size);
-	if (!str)
-	  return NULL;
-	object = str;
       }
       break;
 
@@ -502,12 +495,6 @@
   switch (payload->attribute) {
   case SILC_ATTRIBUTE_USER_INFO:
     {
-      SilcVCard vcard = object;
-      if (object_size != sizeof(*vcard))
-	break;
-      if (!silc_vcard_decode(payload->data, payload->data_len, vcard))
-	break;
-      ret = TRUE;
     }
     break;
 

Modified: silc-server/branches/upstream/current/lib/silccore/silcpacket.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccore/silcpacket.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccore/silcpacket.c (original)
+++ silc-server/branches/upstream/current/lib/silccore/silcpacket.c Sat Nov 24 19:00:23 2007
@@ -19,7 +19,7 @@
 /*
  * Created: Fri Jul 25 18:52:14 1997
  */
-/* $Id: silcpacket.c,v 1.106.2.5 2007/07/01 13:56:59 priikone Exp $ */
+/* $Id: silcpacket.c,v 1.106.2.7 2007/11/05 20:34:55 priikone Exp $ */
 
 #include "silc.h"
 
@@ -785,6 +785,8 @@
     return NULL;
   }
 
+  SILC_LOG_DEBUG(("Created packet stream %p", ps));
+
   return ps;
 }
 
@@ -886,6 +888,8 @@
 
   if (silc_atomic_sub_int8(&stream->refcnt, 1) > 0) {
     stream->destroyed = TRUE;
+
+    SILC_LOG_DEBUG(("Marking packet stream %p destroyed", stream));
 
     /* Close the underlaying stream */
     if (!stream->udp && stream->stream)
@@ -1467,14 +1471,6 @@
   unsigned char *iv = silc_cipher_get_iv(cipher);
   SilcUInt32 pc1, pc2;
 
-  /* Increment 64-bit packet counter */
-  SILC_GET32_MSB(pc1, iv + 4);
-  SILC_GET32_MSB(pc2, iv + 8);
-  if (++pc2 == 0)
-    ++pc1;
-  SILC_PUT32_MSB(pc1, iv + 4);
-  SILC_PUT32_MSB(pc2, iv + 8);
-
   /* Reset block counter */
   memset(iv + 12, 0, 4);
 
@@ -1485,11 +1481,24 @@
     ret_iv[1] = ret_iv[0] + iv[4];
     ret_iv[2] = ret_iv[0] ^ ret_iv[1];
     ret_iv[3] = ret_iv[0] + ret_iv[2];
-    SILC_PUT32_MSB(pc2, ret_iv + 4);
+
+    /* Increment 32-bit packet counter */
+    SILC_GET32_MSB(pc1, iv + 8);
+    pc1++;
+    SILC_PUT32_MSB(pc1, ret_iv + 4);
+
     SILC_LOG_HEXDUMP(("IV"), ret_iv, 8);
 
     /* Set new nonce to counter block */
-    memcpy(iv + 4, ret_iv, 4);
+    memcpy(iv + 4, ret_iv, 8);
+  } else {
+    /* Increment 64-bit packet counter */
+    SILC_GET32_MSB(pc1, iv + 4);
+    SILC_GET32_MSB(pc2, iv + 8);
+    if (++pc2 == 0)
+      ++pc1;
+    SILC_PUT32_MSB(pc1, iv + 4);
+    SILC_PUT32_MSB(pc2, iv + 8);
   }
 
   SILC_LOG_HEXDUMP(("Counter Block"), iv, 16);

Modified: silc-server/branches/upstream/current/lib/silccore/silcpacket.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccore/silcpacket.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccore/silcpacket.h (original)
+++ silc-server/branches/upstream/current/lib/silccore/silcpacket.h Sat Nov 24 19:00:23 2007
@@ -402,6 +402,12 @@
  *    Returns list of packet streams added to the packet engine.  The caller
  *    must free the list with silc_packet_engine_free_streams_list.
  *
+ * NOTES
+ *
+ *    This function may also return disconnected and destroyed streams.  The
+ *    caller should use silc_packet_stream_is_valid to check if the stream
+ *    is valid.
+ *
  ***/
 SilcDList silc_packet_engine_get_streams(SilcPacketEngine engine);
 

Modified: silc-server/branches/upstream/current/lib/silccrypt/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccrypt/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccrypt/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silccrypt/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silccrypt/Makefile.ad file in the source tree.
 
 # Source: ./lib/silccrypt/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silccrypt/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccrypt/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccrypt/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silccrypt/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silccrypt/Makefile.ad file in the source tree.
 
 # Source: ./lib/silccrypt/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silccrypt/aes.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccrypt/aes.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccrypt/aes.c (original)
+++ silc-server/branches/upstream/current/lib/silccrypt/aes.c Sat Nov 24 19:00:23 2007
@@ -74,17 +74,35 @@
 SILC_CIPHER_API_ENCRYPT(aes_cbc)
 {
   int nb = len >> 4;
+  SilcUInt32 tmp[4], tmp2[4];
 
   SILC_ASSERT((len & (16 - 1)) == 0);
   if (len & (16 - 1))
     return FALSE;
 
   while(nb--) {
-    lp32(iv)[0] ^= lp32(src)[0];
-    lp32(iv)[1] ^= lp32(src)[1];
-    lp32(iv)[2] ^= lp32(src)[2];
-    lp32(iv)[3] ^= lp32(src)[3];
+    SILC_GET32_MSB(tmp[0], &iv[0]);
+    SILC_GET32_MSB(tmp[1], &iv[4]);
+    SILC_GET32_MSB(tmp[2], &iv[8]);
+    SILC_GET32_MSB(tmp[3], &iv[12]);
+
+    SILC_GET32_MSB(tmp2[0], &src[0]);
+    SILC_GET32_MSB(tmp2[1], &src[4]);
+    SILC_GET32_MSB(tmp2[2], &src[8]);
+    SILC_GET32_MSB(tmp2[3], &src[12]);
+
+    tmp[0] = tmp[0] ^ tmp2[0];
+    tmp[1] = tmp[1] ^ tmp2[1];
+    tmp[2] = tmp[2] ^ tmp2[2];
+    tmp[3] = tmp[3] ^ tmp2[3];
+
+    SILC_PUT32_MSB(tmp[0], &iv[0]);
+    SILC_PUT32_MSB(tmp[1], &iv[4]);
+    SILC_PUT32_MSB(tmp[2], &iv[8]);
+    SILC_PUT32_MSB(tmp[3], &iv[12]);
+
     aes_encrypt(iv, iv, &((AesContext *)context)->u.enc);
+
     memcpy(dst, iv, 16);
     src += 16;
     dst += 16;
@@ -100,6 +118,7 @@
 {
   unsigned char tmp[16];
   int nb = len >> 4;
+  SilcUInt32 tmp2[4], tmp3[4];
 
   if (len & (16 - 1))
     return FALSE;
@@ -107,10 +126,27 @@
   while(nb--) {
     memcpy(tmp, src, 16);
     aes_decrypt(src, dst, &((AesContext *)context)->u.dec);
-    lp32(dst)[0] ^= lp32(iv)[0];
-    lp32(dst)[1] ^= lp32(iv)[1];
-    lp32(dst)[2] ^= lp32(iv)[2];
-    lp32(dst)[3] ^= lp32(iv)[3];
+
+    SILC_GET32_MSB(tmp2[0], &iv[0]);
+    SILC_GET32_MSB(tmp2[1], &iv[4]);
+    SILC_GET32_MSB(tmp2[2], &iv[8]);
+    SILC_GET32_MSB(tmp2[3], &iv[12]);
+
+    SILC_GET32_MSB(tmp3[0], &dst[0]);
+    SILC_GET32_MSB(tmp3[1], &dst[4]);
+    SILC_GET32_MSB(tmp3[2], &dst[8]);
+    SILC_GET32_MSB(tmp3[3], &dst[12]);
+
+    tmp2[0] = tmp3[0] ^ tmp2[0];
+    tmp2[1] = tmp3[1] ^ tmp2[1];
+    tmp2[2] = tmp3[2] ^ tmp2[2];
+    tmp2[3] = tmp3[3] ^ tmp2[3];
+
+    SILC_PUT32_MSB(tmp2[0], &dst[0]);
+    SILC_PUT32_MSB(tmp2[1], &dst[4]);
+    SILC_PUT32_MSB(tmp2[2], &dst[8]);
+    SILC_PUT32_MSB(tmp2[3], &dst[12]);
+
     memcpy(iv, tmp, 16);
     src += 16;
     dst += 16;

Modified: silc-server/branches/upstream/current/lib/silccrypt/silcpk.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silccrypt/silcpk.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silccrypt/silcpk.c (original)
+++ silc-server/branches/upstream/current/lib/silccrypt/silcpk.c Sat Nov 24 19:00:23 2007
@@ -124,7 +124,7 @@
   int len;
 
   /* Protocol says that at least UN and HN must be provided as identifier */
-  if (!strstr(identifier, "UN=") && !strstr(identifier, "HN=")) {
+  if (!strstr(identifier, "UN=") || !strstr(identifier, "HN=")) {
     SILC_LOG_DEBUG(("The public does not have the required UN= and HN= "
 		    "identifiers"));
     return FALSE;
@@ -206,7 +206,7 @@
 
   if (!username || !host)
     return NULL;
-  if (strlen(username) < 3 || strlen(host) < 3)
+  if (strlen(username) < 1 || strlen(host) < 1)
     return NULL;
 
   memset(&buf, 0, sizeof(buf));

Modified: silc-server/branches/upstream/current/lib/silchttp/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silchttp/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silchttp/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silchttp/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silchttp/Makefile.ad file in the source tree.
 
 # Source: ./lib/silchttp/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silchttp/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silchttp/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silchttp/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silchttp/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silchttp/Makefile.ad file in the source tree.
 
 # Source: ./lib/silchttp/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcmath/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcmath/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcmath/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcmath/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcmath/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcmath/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcmath/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcmath/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcmath/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcmath/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcmath/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcmath/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcske/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcske/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcske/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcske/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcske/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcske/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcske/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcske/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcske/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcske/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcske/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcske/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:12 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcske/silcconnauth.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcske/silcconnauth.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcske/silcconnauth.c (original)
+++ silc-server/branches/upstream/current/lib/silcske/silcconnauth.c Sat Nov 24 19:00:23 2007
@@ -591,14 +591,15 @@
     /* Allocate search constraints for finding the key */
     find = silc_skr_find_alloc();
 
-    if (!find || !connauth->auth_data) {
+    if (!find || !connauth->auth_data || !connauth->ske->prop->public_key) {
       /** Out of memory */
       silc_fsm_next(fsm, silc_connauth_st_responder_failure);
       return SILC_FSM_CONTINUE;
     }
 
-    silc_skr_find_set_pkcs_type(find, connauth->ske->pk_type);
-    silc_skr_find_set_public_key(find, connauth->ske->public_key);
+    silc_skr_find_set_pkcs_type(
+		  find, silc_pkcs_get_type(connauth->ske->prop->public_key));
+    silc_skr_find_set_public_key(find, connauth->ske->prop->public_key);
     silc_skr_find_set_usage(find, (SILC_SKR_USAGE_AUTH |
 				   SILC_SKR_USAGE_KEY_AGREEMENT));
 
@@ -652,6 +653,8 @@
 
   silc_free(connauth->auth_data);
 
+  SILC_LOG_DEBUG(("Signature is Ok"));
+
   /** Authentication successful */
   silc_fsm_next(fsm, silc_connauth_st_responder_success);
   return SILC_FSM_CONTINUE;

Modified: silc-server/branches/upstream/current/lib/silcske/silcske.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcske/silcske.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcske/silcske.c (original)
+++ silc-server/branches/upstream/current/lib/silcske/silcske.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: silcske.c,v 1.92.2.3 2007/07/01 11:12:46 priikone Exp $ */
+/* $Id: silcske.c,v 1.92.2.5 2007/11/05 21:12:56 priikone Exp $ */
 
 #include "silc.h"
 #include "silcske.h"
@@ -3285,7 +3285,7 @@
 			   SilcHmac *ret_hmac_receive,
 			   SilcHash *ret_hash)
 {
-  unsigned char iv[32];
+  unsigned char iv[SILC_HASH_MAXLEN];
   SilcBool iv_included = (prop->flags & SILC_SKE_SP_FLAG_IV_INCLUDED);
 
   /* Allocate ciphers to be used in the communication */
@@ -3309,6 +3309,12 @@
   if (ret_hmac_receive) {
     if (!silc_hmac_alloc((char *)silc_hmac_get_name(prop->hmac), NULL,
 			 ret_hmac_receive))
+      return FALSE;
+  }
+
+  /* Allocate hash */
+  if (ret_hash) {
+    if (!silc_hash_alloc(silc_hash_get_name(prop->hash), ret_hash))
       return FALSE;
   }
 
@@ -3320,10 +3326,24 @@
 			  keymat->enc_key_len, TRUE);
 
       if (silc_cipher_get_mode(*ret_send_key) == SILC_CIPHER_MODE_CTR) {
-        memcpy(iv, ske->hash, 4);
-        memcpy(iv + 4, keymat->receive_iv, iv_included ? 4 : 8);
+	/* Counter mode */
+	if (!ske->rekeying) {
+	  /* Set IV. */
+	  memcpy(iv, ske->hash, 4);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->receive_iv, 8);
+	} else {
+	  /* Rekey, recompute the truncated hash value. */
+	  silc_hash_make(prop->hash, keymat->receive_iv, 8, iv);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->receive_iv, 8);
+	  else
+	    memset(iv + 4, 0, 12);
+	}
+
         silc_cipher_set_iv(*ret_send_key, iv);
       } else {
+	/* Other modes */
 	silc_cipher_set_iv(*ret_send_key, keymat->receive_iv);
       }
     }
@@ -3332,10 +3352,24 @@
 			  keymat->enc_key_len, FALSE);
 
       if (silc_cipher_get_mode(*ret_receive_key) == SILC_CIPHER_MODE_CTR) {
-        memcpy(iv, ske->hash, 4);
-        memcpy(iv + 4, keymat->send_iv, iv_included ? 4 : 8);
+	/* Counter mode */
+	if (!ske->rekeying) {
+	  /* Set IV. */
+	  memcpy(iv, ske->hash, 4);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->send_iv, 8);
+	} else {
+	  /* Rekey, recompute the truncated hash value. */
+	  silc_hash_make(prop->hash, keymat->send_iv, 8, iv);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->send_iv, 8);
+	  else
+	    memset(iv + 4, 0, 12);
+	}
+
         silc_cipher_set_iv(*ret_receive_key, iv);
       } else {
+	/* Other modes */
 	silc_cipher_set_iv(*ret_receive_key, keymat->send_iv);
       }
     }
@@ -3351,10 +3385,24 @@
 			  keymat->enc_key_len, TRUE);
 
       if (silc_cipher_get_mode(*ret_send_key) == SILC_CIPHER_MODE_CTR) {
-        memcpy(iv, ske->hash, 4);
-        memcpy(iv + 4, keymat->send_iv, iv_included ? 4 : 8);
+	/* Counter mode */
+	if (!ske->rekeying) {
+	  /* Set IV. */
+	  memcpy(iv, ske->hash, 4);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->send_iv, 8);
+	} else {
+	  /* Rekey, recompute the truncated hash value. */
+	  silc_hash_make(prop->hash, keymat->send_iv, 8, iv);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->send_iv, 8);
+	  else
+	    memset(iv + 4, 0, 12);
+	}
+
 	silc_cipher_set_iv(*ret_send_key, iv);
       } else {
+	/* Other modes */
 	silc_cipher_set_iv(*ret_send_key, keymat->send_iv);
       }
     }
@@ -3363,10 +3411,25 @@
 			  keymat->enc_key_len, FALSE);
 
       if (silc_cipher_get_mode(*ret_receive_key) == SILC_CIPHER_MODE_CTR) {
-        memcpy(iv, ske->hash, 4);
-        memcpy(iv + 4, keymat->receive_iv, iv_included ? 4 : 8);
+	/* Counter mode */
+	if (!ske->rekeying) {
+	  /* Set IV.  If IV Included flag was negotiated we only set the
+	     truncated hash value. */
+	  memcpy(iv, ske->hash, 4);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->receive_iv, 8);
+	} else {
+	  /* Rekey, recompute the truncated hash value. */
+	  silc_hash_make(prop->hash, keymat->receive_iv, 8, iv);
+	  if (!iv_included)
+	    memcpy(iv + 4, keymat->receive_iv, 8);
+	  else
+	    memset(iv + 4, 0, 12);
+ 	}
+
 	silc_cipher_set_iv(*ret_receive_key, iv);
       } else {
+	/* Other modes */
 	silc_cipher_set_iv(*ret_receive_key, keymat->receive_iv);
       }
     }
@@ -3376,12 +3439,6 @@
     if (ret_hmac_receive)
       silc_hmac_set_key(*ret_hmac_receive, keymat->receive_hmac_key,
 			keymat->hmac_key_len);
-  }
-
-  /* Allocate hash */
-  if (ret_hash) {
-    if (!silc_hash_alloc(silc_hash_get_name(prop->hash), ret_hash))
-      return FALSE;
   }
 
   return TRUE;

Modified: silc-server/branches/upstream/current/lib/silcskr/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcskr/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcskr/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcskr/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcskr/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcskr/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcskr/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcskr/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcskr/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcskr/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcskr/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcskr/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcskr/silcskr.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcskr/silcskr.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcskr/silcskr.c (original)
+++ silc-server/branches/upstream/current/lib/silcskr/silcskr.c Sat Nov 24 19:00:23 2007
@@ -492,6 +492,9 @@
 {
   SilcSKRKeyInternal key;
   SilcSKRStatus status = SILC_SKR_ERROR;
+#if defined(SILC_DEBUG)
+  char tmp[256];
+#endif /* SILC_DEBUG */
 
   SILC_LOG_DEBUG(("Adding SILC public key"));
 
@@ -515,6 +518,12 @@
   key->key.usage = usage;
   key->key.key = public_key;
   key->key.key_context = key_context;
+
+#if defined(SILC_DEBUG)
+  silc_skr_type_string(SILC_SKR_FIND_USAGE, SILC_32_TO_PTR(usage),
+		       tmp, sizeof(tmp) - 1);
+  SILC_LOG_DEBUG(("Search cons %s", tmp));
+#endif /* SILC_DEBUG */
 
   /* Add key specifics */
 

Modified: silc-server/branches/upstream/current/lib/silcutil/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/Makefile.am?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/Makefile.am (original)
+++ silc-server/branches/upstream/current/lib/silcutil/Makefile.am Sat Nov 24 19:00:23 2007
@@ -2,7 +2,7 @@
 # To make changes edit the ./lib/silcutil/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcutil/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcutil/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/Makefile.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/Makefile.in (original)
+++ silc-server/branches/upstream/current/lib/silcutil/Makefile.in Sat Nov 24 19:00:23 2007
@@ -18,7 +18,7 @@
 # To make changes edit the ./lib/silcutil/Makefile.ad file in the source tree.
 
 # Source: ./lib/silcutil/Makefile.ad
-# Generated: Sun Jul  1 19:05:58 EEST 2007 by priikone
+# Generated: Sun Nov 18 14:37:11 EET 2007 by priikone
 # Distribution: Server
 # License: 
 

Modified: silc-server/branches/upstream/current/lib/silcutil/silcatomic.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/silcatomic.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/silcatomic.h (original)
+++ silc-server/branches/upstream/current/lib/silcutil/silcatomic.h Sat Nov 24 19:00:23 2007
@@ -437,7 +437,7 @@
 SILC_ATOMIC_SET_INT_F(bits)						\
 {									\
   /* Windows */								\
-  InterlockedExchange((LONG)&atomic->value, (LONG)value);		\
+  InterlockedExchange((LONG *)&atomic->value, (LONG)value);		\
 }
 
 #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
@@ -753,7 +753,7 @@
 SILC_ATOMIC_ADD_INT_F(bits)						\
 {									\
   SilcUInt##bits ret;							\
-  SilcInt32 val = value;
+  SilcInt32 val = value;						\
   /* GCC + IA64 (GCC builtin atomic operations) */			\
   ret = __sync_fetch_and_add(&atomic->value, val);			\
   return ret + value;							\
@@ -895,7 +895,7 @@
 SILC_ATOMIC_INC_F(bits)				   			\
 {									\
   /* Windows */								\
-  InterlockedIncrement((LONG)&atomic->value);				\
+  InterlockedIncrement((LONG *)&atomic->value);				\
 }
 
 #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
@@ -1001,7 +1001,7 @@
 SILC_ATOMIC_DEC_F(bits)				   			\
 {									\
   /* Windows */								\
-  InterlockedDecrement((LONG)&atomic->value);				\
+  InterlockedDecrement((LONG *)&atomic->value);				\
 }
 
 #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
@@ -1230,7 +1230,7 @@
 
 #elif defined(__GNUC__) && defined(SILC_IA64)
   /* GCC + IA64 (GCC builtin atomic operations) */
-  return  __sync_bool_compare_and_swap((long)&atomic->value, (long)old_val,
+  return  __sync_bool_compare_and_swap((long *)&atomic->value, (long)old_val,
 				       (long)new_val);
 
 #elif defined(__GNUC__) && defined(SILC_POWERPC)

Modified: silc-server/branches/upstream/current/lib/silcutil/silcconfig.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/silcconfig.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/silcconfig.c (original)
+++ silc-server/branches/upstream/current/lib/silcutil/silcconfig.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: silcconfig.c,v 1.24 2006/12/31 15:33:57 priikone Exp $ */
+/* $Id: silcconfig.c,v 1.24.2.1 2007/09/09 15:04:15 priikone Exp $ */
 
 #include "silc.h"
 
@@ -26,6 +26,8 @@
 #else
 #define SILC_CONFIG_DEBUG(fmt)
 #endif
+
+#define BUF_SIZE 255
 
 /* this is the option struct and currently it is only used internally to
  * the module and other structs. */
@@ -112,11 +114,14 @@
  * a separator is any non alphanumeric character nor "_" or "-" */
 static char *my_next_token(SilcConfigFile *file, char *to)
 {
+  unsigned int count = 0;
   register char *o;
   my_trim_spaces(file);
   o = file->p;
-  while (isalnum((int)*o) || (*o == '_') || (*o == '-'))
+  while ((isalnum((int)*o) || (*o == '_') || (*o == '-')) && count < BUF_SIZE) {
+    count++;
     *to++ = *o++;
+  }
   *to = '\0';
   file->p = o;
   return to;
@@ -130,24 +135,30 @@
   my_trim_spaces(file);
   o = file->p;
   if (*o == '"') {
-    char *quot = strchr(++o, '"');
-    int len = quot - o;
-    if (!quot) { /* XXX FIXME: gotta do something here */
-      printf("Bullshit, missing matching \"");
+    unsigned int count = 0;
+    char *d = to;
+    while (count < BUF_SIZE) {
+      o++;
+      if (*o == '"') {
+          break;
+      }
+      if (*o == '\\') {
+          o++;
+      }
+      count++;
+      *d++ = *o;
+    }
+    if (count >= BUF_SIZE) { /* XXX FIXME: gotta do something here */
+      fprintf(stderr, "Bullshit, missing matching \"");
       exit(1);
     }
-    if (len <= 0)
-      *to = '\0';
-    else {
-      strncpy(to, o, len);
-      to[len] = '\0';
-    }
+    *d = '\0';
     /* update stream pointer */
-    file->p = quot + 1;
-    return to;
-  }
-  /* we don't need quote parsing, fall-back to token extractor */
-  my_next_token(file, to);
+    file->p = o + 1;
+  } else {
+    /* we don't need quote parsing, fall-back to token extractor */
+    my_next_token(file, to);
+  }
   return to;
 }
 
@@ -454,7 +465,7 @@
 
   /* loop throught statements */
   while (1) {
-    char buf[255];
+    char buf[BUF_SIZE];
     SilcConfigOption *thisopt;
 
     /* makes it pointing to the next interesting char */

Modified: silc-server/branches/upstream/current/lib/silcutil/silcnet.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/silcnet.h?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/silcnet.h (original)
+++ silc-server/branches/upstream/current/lib/silcutil/silcnet.h Sat Nov 24 19:00:23 2007
@@ -25,11 +25,6 @@
  * can be used to create TCP/IP and UDP/IP connections and listeners.
  * Various utility functions for resolving various information is also
  * provided.
- *
- * On WIN32 systems the SILC Net API must initialized by calling the
- * silc_net_win32_init and uninitialized when the application ends by
- * calling the silc_net_win32_uninit function. The initializing must be
- * done in order to assure that the SILC Net API works correctly.
  *
  ***/
 

Modified: silc-server/branches/upstream/current/lib/silcutil/silcschedule.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/silcschedule.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/silcschedule.c (original)
+++ silc-server/branches/upstream/current/lib/silcutil/silcschedule.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: silcschedule.c,v 1.74.2.1 2007/06/06 14:32:17 priikone Exp $ */
+/* $Id: silcschedule.c,v 1.74.2.2 2007/08/07 18:15:19 priikone Exp $ */
 
 #include "silc.h"
 
@@ -201,12 +201,12 @@
   if (silc_unlikely(task == SILC_ALL_TASKS)) {
     SilcTask task;
     SilcHashTableList htl;
-    SilcUInt32 fd;
+    void *fd;
 
     /* Delete from fd queue */
     silc_hash_table_list(schedule->fd_queue, &htl);
-    while (silc_hash_table_get(&htl, (void *)&fd, (void *)&task))
-      silc_hash_table_del(schedule->fd_queue, SILC_32_TO_PTR(fd));
+    while (silc_hash_table_get(&htl, &fd, (void *)&task))
+      silc_hash_table_del(schedule->fd_queue, fd);
     silc_hash_table_list_reset(&htl);
 
     /* Delete from timeout queue */

Modified: silc-server/branches/upstream/current/lib/silcutil/unix/silcunixnet.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/unix/silcunixnet.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/unix/silcunixnet.c (original)
+++ silc-server/branches/upstream/current/lib/silcutil/unix/silcunixnet.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: silcunixnet.c,v 1.37.2.2 2007/06/24 14:13:11 priikone Exp $ */
+/* $Id: silcunixnet.c,v 1.37.2.3 2007/11/04 14:18:04 priikone Exp $ */
 
 #include "silc.h"
 #include "silcnet.h"
@@ -363,8 +363,10 @@
 
   if (remote_ip_addr && remote_port) {
     if (sock->ipv6) {
+#ifdef HAVE_IPV6
       from = (struct sockaddr *)&s.sin6;
       flen = sizeof(s.sin6);
+#endif /* HAVE_IPV6 */
     } else {
       from = (struct sockaddr *)&s.sin;
       flen = sizeof(s.sin);
@@ -395,9 +397,13 @@
   /* Return remote address */
   if (remote_ip_addr && remote_port) {
     if (sock->ipv6) {
+#ifdef HAVE_IPV6
       *remote_port = ntohs(s.sin6.sin6_port);
       inet_ntop(AF_INET6, &s.sin6.sin6_addr, remote_ip_addr,
 		remote_ip_addr_size);
+#else
+      *remote_port = 0;
+#endif /* HAVE_IPV6 */
     } else {
       *remote_port = ntohs(s.sin.sin_port);
       inet_ntop(AF_INET, &s.sin.sin_addr, remote_ip_addr,

Modified: silc-server/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c (original)
+++ silc-server/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c Sat Nov 24 19:00:23 2007
@@ -16,7 +16,7 @@
   GNU General Public License for more details.
 
 */
-/* $Id: silcunixschedule.c,v 1.28.2.4 2007/06/24 14:12:26 priikone Exp $ */
+/* $Id: silcunixschedule.c,v 1.28.2.5 2007/08/07 18:15:19 priikone Exp $ */
 
 #include "silc.h"
 
@@ -121,11 +121,13 @@
   struct pollfd *fds = internal->fds;
   SilcUInt32 fds_count = internal->fds_count;
   int fd, ret, i = 0, timeout = -1;
+  void *fdp;
 
   silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, (void *)&fd, (void *)&task)) {
+  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
     if (!task->events)
       continue;
+    fd = SILC_PTR_TO_32(fdp);
 
     /* Allocate larger fd table if needed */
     if (i >= fds_count) {
@@ -198,14 +200,16 @@
   SilcTaskFd task;
   fd_set in, out;
   int fd, max_fd = 0, ret;
+  void *fdp;
 
   FD_ZERO(&in);
   FD_ZERO(&out);
 
   silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, (void *)&fd, (void *)&task)) {
+  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
     if (!task->events)
       continue;
+    fd = SILC_PTR_TO_32(fdp);
 
 #ifdef FD_SETSIZE
     if (fd >= FD_SETSIZE)
@@ -233,9 +237,10 @@
     return ret;
 
   silc_hash_table_list(schedule->fd_queue, &htl);
-  while (silc_hash_table_get(&htl, (void *)&fd, (void *)&task)) {
+  while (silc_hash_table_get(&htl, &fdp, (void *)&task)) {
     if (!task->header.valid || !task->events)
       continue;
+    fd = SILC_PTR_TO_32(fdp);
 
 #ifdef FD_SETSIZE
     if (fd >= FD_SETSIZE)

Modified: silc-server/branches/upstream/current/silcdefs.h.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-server/branches/upstream/current/silcdefs.h.in?rev=186&op=diff
==============================================================================
--- silc-server/branches/upstream/current/silcdefs.h.in (original)
+++ silc-server/branches/upstream/current/silcdefs.h.in Sat Nov 24 19:00:23 2007
@@ -393,9 +393,6 @@
 /* SILC_LOGSDIR */
 #undef SILC_LOGSDIR
 
-/* SILC_MODULESDIR */
-#undef SILC_MODULESDIR
-
 /* GMP */
 #undef SILC_MP_GMP
 
@@ -413,9 +410,6 @@
 
 /* SILC_SERVER_CONFIG_FILE */
 #undef SILC_SERVER_CONFIG_FILE
-
-/* HAVE_SIM */
-#undef SILC_SIM
 
 /* HAVE_THREAD */
 #undef SILC_THREADS




More information about the Pkg-silc-commits mailing list