silc.git
14 years agoconfigure: check threads support in OpenBSD. silc.client.1.1.8 silc.server.1.1.17
Pekka Riikonen [Fri, 31 Jul 2009 19:38:06 +0000 (22:38 +0300)]
configure: check threads support in OpenBSD.

14 years agoFixed string format vulnerability in client entry handling.
Pekka Riikonen [Fri, 31 Jul 2009 19:32:57 +0000 (22:32 +0300)]
Fixed string format vulnerability in client entry handling.

Reported and patch provided by William Cummings.

14 years agosilcd: Fixed IDENTIFY command reply handling for channels
Pekka Riikonen [Mon, 8 Jun 2009 05:58:35 +0000 (08:58 +0300)]
silcd: Fixed IDENTIFY command reply handling for channels

The IDENTIFY comamnd reply for channels were broken because the channel ID
parsing always failed.  This would cause issues like USERS command not
returning the users for a channel, making the channel appear empty, in some
specific cases.

Fixed also the USERS command reply to not query the channel information
from router more than once.

14 years agosilcd: Abort active protocols in DETACH command
Pekka Riikonen [Mon, 8 Jun 2009 05:03:02 +0000 (08:03 +0300)]
silcd: Abort active protocols in DETACH command

When detaching client, which results into closing of the actual connection
it is important to abort any active protocols, such as rekeys, because
they cannot be completed with detached clients.

14 years agosilcd: Added SKR to debug levels
Pekka Riikonen [Sun, 7 Jun 2009 17:04:16 +0000 (20:04 +0300)]
silcd: Added SKR to debug levels

14 years agosilcd: Save debug message in ring buffer
Pekka Riikonen [Tue, 2 Jun 2009 05:01:25 +0000 (08:01 +0300)]
silcd: Save debug message in ring buffer

In debug version save 3000 last debug messages in ring buffer so that they
are available in core files.

14 years agoconfigure.ad: Fixed configure to support new autoconf
Pekka Riikonen [Mon, 25 May 2009 17:44:07 +0000 (20:44 +0300)]
configure.ad: Fixed configure to support new autoconf

14 years agosilcd: fixed Deny hostname comparison
Pekka Riikonen [Mon, 25 May 2009 17:43:22 +0000 (20:43 +0300)]
silcd: fixed Deny hostname comparison

Use the silc_strin_match instead of silc_string_compare to match
hostnames and IP addresses in silcd.conf.  Fixed for Deny but changed
in all the other places as well.

15 years agoAdded proper copyright notices to COPYING and BSD files silc.server.1.1.16
Pekka Riikonen [Wed, 11 Mar 2009 15:04:20 +0000 (17:04 +0200)]
Added proper copyright notices to COPYING and BSD files

15 years agosilcd: IDENTIFY command reply didn't save userinfo correctly
Pekka Riikonen [Tue, 3 Mar 2009 06:02:27 +0000 (08:02 +0200)]
silcd: IDENTIFY command reply didn't save userinfo correctly

The IDENTIFY command reply didn't duplicate the userinfo when adding
new client thus causing weird crashes later when freeing the userinfo.

15 years agosilcd: IDENTIFY command reply didn't save client correctly
Pekka Riikonen [Tue, 3 Mar 2009 05:52:58 +0000 (07:52 +0200)]
silcd: IDENTIFY command reply didn't save client correctly

The IDENTIFY command reply added sometimes new client without
duplicating the nickname of the client thus causing odd crashes later
when trying to free the nickname.

15 years agoPacketEngine: Don't free underlaying stream in packet stream create error
Pekka Riikonen [Fri, 27 Feb 2009 14:22:36 +0000 (16:22 +0200)]
PacketEngine: Don't free underlaying stream in packet stream create error

If packet stream creation failed it freed the stream given as argument.
This is wrong.  It is the caller's responsibility to free it if the
packet stream creation failed.

