silcclient: auto-negotiation of private message key using SKE over SILCnet
authorPekka Riikonen <priikone@silcnet.org>
Mon, 28 Apr 2014 19:59:28 +0000 (22:59 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 28 Apr 2014 19:59:28 +0000 (22:59 +0300)
commit80d10dbf48785c2163551a7f94a46f6f5849c4a7
tree004c7a78975cfb1c5827ff99220496d8072c84a8
parentd7f1e81fea0d1da2ac870b8dfa600669aa280cd5
silcclient: auto-negotiation of private message key using SKE over SILCnet

Previously in SILC private messages have been protected in normal mode
using the session key shared between the client and server and other
servers in the network.  This obviously has security implications if
the SILC servers cannot be trusted.

To overcome this issue silcclient library has offered user the ability to
use pre-shared key (or password) as the secret key to protect private
message, or to negotiate fresh key material using SKE peer-to-peer over
the internet (key agreement).

However, both of these feature have severe limitations.  The first one
requiring coordinated effort to somehow share the key or password and
the second requiring peer-to-peer connection which may not be possible
due to NAT and firewalls.

This commit adds a new private message protection method and takes it
into use as the default protection method.  The commits adds support
for automatic negotiation of the private message key using SKE but instead
of doing it peer-to-peer over the internet it is done client-to-client
over the SILC network itself.  This is accomplished by tunneling the
SKE protocol inside private message packets.  As SKE is safe over the
unprotected and untrusted internet it is safe also over the SILC network.

The end result of the auto-negotiation is a shared secret known only
to the two clients.  The SKE provides mutual authentication with digital
signatures to prevent man-in-the-middle attack.  The private messages
protected with this key can be read only by the two clients.  SILC servers
along the way cannot decrypt them.  The key is periodically re-keyed
(5 minutes or so) and it provides Perfect Forward Secrecy.

The auto-negotiation is enabled by default.  It can detect within seconds
if the remote client supports the method and if it doesn't it gives a
notification that the private message protection has been reverted back
to session keys.  Application can disable the feature, if wanted.

This feature does not require any changes to SILC servers.
lib/silcclient/client.h
lib/silcclient/client_internal.h
lib/silcclient/client_prvmsg.c
lib/silcclient/client_prvmsg.h
lib/silcclient/command_reply.c
lib/silcclient/silcclient.h
lib/silccore/silcmessage.h