--- silc-toolkit-1.1.7.orig/debian/changelog
+++ silc-toolkit-1.1.7/debian/changelog
@@ -0,0 +1,211 @@
+silc-toolkit (1.1.7-2+lenny1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch-backports:
+    - drop support for dpkg-gensymbols.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Wed, 02 Sep 2009 02:51:00 +0200
+
+silc-toolkit (1.1.7-2+lenny1) stable-security; urgency=high
+
+  * Backport upstream security fixes:
+    - [ebfe5dc] ASN1: Fix stack variable overwrite when encoding OID
+    - [b2b91b0] HTTP: fix stack overwrite due to format string error
+    - [1598b3a] Fixed string format vulnerability in client entry handling
+    - [8cb801c] More string format fixes in silcd and client libary
+
+ -- Jérémy Bobbio <lunar@debian.org>  Mon, 31 Aug 2009 15:12:49 +0200
+
+silc-toolkit (1.1.7-2) unstable; urgency=low
+
+  * Backport upstream fixes found in silc-server 1.1.11.
+  * Bump Standards-Version to 3.8.0, no changes required. 
+  * Remove erroneous empty line in libsilc-1.1-2.symbols.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Fri, 11 Jul 2008 12:50:03 +0200
+
+silc-toolkit (1.1.7-1) unstable; urgency=high
+
+  * New upstream release:
+    - SECURITY: fixes possible buffer overflow in PKCS#1 message decoding.
+  * Setting urgency to high for the security update.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Tue, 25 Mar 2008 14:08:55 +0100
+
+silc-toolkit (1.1.6-1) unstable; urgency=low
+
+  [ Jérémy Bobbio ]
+  * New upstream release.
+  * Add a watch file.
+  * Promote the Homepage pseudo-field to a real field for source package.
+  * Bump Standards-Version to 3.7.3 (no changes required).
+  * Add support for dpkg-gensymbols.  Requires dpkg-dev (>= 1.14.8) to build.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Sat, 08 Mar 2008 23:35:04 +0000
+
+silc-toolkit (1.1.5-1) unstable; urgency=low
+
+  [ Micah Anderson ]
+  * New upstream release
+
+  [ Jérémy Bobbio ]
+  * Make the clean rule policy compliant. (Closes: #442731)
+  * Fix debian/copyright issues mentioned by ftpmaster. 
+
+ -- Jérémy Bobbio <lunar@debian.org>  Tue, 25 Sep 2007 22:16:07 +0200
+
+silc-toolkit (1.1.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Update debian/control to set Priority of libsilc-1.1-2-dbg to "extra", as
+    the ftpmasters sorted it.
+  * Improve the package description, thanks to Anarcat.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Wed, 12 Sep 2007 02:10:04 +0200
+
+silc-toolkit (1.1.2-2) unstable; urgency=low
+
+  * Fix some IA64 related functions in lib/silcutil/silcatomic.h, allowing
+    silc-toolkit to build on ia64.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Wed, 11 Jul 2007 13:27:58 +0200
+
+silc-toolkit (1.1.2-1) unstable; urgency=low
+
+  * New upstream release including more security fixes.
+  * Add Depends on pkg-config to libsilc-1.1-2-dev.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Sat, 07 Jul 2007 00:34:42 +0200
+
+silc-toolkit (1.1.1-1) unstable; urgency=low
+
+  * New upstream release, fixing two buffer overflow issues.
+  * Update binary package name to reflacte the new SONAME.
+  * Use --docdir instead of --with-docdir for ./configure in debian/rules.
+  * Fix lintian warning "debian-rules-ignores-make-clean-error" in
+    debian/rules.
+  * More cleanups and fixes in debian/copyright.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Wed, 27 Jun 2007 15:11:17 +0200
+
+silc-toolkit (1.1-1) unstable; urgency=low
+
+  [ Michael C. Schultheiss ]
+  * New upstream release: Upgrade to 1.1 final
+
+  [ Jérémy Bobbio ]
+  * Improve debian/copyright, listing exceptions to the package main
+    copyright.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Sat, 16 Jun 2007 18:07:51 +0100
+
+silc-toolkit (1.1~beta4-1) unstable; urgency=low
+
+  [ Jérémy Bobbio ]
+  * New upstream release:                                     (Closes: #413790)
+     - update binary package name to reflect the new SONAME,
+     - upstream now provide its own pkg-config script.
+  * silc-toolkit is now maintained by the Debian SILC team!
+  * Switch to debhelper 5.
+  * Use ${binary:Version} instead of ${Source-Version}.
+  * Do not ship the .la files anymore.  Using pkg-config instead of .la avoid
+    troubles.
+  * Various cleanups and updates in debian/rules.
+  * Documentation is now shipped in /usr/share/doc/libsilc-1.1-1-dev instead
+    of /usr/share/doc/libsilc-dev.
+
+  [ Stefan Siegl ]
+  * SIM modules are now shipped in /usr/lib/silc/libsilc-1.1-1 instead of
+    /usr/lib/silc.
+  * Do not conflict with libsilc package.
+
+  [ Jérémy Bobbio ]
+  * Add debug package.
+
+ -- Jérémy Bobbio <lunar@debian.org>  Fri, 01 Jun 2007 16:55:50 +0200
+
+silc-toolkit (0.9.12-6) unstable; urgency=high
+
+  * debian/copyright: Mention new license of SILC draft RFCs.
+    + Urgency high due to RC bug (Closes: #393412)
+
+ -- Michael C. Schultheiss <schultmc@debian.org>  Mon, 16 Oct 2006 16:32:22 +0000
+
+silc-toolkit (0.9.12-5) unstable; urgency=low
+
+  * New Maintainer (Closes: #370794)
+    + debian/control{,.sh}: Update maintainer address, update Standards
+      version
+  * Incorporate NMUs
+
+ -- Michael C. Schultheiss <schultmc@debian.org>  Thu, 24 Aug 2006 20:40:12 +0000
+
+silc-toolkit (0.9.12-4.4) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Move libsilc.so and libsilcclient.so to the -dev package (Closes:
+    #379800).
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Wed, 26 Jul 2006 13:42:57 +0200
+
+silc-toolkit (0.9.12-4.3) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Fix empty packages (Closes: #331630)
+  * Bump standards version
+
+ -- Julien Danjou <acid@debian.org>  Tue, 25 Jul 2006 17:50:00 +0200
+
+silc-toolkit (0.9.12-4.2) unstable; urgency=low
+
+  * 0-day NMU to fix an RC bug.
+  * Explicitly execute debian/control.sh with sh as suggested by Andreas
+    Jochens (closes: bug#328924).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon,  6 Feb 2006 20:24:24 +0100
+
+silc-toolkit (0.9.12-4.1) unstable; urgency=low
+
+  * This is an NMU, I don't know why Tamas didn't want to fix this.
+    rebuild control file whenever shared library's soname
+    changes, to satisfy debian policy requirements for
+    shared package names.  (closes: 323035) See section 8.1
+    for more details.  
+    http://www.debian.org/doc/debian-policy/ch-sharedlibs.html
+    Though policy doesn't mention it, the point is to provide a migration
+    path when for other packages when changes to the lib require changes
+    to the soname.
+
+ -- Raul Miller <moth@debian.org>  Sat, 10 Sep 2005 13:04:57 -0400
+
+silc-toolkit (0.9.12-4) unstable; urgency=low
+
+  * RC5 removed (closes: #279146)
+  * check the list archive, I asked for some problems, 
+    nobody answered it (closes: #273871)
+
+ -- Tamas SZERB <toma@rulez.org>  Sun,  7 Nov 2004 17:06:53 +0100
+
+silc-toolkit (0.9.12-3) unstable; urgency=low
+
+  * beat me, Randall Donald <ftpmaster@debian.org> noticed
+    that I messed up the license file pointer to the copyright
+    file, it is fixed now.
+
+ -- Tamas SZERB <toma@rulez.org>  Tue, 17 Aug 2004 12:21:38 +0200
+
+silc-toolkit (0.9.12-2) unstable; urgency=low
+
+  * according the email of Randall Donald <ftpmaster@debian.org>
+    on Mon, 16 Aug 2004 02:42:14 -0400
+    file pointer to the full GPL text in base-files applied into
+    the copyright file and
+  * the -dev packaged moved from devel to libdevel
+
+ -- Tamas SZERB <toma@rulez.org>  Mon, 16 Aug 2004 12:30:17 +0200
+
+silc-toolkit (0.9.12-1) unstable; urgency=low
+
+  * Initial Release. (closes: #118202, #246148)
+
+ -- Tamas SZERB <toma@rulez.org>  Wed,  7 Jan 2004 15:56:35 +0100
+
--- silc-toolkit-1.1.7.orig/debian/libsilc-1.1-2.install
+++ silc-toolkit-1.1.7/debian/libsilc-1.1-2.install
@@ -0,0 +1,2 @@
+usr/lib/*.so.*
+usr/lib/silc/*/*.so*
--- silc-toolkit-1.1.7.orig/debian/docs
+++ silc-toolkit-1.1.7/debian/docs
@@ -0,0 +1,4 @@
+README
+README.CVS
+TODO
+CREDITS
--- silc-toolkit-1.1.7.orig/debian/compat
+++ silc-toolkit-1.1.7/debian/compat
@@ -0,0 +1 @@
+5
--- silc-toolkit-1.1.7.orig/debian/watch
+++ silc-toolkit-1.1.7/debian/watch
@@ -0,0 +1,3 @@
+version=3
+http://silcnet.org/download/toolkit/sources/silc-toolkit-([\d\.]+)\.tar\.gz \
+        debian svn-upgrade
--- silc-toolkit-1.1.7.orig/debian/copyright
+++ silc-toolkit-1.1.7/debian/copyright
@@ -0,0 +1,271 @@
+This package was debianized by Tamas SZERB <toma@rulez.org> on
+Wed,  7 Jan 2004 15:56:35 +0100.
+
+It was downloaded from http://silcnet.org/software/download/toolkit/
+and http://silcnet.org/priikone/pre/ for pre-release versions.
+
+Upstream Author:
+
+    Pekka Riikonen <priikone@silcnet.org>
+
+Copyright:
+
+    Copyright (C) 1997-2007 Pekka Riikonen
+
+License:
+
+    The SILC Toolkit distribution is dual-licensed distribution.  The following
+    licenses govern this distribution, and you are free to choose either one of
+    the licenses:
+
+     - GNU General Public License, Version 2
+
+       On Debian systems, a copy of the GNU General Public License, version 2
+       is available in /usr/share/common-licenses/GPL-2 as part of the
+       base-files package.
+
+     - Revised BSD License
+
+       Redistribution and use in source and binary forms, with or without
+       modification, are permitted provided that the following conditions are
+       met:
+
+           1. Redistributions of source code must retain the above copyright
+              notice, this list of conditions and the following disclaimer.
+           2. Redistributions in binary form must reproduce the above copyright
+              notice, this list of conditions and the following disclaimer in
+              the documentation and/or other materials provided with the
+              distribution.
+           3. The name of the author may not be used to endorse or promote
+              products derived from this software without specific prior written
+              permission.
+
+       THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+       IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+       DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+       (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+       SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+       HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+       STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+       ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+       POSSIBILITY OF SUCH DAMAGE.
+
+Exceptions to the previous statements:
+
+  * doc/draft-riikonen-presence-attrs-04.txt,
+    doc/draft-riikonen-silc-commands-07.txt,
+    doc/draft-riikonen-silc-flags-payloads-04.txt,
+    doc/draft-riikonen-silc-ke-auth-09.txt,
+    doc/draft-riikonen-silc-multimedia-session-00.txt,
+    doc/draft-riikonen-silc-pp-09.txt,
+    doc/draft-riikonen-silc-spec-09.txt:
+
+    Licensed under the following terms (per Message-ID:
+    <Pine.NEB.4.64.0610161755240.9865@otaku.Xtrmntr.org>, quoted
+    below):
+
+    : Because the authors of contributions to the IETF standards retain most
+    : intellectual property rights with respect to such contributions under
+    : IETF policies in effect during the development of the draft SILC RFCs,
+    : and because you are an author of said documents, the Debian community
+    : hereby requests that you kindly agree to release your contributions in
+    : the draft SILC RFCs under the license below, for inclusion in Debian.
+    :
+    :         I agree to grant third parties the irrevocable
+    :         right to copy, use and distribute the work, with
+    :         or without modification, in any medium, without royalty,
+    :         provided that, unless separate permission is granted,
+    :         redistributed modified works:
+    :
+    :              (a) do not contain misleading author, version, name
+    :                  of work, or endorsement information, and
+    :
+    :              (b) do not claim endorsement of the modified work by
+    :                  the Contributor, or any organization the
+    :                  Contributor belongs to, the Internet Engineering
+    :                  Task Force (IETF), Internet Research Task Force
+    :                  (IRTF), Internet Engineering Steering Group
+    :                  (IESG), Internet Architecture Board (IAB),
+    :                  Internet Assigned Numbers Authority (IANA),
+    :                  Internet Society (ISOC), Request For Comments
+    :                  (RFC) Editor, or any combination or variation of
+    :                  such terms (including without limitation the
+    :                  IETF "4 diamonds" logo), or any terms that are
+    :                  confusingly similar thereto, and
+    :
+    :              (c) remove any claims of status as an Internet
+    :                  Standard, including without limitation removing
+    :                  the RFC boilerplate.
+    :
+    :         The IETF suggests that any citation or excerpt of
+    :         unmodified text reference the RFC or other document from
+    :         which the text is derived.
+    :
+    : To indicate that you agree to these terms, please reply to this e-mail
+    : and quote the license above and indicate that you agree to this.
+    :
+    I agree.
+    
+            Pekka
+    ________________________________________________________________________
+     Pekka Riikonen                                 priikone at silcnet.org
+     Secure Internet Live Conferencing (SILC)       http://silcnet.org/
+
+  * lib/contrib/getopti.c,
+    lib/contrib/getopti.h:
+
+    Public Domain.
+
+  * lib/contrib/nfkc.c,
+    lib/contrib/stringprep.c:
+
+    Copyright (C) 2002, 2003, 2004, 2005 Simon Josefsson
+
+    Licensed under the GNU Lesser General Public License, version 2.1 or any
+    later version.
+
+  * lib/contrib/regexpr.c,
+    lib/contrib/regexpr.h:
+
+    Copyright (C) 1991 Tatu Ylonen
+
+    Permission to use, copy, modify, distribute, and sell this software and its
+    documentation is hereby granted without fee, provided that the above
+    copyright notice appears in all source code copies, the name of Tatu Ylonen
+    is not used to advertise products containing this software or a derivation
+    thereof, and all modified versions are clearly marked as such.
+
+  * lib/silccrypt/aes.c:
+
+    Copyright (C) 1998-2006 Brian Gladman
+
+    The free distribution and use of this software in both source and binary
+    form is allowed (with or without changes) provided that:
+
+      1. distributions of this source code include the above copyright
+         notice, this list of conditions and the following disclaimer;
+
+      2. distributions in binary form include the above copyright
+         notice, this list of conditions and the following disclaimer
+         in the documentation and/or other associated materials;
+
+      3. the copyright holder's name is not used to endorse products
+         built using this software without specific written permission.
+
+    ALTERNATIVELY, provided that this notice is retained in full, this product
+    may be distributed under the terms of the GNU General Public License (GPL),
+    in which case the provisions of the GPL apply INSTEAD OF those given above.
+  
+  * lib/silccrypt/aes_x86.asm,
+    lib/silccrypt/aes_x86_64.asm:
+
+    Copyright (C) 2002 Brian Gladman
+
+    The free distribution and use of this software in both source and binary
+    form is allowed (with or without changes) provided that:
+
+      1. distributions of this source code include the above copyright
+         notice, this list of conditions and the following disclaimer;
+
+      2. distributions in binary form include the above copyright
+         notice, this list of conditions and the following disclaimer
+         in the documentation and/or other associated materials;
+
+      3. the copyright holder's name is not used to endorse products
+         built using this software without specific written permission.
+
+    ALTERNATIVELY, provided that this notice is retained in full, this product
+    may be distributed under the terms of the GNU General Public License (GPL),
+    in which case the provisions of the GPL apply INSTEAD OF those given above.
+
+  * lib/silccrypt/blowfish.c: 
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal in the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, dis-tribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+    Except as contained in this notice, the name of the authors shall not be
+    used in advertising or otherwise to promote the sale, use or other dealings
+    in this Software without prior written authorization from the authors.
+
+  * lib/silccrypt/md5.c,
+    lib/silccrypt/md5_internal.h:
+    
+    Public Domain.
+
+  * lib/silccrypt/rijndael_internal.h:
+    
+    Copyright (C) 1998-2006 Brian Gladman
+
+    Licensed under the GNU General Public License
+    OR under the following terms:
+
+      The free distribution and use of this software in both source and binary
+      form is allowed (with or without changes) provided that:
+
+        1. distributions of this source code include the above copyright
+           notice, this list of conditions and the following disclaimer;
+
+        2. distributions in binary form include the above copyright
+           notice, this list of conditions and the following disclaimer
+           iin the documentation and/or other associated materials;
+
+        3. the copyright holder's name is not used to endorse products
+           built using this software without specific written permission.
+
+  * lib/silccrypt/sha1.c,
+    lib/silccrypt/sha1_internal.h:
+    
+    Public Domain.
+
+  * lib/silccrypt/sha256.c:
+    
+    Public Domain.
+
+  * lib/silcrypt/twofish.c:
+
+    Copyright (C) 1999 Brian Gladman
+
+    Copyright in this implementation is held by Dr B R Gladman but I hereby
+    give permission for its free direct or derivative use subject to
+    acknowledgment of its origin and compliance with any conditions that the
+    originators of the algorithm place on its exploitation.
+
+  * lib/silcmath/tma.c,
+    lib/silcmath/tma.h:
+
+    Public Domain.
+
+  * lib/silcutil/silcconfig.c,
+    lib/silcutil/silcconfig.h:
+
+    Copyright (C) 2002-2006 Giovanni Giacobbi
+
+    Licensed under the same terms as SILC Toolkit.
+
+  * lib/silcutil/silcsnprintf.c:
+
+    Copyright (C) 1995 Patrick Powell
+
+    This code is based on code written by Patrick Powell (papowell@astart.com)
+    It may be used for any purpose as long as this notice remains intact on all
+    source code distributions
+
+  * tutorial/mybot/mybot.c:
+
+    Public Domain.
--- silc-toolkit-1.1.7.orig/debian/libsilc-1.1-2-dev.install
+++ silc-toolkit-1.1.7/debian/libsilc-1.1-2-dev.install
@@ -0,0 +1,6 @@
+usr/include/silc/*.h
+usr/lib/lib*.so
+usr/lib/*.a
+usr/lib/pkgconfig/*.pc
+usr/share/doc/libsilc-1.1-2-dev/toolkit
+usr/share/doc/libsilc-1.1-2-dev/tutorial
--- silc-toolkit-1.1.7.orig/debian/rules
+++ silc-toolkit-1.1.7/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CFLAGS =-Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+NAME = libsilc-1.1-2
+
+config.status: configure
+	dh_testdir
+	-rm -f config.guess config.sub
+	ln -sf /usr/share/misc/config.guess config.guess
+	ln -sf /usr/share/misc/config.sub config.sub
+	CFLAGS="$(CFLAGS)" ./configure \
+		--host=$(DEB_HOST_GNU_TYPE) \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--prefix=/usr --mandir=\$${prefix}/share/man \
+		--infodir=\$${prefix}/share/info \
+		--docdir=\$${prefix}/share/doc/${NAME}-dev \
+		--libdir=\$${prefix}/lib \
+		--includedir=\$${prefix}/include/silc \
+		\
+		--enable-debug \
+		--enable-shared \
+		--enable-static \
+		--enable-ipv6 \
+		--with-simdir=\$${libdir}/silc/${NAME} \
+		--without-libtoolfix
+	
+build: build-stamp
+build-stamp:  config.status
+	dh_testdir
+	$(MAKE)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	-rm -f config.sub config.guess
+	-rm -f build-stamp 
+	[ ! -f Makefile ] || $(MAKE) distclean
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+	cp silcdefs.h debian/tmp/usr/include/silc/silcdistdefs.h
+
+# Build architecture-independent files here.
+binary-indep: build install
+	# We have nothing to do.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs CHANGES
+	dh_installdocs
+	dh_installexamples
+	dh_install --autodest --sourcedir=debian/tmp
+	dh_installman
+	dh_link
+	dh_strip --dbg-package=${NAME}-dbg
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 
--- silc-toolkit-1.1.7.orig/debian/control
+++ silc-toolkit-1.1.7/debian/control
@@ -0,0 +1,52 @@
+Source: silc-toolkit
+Priority: optional
+Maintainer: Debian SILC Team <pkg-silc-devel@lists.alioth.debian.org>
+Uploaders: Michael C. Schultheiss <schultmc@debian.org>,
+ Jérémy Bobbio <lunar@debian.org>, Micah Anderson <micah@debian.org>
+Section: devel
+Build-Depends: debhelper (>= 5.0.0), autotools-dev
+Standards-Version: 3.8.0
+Homepage: http://silcnet.org/software/developers/toolkit
+XS-Vcs-Svn: svn://svn.debian.org/pkg-silc/silc-toolkit/trunk
+XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-silc/silc-toolkit/trunk
+
+Package: libsilc-1.1-2-dev
+Section: libdevel
+Architecture: any
+Depends: libsilc-1.1-2 (= ${binary:Version}), pkg-config
+Provides: libsilc-dev
+Replaces: libsilc-dev
+Conflicts: libsilc-dev
+Description: developer files for SILC library (silc-toolkit)
+ SILC (Secure Internet Live Conferencing) is a network protocol designed
+ to provide end-to-end security for conferencing services. SILC has a
+ command set and a user interface similar to IRC, but the network
+ protocol is completely different as it supports public key strong
+ cryptography and a different network model.
+ .
+ This package contains headers and documentation for both the generic SILC
+ library (libsilc) and the client library (libsilcclient).
+ 
+Package: libsilc-1.1-2-dbg
+Section: libdevel
+Priority: extra
+Architecture: any
+Depends: libsilc-1.1-2 (= ${binary:Version})
+Description: debugging symbols for the SILC library (silc-toolkit)
+ This package contains debug symbols for both libsilc and libsilcclient.
+
+Package: libsilc-1.1-2
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Provides: libsilc
+Replaces: libsilc
+Description: SILC library (silc-toolkit)
+ SILC (Secure Internet Live Conferencing) is a network protocol designed
+ to provide end-to-end security for conferencing services. SILC has a
+ command set and a user interface similar to IRC, but the network
+ protocol is completely different as it supports public key strong
+ cryptography and a different network model.
+ .
+ This package contains both the generic SILC library (libsilc) and the client
+ library (libsilcclient).
--- silc-toolkit-1.1.7.orig/lib/silchttp/silchttpserver.c
+++ silc-toolkit-1.1.7/lib/silchttp/silchttpserver.c
@@ -194,7 +194,7 @@
 
     /* Check we have received all data */
     cl = silc_mime_get_field(conn->curheaders, "Content-Length");
-    if (cl && sscanf(cl, "%lu", (unsigned long *)&cll) == 1) {
+    if (cl && sscanf(cl, "%u", &cll) == 1) {
       if (data_len < cll) {
 	/* More data to come */
 	silc_mime_free(conn->curheaders);
--- silc-toolkit-1.1.7.orig/lib/silccore/silcpacket.c
+++ silc-toolkit-1.1.7/lib/silccore/silcpacket.c
@@ -723,8 +723,8 @@
 			    (void *)&ps->sc)) {
     ps->sc = silc_calloc(1, sizeof(*ps->sc));
     if (!ps->sc) {
-      silc_packet_stream_destroy(ps);
       silc_mutex_unlock(engine->lock);
+      silc_packet_stream_destroy(ps);
       return NULL;
     }
     ps->sc->engine = engine;
@@ -735,8 +735,8 @@
     if (!inbuf) {
       silc_free(ps->sc);
       ps->sc = NULL;
-      silc_packet_stream_destroy(ps);
       silc_mutex_unlock(engine->lock);
+      silc_packet_stream_destroy(ps);
       return NULL;
     }
     silc_buffer_reset(inbuf);
@@ -746,8 +746,8 @@
       silc_buffer_free(inbuf);
       silc_free(ps->sc);
       ps->sc = NULL;
-      silc_packet_stream_destroy(ps);
       silc_mutex_unlock(engine->lock);
+      silc_packet_stream_destroy(ps);
       return NULL;
     }
     silc_dlist_add(ps->sc->inbufs, inbuf);
@@ -758,8 +758,8 @@
       silc_dlist_del(ps->sc->inbufs, inbuf);
       silc_free(ps->sc);
       ps->sc = NULL;
-      silc_packet_stream_destroy(ps);
       silc_mutex_unlock(engine->lock);
+      silc_packet_stream_destroy(ps);
       return NULL;
     }
   }
@@ -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)
--- silc-toolkit-1.1.7.orig/lib/silcutil/unix/silcunixnet.c
+++ silc-toolkit-1.1.7/lib/silcutil/unix/silcunixnet.c
@@ -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;
 }
 
--- silc-toolkit-1.1.7.orig/lib/silcutil/silcutil.c
+++ silc-toolkit-1.1.7/lib/silcutil/silcutil.c
@@ -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';
 
--- silc-toolkit-1.1.7.orig/lib/silcutil/silcbuffmt.c
+++ silc-toolkit-1.1.7/lib/silcutil/silcbuffmt.c
@@ -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;
--- silc-toolkit-1.1.7.orig/lib/silcasn1/silcasn1_encode.c
+++ silc-toolkit-1.1.7/lib/silcasn1/silcasn1_encode.c
@@ -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;
 	    }
--- silc-toolkit-1.1.7.orig/lib/silcclient/command.c
+++ silc-toolkit-1.1.7/lib/silcclient/command.c
@@ -955,7 +955,7 @@
     }
 
     if (client->internal->params->full_channel_names)
-      silc_snprintf(tmp, sizeof(tmp), conn->current_channel->channel_name);
+      silc_snprintf(tmp, sizeof(tmp), "%s", conn->current_channel->channel_name);
     else
       silc_snprintf(tmp, sizeof(tmp), "%s%s%s",
 		    conn->current_channel->channel_name,
@@ -2143,7 +2143,7 @@
     }
 
     if (client->internal->params->full_channel_names)
-      silc_snprintf(tmp, sizeof(tmp), conn->current_channel->channel_name);
+      silc_snprintf(tmp, sizeof(tmp), "%s", conn->current_channel->channel_name);
     else
       silc_snprintf(tmp, sizeof(tmp), "%s%s%s",
 		    conn->current_channel->channel_name,
@@ -2553,7 +2553,7 @@
     }
 
     if (client->internal->params->full_channel_names)
-      silc_snprintf(tmp, sizeof(tmp), conn->current_channel->channel_name);
+      silc_snprintf(tmp, sizeof(tmp), "%s", conn->current_channel->channel_name);
     else
       silc_snprintf(tmp, sizeof(tmp), "%s%s%s",
 		    conn->current_channel->channel_name,
@@ -2620,7 +2620,7 @@
     }
 
     if (conn->client->internal->params->full_channel_names)
-      silc_snprintf(tmp, sizeof(tmp), conn->current_channel->channel_name);
+      silc_snprintf(tmp, sizeof(tmp), "%s", conn->current_channel->channel_name);
     else
       silc_snprintf(tmp, sizeof(tmp), "%s%s%s",
 		    conn->current_channel->channel_name,
--- silc-toolkit-1.1.7.orig/lib/silcclient/client_entry.c
+++ silc-toolkit-1.1.7/lib/silcclient/client_entry.c
@@ -800,10 +800,10 @@
 		      client_entry->server, sizeof(client_entry->server));
   if (nickname && client->internal->params->full_nicknames)
     silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
-		  nickname);
+		  "%s", nickname);
   else if (nickname)
     silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
-		  parsed);
+		  "%s", parsed);
 
   silc_parse_userfqdn(username, client_entry->username,
 		      sizeof(client_entry->username),
@@ -890,10 +890,10 @@
 			client_entry->server, sizeof(client_entry->server));
     if (client->internal->params->full_nicknames)
       silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
-		    nickname);
+		    "%s", nickname);
     else
       silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
-		    parsed);
+		    "%s", parsed);
 
     /* Normalize nickname */
     nick = silc_identifier_check(parsed, strlen(parsed),
@@ -1186,7 +1186,7 @@
         return NULL;
 
       silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
-		    cp);
+		    "%s", cp);
       silc_free(cp);
     }
 