15 years agosilcd: handle SIGNOFF notify for local clients correctly
Pekka Riikonen [Fri, 27 Feb 2009 14:16:11 +0000 (16:16 +0200)]
silcd: handle SIGNOFF notify for local clients correctly

In some rare cases router can send SIGNOFF notify to server for a client
that is locally connected to the server.  The server didn't close the
client's connection but freed the entry.  This later caused various
different crashes when accessing the freed the client.

15 years agoFixed unsigned <-> signed char issues
Pekka Riikonen [Thu, 26 Feb 2009 06:07:56 +0000 (08:07 +0200)]
Fixed unsigned <-> signed char issues

15 years agoSKE: When failure is received mark SKE always failed
Pekka Riikonen [Thu, 26 Feb 2009 06:06:02 +0000 (08:06 +0200)]
SKE: When failure is received mark SKE always failed

Mark the SKE failed even if we don't receive error from remote.  Fixes
crash where the callback is called back to application without valid
key material and without error status.

15 years agosilcd: increment stat.clients statistics whenever adding new client
Pekka Riikonen [Sat, 17 Jan 2009 09:42:07 +0000 (11:42 +0200)]
silcd: increment stat.clients statistics whenever adding new client

When new client is added to server the stat.clients must always be
incremented.  Otherwise it is possible to go under zero when removing
the clients by server.

15 years agosilcd: do not create dynamic connections on non-dynamic server
Pekka Riikonen [Thu, 15 Jan 2009 10:21:23 +0000 (12:21 +0200)]
silcd: do not create dynamic connections on non-dynamic server

15 years agoAdded scripts/release
Pekka Riikonen [Mon, 12 Jan 2009 07:03:41 +0000 (09:03 +0200)]
Added scripts/release

15 years agoLibtool 2.x support silc.client.1.1.7
Pekka Riikonen [Sat, 10 Jan 2009 16:08:27 +0000 (18:08 +0200)]
Libtool 2.x support

15 years agoUpdated release documentation.
Pekka Riikonen [Sat, 10 Jan 2009 09:54:57 +0000 (11:54 +0200)]
Updated release documentation.

15 years agoFixed operation context NULLin in disconnect.
Pekka Riikonen [Fri, 9 Jan 2009 08:14:12 +0000 (10:14 +0200)]
Fixed operation context NULLin in disconnect.

15 years agoTake stream reference correctly in packet error callback
Pekka Riikonen [Fri, 9 Jan 2009 05:33:55 +0000 (07:33 +0200)]
Take stream reference correctly in packet error callback

Reverted commit e5e28835f5f0c4c5b52f0449e75b7f1c03a37548

15 years agoRemove possible packet error timeouts in EOS callback
Pekka Riikonen [Thu, 8 Jan 2009 20:32:47 +0000 (22:32 +0200)]
Remove possible packet error timeouts in EOS callback

15 years agoAdded debug logs for updating stat.clients value
Pekka Riikonen [Thu, 8 Jan 2009 19:58:39 +0000 (21:58 +0200)]
Added debug logs for updating stat.clients value

15 years agoFixed libtool installation: always use --mode=install silc.server.1.1.15 silc.toolkit.1.1.9
Pekka Riikonen [Thu, 8 Jan 2009 14:25:04 +0000 (16:25 +0200)]
Fixed libtool installation: always use --mode=install

15 years agofix.pl: support for new perl
Pekka Riikonen [Thu, 8 Jan 2009 13:58:57 +0000 (15:58 +0200)]
fix.pl: support for new perl

15 years agoRemoved libtoolfix
Pekka Riikonen [Thu, 8 Jan 2009 12:35:48 +0000 (14:35 +0200)]
Removed libtoolfix

15 years agoDocumented public_ip field
Pekka Riikonen [Thu, 8 Jan 2009 09:31:48 +0000 (11:31 +0200)]
Documented public_ip field

15 years agoMerge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Thu, 8 Jan 2009 09:20:01 +0000 (11:20 +0200)]
Merge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

