[Pkg-silc-commits] r322 - in /silc-toolkit/branches/upstream/current: ./ apps/ doc/ doc/toolkit/ includes/ lib/ lib/contrib/ lib/silcapputil/ lib/silcasn1/ lib/silcclient/ lib/silccore/ lib/silccrypt/ lib/silchttp/ lib/silcmath/ lib/silcsftp/ 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
Mon Nov 24 16:22:47 UTC 2008
Author: micah
Date: Mon Nov 24 16:22:47 2008
New Revision: 322
URL: http://svn.debian.org/wsvn/pkg-silc/?sc=1&rev=322
Log:
[svn-upgrade] Integrating new upstream version, silc-toolkit (1.1.8)
Added:
silc-toolkit/branches/upstream/current/ChangeLog
Removed:
silc-toolkit/branches/upstream/current/CHANGES
Modified:
silc-toolkit/branches/upstream/current/Makefile.am
silc-toolkit/branches/upstream/current/Makefile.in
silc-toolkit/branches/upstream/current/apps/Makefile.am
silc-toolkit/branches/upstream/current/apps/Makefile.in
silc-toolkit/branches/upstream/current/configure
silc-toolkit/branches/upstream/current/configure.ac
silc-toolkit/branches/upstream/current/doc/Makefile.am
silc-toolkit/branches/upstream/current/doc/Makefile.in
silc-toolkit/branches/upstream/current/doc/toolkit/index.html
silc-toolkit/branches/upstream/current/doc/toolkit/silctypes-SilcUInt32.html
silc-toolkit/branches/upstream/current/includes/Makefile.am
silc-toolkit/branches/upstream/current/includes/Makefile.in
silc-toolkit/branches/upstream/current/includes/silcdistdefs.h
silc-toolkit/branches/upstream/current/includes/silcversion.h
silc-toolkit/branches/upstream/current/lib/Makefile.am
silc-toolkit/branches/upstream/current/lib/Makefile.in
silc-toolkit/branches/upstream/current/lib/contrib/Makefile.am
silc-toolkit/branches/upstream/current/lib/contrib/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcapputil/silcidcache.c
silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1.c
silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1_encode.c
silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcclient/client.c
silc-toolkit/branches/upstream/current/lib/silcclient/client.h
silc-toolkit/branches/upstream/current/lib/silcclient/client_channel.c
silc-toolkit/branches/upstream/current/lib/silcclient/client_entry.c
silc-toolkit/branches/upstream/current/lib/silcclient/client_internal.h
silc-toolkit/branches/upstream/current/lib/silcclient/client_notify.c
silc-toolkit/branches/upstream/current/lib/silcclient/client_register.c
silc-toolkit/branches/upstream/current/lib/silcclient/command.c
silc-toolkit/branches/upstream/current/lib/silcclient/command_reply.c
silc-toolkit/branches/upstream/current/lib/silccore/Makefile.am
silc-toolkit/branches/upstream/current/lib/silccore/Makefile.in
silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.c
silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.h
silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.am
silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.in
silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86.asm
silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86_64.asm
silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.am
silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcske/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcske/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcske/silcske.c
silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcskr/silcskr.c
silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.in
silc-toolkit/branches/upstream/current/lib/silcutil/silcbuffmt.c
silc-toolkit/branches/upstream/current/lib/silcutil/silcfdstream.c
silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream.c
silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream_i.h
silc-toolkit/branches/upstream/current/lib/silcutil/silcstack.c
silc-toolkit/branches/upstream/current/lib/silcutil/silctypes.h
silc-toolkit/branches/upstream/current/lib/silcutil/silcutil.c
silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.c
silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.h
silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixnet.c
silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c
silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixsocketstream.c
silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.am
silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.in
silc-toolkit/branches/upstream/current/silc-toolkit.spec
Added: silc-toolkit/branches/upstream/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/ChangeLog?rev=322&op=file
==============================================================================
--- silc-toolkit/branches/upstream/current/ChangeLog (added)
+++ silc-toolkit/branches/upstream/current/ChangeLog Mon Nov 24 16:22:47 2008
@@ -1,0 +1,326 @@
+commit 711fe01f210030b40ce0aeceb1c18526632ba5b8
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Oct 25 16:58:50 2008 +0300
+
+ Fixed channel MAC key setting in JOIN notify and command reply
+
+ In JOIN notify when MAC algo changes wrong key was set to the new MAC.
+
+ In JOIN command reply in backup router the channel key may not be set
+ in command reply because backup reiceives also CHANNEL_KEY packet from
+ router and hence clients receive it too, but new MAC context was still
+ allocated in the command reply, hence using empty MAC without key with
+ channel messages.
+
+commit 457becb724b71a6145d8c1ad2111b972ed67128d
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Sep 13 15:45:53 2008 +0300
+
+ SKE: Verify initiator's public key always
+
+ We used to verify initiator's public key only if we were doing mutual
+ authentication. We now verify it always because calling application
+ may need the public key initiator sent.
+
+commit 90e14dc985628e0b0f86e604d511039d302dc956
+Author: Skywing <skywing at valhallalegends.com>
+Date: Fri Jun 27 18:13:59 2008 -0500
+
+ Fix reference count bug leading to memory corruption on duplicate deletions.
+
+commit 35135dcd998899182a78e7742b753c2bec72d923
+Author: Skywing <skywing at valhallalegends.com>
+Date: Fri Jun 20 17:37:21 2008 -0500
+
+ Make packet stream reference counts 32 bits.
+
+commit 1cc9af890006b0181913d4f84909442744476745
+Author: Kp <kp at valhallalegends.com>
+Date: Sun Jun 1 16:15:46 2008 -0500
+
+ Packet streams: make packet handling callback pointers read only.
+
+ The function pointers for the packet handling callbacks are never
+ modified, so make them read only.
+
+commit 3661cbc69ce24b5230c8602b24927eb841933b5e
+Author: Kp <kp at valhallalegends.com>
+Date: Sun Jun 1 12:59:42 2008 -0500
+
+ Packet streams: avoid double free if silc_id_id2str fails.
+
+ In silc_packet_set_ids, the old ID is freed before silc_id_id2str is
+ called. If silc_id_id2str fails, then silc_packet_set_ids returns
+ without resetting the ID pointer. The pointer is then free, but not
+ NULL. When the packet stream is destroyed, silc_packet_stream_destroy
+ will free the pointer again. Reset the ID pointer to NULL immediately
+ after freeing it to prevent this.
+
+commit 7ebc6fcc9308c92130d59641b9f85341e609708b
+Author: Kp <kp at valhallalegends.com>
+Date: Sun Jun 1 12:25:50 2008 -0500
+
+ Packet streams: fix memory leak on dlist allocation failure.
+
+ If silc_dlist_init fails to allocate a SilcDList for stream->process,
+ then silc_packet_stream_link_va leaks the newly allocated
+ SilcPacketProcess. Fix that by calling silc_free(p) on the error path.
+
+commit 8a03227a106d087077ab9f9e21f644c8b653af3f
+Author: Kp <kp at valhallalegends.com>
+Date: Fri May 30 23:31:07 2008 -0500
+
+ ASN1: Fix NULL pointer dereference on stack allocation failure.
+
+ If the second silc_stack_alloc fails, then asn1->stack2 is NULL. Thus,
+ when silc_asn1_init calls silc_stack_free(asn1->stack2), it is
+ equivalent to silc_stack_free(NULL). However, silc_stack_free does not
+ check for a NULL pointer. Fix silc_asn1_init to free asn1->stack1, as
+ was intended.
+
+commit 7f51164d1ac93077d832de44a8dc71783fab8b33
+Author: Kp <kp at valhallalegends.com>
+Date: Thu Apr 24 22:18:27 2008 -0500
+
+ Avoid NULL dereference when leaving a channel with a private key.
+
+ Split out a patch from Skywing <skywing at valhallalegends.com> to fix a
+ NULL pointer dereference when the client leaves a +k channel and the
+ local user had set a key for the channel.
+
+commit ebfe5dc8641467efea3506a4797a2b1260b2da55
+Author: Kp <kp at valhallalegends.com>
+Date: Sat May 31 16:37:45 2008 -0500
+
+ ASN1: Fix stack variable overwrite when encoding OID.
+
+ The call to sscanf specifies a format string of "%lu", a long unsigned
+ int. The pointer argument was cast to unsigned long *, but this is
+ wrong for 64 bit systems. On 64 bit systems, unsigned long is 64 bits,
+ but the oid value is a SilcUInt32 on all systems. As a result, sscanf
+ will overwrite a neighboring variable on the stack. Fix this by
+ changing the format string to "%u" and removing the cast.
+
+commit 41bac7b295aab8a09a1add8ca02db472fcd31184
+Author: Kp <kp at valhallalegends.com>
+Date: Sat May 31 23:57:51 2008 -0500
+
+ Types: make SilcUInt32 an unsigned int in most cases.
+
+ On typical 32-bit systems, both unsigned int and unsigned long are 32
+ bits wide. However, they have different format specifiers, so they
+ cannot be used interchangeably. On typical 64-bit systems, unsigned int
+ is 32 bits and unsigned long is 64 bits. To allow for a more consistent
+ format string, reorder the type size checks so that SilcUInt32 is an
+ unsigned int on both 32 bit and 64 bit systems.
+
+commit 9606632e594c94958116127a39e4411888c4a30b
+Author: Kp <kp at valhallalegends.com>
+Date: Sat May 31 23:41:59 2008 -0500
+
+ Type sanity: add compile time check that integers are of the expected size.
+
+ The comments in silctypes.h guarantee that certain types are of
+ particular sizes. Add compile time checks that will fail if these
+ guarantees are not met.
+
+commit ad10dc073b3684e02f5fa14449463c1122bd4cb2
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Aug 31 10:58:11 2008 +0300
+
+ Handle failed memory allocations in packet sending
+
+commit 127c91c66005ddf9585458914e4caaf56758b490
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Aug 31 09:58:49 2008 +0300
+
+ silc_stack_free can now be called with NULL stack
+
+commit 103986117eb70b715d462b4d520a1f0912b8f90f
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 15:08:03 2008 +0300
+
+ Handle EAGAIN and EINTR correctly in silc_get_input in case of error
+
+commit ca4ecaceb517b395f7ca7f74c9333a18e5d39f40
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 14:15:49 2008 +0300
+
+ Mark client entry invalid when killed and when notified non-existing
+
+commit 136127fe86ff65414e1053c2f23b2126fb91b204
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 14:14:45 2008 +0300
+
+ Fixed command calling crash
+
+ If command finishes synchronously the command context is not valid
+ anymore and cannot be accessed. Reported by Sami Farin.
+
+commit 9263a12746fef57cf369e6830431e85d730c8701
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 14:12:33 2008 +0300
+
+ Changed packet_error structure const correctly
+
+commit 68778effadb54cc42d8da50a30b97e12738415bd
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 14:12:00 2008 +0300
+
+ Fixed resuming to work even when there are no joined channels
+
+commit 200cf7d05f4f9d46ce0ec08b906f988fd19747ee
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 14:10:45 2008 +0300
+
+ Fixed channel private key deleting to restore original keys correctly
+
+commit 434015aa9a1ffc492116af219eba09e36188cbf9
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Aug 30 10:50:24 2008 +0300
+
+ Resolve channel in INVITE notify if we don't have it yet
+
+ Fixes bug that user cannot se INVITE notifications sent by other users.
+
+commit 4d26d9f598384d7cd49c6238ea4a81b9f4e6f212
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Jun 22 17:42:40 2008 +0300
+
+ Remove client from expired client list before deleting it
+
+commit 32607f5db7ea3393765be5421e754ef191894dd5
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Jun 22 16:56:36 2008 +0300
+
+ Fixed the silc_parse_userqfdn argument handling, again.
+
+commit a21cfe2e02c268a20b8231b52017234fb3beea3f
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Jun 22 11:04:37 2008 +0300
+
+ Fixed silc_parse_userfqdn argument check
+
+commit a939f27e19b8084ef2acd25156b19d26d1440ace
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun Jun 22 11:03:58 2008 +0300
+
+ Make sure client entry is not expired more than once
+
+commit ff6a990d9e7361a5d1eb9909483bcea7decef4d4
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Mon Jun 9 08:26:01 2008 +0300
+
+ Close socket if TCP connecting fails to avoid leaking sockets
+
+commit 9d4cd9d224dfd74d0d4059350cb511dc760d70f0
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Mon Jun 9 08:18:33 2008 +0300
+
+ Add non-executing stack when compiling AES asm for GNU/ELF.
+
+ Patch by Kp <kp at valhallalegends.com>bg
+
+ Signed-off-by: Pekka Riikonen <priikone at silcnet.org>
+
+commit 659451d6ae9212f6f5414a99646ffbe4f55689d0
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun May 25 12:25:04 2008 +0300
+
+ Handle memory allocation failures when unformatting data
+
+commit 8aa96201d790de6a23905c5f0c87c950b582b8af
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun May 25 12:24:41 2008 +0300
+
+ Add non-executing stack when compiling AES asm for GNU/ELF.
+
+ Patch by Kp <kp at valhallalegends.com>
+
+ Signed-off-by: Pekka Riikonen <priikone at silcnet.org>
+
+commit 90009aed5e2261b993679a9acfe035b0833ab873
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sun May 25 12:23:17 2008 +0300
+
+ Fixed crash when packet stream creation fails.
+
+commit 929798ea2747657e5834da459d4abb9bb41d71b0
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Apr 12 13:51:06 2008 +0300
+
+ SILC_IS_FD_STREAM and SILC_IS_SOCKET_STREAM now checks for NULL stream.
+
+commit 7f2e2c591c48f80822808759d12958769a323536
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Apr 12 13:50:39 2008 +0300
+
+ Fixed silc_skr_init to not fail if threads support are not compiled in.
+
+commit 01ad96cb7e509ac24c73220a2fa7c43fdd6cb70c
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Sat Apr 12 13:50:09 2008 +0300
+
+ Removed wrong SILC_LOG_ERROR and assert check from silc_idcache_add.
+
+ In some cases it is not fatal error to attempt to add entry that already
+ exists. Removed the assert and changed the error to debug message.
+
+commit 2dc72c63d6cc4e4f2addb99783554707a3488b6d
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Thu Apr 10 18:03:46 2008 +0300
+
+ Mark scheduler task unscheduled after silc_schedule_unset_listen_fd.
+
+ Affects epoll() version of schduler. If it isn't marked unscheduled
+ next time fd's events are changed they expect the fd to be in epoll()
+ which they are not. Setting unscheduled will add them again to epoll().
+
+commit c724c52cf360b74e42a7f2c7450a25bd1fcb220d
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Thu Apr 10 18:01:35 2008 +0300
+
+ Fixed QoS data limit handling in socket stream when reading data.
+
+commit 8b11d3c1627f1dc3c7966bb51901bcdcf1f8a9fb
+Author: Pekka Riikonen <priikone at silcnet.org>
+Date: Thu Apr 10 17:59:59 2008 +0300
+
+ Fixed packet stream destroy crashes when closing connections.
+
+ Take a reference of the packet stream and then destroy it. The final
+ reference is freed in the timeout callback. Any operation in the mean
+ time will detect the stream is destroyed and won't do anything.
+
+ Makefile.ad | 2 +-
+ lib/configure.ad | 2 +
+ lib/silcapputil/silcidcache.c | 3 +-
+ lib/silcasn1/silcasn1.c | 2 +-
+ lib/silcasn1/silcasn1_encode.c | 4 +-
+ lib/silcclient/client.c | 12 +-
+ lib/silcclient/client.h | 14 +-
+ lib/silcclient/client_channel.c | 10 +-
+ lib/silcclient/client_entry.c | 229 ++++++++-------
+ lib/silcclient/client_internal.h | 2 +-
+ lib/silcclient/client_notify.c | 18 +-
+ lib/silcclient/client_register.c | 39 ++--
+ lib/silcclient/command.c | 5 +-
+ lib/silcclient/command_reply.c | 26 +-
+ lib/silccore/silcpacket.c | 85 +++---
+ lib/silccore/silcpacket.h | 6 +-
+ lib/silccrypt/aes_x86.asm | 4 +
+ lib/silccrypt/aes_x86_64.asm | 4 +
+ lib/silcske/silcske.c | 84 +++---
+ lib/silcskr/silcskr.c | 3 +-
+ lib/silcutil/silcbuffmt.c | 25 +-
+ lib/silcutil/silcfdstream.c | 4 +-
+ lib/silcutil/silcsocketstream.c | 6 +-
+ lib/silcutil/silcsocketstream_i.h | 6 +-
+ lib/silcutil/silcstack.c | 5 +-
+ lib/silcutil/silctypes.h | 15 +-
+ lib/silcutil/silcutil.c | 25 ++-
+ lib/silcutil/stacktrace.c | 393 +++++++++++++++++++++----
+ lib/silcutil/stacktrace.h | 13 +-
+ lib/silcutil/unix/silcunixnet.c | 3 +
+ lib/silcutil/unix/silcunixschedule.c | 3 +-
+ lib/silcutil/unix/silcunixsocketstream.c | 8 +-
Modified: silc-toolkit/branches/upstream/current/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./Makefile.ad file in the source tree.
# Source: ./Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
@@ -27,7 +27,7 @@
SUBDIRS = @LIBSUBDIR@ apps win32 includes doc
-EXTRA_DIST = silcdefs.h.in silc-toolkit.spec symbian libtoolfix CHANGES CREDITS
+EXTRA_DIST = silcdefs.h.in silc-toolkit.spec symbian libtoolfix CREDITS
include $(top_srcdir)/Makefile.defines.in
Modified: silc-toolkit/branches/upstream/current/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./Makefile.ad file in the source tree.
# Source: ./Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
@@ -101,9 +101,9 @@
$(top_srcdir)/configure \
$(top_srcdir)/tutorial/Makefile.defines.in \
$(top_srcdir)/tutorial/Makefile.defines_int.in \
- $(top_srcdir)/tutorial/Makefile.in COPYING INSTALL TODO \
- config.guess config.sub depcomp install-sh ltmain.sh missing \
- mkinstalldirs
+ $(top_srcdir)/tutorial/Makefile.in COPYING ChangeLog INSTALL \
+ TODO config.guess config.sub depcomp install-sh ltmain.sh \
+ missing mkinstalldirs
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -289,7 +289,7 @@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
SUBDIRS = @LIBSUBDIR@ apps win32 includes doc
-EXTRA_DIST = silcdefs.h.in silc-toolkit.spec symbian libtoolfix CHANGES CREDITS
+EXTRA_DIST = silcdefs.h.in silc-toolkit.spec symbian libtoolfix CREDITS
#
# INCLUDE defines
Modified: silc-toolkit/branches/upstream/current/apps/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/apps/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/apps/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/apps/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./apps/Makefile.ad file in the source tree.
# Source: ./apps/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/apps/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/apps/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/apps/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/apps/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./apps/Makefile.ad file in the source tree.
# Source: ./apps/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/configure
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/configure?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/configure (original)
+++ silc-toolkit/branches/upstream/current/configure Mon Nov 24 16:22:47 2008
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for Toolkit 1.1.7.
+# Generated by GNU Autoconf 2.61 for Toolkit 1.1.8.
#
# Report bugs to <silc-devel at lists.silcnet.org>.
#
@@ -728,8 +728,8 @@
# Identity of this package.
PACKAGE_NAME='Toolkit'
PACKAGE_TARNAME='silc-toolkit'
-PACKAGE_VERSION='1.1.7'
-PACKAGE_STRING='Toolkit 1.1.7'
+PACKAGE_VERSION='1.1.8'
+PACKAGE_STRING='Toolkit 1.1.8'
PACKAGE_BUGREPORT='silc-devel at lists.silcnet.org'
# Factoring default headers for most tests.
@@ -1467,7 +1467,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 Toolkit 1.1.7 to adapt to many kinds of systems.
+\`configure' configures Toolkit 1.1.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1538,7 +1538,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Toolkit 1.1.7:";;
+ short | recursive ) echo "Configuration of Toolkit 1.1.8:";;
esac
cat <<\_ACEOF
@@ -1653,7 +1653,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Toolkit configure 1.1.7
+Toolkit configure 1.1.8
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1667,7 +1667,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Toolkit $as_me 1.1.7, which was
+It was created by Toolkit $as_me 1.1.8, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2483,7 +2483,7 @@
# Define the identity of the package.
PACKAGE='silc-toolkit'
- VERSION='1.1.7'
+ VERSION='1.1.8'
cat >>confdefs.h <<_ACEOF
@@ -31146,6 +31146,8 @@
#define SILC_STACKTRACE
_ACEOF
+ CFLAGS="$CFLAGS -rdynamic"
+ PC_CFLAGS="$PC_CFLAGS -rdynamic"
;;
*)
{ echo "$as_me:$LINENO: result: no" >&5
@@ -31782,7 +31784,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Toolkit $as_me 1.1.7, which was
+This file was extended by Toolkit $as_me 1.1.8, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31835,7 +31837,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-Toolkit config.status 1.1.7
+Toolkit config.status 1.1.8
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Modified: silc-toolkit/branches/upstream/current/configure.ac
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/configure.ac?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/configure.ac (original)
+++ silc-toolkit/branches/upstream/current/configure.ac Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the configure.ad file in the source tree.
# Source: configure.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
@@ -23,7 +23,7 @@
# information.
#
-AC_INIT([Toolkit], [1.1.7], [silc-devel at lists.silcnet.org], [silc-toolkit])
+AC_INIT([Toolkit], [1.1.8], [silc-devel at lists.silcnet.org], [silc-toolkit])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
AC_PREREQ(2.52)
@@ -1494,6 +1494,8 @@
yes)
AC_MSG_RESULT(yes)
AC_DEFINE([SILC_STACKTRACE], [], [SILC_STACKTRACE])
+ CFLAGS="$CFLAGS -rdynamic"
+ PC_CFLAGS="$PC_CFLAGS -rdynamic"
;;
*)
AC_MSG_RESULT(no)
Modified: silc-toolkit/branches/upstream/current/doc/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/doc/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/doc/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/doc/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./doc/Makefile.ad file in the source tree.
# Source: ./doc/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/doc/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/doc/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/doc/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/doc/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./doc/Makefile.ad file in the source tree.
# Source: ./doc/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/doc/toolkit/index.html
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/doc/toolkit/index.html?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/doc/toolkit/index.html (original)
+++ silc-toolkit/branches/upstream/current/doc/toolkit/index.html Mon Nov 24 16:22:47 2008
@@ -63,9 +63,9 @@
<big><b>SILC Toolkit Reference Manual</b></big>
<br />
<small>
-Version: 1.1.7<br />
+Version: 1.1.8<br />
Copyright © 1997 - 2007 The SILC Project<br />
-Updated: Thu Mar 20 08:43:07 EET 2008
+Updated: Sat Oct 25 17:28:37 EEST 2008
</small>
<br /><br /><br />
Welcome to the SILC Toolkit Reference Manual. The manual is a complete
Modified: silc-toolkit/branches/upstream/current/doc/toolkit/silctypes-SilcUInt32.html
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/doc/toolkit/silctypes-SilcUInt32.html?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/doc/toolkit/silctypes-SilcUInt32.html (original)
+++ silc-toolkit/branches/upstream/current/doc/toolkit/silctypes-SilcUInt32.html Mon Nov 24 16:22:47 2008
@@ -171,13 +171,13 @@
</FONT></PRE><FONT SIZE="+1"><B>
<FONT COLOR="#000055">SOURCE
</FONT></B></FONT>
-<PRE><FONT FACE="courier" size="3"> #if SILC_SIZEOF_LONG == 4
+<PRE><FONT FACE="courier" size="3"> #if SILC_SIZEOF_INT == 4
+ typedef unsigned int <B>SilcUInt32</B>;
+ typedef signed int <A HREF="silctypes-SilcInt32.html">SilcInt32</A>;
+ #else
+ #if SILC_SIZEOF_LONG == 4
typedef unsigned long <B>SilcUInt32</B>;
typedef signed long <A HREF="silctypes-SilcInt32.html">SilcInt32</A>;
- #else
- #if SILC_SIZEOF_INT == 4
- typedef unsigned int <B>SilcUInt32</B>;
- typedef signed int <A HREF="silctypes-SilcInt32.html">SilcInt32</A>;
#else
#if SILC_SIZEOF_LONG_LONG >= 4
#ifndef WIN32
Modified: silc-toolkit/branches/upstream/current/includes/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/includes/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/includes/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/includes/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./includes/Makefile.ad file in the source tree.
# Source: ./includes/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/includes/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/includes/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/includes/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/includes/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./includes/Makefile.ad file in the source tree.
# Source: ./includes/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/includes/silcdistdefs.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/includes/silcdistdefs.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/includes/silcdistdefs.h (original)
+++ silc-toolkit/branches/upstream/current/includes/silcdistdefs.h Mon Nov 24 16:22:47 2008
@@ -1,7 +1,7 @@
/*
Automatically generated by Autodist 1.4. Do not edit.
- Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+ Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
Distribution: Toolkit
License: distdir/TOOLKIT
*/
Modified: silc-toolkit/branches/upstream/current/includes/silcversion.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/includes/silcversion.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/includes/silcversion.h (original)
+++ silc-toolkit/branches/upstream/current/includes/silcversion.h Mon Nov 24 16:22:47 2008
@@ -27,11 +27,11 @@
/* 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_TOOLKIT_VERSION SILC_VERSION(1,1,7)
+#define __SILC_TOOLKIT_VERSION SILC_VERSION(1,1,8)
-#define SILC_VERSION_STRING "1.1.7"
-#define SILC_DIST_VERSION_STRING "1.1.7"
-#define SILC_PROTOCOL_VERSION_STRING "SILC-1.2-1.1.7 silc-toolkit"
+#define SILC_VERSION_STRING "1.1.8"
+#define SILC_DIST_VERSION_STRING "1.1.8"
+#define SILC_PROTOCOL_VERSION_STRING "SILC-1.2-1.1.8 silc-toolkit"
#define SILC_NAME "SILC Toolkit"
/* SILC Protocol version number */
Modified: silc-toolkit/branches/upstream/current/lib/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/Makefile.ad file in the source tree.
# Source: ./lib/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/Makefile.ad file in the source tree.
# Source: ./lib/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/contrib/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/contrib/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/contrib/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/contrib/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/contrib/Makefile.ad file in the source tree.
# Source: ./lib/contrib/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/contrib/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/contrib/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/contrib/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/contrib/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/contrib/Makefile.ad file in the source tree.
# Source: ./lib/contrib/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcapputil/Makefile.ad file in the source tree.
# Source: ./lib/silcapputil/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcapputil/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcapputil/Makefile.ad file in the source tree.
# Source: ./lib/silcapputil/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcapputil/silcidcache.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcapputil/silcidcache.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcapputil/silcidcache.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcapputil/silcidcache.c Mon Nov 24 16:22:47 2008
@@ -142,9 +142,8 @@
if (id) {
/* See if this entry is added already to cache */
if (silc_idcache_find_by_id_one(cache, id, NULL)) {
- SILC_LOG_ERROR(("Attempted to add same ID twice to ID Cache, id %s",
+ SILC_LOG_DEBUG(("Attempted to add same ID twice to ID Cache, id %s",
silc_id_render(id, cache->id_type)));
- SILC_ASSERT(FALSE);
goto err;
}
}
Modified: silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcasn1/Makefile.ad file in the source tree.
# Source: ./lib/silcasn1/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcasn1/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcasn1/Makefile.ad file in the source tree.
# Source: ./lib/silcasn1/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1.c Mon Nov 24 16:22:47 2008
@@ -53,7 +53,7 @@
asn1->stack2 = silc_stack_alloc(768);
if (!asn1->stack2) {
- silc_stack_free(asn1->stack2);
+ silc_stack_free(asn1->stack1);
return FALSE;
}
Modified: silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1_encode.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1_encode.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1_encode.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcasn1/silcasn1_encode.c Mon Nov 24 16:22:47 2008
@@ -351,7 +351,7 @@
/* Get OID words from the string */
cp = strchr(oidstr, '.');
while (cp) {
- if (sscanf(oidstr, "%lu", (unsigned long *)&oid) != 1) {
+ if (sscanf(oidstr, "%u", &oid) != 1) {
SILC_LOG_DEBUG(("Malformed OID string"));
goto fail;
}
@@ -362,7 +362,7 @@
cp = strchr(oidstr, '.');
if (!cp) {
- if (sscanf(oidstr, "%lu", (unsigned long *)&oid) != 1) {
+ if (sscanf(oidstr, "%u", &oid) != 1) {
SILC_LOG_DEBUG(("Malformed OID string"));
goto fail;
}
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcclient/Makefile.ad file in the source tree.
# Source: ./lib/silcclient/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcclient/Makefile.ad file in the source tree.
# Source: ./lib/silcclient/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client.c Mon Nov 24 16:22:47 2008
@@ -55,7 +55,7 @@
SilcClient client = silc_fsm_get_state_context(fsm);
/* Signal client that we have finished */
- silc_atomic_sub_int16(&client->internal->conns, 1);
+ silc_atomic_sub_int32(&client->internal->conns, 1);
client->internal->connection_closed = TRUE;
SILC_FSM_EVENT_SIGNAL(&client->internal->wait_event);
@@ -529,7 +529,7 @@
/* A connection finished */
SILC_LOG_DEBUG(("Event: connection closed"));
client->internal->connection_closed = FALSE;
- if (silc_atomic_get_int16(&client->internal->conns) == 0 &&
+ if (silc_atomic_get_int32(&client->internal->conns) == 0 &&
client->internal->stop)
SILC_FSM_EVENT_SIGNAL(&client->internal->wait_event);
return SILC_FSM_CONTINUE;
@@ -538,7 +538,7 @@
if (client->internal->stop) {
/* Stop client libarry. If we have running connections, wait until
they finish first. */
- if (silc_atomic_get_int16(&client->internal->conns) == 0) {
+ if (silc_atomic_get_int32(&client->internal->conns) == 0) {
SILC_LOG_DEBUG(("Event: stop"));
silc_fsm_next(fsm, silc_client_st_stop);
}
@@ -672,7 +672,7 @@
silc_fsm_start(thread, silc_client_connection_st_start);
SILC_LOG_DEBUG(("New connection %p", conn));
- silc_atomic_add_int16(&client->internal->conns, 1);
+ silc_atomic_add_int32(&client->internal->conns, 1);
return conn;
}
@@ -936,7 +936,7 @@
nickname_format[sizeof(new_client->internal->
params->nickname_format) - 1] = 0;
- silc_atomic_init16(&new_client->internal->conns, 0);
+ silc_atomic_init32(&new_client->internal->conns, 0);
return new_client;
}
@@ -964,7 +964,7 @@
silc_dlist_uninit(client->internal->ftp_sessions);
if (client->internal->lock)
silc_mutex_free(client->internal->lock);
- silc_atomic_uninit16(&client->internal->conns);
+ silc_atomic_uninit32(&client->internal->conns);
silc_free(client->username);
silc_free(client->hostname);
silc_free(client->realname);
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client.h Mon Nov 24 16:22:47 2008
@@ -53,14 +53,17 @@
SilcUInt32 key_len; /* Key data length */
SilcClientKeyAgreement ke; /* Current key agreement context or NULL */
+ SilcAtomic32 refcnt; /* Reference counter */
+ SilcAtomic32 deleted; /* Flag indicating whether the client object is
+ already scheduled for deletion */
+ SilcUInt16 resolve_cmd_ident; /* Command identifier when resolving */
+
/* Flags */
unsigned int valid : 1; /* FALSE if this entry is not valid. Entry
without nickname is not valid. */
unsigned int generated : 1; /* TRUE if library generated `key' */
unsigned int prv_resp : 1; /* TRUE if we are responder when using
private message keys. */
- SilcUInt16 resolve_cmd_ident; /* Command identifier when resolving */
- SilcAtomic8 refcnt; /* Reference counter */
} SilcClientEntryInternal;
/* Internal channel entry context */
@@ -81,20 +84,23 @@
SilcHmac hmac; /* Current HMAC */
unsigned char iv[SILC_CIPHER_MAX_IV_SIZE]; /* Current IV */
+ SilcAtomic32 refcnt; /* Reference counter */
+ SilcAtomic32 deleted; /* Flag indicating whether the
+ channel object is already
+ scheduled for deletion */
SilcUInt16 resolve_cmd_ident; /* Channel information resolving
identifier. This is used when
resolving users, and other
stuff that relates to the
channel. Not used for the
channel resolving itself. */
- SilcAtomic16 refcnt; /* Reference counter */
} SilcChannelEntryInternal;
/* Internal server entry context */
typedef struct SilcServerEntryInternalStruct {
SilcRwLock lock; /* Read/write lock */
SilcUInt16 resolve_cmd_ident; /* Resolving identifier */
- SilcAtomic8 refcnt; /* Reference counter */
+ SilcAtomic32 refcnt; /* Reference counter */
} SilcServerEntryInternal;
#endif /* CLIENT_H */
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client_channel.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client_channel.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client_channel.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client_channel.c Mon Nov 24 16:22:47 2008
@@ -626,8 +626,14 @@
}
channel->internal.curr_key = NULL;
- channel->cipher = silc_cipher_get_name(channel->internal.send_key);
- channel->hmac = silc_hmac_get_name(channel->internal.hmac);
+ if (channel->internal.send_key)
+ channel->cipher = silc_cipher_get_name(channel->internal.send_key);
+ else
+ channel->cipher = NULL;
+ if (channel->internal.hmac)
+ channel->hmac = silc_hmac_get_name(channel->internal.hmac);
+ else
+ channel->hmac = NULL;
silc_dlist_uninit(channel->internal.private_keys);
channel->internal.private_keys = NULL;
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client_entry.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client_entry.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client_entry.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client_entry.c Mon Nov 24 16:22:47 2008
@@ -791,7 +791,8 @@
return NULL;
silc_rwlock_alloc(&client_entry->internal.lock);
- silc_atomic_init8(&client_entry->internal.refcnt, 0);
+ silc_atomic_init32(&client_entry->internal.refcnt, 0);
+ silc_atomic_init32(&client_entry->internal.deleted, 1);
client_entry->id = *id;
client_entry->mode = mode;
client_entry->realname = userinfo ? strdup(userinfo) : NULL;
@@ -995,7 +996,8 @@
silc_client_ftp_session_free_client(client, client_entry);
if (client_entry->internal.ke)
silc_client_abort_key_agreement(client, conn, client_entry);
- silc_atomic_uninit8(&client_entry->internal.refcnt);
+ silc_atomic_uninit32(&client_entry->internal.deleted);
+ silc_atomic_uninit32(&client_entry->internal.refcnt);
silc_rwlock_free(client_entry->internal.lock);
silc_free(client_entry);
}
@@ -1005,30 +1007,18 @@
SilcBool silc_client_del_client(SilcClient client, SilcClientConnection conn,
SilcClientEntry client_entry)
{
- SilcBool ret;
-
if (!client_entry)
return FALSE;
- if (silc_atomic_sub_int8(&client_entry->internal.refcnt, 1) > 0)
+ SILC_LOG_DEBUG(("Marking client entry %p deleted"));
+
+ if (silc_atomic_sub_int32(&client_entry->internal.deleted, 1) != 0) {
+ SILC_LOG_DEBUG(("Client entry %p already marked deleted"));
return FALSE;
-
- SILC_LOG_DEBUG(("Deleting client %p", client_entry));
-
- silc_mutex_lock(conn->internal->lock);
- ret = silc_idcache_del_by_context(conn->internal->client_cache,
- client_entry, NULL);
- silc_mutex_unlock(conn->internal->lock);
-
- if (ret) {
- /* Remove from channels */
- silc_client_remove_from_channels(client, conn, client_entry);
-
- /* Free the client entry data */
- silc_client_del_client_entry(client, conn, client_entry);
- }
-
- return ret;
+ }
+
+ silc_client_unref_client(client, conn, client_entry);
+ return TRUE;
}
/* Internal routine used to find client by ID and if not found this creates
@@ -1072,10 +1062,10 @@
SilcClientConnection conn,
SilcClientEntry client_entry)
{
- silc_atomic_add_int8(&client_entry->internal.refcnt, 1);
+ silc_atomic_add_int32(&client_entry->internal.refcnt, 1);
SILC_LOG_DEBUG(("Client %p refcnt %d->%d", client_entry,
- silc_atomic_get_int8(&client_entry->internal.refcnt) - 1,
- silc_atomic_get_int8(&client_entry->internal.refcnt)));
+ silc_atomic_get_int32(&client_entry->internal.refcnt) - 1,
+ silc_atomic_get_int32(&client_entry->internal.refcnt)));
return client_entry;
}
@@ -1084,11 +1074,32 @@
void silc_client_unref_client(SilcClient client, SilcClientConnection conn,
SilcClientEntry client_entry)
{
- if (client_entry) {
- SILC_LOG_DEBUG(("Client %p refcnt %d->%d", client_entry,
- silc_atomic_get_int8(&client_entry->internal.refcnt),
- silc_atomic_get_int8(&client_entry->internal.refcnt) - 1));
- silc_client_del_client(client, conn, client_entry);
+ SilcBool ret;
+
+ if (!client_entry)
+ return;
+
+ SILC_LOG_DEBUG(("Client %p refcnt %d->%d", client_entry,
+ silc_atomic_get_int32(&client_entry->internal.refcnt),
+ silc_atomic_get_int32(&client_entry->internal.refcnt) - 1));
+
+ if (silc_atomic_sub_int32(&client_entry->internal.refcnt, 1) > 0)
+ return;
+
+ SILC_LOG_DEBUG(("Deleting client %p (%d)", client_entry,
+ silc_atomic_get_int32(&client_entry->internal.deleted)));
+
+ silc_mutex_lock(conn->internal->lock);
+ ret = silc_idcache_del_by_context(conn->internal->client_cache,
+ client_entry, NULL);
+ silc_mutex_unlock(conn->internal->lock);
+
+ if (ret) {
+ /* Remove from channels */
+ silc_client_remove_from_channels(client, conn, client_entry);
+
+ /* Free the client entry data */
+ silc_client_del_client_entry(client, conn, client_entry);
}
}
@@ -1626,7 +1637,8 @@
return NULL;
silc_rwlock_alloc(&channel->internal.lock);
- silc_atomic_init16(&channel->internal.refcnt, 0);
+ silc_atomic_init32(&channel->internal.refcnt, 0);
+ silc_atomic_init32(&channel->internal.deleted, 1);
channel->id = *channel_id;
channel->mode = mode;
@@ -1639,7 +1651,7 @@
if (!channel->channel_name) {
silc_rwlock_free(channel->internal.lock);
- silc_atomic_uninit16(&channel->internal.refcnt);
+ silc_atomic_uninit32(&channel->internal.refcnt);
silc_free(channel);
return NULL;
}
@@ -1648,7 +1660,7 @@
NULL, NULL, NULL, TRUE);
if (!channel->user_list) {
silc_rwlock_free(channel->internal.lock);
- silc_atomic_uninit16(&channel->internal.refcnt);
+ silc_atomic_uninit32(&channel->internal.refcnt);
silc_free(channel->channel_name);
silc_free(channel);
return NULL;
@@ -1659,7 +1671,7 @@
SILC_STRING_UTF8, 256, NULL);
if (!channel_namec) {
silc_rwlock_free(channel->internal.lock);
- silc_atomic_uninit16(&channel->internal.refcnt);
+ silc_atomic_uninit32(&channel->internal.refcnt);
silc_free(channel->channel_name);
silc_hash_table_free(channel->user_list);
silc_free(channel);
@@ -1672,7 +1684,7 @@
if (!silc_idcache_add(conn->internal->channel_cache, channel_namec,
&channel->id, channel)) {
silc_rwlock_free(channel->internal.lock);
- silc_atomic_uninit16(&channel->internal.refcnt);
+ silc_atomic_uninit32(&channel->internal.refcnt);
silc_free(channel_namec);
silc_free(channel->channel_name);
silc_hash_table_free(channel->user_list);
@@ -1694,67 +1706,18 @@
SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
SilcChannelEntry channel)
{
- SilcIDCacheEntry id_cache;
- SilcBool ret = TRUE;
- SilcCipher key;
- SilcHmac hmac;
- char *namec;
-
if (!channel)
return FALSE;
- if (silc_atomic_sub_int16(&channel->internal.refcnt, 1) > 0)
+ SILC_LOG_DEBUG(("Marking channel entry %p deleted"));
+
+ if (silc_atomic_sub_int32(&channel->internal.deleted, 1) != 0) {
+ SILC_LOG_DEBUG(("Channel entry %p already marked deleted"));
return FALSE;
-
- SILC_LOG_DEBUG(("Deleting channel %p", channel));
-
- silc_mutex_lock(conn->internal->lock);
- if (silc_idcache_find_by_context(conn->internal->channel_cache, channel,
- &id_cache)) {
- namec = id_cache->name;
- ret = silc_idcache_del_by_context(conn->internal->channel_cache,
- channel, NULL);
- silc_free(namec);
- }
- silc_mutex_unlock(conn->internal->lock);
-
- if (!ret)
- return FALSE;
-
- silc_client_empty_channel(client, conn, channel);
- silc_client_del_channel_private_keys(client, conn, channel);
- silc_hash_table_free(channel->user_list);
- silc_free(channel->channel_name);
- silc_free(channel->topic);
- if (channel->founder_key)
- silc_pkcs_public_key_free(channel->founder_key);
- if (channel->internal.send_key)
- silc_cipher_free(channel->internal.send_key);
- if (channel->internal.receive_key)
- silc_cipher_free(channel->internal.receive_key);
- if (channel->internal.hmac)
- silc_hmac_free(channel->internal.hmac);
- if (channel->internal.old_channel_keys) {
- silc_dlist_start(channel->internal.old_channel_keys);
- while ((key = silc_dlist_get(channel->internal.old_channel_keys)))
- silc_cipher_free(key);
- silc_dlist_uninit(channel->internal.old_channel_keys);
- }
- if (channel->internal.old_hmacs) {
- silc_dlist_start(channel->internal.old_hmacs);
- while ((hmac = silc_dlist_get(channel->internal.old_hmacs)))
- silc_hmac_free(hmac);
- silc_dlist_uninit(channel->internal.old_hmacs);
- }
- if (channel->channel_pubkeys)
- silc_argument_list_free(channel->channel_pubkeys,
- SILC_ARGUMENT_PUBLIC_KEY);
- silc_atomic_uninit16(&channel->internal.refcnt);
- silc_rwlock_free(channel->internal.lock);
- silc_schedule_task_del_by_context(conn->client->schedule, channel);
- silc_free(channel);
-
- return ret;
+ }
+
+ silc_client_unref_channel(client, conn, channel);
+ return TRUE;
}
/* Replaces the channel ID of the `channel' to `new_id'. Returns FALSE
@@ -1806,10 +1769,10 @@
SilcClientConnection conn,
SilcChannelEntry channel_entry)
{
- silc_atomic_add_int16(&channel_entry->internal.refcnt, 1);
+ silc_atomic_add_int32(&channel_entry->internal.refcnt, 1);
SILC_LOG_DEBUG(("Channel %p refcnt %d->%d", channel_entry,
- silc_atomic_get_int16(&channel_entry->internal.refcnt) - 1,
- silc_atomic_get_int16(&channel_entry->internal.refcnt)));
+ silc_atomic_get_int32(&channel_entry->internal.refcnt) - 1,
+ silc_atomic_get_int32(&channel_entry->internal.refcnt)));
return channel_entry;
}
@@ -1818,13 +1781,71 @@
void silc_client_unref_channel(SilcClient client, SilcClientConnection conn,
SilcChannelEntry channel_entry)
{
- if (channel_entry) {
- SILC_LOG_DEBUG(("Channel %p refcnt %d->%d", channel_entry,
- silc_atomic_get_int16(&channel_entry->internal.refcnt),
- silc_atomic_get_int16(&channel_entry->internal.refcnt)
- - 1));
- silc_client_del_channel(client, conn, channel_entry);
- }
+ SilcIDCacheEntry id_cache;
+ SilcBool ret = TRUE;
+ SilcCipher key;
+ SilcHmac hmac;
+ char *namec;
+
+ if (!channel_entry)
+ return;
+
+ SILC_LOG_DEBUG(("Channel %p refcnt %d->%d", channel_entry,
+ silc_atomic_get_int32(&channel_entry->internal.refcnt),
+ silc_atomic_get_int32(&channel_entry->internal.refcnt)
+ - 1));
+
+ if (silc_atomic_sub_int32(&channel_entry->internal.refcnt, 1) > 0)
+ return;
+
+ SILC_LOG_DEBUG(("Deleting channel %p", channel_entry));
+
+ silc_mutex_lock(conn->internal->lock);
+ if (silc_idcache_find_by_context(conn->internal->channel_cache, channel_entry,
+ &id_cache)) {
+ namec = id_cache->name;
+ ret = silc_idcache_del_by_context(conn->internal->channel_cache,
+ channel_entry, NULL);
+ silc_free(namec);
+ }
+ silc_mutex_unlock(conn->internal->lock);
+
+ if (!ret)
+ return;
+
+ silc_client_empty_channel(client, conn, channel_entry);
+ silc_client_del_channel_private_keys(client, conn, channel_entry);
+ silc_hash_table_free(channel_entry->user_list);
+ silc_free(channel_entry->channel_name);
+ silc_free(channel_entry->topic);
+ if (channel_entry->founder_key)
+ silc_pkcs_public_key_free(channel_entry->founder_key);
+ if (channel_entry->internal.send_key)
+ silc_cipher_free(channel_entry->internal.send_key);
+ if (channel_entry->internal.receive_key)
+ silc_cipher_free(channel_entry->internal.receive_key);
+ if (channel_entry->internal.hmac)
+ silc_hmac_free(channel_entry->internal.hmac);
+ if (channel_entry->internal.old_channel_keys) {
+ silc_dlist_start(channel_entry->internal.old_channel_keys);
+ while ((key = silc_dlist_get(channel_entry->internal.old_channel_keys)))
+ silc_cipher_free(key);
+ silc_dlist_uninit(channel_entry->internal.old_channel_keys);
+ }
+ if (channel_entry->internal.old_hmacs) {
+ silc_dlist_start(channel_entry->internal.old_hmacs);
+ while ((hmac = silc_dlist_get(channel_entry->internal.old_hmacs)))
+ silc_hmac_free(hmac);
+ silc_dlist_uninit(channel_entry->internal.old_hmacs);
+ }
+ if (channel_entry->channel_pubkeys)
+ silc_argument_list_free(channel_entry->channel_pubkeys,
+ SILC_ARGUMENT_PUBLIC_KEY);
+ silc_atomic_uninit32(&channel_entry->internal.deleted);
+ silc_atomic_uninit32(&channel_entry->internal.refcnt);
+ silc_rwlock_free(channel_entry->internal.lock);
+ silc_schedule_task_del_by_context(conn->client->schedule, channel_entry);
+ silc_free(channel_entry);
}
/* Free channel entry list */
@@ -2059,7 +2080,7 @@
return NULL;
silc_rwlock_alloc(&server_entry->internal.lock);
- silc_atomic_init8(&server_entry->internal.refcnt, 0);
+ silc_atomic_init32(&server_entry->internal.refcnt, 0);
server_entry->id = *server_id;
if (server_name)
server_entry->server_name = strdup(server_name);
@@ -2111,7 +2132,7 @@
if (!server)
return FALSE;
- if (silc_atomic_sub_int8(&server->internal.refcnt, 1) > 0)
+ if (silc_atomic_sub_int32(&server->internal.refcnt, 1) > 0)
return FALSE;
SILC_LOG_DEBUG(("Deleting server %p", server));
@@ -2130,7 +2151,7 @@
silc_free(server->server_info);
if (server->public_key)
silc_pkcs_public_key_free(server->public_key);
- silc_atomic_uninit8(&server->internal.refcnt);
+ silc_atomic_uninit32(&server->internal.refcnt);
silc_rwlock_free(server->internal.lock);
silc_free(server);
@@ -2198,10 +2219,10 @@
SilcClientConnection conn,
SilcServerEntry server_entry)
{
- silc_atomic_add_int8(&server_entry->internal.refcnt, 1);
+ silc_atomic_add_int32(&server_entry->internal.refcnt, 1);
SILC_LOG_DEBUG(("Server %p refcnt %d->%d", server_entry,
- silc_atomic_get_int8(&server_entry->internal.refcnt) - 1,
- silc_atomic_get_int8(&server_entry->internal.refcnt)));
+ silc_atomic_get_int32(&server_entry->internal.refcnt) - 1,
+ silc_atomic_get_int32(&server_entry->internal.refcnt)));
return server_entry;
}
@@ -2212,8 +2233,8 @@
{
if (server_entry) {
SILC_LOG_DEBUG(("Server %p refcnt %d->%d", server_entry,
- silc_atomic_get_int8(&server_entry->internal.refcnt),
- silc_atomic_get_int8(&server_entry->internal.refcnt)
+ silc_atomic_get_int32(&server_entry->internal.refcnt),
+ silc_atomic_get_int32(&server_entry->internal.refcnt)
- 1));
silc_client_del_server(client, conn, server_entry);
}
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client_internal.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client_internal.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client_internal.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client_internal.h Mon Nov 24 16:22:47 2008
@@ -108,7 +108,7 @@
char *silc_client_version; /* Version set by application */
SilcClientRunning running; /* Running/Stopped callback */
void *running_context; /* Context for runnign callback */
- SilcAtomic16 conns; /* Number of connections in client */
+ SilcAtomic32 conns; /* Number of connections in client */
SilcUInt16 next_session_id; /* Next FTP session ID */
/* Events */
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client_notify.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client_notify.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client_notify.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client_notify.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -298,8 +298,14 @@
/* Get the channel entry */
channel = silc_client_get_channel_by_id(client, conn, &id.u.channel_id);
- if (!channel)
- goto out;
+ if (!channel) {
+ /** Resolve channel */
+ SILC_FSM_CALL(silc_client_get_channel_by_id_resolve(
+ client, conn, &id.u.channel_id,
+ silc_client_notify_resolved,
+ notify));
+ /* NOT REACHED */
+ }
/* If channel is being resolved handle notify after resolving */
if (channel->internal.resolve_cmd_ident) {
@@ -529,7 +535,7 @@
if (tmp && tmp_len > 128)
tmp[128] = '\0';
- if (packet->dst_id_type == SILC_ID_CHANNEL)
+ if (packet->dst_id_type == SILC_ID_CHANNEL)
if (silc_id_str2id(packet->dst_id, packet->dst_id_len, SILC_ID_CHANNEL,
&id.u.channel_id, sizeof(id.u.channel_id)))
channel = silc_client_get_channel_by_id(client, conn, &id.u.channel_id);
@@ -912,9 +918,7 @@
/* Get HMAC key from the old HMAC context, and update it to the new one */
tmp = (unsigned char *)silc_hmac_get_key(channel->internal.hmac, &tmp_len);
if (tmp) {
- silc_hash_make(silc_hmac_get_hash(newhmac), tmp, tmp_len, hash);
- silc_hmac_set_key(newhmac, hash,
- silc_hash_len(silc_hmac_get_hash(newhmac)));
+ silc_hmac_set_key(newhmac, tmp, tmp_len);
if (channel->internal.hmac)
silc_hmac_free(channel->internal.hmac);
channel->internal.hmac = newhmac;
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/client_register.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/client_register.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/client_register.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/client_register.c Mon Nov 24 16:22:47 2008
@@ -563,25 +563,26 @@
&conn->local_entry->id);
/* Call JOIN command replies for all joined channel */
- silc_idcache_get_all(conn->internal->channel_cache, &channels);
- silc_list_start(channels);
- while ((entry = silc_list_get(channels))) {
- SilcHashTableList htl;
- const char *cipher, *hmac;
-
- channel = entry->context;
- cipher = (channel->internal.send_key ?
- silc_cipher_get_name(channel->internal.send_key) : NULL);
- hmac = (channel->internal.hmac ?
- silc_hmac_get_name(channel->internal.hmac) : NULL);
- silc_hash_table_list(channel->user_list, &htl);
- silc_client_resume_command_callback(client, conn, SILC_COMMAND_JOIN,
- channel->channel_name, channel,
- channel->mode, &htl, channel->topic,
- cipher, hmac, channel->founder_key,
- channel->channel_pubkeys,
- channel->user_limit);
- silc_hash_table_list_reset(&htl);
+ if (silc_idcache_get_all(conn->internal->channel_cache, &channels)) {
+ silc_list_start(channels);
+ while ((entry = silc_list_get(channels))) {
+ SilcHashTableList htl;
+ const char *cipher, *hmac;
+
+ channel = entry->context;
+ cipher = (channel->internal.send_key ?
+ silc_cipher_get_name(channel->internal.send_key) : NULL);
+ hmac = (channel->internal.hmac ?
+ silc_hmac_get_name(channel->internal.hmac) : NULL);
+ silc_hash_table_list(channel->user_list, &htl);
+ silc_client_resume_command_callback(client, conn, SILC_COMMAND_JOIN,
+ channel->channel_name, channel,
+ channel->mode, &htl, channel->topic,
+ cipher, hmac, channel->founder_key,
+ channel->channel_pubkeys,
+ channel->user_limit);
+ silc_hash_table_list_reset(&htl);
+ }
}
conn->internal->registering = FALSE;
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/command.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/command.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/command.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/command.c Mon Nov 24 16:22:47 2008
@@ -411,6 +411,7 @@
SilcUInt32 argc = 0;
unsigned char **argv = NULL;
SilcUInt32 *argv_lens = NULL, *argv_types = NULL;
+ SilcUInt16 cmd_ident;
SilcClientCommand command;
SilcClientCommandContext cmd;
char *arg;
@@ -480,7 +481,7 @@
cmd->argv = argv;
cmd->argv_lens = argv_lens;
cmd->argv_types = argv_types;
- cmd->cmd_ident = silc_client_cmd_ident(conn);
+ cmd_ident = cmd->cmd_ident = silc_client_cmd_ident(conn);
cmd->called = TRUE;
cmd->verbose = TRUE;
silc_list_init(cmd->reply_callbacks,
@@ -492,7 +493,7 @@
silc_client_command_destructor, NULL, FALSE);
silc_fsm_start_sync(&cmd->thread, command->command);
- return cmd->cmd_ident;
+ return cmd_ident;
}
/* Generic function to send any command. The arguments must be sent already
Modified: silc-toolkit/branches/upstream/current/lib/silcclient/command_reply.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcclient/command_reply.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcclient/command_reply.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcclient/command_reply.c Mon Nov 24 16:22:47 2008
@@ -118,6 +118,7 @@
client_entry = silc_client_get_client_by_id(client, conn, &id.u.client_id);
if (client_entry) {
silc_client_remove_from_channels(client, conn, client_entry);
+ client_entry->internal.valid = FALSE;
silc_client_del_client(client, conn, client_entry);
silc_client_unref_client(client, conn, client_entry);
}
@@ -947,6 +948,7 @@
/* Remove the client */
if (client_entry) {
silc_client_remove_from_channels(client, conn, client_entry);
+ client_entry->internal.valid = FALSE;
silc_client_del_client(client, conn, client_entry);
silc_client_unref_client(client, conn, client_entry);
}
@@ -1170,6 +1172,17 @@
silc_client_ref_channel(client, conn, channel);
}
+ /* Get hmac */
+ hmac = silc_argument_get_arg_type(args, 11, NULL);
+ if (hmac && !silc_hmac_is_supported(hmac)) {
+ if (cmd->verbose)
+ SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
+ "Cannot join channel: Unsupported HMAC `%s'", hmac);
+ ERROR_CALLBACK(SILC_STATUS_ERR_UNKNOWN_ALGORITHM);
+ silc_rwlock_unlock(channel->internal.lock);
+ goto out;
+ }
+
/* Get the list count */
tmp = silc_argument_get_arg_type(args, 12, &len);
if (!tmp) {
@@ -1238,19 +1251,6 @@
goto out;
}
if (!silc_buffer_pull(&client_mode_list, 4)) {
- silc_rwlock_unlock(channel->internal.lock);
- goto out;
- }
- }
-
- /* Get hmac */
- hmac = silc_argument_get_arg_type(args, 11, NULL);
- if (hmac) {
- if (!silc_hmac_alloc(hmac, NULL, &channel->internal.hmac)) {
- if (cmd->verbose)
- SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR,
- "Cannot join channel: Unsupported HMAC `%s'", hmac);
- ERROR_CALLBACK(SILC_STATUS_ERR_UNKNOWN_ALGORITHM);
silc_rwlock_unlock(channel->internal.lock);
goto out;
}
Modified: silc-toolkit/branches/upstream/current/lib/silccore/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccore/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccore/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silccore/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silccore/Makefile.ad file in the source tree.
# Source: ./lib/silccore/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silccore/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccore/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccore/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silccore/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silccore/Makefile.ad file in the source tree.
# Source: ./lib/silccore/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -40,7 +40,7 @@
SilcMutex lock; /* Engine lock */
SilcRng rng; /* RNG for engine */
SilcHashTable contexts; /* Per scheduler contexts */
- SilcPacketCallbacks *callbacks; /* Packet callbacks */
+ const SilcPacketCallbacks *callbacks; /* Packet callbacks */
void *callback_context; /* Context for callbacks */
SilcList streams; /* All streams in engine */
SilcList packet_pool; /* Free list for received packets */
@@ -51,7 +51,7 @@
/* Packet processor context */
typedef struct SilcPacketProcessStruct {
SilcPacketType *types; /* Packets to process */
- SilcPacketCallbacks *callbacks; /* Callbacks or NULL */
+ const SilcPacketCallbacks *callbacks; /* Callbacks or NULL */
void *callback_context;
SilcInt32 priority; /* Priority */
} *SilcPacketProcess;
@@ -81,7 +81,7 @@
unsigned char *dst_id; /* Destination ID */
SilcUInt32 send_psn; /* Sending sequence */
SilcUInt32 receive_psn; /* Receiving sequence */
- SilcAtomic8 refcnt; /* Reference counter */
+ SilcAtomic32 refcnt; /* Reference counter */
SilcUInt8 sid; /* Security ID, set if IV included */
unsigned int src_id_len : 6;
unsigned int src_id_type : 2;
@@ -336,7 +336,6 @@
silc_mutex_unlock(ps->lock);
if (ret == -1) {
/* Cannot read now, do it later. */
- silc_buffer_pull(inbuf, silc_buffer_len(inbuf));
return FALSE;
}
@@ -394,7 +393,6 @@
if (ret == -1) {
/* Cannot read now, do it later. */
- silc_buffer_pull(inbuf, silc_buffer_len(inbuf));
return FALSE;
}
@@ -542,7 +540,7 @@
SilcPacketEngine
silc_packet_engine_start(SilcRng rng, SilcBool router,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context)
{
SilcPacketEngine engine;
@@ -623,7 +621,7 @@
silc_free(engine);
}
-static const char *packet_error[] = {
+static const char * const packet_error[] = {
"Cannot read from stream",
"Cannot write to stream",
"Packet MAC failed",
@@ -697,7 +695,7 @@
return NULL;
ps->stream = stream;
- silc_atomic_init8(&ps->refcnt, 1);
+ silc_atomic_init32(&ps->refcnt, 1);
silc_mutex_alloc(&ps->lock);
/* Allocate out buffer */
@@ -723,8 +721,8 @@
(void *)&ps->sc)) {
ps->sc = silc_calloc(1, sizeof(*ps->sc));
if (!ps->sc) {
+ silc_mutex_unlock(engine->lock);
silc_packet_stream_destroy(ps);
- silc_mutex_unlock(engine->lock);
return NULL;
}
ps->sc->engine = engine;
@@ -735,8 +733,8 @@
if (!inbuf) {
silc_free(ps->sc);
ps->sc = NULL;
+ silc_mutex_unlock(engine->lock);
silc_packet_stream_destroy(ps);
- silc_mutex_unlock(engine->lock);
return NULL;
}
silc_buffer_reset(inbuf);
@@ -746,8 +744,8 @@
silc_buffer_free(inbuf);
silc_free(ps->sc);
ps->sc = NULL;
+ silc_mutex_unlock(engine->lock);
silc_packet_stream_destroy(ps);
- silc_mutex_unlock(engine->lock);
return NULL;
}
silc_dlist_add(ps->sc->inbufs, inbuf);
@@ -758,8 +756,8 @@
silc_dlist_del(ps->sc->inbufs, inbuf);
silc_free(ps->sc);
ps->sc = NULL;
+ silc_mutex_unlock(engine->lock);
silc_packet_stream_destroy(ps);
- silc_mutex_unlock(engine->lock);
return NULL;
}
}
@@ -818,7 +816,7 @@
return NULL;
ps->sc = stream->sc;
- silc_atomic_init8(&ps->refcnt, 1);
+ silc_atomic_init32(&ps->refcnt, 1);
silc_mutex_alloc(&ps->lock);
/* Set the UDP packet stream as underlaying stream */
@@ -886,7 +884,9 @@
if (!stream)
return;
- if (silc_atomic_sub_int8(&stream->refcnt, 1) > 0) {
+ if (silc_atomic_sub_int32(&stream->refcnt, 1) > 0) {
+ if (stream->destroyed)
+ return;
stream->destroyed = TRUE;
SILC_LOG_DEBUG(("Marking packet stream %p destroyed", stream));
@@ -901,17 +901,18 @@
if (!stream->udp) {
/* Delete from engine */
- engine = stream->sc->engine;
- silc_mutex_lock(engine->lock);
- silc_list_del(engine->streams, stream);
-
- /* Remove per scheduler context, if it is not used anymore */
if (stream->sc) {
+ engine = stream->sc->engine;
+ silc_mutex_lock(engine->lock);
+ silc_list_del(engine->streams, stream);
+
+ /* Remove per scheduler context, if it is not used anymore */
stream->sc->stream_count--;
if (!stream->sc->stream_count)
silc_hash_table_del(engine->contexts, stream->sc->schedule);
- }
- silc_mutex_unlock(engine->lock);
+
+ silc_mutex_unlock(engine->lock);
+ }
/* Destroy the underlaying stream */
if (stream->stream)
@@ -971,7 +972,7 @@
silc_free(stream->src_id);
silc_free(stream->dst_id);
- silc_atomic_uninit8(&stream->refcnt);
+ silc_atomic_uninit32(&stream->refcnt);
silc_mutex_free(stream->lock);
silc_free(stream);
}
@@ -1000,7 +1001,7 @@
/* Links `callbacks' to `stream' for specified packet types */
static SilcBool silc_packet_stream_link_va(SilcPacketStream stream,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context,
int priority, va_list ap)
{
@@ -1029,6 +1030,7 @@
stream->process = silc_dlist_init();
if (!stream->process) {
silc_mutex_unlock(stream->lock);
+ silc_free(p);
return FALSE;
}
}
@@ -1078,7 +1080,7 @@
/* Links `callbacks' to `stream' for specified packet types */
SilcBool silc_packet_stream_link(SilcPacketStream stream,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context,
int priority, ...)
{
@@ -1096,7 +1098,7 @@
/* Unlinks `callbacks' from `stream'. */
void silc_packet_stream_unlink(SilcPacketStream stream,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context)
{
SilcPacketProcess p;
@@ -1152,10 +1154,10 @@
void silc_packet_stream_ref(SilcPacketStream stream)
{
- silc_atomic_add_int8(&stream->refcnt, 1);
+ silc_atomic_add_int32(&stream->refcnt, 1);
SILC_LOG_DEBUG(("Stream %p, refcnt %d->%d", stream,
- silc_atomic_get_int8(&stream->refcnt) - 1,
- silc_atomic_get_int8(&stream->refcnt)));
+ silc_atomic_get_int32(&stream->refcnt) - 1,
+ silc_atomic_get_int32(&stream->refcnt)));
}
/* Unreference packet stream */
@@ -1163,11 +1165,11 @@
void silc_packet_stream_unref(SilcPacketStream stream)
{
SILC_LOG_DEBUG(("Stream %p, refcnt %d->%d", stream,
- silc_atomic_get_int8(&stream->refcnt),
- silc_atomic_get_int8(&stream->refcnt) - 1));
- if (silc_atomic_sub_int8(&stream->refcnt, 1) > 0)
+ silc_atomic_get_int32(&stream->refcnt),
+ silc_atomic_get_int32(&stream->refcnt) - 1));
+ if (silc_atomic_sub_int32(&stream->refcnt, 1) > 0)
return;
- silc_atomic_add_int8(&stream->refcnt, 1);
+ silc_atomic_add_int32(&stream->refcnt, 1);
silc_packet_stream_destroy(stream);
}
@@ -1322,6 +1324,7 @@
{
SilcUInt32 len;
unsigned char tmp[32];
+ void *tmp_id;
if (!src_id && !dst_id)
return FALSE;
@@ -1331,16 +1334,17 @@
if (src_id) {
SILC_LOG_DEBUG(("Setting source ID to packet stream %p", stream));
- silc_free(stream->src_id);
if (!silc_id_id2str(src_id, src_id_type, tmp, sizeof(tmp), &len)) {
silc_mutex_unlock(stream->lock);
return FALSE;
}
- stream->src_id = silc_memdup(tmp, len);
- if (!stream->src_id) {
+ tmp_id = silc_memdup(tmp, len);
+ if (!tmp_id) {
silc_mutex_unlock(stream->lock);
return FALSE;
}
+ silc_free(stream->src_id);
+ stream->src_id = tmp_id;
stream->src_id_type = src_id_type;
stream->src_id_len = len;
}
@@ -1348,16 +1352,17 @@
if (dst_id) {
SILC_LOG_DEBUG(("Setting destination ID to packet stream %p", stream));
- silc_free(stream->dst_id);
if (!silc_id_id2str(dst_id, dst_id_type, tmp, sizeof(tmp), &len)) {
silc_mutex_unlock(stream->lock);
return FALSE;
}
- stream->dst_id = silc_memdup(tmp, len);
- if (!stream->dst_id) {
+ tmp_id = silc_memdup(tmp, len);
+ if (!tmp_id) {
silc_mutex_unlock(stream->lock);
return FALSE;
}
+ silc_free(stream->dst_id);
+ stream->dst_id = tmp_id;
stream->dst_id_type = dst_id_type;
stream->dst_id_len = len;
}
@@ -2339,7 +2344,7 @@
void *stream_context);
/* Packet waiting callbacks */
-static SilcPacketCallbacks silc_packet_wait_cbs =
+static const SilcPacketCallbacks silc_packet_wait_cbs =
{
silc_packet_wait_packet_receive, NULL, NULL
};
@@ -2528,7 +2533,7 @@
} *SilcPacketWrapperStream;
/* Packet wrapper callbacks */
-static SilcPacketCallbacks silc_packet_wrap_cbs =
+static const SilcPacketCallbacks silc_packet_wrap_cbs =
{
silc_packet_wrap_packet_receive, NULL, NULL
};
Modified: silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silccore/silcpacket.h Mon Nov 24 16:22:47 2008
@@ -361,7 +361,7 @@
***/
SilcPacketEngine
silc_packet_engine_start(SilcRng rng, SilcBool router,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context);
/****f* silccore/SilcPacketAPI/silc_packet_engine_stop
@@ -651,7 +651,7 @@
*
***/
SilcBool silc_packet_stream_link(SilcPacketStream stream,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context,
int priority, ...);
@@ -671,7 +671,7 @@
*
***/
void silc_packet_stream_unlink(SilcPacketStream stream,
- SilcPacketCallbacks *callbacks,
+ const SilcPacketCallbacks *callbacks,
void *callback_context);
/****f* silccore/SilcPacketAPI/SilcPacketWrapCoder
Modified: silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silccrypt/Makefile.ad file in the source tree.
# Source: ./lib/silccrypt/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silccrypt/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silccrypt/Makefile.ad file in the source tree.
# Source: ./lib/silccrypt/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86.asm
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86.asm?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86.asm (original)
+++ silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86.asm Mon Nov 24 16:22:47 2008
@@ -595,3 +595,7 @@
%endif
end
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
Modified: silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86_64.asm
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86_64.asm?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86_64.asm (original)
+++ silc-toolkit/branches/upstream/current/lib/silccrypt/aes_x86_64.asm Mon Nov 24 16:22:47 2008
@@ -864,3 +864,7 @@
%endif
end
+
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
Modified: silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silchttp/Makefile.ad file in the source tree.
# Source: ./lib/silchttp/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silchttp/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silchttp/Makefile.ad file in the source tree.
# Source: ./lib/silchttp/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcmath/Makefile.ad file in the source tree.
# Source: ./lib/silcmath/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcmath/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcmath/Makefile.ad file in the source tree.
# Source: ./lib/silcmath/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcsftp/Makefile.ad file in the source tree.
# Source: ./lib/silcsftp/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcsftp/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcsftp/Makefile.ad file in the source tree.
# Source: ./lib/silcsftp/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcsim/Makefile.ad file in the source tree.
# Source: ./lib/silcsim/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcsim/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcsim/Makefile.ad file in the source tree.
# Source: ./lib/silcsim/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcske/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcske/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcske/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcske/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcske/Makefile.ad file in the source tree.
# Source: ./lib/silcske/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcske/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcske/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcske/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcske/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcske/Makefile.ad file in the source tree.
# Source: ./lib/silcske/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcske/silcske.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcske/silcske.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcske/silcske.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcske/silcske.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2000 - 2007 Pekka Riikonen
+ Copyright (C) 2000 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -182,15 +182,11 @@
static SilcSKEStatus silc_ske_check_version(SilcSKE ske)
{
- SilcUInt32 r_software_version = 0;
- char *r_software_string = NULL;
-
if (!ske->remote_version || !ske->version)
return SILC_SKE_STATUS_BAD_VERSION;
if (!silc_parse_version_string(ske->remote_version, NULL, NULL,
- &r_software_version,
- &r_software_string, NULL))
+ NULL, NULL, NULL))
return SILC_SKE_STATUS_BAD_VERSION;
return SILC_SKE_STATUS_OK;
@@ -2026,15 +2022,9 @@
silc_packet_free(ske->packet);
ske->packet = NULL;
- /* Verify the received public key and verify the signature if we are
- doing mutual authentication. */
- if (ske->start_payload &&
- ske->start_payload->flags & SILC_SKE_SP_FLAG_MUTUAL) {
-
- SILC_LOG_DEBUG(("We are doing mutual authentication"));
-
- if (!recv_payload->pk_data && (ske->callbacks->verify_key ||
- ske->repository)) {
+ /* Verify public key, except in rekey, when it is not sent */
+ if (!ske->rekey) {
+ if (!recv_payload->pk_data) {
/** Public key not provided */
SILC_LOG_ERROR(("Remote end did not send its public key (or "
"certificate), even though we require it"));
@@ -2044,8 +2034,7 @@
}
/* Decode the remote's public key */
- if (recv_payload->pk_data &&
- !silc_pkcs_public_key_alloc(recv_payload->pk_type,
+ if (!silc_pkcs_public_key_alloc(recv_payload->pk_type,
recv_payload->pk_data,
recv_payload->pk_len,
&ske->prop->public_key)) {
@@ -2056,39 +2045,36 @@
return SILC_FSM_CONTINUE;
}
- if (ske->prop->public_key && (ske->callbacks->verify_key ||
- ske->repository)) {
- SILC_LOG_DEBUG(("Verifying public key"));
-
- /** Waiting public key verification */
- silc_fsm_next(fsm, silc_ske_st_responder_phase4);
-
- /* If repository is provided, verify the key from there. */
- if (ske->repository) {
- SilcSKRFind find;
-
- find = silc_skr_find_alloc();
- if (!find) {
- ske->status = SILC_SKE_STATUS_OUT_OF_MEMORY;
- silc_fsm_next(fsm, silc_ske_st_responder_error);
- return SILC_FSM_CONTINUE;
- }
- silc_skr_find_set_pkcs_type(find,
- silc_pkcs_get_type(ske->prop->public_key));
- silc_skr_find_set_public_key(find, ske->prop->public_key);
- silc_skr_find_set_usage(find, SILC_SKR_USAGE_KEY_AGREEMENT);
-
- /* Find key from repository */
- SILC_FSM_CALL(silc_skr_find(ske->repository,
- silc_fsm_get_schedule(fsm), find,
- silc_ske_skr_callback, ske));
- } else {
- /* Verify from application */
+ SILC_LOG_DEBUG(("Verifying public key"));
+
+ /** Waiting public key verification */
+ silc_fsm_next(fsm, silc_ske_st_responder_phase4);
+
+ /* If repository is provided, verify the key from there. */
+ if (ske->repository) {
+ SilcSKRFind find;
+
+ find = silc_skr_find_alloc();
+ if (!find) {
+ ske->status = SILC_SKE_STATUS_OUT_OF_MEMORY;
+ silc_fsm_next(fsm, silc_ske_st_responder_error);
+ return SILC_FSM_CONTINUE;
+ }
+ silc_skr_find_set_pkcs_type(find,
+ silc_pkcs_get_type(ske->prop->public_key));
+ silc_skr_find_set_public_key(find, ske->prop->public_key);
+ silc_skr_find_set_usage(find, SILC_SKR_USAGE_KEY_AGREEMENT);
+
+ /* Find key from repository */
+ SILC_FSM_CALL(silc_skr_find(ske->repository,
+ silc_fsm_get_schedule(fsm), find,
+ silc_ske_skr_callback, ske));
+ } else {
+ /* Verify from application */
+ if (ske->callbacks->verify_key)
SILC_FSM_CALL(ske->callbacks->verify_key(ske, ske->prop->public_key,
ske->callbacks->context,
silc_ske_pk_verified, NULL));
- }
- /* NOT REACHED */
}
}
@@ -2129,7 +2115,7 @@
unsigned char hash[SILC_HASH_MAXLEN];
SilcUInt32 hash_len;
- SILC_LOG_DEBUG(("Public key is authentic"));
+ SILC_LOG_DEBUG(("We are doing mutual authentication"));
/* Compute the hash value */
status = silc_ske_make_hash(ske, hash, &hash_len, TRUE);
@@ -2429,7 +2415,7 @@
ske->timeout = params->timeout_secs ? params->timeout_secs : 30;
if (ske->flags & SILC_SKE_SP_FLAG_IV_INCLUDED)
ske->session_port = params->session_port;
- ske->version = strdup(params->version);
+ ske->version = params->version;
if (!ske->version)
return NULL;
ske->running = TRUE;
Modified: silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcskr/Makefile.ad file in the source tree.
# Source: ./lib/silcskr/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcskr/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcskr/Makefile.ad file in the source tree.
# Source: ./lib/silcskr/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcskr/silcskr.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcskr/silcskr.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcskr/silcskr.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcskr/silcskr.c Mon Nov 24 16:22:47 2008
@@ -632,8 +632,7 @@
SilcBool silc_skr_init(SilcSKR skr)
{
- if (!silc_mutex_alloc(&skr->lock))
- return FALSE;
+ silc_mutex_alloc(&skr->lock);
skr->keys = silc_hash_table_alloc(0, silc_skr_hash, NULL,
silc_skr_compare, NULL,
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcutil/Makefile.ad file in the source tree.
# Source: ./lib/silcutil/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcutil/Makefile.ad file in the source tree.
# Source: ./lib/silcutil/Makefile.ad
-# Generated: Thu Mar 20 08:39:31 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:12 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcbuffmt.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcbuffmt.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcbuffmt.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcbuffmt.c Mon Nov 24 16:22:47 2008
@@ -365,7 +365,8 @@
UNFORMAT_HAS_SPACE(src, len2);
if (silc_likely(len2 && x)) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -478,7 +479,8 @@
UNFORMAT_HAS_SPACE(src, len2);
if (silc_likely(x && len2)) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -493,7 +495,8 @@
UNFORMAT_HAS_SPACE(src, len2);
if (silc_likely(x && len2)) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -521,7 +524,8 @@
UNFORMAT_HAS_SPACE(src, len2);
if (silc_likely(x && len2)) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -571,7 +575,8 @@
*len3 = len2;
if (x && len2) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -589,7 +594,8 @@
*len3 = len2;
if (x && len2) {
*x = silc_scalloc(stack, len2 + 1, sizeof(unsigned char));
- memcpy(*x, src->data, len2);
+ if (*x)
+ memcpy(*x, src->data, len2);
}
silc_buffer_pull(src, len2);
break;
@@ -630,9 +636,10 @@
SILC_GET32_MSB(len2, src->data);
silc_buffer_pull(src, 4);
UNFORMAT_HAS_SPACE(src, len2);
- silc_buffer_sformat(stack, x,
- SILC_STR_DATA(src->data, len2),
- SILC_STR_END);
+ if (silc_buffer_sformat(stack, x,
+ SILC_STR_DATA(src->data, len2),
+ SILC_STR_END) < 0)
+ goto fail;
silc_buffer_pull(src, len2);
}
break;
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcfdstream.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcfdstream.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcfdstream.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcfdstream.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -21,7 +21,7 @@
/************************** Types and definitions ***************************/
-#define SILC_IS_FD_STREAM(s) (s->ops == &silc_fd_stream_ops)
+#define SILC_IS_FD_STREAM(s) (s && s->ops == &silc_fd_stream_ops)
const SilcStreamOps silc_fd_stream_ops;
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -350,6 +350,7 @@
!limit_sec && !limit_usec) {
silc_schedule_task_del_by_context(socket_stream->schedule,
socket_stream->qos);
+ silc_free(socket_stream->qos->buffer);
silc_free(socket_stream->qos);
socket_stream->qos = NULL;
return TRUE;
@@ -370,7 +371,8 @@
socket_stream->qos->cur_rate = 0;
socket_stream->qos->sock = socket_stream;
- socket_stream->qos->buffer = silc_malloc(read_limit_bytes);
+ socket_stream->qos->buffer = silc_realloc(socket_stream->qos->buffer,
+ read_limit_bytes);
if (!socket_stream->qos->buffer)
return FALSE;
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream_i.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream_i.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream_i.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcsocketstream_i.h Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2005 - 2006 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -56,8 +56,8 @@
unsigned int connected : 1; /* UDP connected state */
};
-#define SILC_IS_SOCKET_STREAM(s) (s->ops == &silc_socket_stream_ops)
-#define SILC_IS_SOCKET_STREAM_UDP(s) (s->ops == &silc_socket_udp_stream_ops)
+#define SILC_IS_SOCKET_STREAM(s) (s && s->ops == &silc_socket_stream_ops)
+#define SILC_IS_SOCKET_STREAM_UDP(s) (s && s->ops == &silc_socket_udp_stream_ops)
extern const SilcStreamOps silc_socket_stream_ops;
extern const SilcStreamOps silc_socket_udp_stream_ops;
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcstack.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcstack.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcstack.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcstack.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2003 - 2006 Pekka Riikonen
+ Copyright (C) 2003 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -65,6 +65,9 @@
void silc_stack_free(SilcStack stack)
{
int i;
+
+ if (!stack)
+ return;
silc_free(stack->frames);
for (i = 0; i < SILC_STACK_BLOCK_NUM; i++)
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silctypes.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silctypes.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silctypes.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silctypes.h Mon Nov 24 16:22:47 2008
@@ -177,13 +177,13 @@
*
* SOURCE
*/
+#if SILC_SIZEOF_INT == 4
+typedef unsigned int SilcUInt32;
+typedef signed int SilcInt32;
+#else
#if SILC_SIZEOF_LONG == 4
typedef unsigned long SilcUInt32;
typedef signed long SilcInt32;
-#else
-#if SILC_SIZEOF_INT == 4
-typedef unsigned int SilcUInt32;
-typedef signed int SilcInt32;
#else
#if SILC_SIZEOF_LONG_LONG >= 4
#ifndef WIN32
@@ -634,4 +634,11 @@
#endif
/***/
+typedef char __check_size1[sizeof(SilcInt8) == 1 ? 1 : -1];
+typedef char __check_size2[sizeof(SilcUInt8) == 1 ? 1 : -1];
+typedef char __check_size3[sizeof(SilcInt16) == 2 ? 1 : -1];
+typedef char __check_size4[sizeof(SilcUInt16) == 2 ? 1 : -1];
+typedef char __check_size5[sizeof(SilcInt32) == 4 ? 1 : -1];
+typedef char __check_size6[sizeof(SilcUInt32) == 4 ? 1 : -1];
+
#endif /* SILCTYPES_H */
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/silcutil.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/silcutil.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/silcutil.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/silcutil.c Mon Nov 24 16:22:47 2008
@@ -119,8 +119,10 @@
if (!user && !fqdn)
return 0;
- memset(user, 0, user_size);
- memset(fqdn, 0, fqdn_size);
+ if (user)
+ memset(user, 0, user_size);
+ if (user)
+ memset(fqdn, 0, fqdn_size);
if (!string)
return 0;
@@ -469,7 +471,7 @@
{
unsigned char *fingerprint, *cp;
unsigned int len, blocks, i;
-
+
if (!data || !data_len)
return NULL;
@@ -484,7 +486,7 @@
cp = fingerprint = silc_calloc(len, sizeof(*fingerprint));
if (!cp)
return NULL;
-
+
for (i = 0; i < data_len; i++) {
silc_snprintf(cp, len, "%02X", data[i]);
cp += 2;
@@ -497,7 +499,7 @@
}
i--;
if ((i + 1) % 10 == 0)
- *(--cp) = '\0';
+ *(--cp) = '\0';
if ((i + 1) % 2 == 0)
*(--cp) = '\0';
@@ -555,13 +557,18 @@
printf("%s", prompt);
fflush(stdout);
+ read_again1:
if ((read(fd, input, sizeof(input))) < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ goto read_again1;
fprintf(stderr, "silc: %s\n", strerror(errno));
+ signal(SIGINT, SIG_DFL);
tcsetattr(fd, TCSANOW, &to_old);
return NULL;
}
if (strlen(input) <= 1) {
+ signal(SIGINT, SIG_DFL);
tcsetattr(fd, TCSANOW, &to_old);
return NULL;
}
@@ -589,10 +596,18 @@
printf("%s", prompt);
fflush(stdout);
+ signal(SIGINT, SIG_IGN);
+
+ read_again2:
if ((read(fd, input, sizeof(input))) < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ goto read_again2;
fprintf(stderr, "silc: %s\n", strerror(errno));
+ signal(SIGINT, SIG_DFL);
return NULL;
}
+
+ signal(SIGINT, SIG_DFL);
if (strlen(input) <= 1)
return NULL;
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 2002, 2007 Pekka Riikonen
+ Copyright (C) 2002 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -17,14 +17,72 @@
*/
+/* This file implements memory leak checker and basic memory corruption
+ and double free checker. It is multi-thread safe. It does the
+ following:
+
+ o Tracks all memory allocations and report any unfreed memory at the
+ end of the program with backtrace where the memory was allocated.
+
+ o Checks if a memory location has been freed already and abort the
+ program with the backtrace of the location of the double free.
+
+ o Checks if a given pointer has been allocated at all and abort the
+ program with the backtrace where the invalid free was given.
+
+ o Checks at the time of free if the memory was written out of bounds
+ (overflow) and abort with the backtrace of the free. The backtrace
+ might not help to find the overflow but at least it is detected.
+ By setting SILC_MALLOC_DUMP the memory is dummped to help and see
+ what it contains.
+
+ o Can detect if the memory is read or written out of bounds (overflow)
+ and abort immediately the with the backtrace when the illegal access
+ occurs. This can be enabled by using SILC_MALLOC_PROTECT.
+
+ The following environment variables can be used:
+
+ SILC_MALLOC_NO_FREE
+
+ When set to value 1, the program doesn't actually free any memory.
+ This provides more detailed information especially in case of double
+ free. If the location of the double free cannot be located, by
+ setting this variable the program will show where the memory was
+ originally allocated and freed.
+
+ SILC_MALLOC_DUMP
+
+ When set to value 1, in case of fatal error, dumps the memory location,
+ if possible. This can help see what the memory contains.
+
+ SILC_MALLOC_PROTECT
+
+ When set to value 1 each allocation will have an inaccesible memory
+ page following the allocated memory area. This will detect if the
+ the memory is accessed (read or write) beyond its boundaries. This
+ will help to identify the place where illegal memory access occurs.
+
+ To work correctly this of course expects that code uses SILC memory
+ allocation and access routines.
+
+*/
+
#include "silc.h"
#ifdef SILC_STACKTRACE
+#include <execinfo.h>
+#include <signal.h>
+#include <malloc.h>
+#include <sys/mman.h>
static void *st_blocks = NULL;
static unsigned long st_blocks_count = 0;
+static unsigned long st_num_malloc = 0;
static SilcBool dump = FALSE;
-static SilcBool malloc_check = FALSE;
+static SilcBool no_free = FALSE;
+static SilcBool dump_mem = FALSE;
+static SilcUInt32 pg = 0;
+static SilcMutex lock = NULL;
#ifdef SILC_DEBUG
#define SILC_ST_DEPTH 15
@@ -34,71 +92,207 @@
/* Memory block with stack trace */
typedef struct SilcStBlockStruct {
- unsigned int dumpped : 1; /* Block is dumpped */
- unsigned int depth : 8; /* Depth of stack trace */
- unsigned int line : 23; /* Allocation line in program */
+ struct SilcStBlockStruct *next;
+ struct SilcStBlockStruct *prev;
void *stack[SILC_ST_DEPTH]; /* Stack trace */
const char *file; /* Allocation file in program */
- unsigned long size; /* Allocated memory size */
- struct SilcStBlockStruct *next;
- struct SilcStBlockStruct *prev;
+ const char *free_file; /* Free file in program */
+ SilcUInt32 size; /* Allocated memory size */
+ SilcUInt16 line; /* Allocation line in program */
+ SilcUInt16 free_line; /* Free line in program */
+ SilcUInt16 depth; /* Depth of stack trace */
+ SilcUInt16 dumpped; /* Block is dumpped */
+ SilcUInt32 bound; /* Top bound */
} *SilcStBlock;
-/* Get current frame pointer */
-#define SILC_ST_GET_FP(ret_fp) \
-do { \
- register void *cfp; \
- asm volatile ("movl %%ebp, %0" : "=r" (cfp)); \
- (ret_fp) = cfp; \
-} while(0);
-
-#define SILC_ST_GET_SIZE(size) ((size + sizeof(struct SilcStBlockStruct)))
+#define SILC_ST_TOP_BOUND 0xfeed1977
+#define SILC_ST_BOTTOM_BOUND 0x9152beef
+#define SILC_ST_GET_SIZE(size) ((size + sizeof(struct SilcStBlockStruct) + 4))
#define SILC_ST_GET_STACK(p) ((SilcStBlock)(((unsigned char *)p) - \
sizeof(struct SilcStBlockStruct)))
#define SILC_ST_GET_PTR(p) (((unsigned char *)p) + \
sizeof(struct SilcStBlockStruct))
-
-void silc_st_stacktrace(SilcStBlock stack)
-{
- void *fp;
-
- if (!dump) {
- atexit(silc_st_dump);
- dump = TRUE;
- }
-
- if (!malloc_check) {
- /* Linux libc malloc check */
- setenv("MALLOC_CHECK_", "2", 1);
-
- /* NetBSD malloc check */
- setenv("MALLOC_OPTIONS", "AJ", 1);
-
- malloc_check = TRUE;
- }
-
- /* Save the stack */
- SILC_ST_GET_FP(fp);
- for (stack->depth = 0; fp; stack->depth++) {
- if (stack->depth == SILC_ST_DEPTH)
- break;
-
- /* Get program pointer and frame pointer from this frame */
- stack->stack[stack->depth] = *((void **)(((unsigned char *)fp) + 4));
- fp = *((void **)fp);
- }
+#define SILC_ST_GET_BOUND(p, size) (SilcUInt32 *)(((unsigned char *)p) + \
+ SILC_ST_GET_SIZE(size) - 4)
+
+#define SILC_ST_ALIGN(bytes, align) (((bytes) + (align - 1)) & ~(align - 1))
+#define SILC_ST_GET_SIZE_ALIGN(size, align) \
+ SILC_ST_ALIGN(SILC_ST_GET_SIZE(size) - 4, align)
+#define SILC_ST_GET_PTR_ALIGN(stack, align) \
+ (((unsigned char *)stack) - (SILC_ST_GET_SIZE_ALIGN(stack->size, pg) - \
+ SILC_ST_GET_SIZE(stack->size)) - 4)
+#define SILC_ST_GET_STACK_ALIGN(p, size, align) \
+ ((SilcStBlock)(((unsigned char *)p) + (SILC_ST_GET_SIZE_ALIGN(size, pg) - \
+ SILC_ST_GET_SIZE(size)) + 4))
+
+#define silc_hexdump(ptr, size, file) \
+ silc_log_output_hexdump("", "", 0, ptr, size, "")
+
+void silc_st_abort(SilcStBlock stack, const char *file, int line,
+ char *fmt, ...)
+{
+ void *bt[SILC_ST_DEPTH];
+ SilcUInt32 *bound;
+ va_list va;
+ int btc;
+
+ va_start(va, fmt);
+ vfprintf(stderr, fmt, va);
+ va_end(va);
+
+ fprintf(stderr, "----- BACKTRACE -----\n%s:%d:\n", file, line);
+ btc = backtrace(bt, SILC_ST_DEPTH);
+ backtrace_symbols_fd(bt, btc, 2);
+
+ if (stack) {
+ fprintf(stderr, "----- MEMORY TRACE -----\n");
+ if (stack->free_file)
+ fprintf(stderr, "Freed at: %s:%d\n", stack->free_file,
+ stack->free_line);
+ fprintf(stderr, "Originally allocated at:\n");
+ fprintf(stderr, "%s:%d:\n", stack->file, stack->line);
+ backtrace_symbols_fd(stack->stack, stack->depth, 2);
+ fflush(stderr);
+
+ if (dump_mem) {
+ fprintf(stderr, "----- MEMORY HEADER -----\n");
+ fprintf(stderr, "Header length: %lu, total length %lu\n",
+ sizeof(struct SilcStBlockStruct), SILC_ST_GET_SIZE(stack->size));
+ silc_hexdump((void *)stack, sizeof(struct SilcStBlockStruct), stderr);
+ fflush(stderr);
+ fprintf(stderr, "Header bound is: %p\n",
+ SILC_32_TO_PTR(stack->bound));
+ if (stack->bound != SILC_ST_TOP_BOUND) {
+ fprintf(stderr, "Header bound should be: %p\n",
+ SILC_32_TO_PTR(SILC_ST_TOP_BOUND));
+ fprintf(stderr, "MEMORY IS CORRUPTED (UNDERFLOW)!\n");
+ }
+
+ fprintf(stderr, "----- USER MEMORY -----\n");
+ fprintf(stderr, "Length: %d\n", stack->size);
+ silc_hexdump(((unsigned char *)stack) +
+ sizeof(struct SilcStBlockStruct), stack->size, stderr);
+ fflush(stderr);
+
+ fprintf(stderr, "----- MEMORY FOOTER -----\n");
+ bound = SILC_ST_GET_BOUND(stack, stack->size);
+ silc_hexdump((unsigned char *)bound, 4, stderr);
+ fprintf(stderr, "Footer bound is: %p\n", SILC_32_TO_PTR(*bound));
+ if (*bound != SILC_ST_BOTTOM_BOUND) {
+ fprintf(stderr, "Footer bound should be: %p\n",
+ SILC_32_TO_PTR(SILC_ST_BOTTOM_BOUND));
+ fprintf(stderr, "MEMORY IS CORRUPTED (OVERFLOW)!\n");
+ }
+ }
+ }
+
+ fflush(stderr);
+
+ abort();
+}
+
+void silc_st_sigsegv(int sig, siginfo_t *si, void *context)
+{
+ SilcStBlock orig, stack = (SilcStBlock)si->si_addr;
+
+ /* Make the page accessible again */
+ mprotect(si->si_addr, pg, PROT_READ | PROT_WRITE);
+
+ /* Get the original page from the violated page */
+ orig = (SilcStBlock)(((unsigned char *)si->si_addr) -
+ SILC_ST_GET_SIZE_ALIGN(stack->size, pg));
+ stack = SILC_ST_GET_STACK_ALIGN(orig, stack->size, pg);
+
+ silc_st_abort(stack, __FILE__, __LINE__,
+ "SILC_MALLOC: access violation (overflow)\n");
+}
+
+void silc_st_stacktrace_init(void)
+{
+ const char *var;
+
+ atexit(silc_st_dump);
+ dump = TRUE;
+
+ var = getenv("SILC_MALLOC_NO_FREE");
+ if (var && *var == '1')
+ no_free = TRUE;
+
+ var = getenv("SILC_MALLOC_DUMP");
+ if (var && *var == '1')
+ dump_mem = TRUE;
+
+ var = getenv("SILC_MALLOC_PROTECT");
+ if (var && *var == '1') {
+ struct sigaction sa;
+
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = silc_st_sigsegv;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, NULL);
+
+#if defined(_SC_PAGESIZE)
+ pg = sysconf(_SC_PAGESIZE);
+#elif defined(_SC_PAGE_SIZE)
+ pg = sysconf(_SC_PAGE_SIZE);
+#else
+ pg = getpagesize();
+#endif /* _SC_PAGESIZE */
+ }
+
+ /* Linux libc malloc check */
+ setenv("MALLOC_CHECK_", "3", 1);
+
+ /* NetBSD malloc check */
+ setenv("MALLOC_OPTIONS", "AJ", 1);
+
+ silc_mutex_alloc(&lock);
}
void *silc_st_malloc(size_t size, const char *file, int line)
{
- SilcStBlock stack = (SilcStBlock)malloc(SILC_ST_GET_SIZE(size));
- assert(stack != NULL);
+ SilcStBlock stack;
+
+ if (silc_unlikely(!dump))
+ silc_st_stacktrace_init();
+
+ if (pg) {
+ unsigned char *ptr;
+
+ if (posix_memalign((void *)&ptr, pg,
+ SILC_ST_GET_SIZE_ALIGN(size, pg) + pg))
+ return NULL;
+
+ /* The inaccessible page too will include the allocation information
+ so that we can get it when access violation occurs in that page. */
+ stack = (SilcStBlock)(ptr + SILC_ST_GET_SIZE_ALIGN(size, pg));
+ stack->size = size;
+
+ /* Protect the page */
+ if (mprotect(stack, pg, PROT_NONE))
+ silc_st_abort(NULL, file, line, "SILC_MALLOC: mprotect() error: %s\n",
+ errno == ENOMEM ? "Cannot allocate memory. \nYour program "
+ "leaks memory, allocates too much or system \n"
+ "is out of memory. The SILC_MALLOC_PROTECT cannot "
+ "be used." : strerror(errno));
+
+ /* Get the accessible page */
+ stack = SILC_ST_GET_STACK_ALIGN(ptr, size, pg);
+ } else {
+ stack = (SilcStBlock)malloc(SILC_ST_GET_SIZE(size));
+ if (!stack)
+ return NULL;
+ }
stack->dumpped = 0;
stack->file = file;
+ stack->free_file = NULL;
stack->line = line;
stack->size = size;
- silc_st_stacktrace(stack);
+ stack->bound = SILC_ST_TOP_BOUND;
+ stack->depth = backtrace(stack->stack, SILC_ST_DEPTH);
+
+ silc_mutex_lock(lock);
stack->next = st_blocks;
stack->prev = NULL;
@@ -106,6 +300,12 @@
((SilcStBlock)st_blocks)->prev = stack;
st_blocks = stack;
st_blocks_count++;
+ st_num_malloc++;
+
+ silc_mutex_unlock(lock);
+
+ if (!pg)
+ *SILC_ST_GET_BOUND(stack, size) = SILC_ST_BOTTOM_BOUND;
return SILC_ST_GET_PTR(stack);
}
@@ -113,7 +313,8 @@
void *silc_st_calloc(size_t items, size_t size, const char *file, int line)
{
void *addr = (void *)silc_st_malloc(items * size, file, line);
- memset(addr, 0, items * size);
+ if (addr)
+ memset(addr, 0, items * size);
return addr;
}
@@ -125,25 +326,63 @@
return silc_st_malloc(size, file, line);
stack = SILC_ST_GET_STACK(ptr);
- if (stack->size >= size) {
+ if (!pg && stack->size >= size) {
+ /* Must update footer when the size changes */
+ if (stack->size != size)
+ *SILC_ST_GET_BOUND(stack, size) = SILC_ST_BOTTOM_BOUND;
+
stack->size = size;
return ptr;
} else {
void *addr = (void *)silc_st_malloc(size, file, line);
- memcpy(addr, ptr, stack->size);
- silc_st_free(ptr, file, line);
+ if (addr) {
+ memcpy(addr, ptr, size > stack->size ? stack->size : size);
+ silc_st_free(ptr, file, line);
+ }
return addr;
}
}
void silc_st_free(void *ptr, const char *file, int line)
{
- SilcStBlock stack;
+ SilcStBlock stack, s;
if (!ptr)
return;
+ /* Check for double free */
+ if (!memcmp((unsigned char *)ptr - sizeof(struct SilcStBlockStruct),
+ "\x47\x47\x47\x47", 4))
+ silc_st_abort(no_free ? ptr - sizeof(struct SilcStBlockStruct) : NULL,
+ file, line, "SILC_MALLOC: double free: %p already freed\n",
+ ptr - sizeof(struct SilcStBlockStruct));
+
stack = SILC_ST_GET_STACK(ptr);
+
+ silc_mutex_lock(lock);
+
+ /* Check if we have ever made this allocation */
+ for (s = st_blocks; s; s = s->next)
+ if (s == stack)
+ break;
+ if (s == NULL)
+ silc_st_abort(NULL, file, line,
+ "SILC_MALLOC: %p was never allocated\n", stack);
+
+ if (!pg) {
+ /* Check for underflow */
+ if (stack->bound != SILC_ST_TOP_BOUND)
+ silc_st_abort(stack, file, line,
+ "SILC_MALLOC: %p was written out of bounds (underflow)\n",
+ stack);
+
+ /* Check for overflow */
+ if (*SILC_ST_GET_BOUND(stack, stack->size) != SILC_ST_BOTTOM_BOUND)
+ silc_st_abort(stack, file, line,
+ "SILC_MALLOC: %p was written out of bounds (overflow)\n",
+ stack);
+ }
+
if (stack->next)
stack->next->prev = stack->prev;
if (stack->prev)
@@ -153,15 +392,35 @@
st_blocks_count--;
- memset(stack, 'F', SILC_ST_GET_SIZE(stack->size));
- free(stack);
+ silc_mutex_unlock(lock);
+
+ stack->free_file = file;
+ stack->free_line = line;
+
+ if (no_free) {
+ memset(stack, 0x47, 8);
+ return;
+ }
+
+ if (pg) {
+ ptr = SILC_ST_GET_PTR_ALIGN(stack, pg);
+ mprotect(ptr + SILC_ST_GET_SIZE_ALIGN(stack->size, pg), pg,
+ PROT_READ | PROT_WRITE);
+ memset(ptr, 0x47, SILC_ST_GET_SIZE_ALIGN(stack->size, pg));
+ free(ptr);
+ } else {
+ memset(stack, 0x47, SILC_ST_GET_SIZE(stack->size));
+ free(stack);
+ }
}
void *silc_st_memdup(const void *ptr, size_t size, const char *file, int line)
{
unsigned char *addr = (unsigned char *)silc_st_malloc(size + 1, file, line);
- memcpy((void *)addr, ptr, size);
- addr[size] = '\0';
+ if (addr) {
+ memcpy((void *)addr, ptr, size);
+ addr[size] = '\0';
+ }
return (void *)addr;
}
@@ -170,15 +429,20 @@
return silc_st_memdup(string, strlen(string), file, line);
}
-/* Dumps the stack into file if there are leaks. The file can be read
- with a special stacktrace tool. */
+/* Dumps the stack into file if there are leaks. */
void silc_st_dump(void)
{
SilcStBlock stack, s;
unsigned long leaks = 0, blocks, bytes;
FILE *fp = NULL;
+ char **syms, *cp;
int i;
+ SilcMutex l;
+
+ l = lock;
+ lock = NULL;
+ silc_mutex_free(l);
for (stack = st_blocks; stack; stack = stack->next) {
bytes = blocks = 0;
@@ -194,6 +458,10 @@
fp = stderr;
}
+ /* Get symbol names */
+ syms = backtrace_symbols(stack->stack, stack->depth);
+
+ /* Find number of leaks and bytes leaked for this leak */
for (s = stack; s; s = s->next) {
if (s->file == stack->file && s->line == stack->line &&
s->depth == stack->depth &&
@@ -206,10 +474,24 @@
}
if (blocks) {
- fprintf(fp, "<stacktrace>%s:%d: #blocks=%lu, bytes=%lu\n",
+ fprintf(fp, "<leak>%s:%d: #blocks=%lu, bytes=%lu\n",
stack->file, stack->line, blocks, bytes);
- for (i = 0; i < stack->depth; i++)
- fprintf(fp, "\tpc=%p\n", stack->stack[i]);
+ for (i = 0; i < stack->depth; i++) {
+ if (syms) {
+ cp = syms[i];
+ if (strchr(cp, '('))
+ cp = strchr(cp, '(') + 1;
+ else if (strchr(cp, ' '))
+ cp = strchr(cp, ' ') + 1;
+ if (strchr(cp, ')'))
+ *strchr(cp, ')') = ' ';
+ fprintf(fp, "\t%s\n", cp);
+ } else {
+ fprintf(fp, "\tpc=%p\n", stack->stack[i]);
+ }
+ }
+ fprintf(fp, "\n");
+ free(syms);
}
}
@@ -224,6 +506,7 @@
"-----------------------------------------\n"
"-----------------------------------------\n",
leaks, st_blocks_count);
+ fprintf(stderr, "Number of allocations: %lu\n", st_num_malloc);
}
if (fp && fp != stderr)
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.h
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.h?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.h (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/stacktrace.h Mon Nov 24 16:22:47 2008
@@ -1,6 +1,6 @@
/*
- stacktrace.h
+ stacktrace.h
Author: Pekka Riikonen <priikone at silcnet.org>
@@ -17,14 +17,14 @@
*/
-#ifndef STACKTRACE_H
-#define STACKTRACE_H
+#ifndef MEMTRACE_H
+#define MEMTRACE_H
#ifndef SILCMEMORY_H
#error "Do not include internal header file directly"
#endif
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__)
#undef strdup
#define silc_malloc(s) silc_st_malloc((s), __FILE__, __LINE__)
@@ -32,6 +32,7 @@
#define silc_realloc(p, s) silc_st_realloc((p), (s), __FILE__, __LINE__)
#define silc_free(p) silc_st_free((p), __FILE__, __LINE__)
#define silc_memdup(p, s) silc_st_memdup((p), (s), __FILE__, __LINE__)
+#define silc_strdup(s) silc_st_strdup((s), __FILE__, __LINE__)
#define strdup(s) silc_st_strdup((s), __FILE__, __LINE__)
void *silc_st_malloc(size_t size, const char *file, int line);
@@ -44,6 +45,6 @@
#else
#error "memory allocation stack trace not supported on this platform"
-#endif /* __GNUC__ && __i386__ */
+#endif /* __GNUC__ */
-#endif /* STACKTRACE_H */
+#endif /* MEMTRACE_H */
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixnet.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixnet.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixnet.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixnet.c Mon Nov 24 16:22:47 2008
@@ -701,6 +701,9 @@
silc_async_free(conn->op);
}
+ if (conn->sock && conn->status != SILC_NET_OK)
+ silc_net_close_connection(conn->sock);
+
return SILC_FSM_FINISH;
}
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixschedule.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 1998 - 2007 Pekka Riikonen
+ Copyright (C) 1998 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -288,6 +288,7 @@
SILC_LOG_DEBUG(("epoll_ctl (DEL): %s", strerror(errno)));
return FALSE;
}
+ task->scheduled = FALSE;
return TRUE;
}
Modified: silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixsocketstream.c
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixsocketstream.c?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixsocketstream.c (original)
+++ silc-toolkit/branches/upstream/current/lib/silcutil/unix/silcunixsocketstream.c Mon Nov 24 16:22:47 2008
@@ -4,7 +4,7 @@
Author: Pekka Riikonen <priikone at silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
The contents of this file are subject to one of the Licenses specified
in the COPYING file; You may not use this file except in compliance
@@ -106,8 +106,9 @@
/* If QoS was applied, return the data that was pending. */
if (sock->qos->applied && sock->qos->data_len) {
memcpy(buf, qosbuf, sock->qos->data_len);
+ len = sock->qos->data_len;
sock->qos->data_len = 0;
- return sock->qos->data_len;
+ return len;
}
/* If we have active QoS data pending, return with no data */
@@ -116,7 +117,8 @@
return -1;
}
- /* Read the data from the socket. Never read more than the max limit. */
+ /* Read the data from the socket. The qosbuf size is always the max
+ read limit size. */
len = (buf_len < sock->qos->read_limit_bytes ? buf_len :
sock->qos->read_limit_bytes);
len = read(sock->sock, qosbuf, len);
Modified: silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.am
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.am?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.am (original)
+++ silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.am Mon Nov 24 16:22:47 2008
@@ -2,7 +2,7 @@
# To make changes edit the ./lib/silcvcard/Makefile.ad file in the source tree.
# Source: ./lib/silcvcard/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.in
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.in?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.in (original)
+++ silc-toolkit/branches/upstream/current/lib/silcvcard/Makefile.in Mon Nov 24 16:22:47 2008
@@ -18,7 +18,7 @@
# To make changes edit the ./lib/silcvcard/Makefile.ad file in the source tree.
# Source: ./lib/silcvcard/Makefile.ad
-# Generated: Thu Mar 20 08:39:30 EET 2008 by priikone
+# Generated: Sat Oct 25 17:16:11 EEST 2008 by priikone
# Distribution: Toolkit
# License: distdir/TOOLKIT
Modified: silc-toolkit/branches/upstream/current/silc-toolkit.spec
URL: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/branches/upstream/current/silc-toolkit.spec?rev=322&op=diff
==============================================================================
--- silc-toolkit/branches/upstream/current/silc-toolkit.spec (original)
+++ silc-toolkit/branches/upstream/current/silc-toolkit.spec Mon Nov 24 16:22:47 2008
@@ -1,6 +1,6 @@
Summary: SILC Toolkit
Name: silc-toolkit
-Version: 1.1.7
+Version: 1.1.8
Release: 0.fc8
License: GPL/BSD dual licensed
Group: System Environment/Libraries
More information about the Pkg-silc-commits
mailing list