15 years agoPacket engine: more padding length check fixes
Pekka Riikonen [Tue, 16 Dec 2008 15:17:58 +0000 (17:17 +0200)]
Packet engine: more padding length check fixes

The padding length must be checked differently depending on whether the
packet is fully encrypted with session key or if only the header is
encrypted with session key (fe. channel messages).

15 years agoDon't decrement my_clients when killing or expiring a detached client.
Skywing [Sat, 13 Dec 2008 21:27:48 +0000 (16:27 -0500)]
Don't decrement my_clients when killing or expiring a detached client.

This prevents my_clients from getting out of sync when a detached
client is forcibly removed, fixing a regression.

15 years agoMerge branch 'topic/format-cleanup' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Sat, 13 Dec 2008 20:30:25 +0000 (22:30 +0200)]
Merge branch 'topic/format-cleanup' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

15 years agoMerge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Sat, 13 Dec 2008 20:02:18 +0000 (22:02 +0200)]
Merge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

15 years agoCleanup: limit length of strings scanned by scanf.
Kp [Sat, 13 Dec 2008 18:37:39 +0000 (12:37 -0600)]
Cleanup: limit length of strings scanned by scanf.

Several uses of scanf-type functions allowed the scanned string to
supply an arbitrarily large input string.  Add length qualifiers to
prevent scanf from overrunning the supplied buffer.

15 years agoCleanup: fix long/int format string errors.
Kp [Sun, 7 Dec 2008 21:48:48 +0000 (15:48 -0600)]
Cleanup: fix long/int format string errors.

Two format strings used long values with int format specifiers.
Fix the format specifiers so that the entire value can be printed.

15 years agoFix error logging format string mangled by a bogus comma.
Kp [Mon, 8 Dec 2008 00:24:33 +0000 (18:24 -0600)]
Fix error logging format string mangled by a bogus comma.

A format string was split over two lines, with the second line
containing the format specifier that prints the channel name.  A comma
was incorrectly appended to the first line, causing the format specifier
substring to become an argument string.  Since no format specifiers
remain in the main string, the logger does not format any arguments.
Remove the bogus comma to fix that.

15 years agoCleanup: fix various int/long format string errors.
Kp [Mon, 8 Dec 2008 00:59:23 +0000 (18:59 -0600)]
Cleanup: fix various int/long format string errors.

Various format strings used int values with long format specifiers.
Fix the format specifiers to be consistent with the values supplied.

15 years agoCleanup: cast socket to long before logging it.
Kp [Sun, 7 Dec 2008 21:46:47 +0000 (15:46 -0600)]
Cleanup: cast socket to long before logging it.

The SilcSocket type varies in size, depending on the host platform.  On
Unix systems, it is an int, which is 32-bits on all interesting
platforms.  On Windows, it is a SOCKET, which is also 32-bits.  However,
on Symbian, SilcSocket is a void pointer.  Changing %lu to %u may not
work in all cases due to this size difference, so instead cast the
socket to a long unsigned, which should avoid loss of precision on all
platforms and still satisfy the %lu format specifier.

15 years agoFix missing argument in SKR debug logging.
Kp [Sun, 7 Dec 2008 21:49:36 +0000 (15:49 -0600)]
Fix missing argument in SKR debug logging.

The format string used in SKR debug logging calls for a pointer and two
int values.  However, only the two int values were provided, so the
debug logs would be wrong if they were ever printed.  Based on context,
the format string probably wanted the SilcSKRKey.  Add it.

15 years agoFix missing argument in client_entry.c debug logging.
Kp [Sun, 7 Dec 2008 22:04:56 +0000 (16:04 -0600)]
Fix missing argument in client_entry.c debug logging.

Logging modifications during merge commit
e9374395ec9747bddd3ea0bfd3e5a17717e97b31 resulted in several log
messages that purport to print a pointer, but do not push one for the
logging code to format.  Add the pointer that was clearly meant in each
case.

15 years agoFix missing argument in silc_client_abort_key_agreement debug logging.
Kp [Sun, 7 Dec 2008 22:35:05 +0000 (16:35 -0600)]
Fix missing argument in silc_client_abort_key_agreement debug logging.

The debug log in silc_client_abort_key_agreement purports to print a
pointer, but does not push one for the logging code to format.  Fix
that, and extend the message to print some other values that might be
interesting.

15 years agoHTTP: fix stack overwrite due to format string error.
Kp [Sat, 13 Dec 2008 03:38:54 +0000 (21:38 -0600)]
HTTP: fix stack overwrite due to format string error.

On AMD64, %lu refers to a 64-bit unsigned value, but the address passed
to sscanf points to a 32-bit unsigned value.  This causes an adjoining
value on the stack to be overwritten with data from the converted
integer.  Fix the format string to match the size of the supplied value,
and remove the pointer cast.

15 years agoID Cache: Fixed destructor callback calling.
Pekka Riikonen [Sat, 13 Dec 2008 19:48:04 +0000 (21:48 +0200)]
ID Cache: Fixed destructor callback calling.

The destructor context given to the ID cache destructor callback was wrong
which caused odd crashes.

15 years agoPacket engine: do not do the padding length check for CTR mode.
Pekka Riikonen [Sat, 13 Dec 2008 19:27:01 +0000 (21:27 +0200)]
Packet engine: do not do the padding length check for CTR mode.

15 years agoCancel future rekeys on a detaching client connection.
Skywing [Sat, 13 Dec 2008 19:15:15 +0000 (14:15 -0500)]
Cancel future rekeys on a detaching client connection.

Previously, these wouldn't be cancelled properly, and might result in
some complaints from the SILC SKE library due to bad parameters.

15 years agoMerge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Sat, 13 Dec 2008 19:13:21 +0000 (21:13 +0200)]
Merge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

15 years agoSend resume notifications to previous owner server when client resumes.
Skywing [Sat, 13 Dec 2008 18:43:25 +0000 (13:43 -0500)]
Send resume notifications to previous owner server when client resumes.

Previously, resume notifications were broadcast to all routers, but not
necessarily the original owner of a particular detached user.  This
caused various breakage when a user was previously homed at a plain
server and then resumed at a router server, as the users previous home
server would never have been properly notified about the resume.

15 years agoMerge branch 'topic/serverlink-fixes' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Sat, 13 Dec 2008 16:18:20 +0000 (18:18 +0200)]
Merge branch 'topic/serverlink-fixes' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

Additional changes:

- Do not register packet error timeout multiple times
- Added padding length sanity checks to packet engine
- Removed old unused macros from silcd

15 years agoMerge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc...
Pekka Riikonen [Sat, 13 Dec 2008 15:56:31 +0000 (17:56 +0200)]
Merge branch 'topic/detach-fixes' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

15 years agoFix use-after-free condition when reconnecting silcd to router silcd.
Skywing [Fri, 12 Dec 2008 04:57:37 +0000 (23:57 -0500)]
Fix use-after-free condition when reconnecting silcd to router silcd.

This fixes a use-after-free bug wherein silcd can reuse the context on
the SilcPacketStream when we receive an EOS indication after the link
was terminated due to a timeout error.

15 years agoDon't count detached users in server local user count.
Skywing [Fri, 12 Dec 2008 04:22:04 +0000 (23:22 -0500)]
Don't count detached users in server local user count.

This commit decrements the count of users when a detach occurs, and
increments the count when a user re-attaches.

This is done as current silc routers have a bug where only a detached
users previous home server is not properly pro-actively notified of a
user resuming elsewhere unless the user resumes on a router server.

The issue with non-router-server resume notification will be fixed
seperately.  This change allows member servers to operate reliably in
the event that there is a router with the aforementioned bug in their
silcnet.

15 years agoUse primary router when sending WHOIS packet if client->router is NULL.
Skywing [Sun, 23 Nov 2008 18:54:12 +0000 (13:54 -0500)]
Use primary router when sending WHOIS packet if client->router is NULL.

client may be non-NULL, but client->router may be NULL when we enter
silc_server_query_client in the case of a detached client on a remote
server that has not been fully resolved yet.  In this case, we should
try and send the packet using the primary router.  This fixes a crash
wherein silc_server_query_client would sometimes crash with a NULL
dereference if called on a remote detached client.

15 years agoUse primary router when sending WHOIS packet if client->router is NULL.
Skywing [Sun, 23 Nov 2008 18:54:12 +0000 (13:54 -0500)]
Use primary router when sending WHOIS packet if client->router is NULL.

client may be non-NULL, but client->router may be NULL when we enter
silc_server_query_client in the case of a detached client on a remote
server that has not been fully resolved yet.  In this case, we should
try and send the packet using the primary router.  This fixes a crash
wherein silc_server_query_client would sometimes crash with a NULL
dereference if called on a remote detached client.

15 years agosilcd: disconnect packet errors with random timeout
Pekka Riikonen [Sun, 23 Nov 2008 10:58:28 +0000 (12:58 +0200)]
silcd: disconnect packet errors with random timeout

15 years agoPacket engine: moved packet sanity checks after MAC check
Pekka Riikonen [Sun, 23 Nov 2008 10:56:20 +0000 (12:56 +0200)]
Packet engine: moved packet sanity checks after MAC check

15 years agoRemoved extra semicolons from SILC_ASSERT and SILC_VERIFY macros
Pekka Riikonen [Sun, 23 Nov 2008 10:48:21 +0000 (12:48 +0200)]
Removed extra semicolons from SILC_ASSERT and SILC_VERIFY macros

15 years agoMerge branch 'master' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch
Pekka Riikonen [Sat, 22 Nov 2008 16:14:35 +0000 (18:14 +0200)]
Merge branch 'master' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch

Code cleanup during merge.

Reverted External IP commit

Reverted changes to silcsocketstream API.  The user context can be now
set to SilcClientConnectionParams.  Increased shared library revision to
avoid backwards incompatiblity.

Signed-off-by: Pekka Riikonen <priikone@silcnet.org>
15 years agoCancel silc_server_connect_to_router_retry when connecting.
Skywing [Sat, 22 Nov 2008 04:57:32 +0000 (23:57 -0500)]
Cancel silc_server_connect_to_router_retry when connecting.

There exists a crash bug such that an un-cancelled timeout callback for
silc_server_connect_to_retry fires after the connection object has
already been cleaned up.  Any router_retry requests must be cancelled
when we are deleting the associated connect object.  The fix that was
implemented was to cancel silc_server_connect_to_router_retry in
addition to silc_server_connect_to_router when a call to
silc_server_create_connections is made.  (This routine is called when
we are to make new server connections if reconnects are enabled.)

The problem would typically occur after a long enough time with silcd
trying to connect to a router server over and over; there is a race
condition component that can delay the initial use-after-free condition
for some time.

15 years agoMark outbound initiated server to server connections as local.
Skywing [Sat, 22 Nov 2008 02:24:07 +0000 (21:24 -0500)]
Mark outbound initiated server to server connections as local.

This fixes an issue where if a disconnect packet is received by the
server for an outbound silc connection (i.e. a server to server link)
and there is an outstanding async operation, such as an SKE or
connection auth, the server will corrupt the heap due to not properly
calling the async abort routine.

This issue would typically happen when we have a silcd setup to connect
to a remote router server, where both ends of the connection have public
keys configured, but the initiator server's IP is wrong.  In this case,
we will get past key exchange and then fail at the connection auth
packet, typically crashing the initiator silcd after heap corruption.

15 years agoMerge branch 'master' of git://valera-ext.nynaeve.net/silc
Skywing [Sat, 22 Nov 2008 00:38:40 +0000 (19:38 -0500)]
Merge branch 'master' of git://valera-ext.nynaeve.net/silc

15 years agoPrevent continuing of an already finished FSM.
Skywing [Sun, 9 Nov 2008 04:07:36 +0000 (23:07 -0500)]
Prevent continuing of an already finished FSM.

Another fix for another crash relating to misuse of FSM and callback logic in
the SKE library.

15 years agoFix crash on SKE failure.
Skywing [Sun, 9 Nov 2008 02:19:03 +0000 (21:19 -0500)]
Fix crash on SKE failure.

Adds checks to prevent SKE failure notification callbacks from being called
multiple times for the same SKE instance.  This would often happen, for
example, if we aborted an SKE.

15 years agoFix crash on expired keyboard prompts
Skywing [Sat, 8 Nov 2008 22:54:03 +0000 (17:54 -0500)]
Fix crash on expired keyboard prompts

15 years agoAdd reference counting to SilcClientEntry/SilcServerEntry for getkey response.
Skywing [Sat, 28 Jun 2008 05:21:51 +0000 (00:21 -0500)]
Add reference counting to SilcClientEntry/SilcServerEntry for getkey response.

This is necessary in case the entry goes away before the user responds to the
keyboard input request.  (Fix for getkey crash if a user logs off before one
responds to the getkey prompt.)

15 years agoFix initialization/deinitialization of various Silc*Entry objects.
Skywing [Sat, 28 Jun 2008 05:12:18 +0000 (00:12 -0500)]
Fix initialization/deinitialization of various Silc*Entry objects.

A number of init/deinit cases were failing to clean up
certain resources.

15 years agoFix reference counting for SilcServerEntry objects,
Skywing [Sat, 28 Jun 2008 04:44:03 +0000 (23:44 -0500)]
Fix reference counting for SilcServerEntry objects,

analogous to the previous fixes for the broken
reference counting for SilcChannelEntry and
SilcClientEntry objects.

15 years agoAdd support for autosendcmd on channel entries to the
Skywing [Fri, 27 Jun 2008 05:18:01 +0000 (00:18 -0500)]
Add support for autosendcmd on channel entries to the

SILC client.  Note that we don't support botmasks yet,
but this can be used to send a command on join of a
channel on connect/reconnect/reattach detached session.

15 years agoAssert that the client count is positive prior to decrementing it.
Kp [Fri, 4 Jul 2008 18:06:00 +0000 (13:06 -0500)]
Assert that the client count is positive prior to decrementing it.

A situation has been observed where a silcd has clients connected to it,
but reports 0 local users.  It is believed that when these users log
off, the server underflows and refuses new connections.  Assert that no
underflow occurs, which should prove or disprove this theory.

15 years agoAdd ``ExternalIp'' config directive to ServerInfo tag in
Skywing [Fri, 27 Jun 2008 05:16:37 +0000 (00:16 -0500)]
Add ``ExternalIp'' config directive to ServerInfo tag in

silcd.conf.  This allows server linking with a server
behind a NAT connecting out to a router.

15 years agoFix reference counting for key exchange handling.
Kp [Sat, 28 Jun 2008 05:28:25 +0000 (00:28 -0500)]
Fix reference counting for key exchange handling.

When a key exchange times out, the SKE can be freed before the user
responds.  Switch the SKE callbacks to obtain their own reference to the
object to prevent this.

15 years agoPrevent continuing of an already finished FSM.
Skywing [Sun, 9 Nov 2008 04:07:36 +0000 (23:07 -0500)]
Prevent continuing of an already finished FSM.

Another fix for another crash relating to misuse of FSM and callback logic in
the SKE library.

15 years agoFix crash on SKE failure.
Skywing [Sun, 9 Nov 2008 02:19:03 +0000 (21:19 -0500)]
Fix crash on SKE failure.

Adds checks to prevent SKE failure notification callbacks from being called
multiple times for the same SKE instance.  This would often happen, for
example, if we aborted an SKE.

15 years agoRevert "Don't delete packet stream"
Skywing [Sun, 9 Nov 2008 02:05:06 +0000 (21:05 -0500)]
Revert "Don't delete packet stream"

This reverts commit 544d0faa279dc3a3ca8f635665bd2cb57e92342b.

15 years agoDon't delete packet stream
Skywing [Sat, 8 Nov 2008 23:46:02 +0000 (18:46 -0500)]
Don't delete packet stream

15 years agoFix crash on expired keyboard prompts
Skywing [Sat, 8 Nov 2008 22:54:03 +0000 (17:54 -0500)]
Fix crash on expired keyboard prompts

15 years agoAdd reference counting to SilcClientEntry/SilcServerEntry for getkey response.
Skywing [Sat, 28 Jun 2008 05:21:51 +0000 (00:21 -0500)]
Add reference counting to SilcClientEntry/SilcServerEntry for getkey response.

This is necessary in case the entry goes away before the user responds to the
keyboard input request.  (Fix for getkey crash if a user logs off before one
responds to the getkey prompt.)

15 years agoFix initialization/deinitialization of various Silc*Entry objects.
Skywing [Sat, 28 Jun 2008 05:12:18 +0000 (00:12 -0500)]
Fix initialization/deinitialization of various Silc*Entry objects.

A number of init/deinit cases were failing to clean up
certain resources.

15 years agoFix reference counting for SilcServerEntry objects,
Skywing [Sat, 28 Jun 2008 04:44:03 +0000 (23:44 -0500)]
Fix reference counting for SilcServerEntry objects,

analogous to the previous fixes for the broken
reference counting for SilcChannelEntry and
SilcClientEntry objects.

15 years agoAdd support for autosendcmd on channel entries to the
Skywing [Fri, 27 Jun 2008 05:18:01 +0000 (00:18 -0500)]
Add support for autosendcmd on channel entries to the

SILC client.  Note that we don't support botmasks yet,
but this can be used to send a command on join of a
channel on connect/reconnect/reattach detached session.

15 years agoAssert that the client count is positive prior to decrementing it.
kp@valhallalegends.com [Fri, 4 Jul 2008 18:06:00 +0000 (13:06 -0500)]
Assert that the client count is positive prior to decrementing it.

A situation has been observed where a silcd has clients connected to it,
but reports 0 local users.  It is believed that when these users log
off, the server underflows and refuses new connections.  Assert that no
underflow occurs, which should prove or disprove this theory.

15 years agoAdd ``ExternalIp'' config directive to ServerInfo tag in
Skywing [Fri, 27 Jun 2008 05:16:37 +0000 (00:16 -0500)]
Add ``ExternalIp'' config directive to ServerInfo tag in

silcd.conf.  This allows server linking with a server
behind a NAT connecting out to a router.

15 years agoFix reference counting for key exchange handling.
kp@valhallalegends.com [Sat, 28 Jun 2008 05:28:25 +0000 (00:28 -0500)]
Fix reference counting for key exchange handling.

When a key exchange times out, the SKE can be freed before the user
responds.  Switch the SKE callbacks to obtain their own reference to the
object to prevent this.

15 years agoFixed channel MAC key setting in JOIN notify and command reply silc.client.1.1.6 silc.server.1.1.14 silc.toolkit.1.1.8
Pekka Riikonen [Sat, 25 Oct 2008 13:58:50 +0000 (16:58 +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.

15 years agosilcd: fixed memory leaks
Pekka Riikonen [Wed, 22 Oct 2008 19:22:00 +0000 (22:22 +0300)]
silcd: fixed memory leaks

15 years agoMerge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch silc.server.1.1.13
Pekka Riikonen [Wed, 24 Sep 2008 15:18:30 +0000 (18:18 +0300)]
Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch

Signed-off-by: Pekka Riikonen <priikone@silcnet.org>
15 years agoDisconnect problem: Mark incoming connections immediately local
Pekka Riikonen [Wed, 24 Sep 2008 14:56:56 +0000 (17:56 +0300)]
Disconnect problem: Mark incoming connections immediately local

This fixes the problem of SKE remaining running in the background
even though the conncection is closed because it was never aborted
because the connection wasn't marked local.  After SKE timeout a
crash may occur.

15 years agoFixed more backup router reconnecting problems
Pekka Riikonen [Wed, 24 Sep 2008 13:53:38 +0000 (16:53 +0300)]
Fixed more backup router reconnecting problems

Fixed also possible buffer overflows.

15 years agoFixed server/backup router reconnecting
Pekka Riikonen [Wed, 24 Sep 2008 05:46:28 +0000 (08:46 +0300)]
Fixed server/backup router reconnecting

15 years agoDocumented public_ip configuration option silc.server.1.1.12
Pekka Riikonen [Sat, 13 Sep 2008 17:54:45 +0000 (20:54 +0300)]
Documented public_ip configuration option

15 years agoFixed backup router shutdown crash
Pekka Riikonen [Sat, 13 Sep 2008 12:49:23 +0000 (15:49 +0300)]
Fixed backup router shutdown crash

15 years agoSKE: Verify initiator's public key always
Pekka Riikonen [Sat, 13 Sep 2008 12:45:53 +0000 (15:45 +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.

15 years agoMerge branch 'topic/code-cleanup' of git://208.110.73.182/silc into silc.1.1.branch
Pekka Riikonen [Thu, 11 Sep 2008 15:47:55 +0000 (18:47 +0300)]
Merge branch 'topic/code-cleanup' of git://208.110.73.182/silc into silc.1.1.branch

15 years agoMerge branch 'topic/null-fixes' of git://208.110.73.182/silc into silc.1.1.branch
Pekka Riikonen [Thu, 11 Sep 2008 15:41:51 +0000 (18:41 +0300)]
Merge branch 'topic/null-fixes' of git://208.110.73.182/silc into silc.1.1.branch

15 years agoMerge branch 'topic/type-safety' of git://208.110.73.182/silc into silc.1.1.branch
Pekka Riikonen [Thu, 11 Sep 2008 15:41:38 +0000 (18:41 +0300)]
Merge branch 'topic/type-safety' of git://208.110.73.182/silc into silc.1.1.branch

15 years agoFix reference count bug leading to memory corruption on duplicate deletions.
Skywing [Fri, 27 Jun 2008 23:13:59 +0000 (18:13 -0500)]
Fix reference count bug leading to memory corruption on duplicate deletions.

15 years agoMake packet stream reference counts 32 bits.
Skywing [Fri, 20 Jun 2008 22:37:21 +0000 (17:37 -0500)]
Make packet stream reference counts 32 bits.

15 years agoPacket streams: make packet handling callback pointers read only.
Kp [Sun, 1 Jun 2008 21:15:46 +0000 (16:15 -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.

15 years agoReorder #if 0/#endif block to avoid splitting a basic block across the #if 0.
Kp [Fri, 4 Jul 2008 18:03:11 +0000 (13:03 -0500)]
Reorder #if 0/#endif block to avoid splitting a basic block across the #if 0.

The bracing convention caused a #if 0/#endif to exclude the close of one
block and the open of another.  This compiled correctly, but confused
other tools that expect to see a block fully present or fully absent.
Move the ending brace of the preceding block out of the #if 0 and the
ending brace of the excluded block into the #if 0 to fix that.

15 years agoFix double free in silcd.
Skywing [Fri, 20 Jun 2008 21:19:32 +0000 (16:19 -0500)]
Fix double free in silcd.

15 years agoPacket streams: avoid double free if silc_id_id2str fails.
Kp [Sun, 1 Jun 2008 17:59:42 +0000 (12:59 -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.