- stevesk@cvs.openbsd.org 2006/07/22 20:48:23
     [atomicio.c auth-options.c auth-passwd.c auth-rhosts.c auth-rsa.c]
     [auth.c auth1.c auth2-chall.c auth2-hostbased.c auth2-passwd.c auth2.c]
     [authfd.c authfile.c bufaux.c bufbn.c buffer.c canohost.c channels.c]
     [cipher-3des1.c cipher-bf1.c cipher-ctr.c cipher.c clientloop.c]
     [compat.c deattack.c dh.c dns.c gss-genr.c gss-serv.c hostfile.c]
     [includes.h kex.c kexdhc.c kexdhs.c kexgexc.c kexgexs.c key.c log.c]
     [mac.c match.c md-sha256.c misc.c moduli.c monitor.c monitor_fdpass.c]
     [monitor_mm.c monitor_wrap.c msg.c nchan.c packet.c rsa.c]
     [progressmeter.c readconf.c readpass.c scp.c servconf.c serverloop.c]
     [session.c sftp-client.c sftp-common.c sftp-glob.c sftp-server.c sftp.c]
     [ssh-add.c ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c]
     [ssh-keysign.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c sshconnect2.c]
     [sshd.c sshlogin.c sshpty.c ttymodes.c uidswap.c xmalloc.c]
     move #include <string.h> out of includes.h
diff --git a/ChangeLog b/ChangeLog
index 636d309..000c578 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,21 @@
      [includes.h moduli.c progressmeter.c scp.c sftp-common.c]
      [sftp-server.c ssh-agent.c sshlogin.c]
      move #include <time.h> out of includes.h
+   - stevesk@cvs.openbsd.org 2006/07/22 20:48:23
+     [atomicio.c auth-options.c auth-passwd.c auth-rhosts.c auth-rsa.c]
+     [auth.c auth1.c auth2-chall.c auth2-hostbased.c auth2-passwd.c auth2.c]
+     [authfd.c authfile.c bufaux.c bufbn.c buffer.c canohost.c channels.c]
+     [cipher-3des1.c cipher-bf1.c cipher-ctr.c cipher.c clientloop.c]
+     [compat.c deattack.c dh.c dns.c gss-genr.c gss-serv.c hostfile.c]
+     [includes.h kex.c kexdhc.c kexdhs.c kexgexc.c kexgexs.c key.c log.c]
+     [mac.c match.c md-sha256.c misc.c moduli.c monitor.c monitor_fdpass.c]
+     [monitor_mm.c monitor_wrap.c msg.c nchan.c packet.c rsa.c]
+     [progressmeter.c readconf.c readpass.c scp.c servconf.c serverloop.c]
+     [session.c sftp-client.c sftp-common.c sftp-glob.c sftp-server.c sftp.c]
+     [ssh-add.c ssh-agent.c ssh-dss.c ssh-keygen.c ssh-keyscan.c]
+     [ssh-keysign.c ssh-rsa.c ssh.c sshconnect.c sshconnect1.c sshconnect2.c]
+     [sshd.c sshlogin.c sshpty.c ttymodes.c uidswap.c xmalloc.c]
+     move #include <string.h> out of includes.h
 
 20060713
  - (dtucker) [auth-krb5.c auth-pam.c] Still more errno.h
@@ -4998,4 +5013,4 @@
    - (djm) Trim deprecated options from INSTALL. Mention UsePAM
    - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
 
-$Id: ChangeLog,v 1.4427 2006/07/24 04:09:40 djm Exp $
+$Id: ChangeLog,v 1.4428 2006/07/24 04:13:33 djm Exp $
diff --git a/atomicio.c b/atomicio.c
index bf1c0fd..009ce1d 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomicio.c,v 1.20 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: atomicio.c,v 1.21 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2006 Damien Miller. All rights reserved.
  * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -29,6 +29,7 @@
 #include "includes.h"
 
 #include <errno.h>
+#include <string.h>
 
 #include "atomicio.h"
 
diff --git a/auth-options.c b/auth-options.c
index 7e6bfeb..33c6264 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.c,v 1.38 2006/07/17 12:02:24 dtucker Exp $ */
+/* $OpenBSD: auth-options.c,v 1.39 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -18,6 +18,7 @@
 # include <netdb.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 
 #include "xmalloc.h"
 #include "match.h"
diff --git a/auth-passwd.c b/auth-passwd.c
index 3cf86dc..e5edc93 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-passwd.c,v 1.37 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth-passwd.c,v 1.38 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -41,6 +41,7 @@
 #include <sys/types.h>
 
 #include <pwd.h>
+#include <string.h>
 
 #include "packet.h"
 #include "buffer.h"
diff --git a/auth-rhosts.c b/auth-rhosts.c
index d50ea3a..c14604d 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rhosts.c,v 1.38 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth-rhosts.c,v 1.39 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -23,6 +23,7 @@
 # include <netgroup.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 
 #include "packet.h"
 #include "uidswap.h"
diff --git a/auth-rsa.c b/auth-rsa.c
index 8675976..65c7780 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rsa.c,v 1.68 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth-rsa.c,v 1.69 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -23,6 +23,7 @@
 #include <openssl/md5.h>
 
 #include <pwd.h>
+#include <string.h>
 
 #include "rsa.h"
 #include "packet.h"
diff --git a/auth.c b/auth.c
index 3bca8dc..0f1d530 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.71 2006/07/12 11:34:58 dtucker Exp $ */
+/* $OpenBSD: auth.c,v 1.72 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -43,6 +43,7 @@
 #include <libgen.h>
 #endif
 #include <stdarg.h>
+#include <string.h>
 
 #include "xmalloc.h"
 #include "match.h"
diff --git a/auth1.c b/auth1.c
index 0892918..034010f 100644
--- a/auth1.c
+++ b/auth1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth1.c,v 1.67 2006/07/20 15:26:14 stevesk Exp $ */
+/* $OpenBSD: auth1.c,v 1.68 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -14,6 +14,7 @@
 
 #include <sys/types.h>
 
+#include <string.h>
 #include <unistd.h>
 
 #include "xmalloc.h"
diff --git a/auth2-chall.c b/auth2-chall.c
index 09412aa..ad6b723 100644
--- a/auth2-chall.c
+++ b/auth2-chall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-chall.c,v 1.27 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth2-chall.c,v 1.28 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  * Copyright (c) 2001 Per Allansson.  All rights reserved.
@@ -25,6 +25,8 @@
  */
 #include "includes.h"
 
+#include <string.h>
+
 #include "ssh2.h"
 #include "auth.h"
 #include "buffer.h"
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 56bf0be..5cb617e 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-hostbased.c,v 1.9 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.10 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 
 #include <pwd.h>
+#include <string.h>
 
 #include "ssh2.h"
 #include "xmalloc.h"
diff --git a/auth2-passwd.c b/auth2-passwd.c
index a1e77c4..a1b65da 100644
--- a/auth2-passwd.c
+++ b/auth2-passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-passwd.c,v 1.7 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: auth2-passwd.c,v 1.8 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "packet.h"
 #include "log.h"
diff --git a/auth2.c b/auth2.c
index ad57c64..83d5224 100644
--- a/auth2.c
+++ b/auth2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.111 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: auth2.c,v 1.112 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 
 #include <pwd.h>
+#include <string.h>
 
 #include "ssh2.h"
 #include "xmalloc.h"
diff --git a/authfd.c b/authfd.c
index f8b7ed7..52766bc 100644
--- a/authfd.c
+++ b/authfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfd.c,v 1.77 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: authfd.c,v 1.78 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -44,6 +44,7 @@
 #include <openssl/evp.h>
 
 #include <fcntl.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/authfile.c b/authfile.c
index 53397ea..8421665 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.70 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: authfile.c,v 1.71 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -47,6 +47,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "cipher.h"
diff --git a/bufaux.c b/bufaux.c
index 4c9cb66..a384cc6 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufaux.c,v 1.42 2006/04/18 10:44:28 dtucker Exp $ */
+/* $OpenBSD: bufaux.c,v 1.43 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -40,6 +40,9 @@
 #include "includes.h"
 
 #include <openssl/bn.h>
+
+#include <string.h>
+
 #include "bufaux.h"
 #include "xmalloc.h"
 #include "log.h"
diff --git a/bufbn.c b/bufbn.c
index 56f4f6d..aa42ea6 100644
--- a/bufbn.c
+++ b/bufbn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufbn.c,v 1.1 2006/04/18 10:44:28 dtucker Exp $*/
+/* $OpenBSD: bufbn.c,v 1.2 2006/07/22 20:48:22 stevesk Exp $*/
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -40,6 +40,9 @@
 #include "includes.h"
 
 #include <openssl/bn.h>
+
+#include <string.h>
+
 #include "bufaux.h"
 #include "xmalloc.h"
 #include "log.h"
diff --git a/buffer.c b/buffer.c
index ba718da..8c9f534 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.27 2006/04/16 00:48:52 djm Exp $ */
+/* $OpenBSD: buffer.c,v 1.28 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -14,6 +14,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "buffer.h"
 #include "log.h"
diff --git a/canohost.c b/canohost.c
index da5131d..97b5a78 100644
--- a/canohost.c
+++ b/canohost.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.c,v 1.57 2006/07/12 22:28:51 stevesk Exp $ */
+/* $OpenBSD: canohost.c,v 1.58 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -24,6 +24,7 @@
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
+#include <string.h>
 
 #include "packet.h"
 #include "xmalloc.h"
diff --git a/channels.c b/channels.c
index e44a2ab..8cf4242 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.259 2006/07/21 21:13:30 stevesk Exp $ */
+/* $OpenBSD: channels.c,v 1.260 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -53,6 +53,7 @@
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
+#include <string.h>
 #include <termios.h>
 #include <unistd.h>
 
diff --git a/cipher-3des1.c b/cipher-3des1.c
index c2c0bf8..2e8735d 100644
--- a/cipher-3des1.c
+++ b/cipher-3des1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher-3des1.c,v 1.4 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: cipher-3des1.c,v 1.5 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2003 Markus Friedl.  All rights reserved.
  *
@@ -26,6 +26,9 @@
 #include "includes.h"
 
 #include <openssl/evp.h>
+
+#include <string.h>
+
 #include "xmalloc.h"
 #include "log.h"
 
diff --git a/cipher-bf1.c b/cipher-bf1.c
index b6aa015..95b4e5e 100644
--- a/cipher-bf1.c
+++ b/cipher-bf1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher-bf1.c,v 1.3 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: cipher-bf1.c,v 1.4 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2003 Markus Friedl.  All rights reserved.
  *
@@ -26,6 +26,9 @@
 #include "includes.h"
 
 #include <openssl/evp.h>
+
+#include <string.h>
+
 #include "xmalloc.h"
 #include "log.h"
 
diff --git a/cipher-ctr.c b/cipher-ctr.c
index be82fd3..105d0bd 100644
--- a/cipher-ctr.c
+++ b/cipher-ctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher-ctr.c,v 1.8 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: cipher-ctr.c,v 1.9 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
  *
@@ -16,6 +16,8 @@
  */
 #include "includes.h"
 
+#include <string.h>
+
 #include <openssl/evp.h>
 
 #include "log.h"
diff --git a/cipher.c b/cipher.c
index c429638..20fa59c 100644
--- a/cipher.c
+++ b/cipher.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.c,v 1.79 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: cipher.c,v 1.80 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -37,12 +37,14 @@
 
 #include "includes.h"
 
+#include <openssl/md5.h>
+
+#include <string.h>
+
 #include "xmalloc.h"
 #include "log.h"
 #include "cipher.h"
 
-#include <openssl/md5.h>
-
 /* compatibility with old or broken OpenSSL versions */
 #include "openbsd-compat/openssl-compat.h"
 
diff --git a/clientloop.c b/clientloop.c
index 9398dc9..0c700db 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.169 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: clientloop.c,v 1.170 2006/07/22 20:48:22 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -74,6 +74,7 @@
 #include <paths.h>
 #endif
 #include <signal.h>
+#include <string.h>
 #include <termios.h>
 #include <unistd.h>
 
diff --git a/compat.c b/compat.c
index 1573ed6..35e429a 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.73 2006/03/25 13:17:01 djm Exp $ */
+/* $OpenBSD: compat.c,v 1.74 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl.  All rights reserved.
  *
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "buffer.h"
 #include "packet.h"
 #include "xmalloc.h"
diff --git a/deattack.c b/deattack.c
index fa397e6..57a747d 100644
--- a/deattack.c
+++ b/deattack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: deattack.c,v 1.27 2006/03/30 09:58:15 djm Exp $ */
+/* $OpenBSD: deattack.c,v 1.28 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Cryptographic attack detector for ssh - source code
  *
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "deattack.h"
 #include "log.h"
 #include "crc32.h"
diff --git a/dh.c b/dh.c
index ff31ca9..b37195f 100644
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.37 2006/07/18 22:27:55 stevesk Exp $ */
+/* $OpenBSD: dh.c,v 1.38 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Niels Provos.  All rights reserved.
  *
@@ -28,6 +28,8 @@
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 
+#include <string.h>
+
 #include "dh.h"
 #include "pathnames.h"
 #include "log.h"
diff --git a/dns.c b/dns.c
index 16954a6..5f123a2 100644
--- a/dns.c
+++ b/dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.20 2006/07/08 21:47:12 stevesk Exp $ */
+/* $OpenBSD: dns.c,v 1.21 2006/07/22 20:48:23 stevesk Exp $ */
 
 /*
  * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -33,6 +33,7 @@
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
+#include <string.h>
 
 #include "xmalloc.h"
 #include "key.h"
diff --git a/gss-genr.c b/gss-genr.c
index 3d630ab..0497657 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gss-genr.c,v 1.10 2006/04/03 07:10:38 djm Exp $ */
+/* $OpenBSD: gss-genr.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */
 
 /*
  * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -28,6 +28,8 @@
 
 #ifdef GSSAPI
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "bufaux.h"
 #include "log.h"
diff --git a/gss-serv.c b/gss-serv.c
index 4ce536d..c033aad 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gss-serv.c,v 1.18 2006/07/02 18:36:47 stevesk Exp $ */
+/* $OpenBSD: gss-serv.c,v 1.19 2006/07/22 20:48:23 stevesk Exp $ */
 
 /*
  * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -28,6 +28,8 @@
 
 #ifdef GSSAPI
 
+#include <string.h>
+
 #include "bufaux.h"
 #include "auth.h"
 #include "log.h"
diff --git a/hostfile.c b/hostfile.c
index a6714b6..c067f5e 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.41 2006/07/05 02:42:09 stevesk Exp $ */
+/* $OpenBSD: hostfile.c,v 1.42 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -43,6 +43,7 @@
 #include <netinet/in.h>
 
 #include <resolv.h>
+#include <string.h>
 
 #include <openssl/hmac.h>
 #include <openssl/sha.h>
diff --git a/includes.h b/includes.h
index da526bc..7a7bd81 100644
--- a/includes.h
+++ b/includes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: includes.h,v 1.53 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: includes.h,v 1.54 2006/07/22 20:48:23 stevesk Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -22,7 +22,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #ifdef HAVE_LIMITS_H
 # include <limits.h> /* For PATH_MAX */
diff --git a/kex.c b/kex.c
index 6a5fd26..0071733 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.71 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.72 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *
@@ -27,6 +27,8 @@
 
 #include <openssl/crypto.h>
 
+#include <string.h>
+
 #include "ssh2.h"
 #include "xmalloc.h"
 #include "buffer.h"
diff --git a/kexdhc.c b/kexdhc.c
index f5f0119..dbbd9bb 100644
--- a/kexdhc.c
+++ b/kexdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexdhc.c,v 1.6 2006/05/18 21:27:25 miod Exp $ */
+/* $OpenBSD: kexdhc.c,v 1.7 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "key.h"
 #include "kex.h"
diff --git a/kexdhs.c b/kexdhs.c
index d139f5c..c64cd77 100644
--- a/kexdhs.c
+++ b/kexdhs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexdhs.c,v 1.5 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: kexdhs.c,v 1.6 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "key.h"
 #include "kex.h"
diff --git a/kexgexc.c b/kexgexc.c
index 9da1844..fb2049e 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexc.c,v 1.6 2006/05/18 21:27:25 miod Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.7 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Niels Provos.  All rights reserved.
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -26,6 +26,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "key.h"
 #include "kex.h"
diff --git a/kexgexs.c b/kexgexs.c
index 0141c6d..72b6623 100644
--- a/kexgexs.c
+++ b/kexgexs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexs.c,v 1.4 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: kexgexs.c,v 1.5 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Niels Provos.  All rights reserved.
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -26,6 +26,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "key.h"
 #include "kex.h"
diff --git a/key.c b/key.c
index 8e6ccc2..e6868de 100644
--- a/key.c
+++ b/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.64 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: key.c,v 1.65 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * read_bignum():
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -36,6 +36,8 @@
 
 #include <openssl/evp.h>
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "key.h"
 #include "rsa.h"
diff --git a/log.c b/log.c
index 4ad7cff..8a308c2 100644
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.34 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: log.c,v 1.35 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -37,6 +37,7 @@
 #include "includes.h"
 
 #include <stdarg.h>
+#include <string.h>
 #include <syslog.h>
 #include <unistd.h>
 #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H)
diff --git a/mac.c b/mac.c
index 02bcc31..a59e7ed 100644
--- a/mac.c
+++ b/mac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mac.c,v 1.10 2006/03/30 09:58:15 djm Exp $ */
+/* $OpenBSD: mac.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -27,6 +27,8 @@
 
 #include <openssl/hmac.h>
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "log.h"
 #include "cipher.h"
diff --git a/match.c b/match.c
index c0e5bf4..8f12ef5 100644
--- a/match.c
+++ b/match.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: match.c,v 1.24 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: match.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -38,6 +38,7 @@
 #include "includes.h"
 
 #include <ctype.h>
+#include <string.h>
 
 #include "match.h"
 #include "xmalloc.h"
diff --git a/md-sha256.c b/md-sha256.c
index 33deb78..063a101 100644
--- a/md-sha256.c
+++ b/md-sha256.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md-sha256.c,v 1.3 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: md-sha256.c,v 1.4 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2005 Damien Miller <djm@openbsd.org>
  *
diff --git a/misc.c b/misc.c
index e9c5ddf..4c202db 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.59 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: misc.c,v 1.60 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2005,2006 Damien Miller.  All rights reserved.
@@ -31,6 +31,7 @@
 #include <sys/socket.h>
 
 #include <stdarg.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <netinet/in.h>
diff --git a/moduli.c b/moduli.c
index 9d4aedd..4d5576a 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moduli.c,v 1.14 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: moduli.c,v 1.15 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 1994 Phil Karn <karn@qualcomm.com>
  * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -43,6 +43,7 @@
 
 #include <openssl/bn.h>
 
+#include <string.h>
 #include <time.h>
 
 #include "xmalloc.h"
diff --git a/monitor.c b/monitor.c
index a5263d7..3799d88 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.81 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: monitor.c,v 1.82 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -38,6 +38,7 @@
 #endif
 #include <pwd.h>
 #include <signal.h>
+#include <string.h>
 
 #ifdef SKEY
 #include <skey.h>
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 9d319ac..d3e65cb 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_fdpass.c,v 1.10 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.11 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 2001 Niels Provos <provos@citi.umich.edu>
  * All rights reserved.
@@ -31,6 +31,7 @@
 #include <sys/uio.h>
 
 #include <errno.h>
+#include <string.h>
 
 #include "log.h"
 #include "monitor_fdpass.h"
diff --git a/monitor_mm.c b/monitor_mm.c
index dc0dbda..b6da692 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_mm.c,v 1.12 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: monitor_mm.c,v 1.13 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * All rights reserved.
@@ -27,6 +27,7 @@
 #include "includes.h"
 
 #include <errno.h>
+#include <string.h>
 
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 9ec60b6..3728e5f 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.47 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.48 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -34,6 +34,7 @@
 
 #include <errno.h>
 #include <pwd.h>
+#include <string.h>
 
 #include "ssh.h"
 #include "dh.h"
diff --git a/msg.c b/msg.c
index 5c535d1..3224726 100644
--- a/msg.c
+++ b/msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.c,v 1.13 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: msg.c,v 1.14 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "buffer.h"
diff --git a/nchan.c b/nchan.c
index 43816a6..78908c3 100644
--- a/nchan.c
+++ b/nchan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nchan.c,v 1.55 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: nchan.c,v 1.56 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl.  All rights reserved.
  *
@@ -29,6 +29,7 @@
 #include <sys/socket.h>
 
 #include <errno.h>
+#include <string.h>
 
 #include "ssh1.h"
 #include "ssh2.h"
diff --git a/packet.c b/packet.c
index ce652cf..8250b3b 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.136 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: packet.c,v 1.137 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -49,6 +49,7 @@
 
 #include <errno.h>
 #include <stdarg.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "xmalloc.h"
diff --git a/progressmeter.c b/progressmeter.c
index c70e993..19dc917 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: progressmeter.c,v 1.33 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: progressmeter.c,v 1.34 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2003 Nils Nordman.  All rights reserved.
  *
@@ -30,6 +30,7 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/readconf.c b/readconf.c
index 73271e8..432b80e 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.156 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: readconf.c,v 1.157 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -25,6 +25,7 @@
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/readpass.c b/readpass.c
index 725ae57..1982fb6 100644
--- a/readpass.c
+++ b/readpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readpass.c,v 1.43 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: readpass.c,v 1.44 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -34,6 +34,7 @@
 # include <paths.h>
 #endif
 #include <stdarg.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "xmalloc.h"
diff --git a/rsa.c b/rsa.c
index 6ca05b3..c656291 100644
--- a/rsa.c
+++ b/rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa.c,v 1.26 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: rsa.c,v 1.27 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -62,6 +62,8 @@
 
 #include "includes.h"
 
+#include <string.h>
+
 #include "rsa.h"
 #include "log.h"
 #include "xmalloc.h"
diff --git a/scp.c b/scp.c
index 72c4ee4..5ff6cac 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.149 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: scp.c,v 1.150 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -86,6 +86,7 @@
 #include <pwd.h>
 #include <signal.h>
 #include <stdarg.h>
+#include <string.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/servconf.c b/servconf.c
index 46558b6..ce44b5f 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.159 2006/07/21 12:43:36 dtucker Exp $ */
+/* $OpenBSD: servconf.c,v 1.160 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -18,6 +18,7 @@
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/serverloop.c b/serverloop.c
index 1ca3e67..ba1e0da 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.140 2006/07/20 15:26:15 stevesk Exp $ */
+/* $OpenBSD: serverloop.c,v 1.141 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -47,6 +47,7 @@
 #include <fcntl.h>
 #include <pwd.h>
 #include <signal.h>
+#include <string.h>
 #include <termios.h>
 #include <unistd.h>
 
diff --git a/session.c b/session.c
index be65086..c2730a4 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.211 2006/07/20 15:26:15 stevesk Exp $ */
+/* $OpenBSD: session.c,v 1.212 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -52,6 +52,7 @@
 #endif
 #include <pwd.h>
 #include <signal.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/sftp-client.c b/sftp-client.c
index 5ba4f0a..84dae58 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.68 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.69 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "openbsd-compat/sys-queue.h"
diff --git a/sftp-common.c b/sftp-common.c
index 6fd0d76..2f3a909 100644
--- a/sftp-common.c
+++ b/sftp-common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-common.c,v 1.16 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: sftp-common.c,v 1.17 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  * Copyright (c) 2001 Damien Miller.  All rights reserved.
@@ -31,6 +31,7 @@
 
 #include <grp.h>
 #include <pwd.h>
+#include <string.h>
 #include <time.h>
 
 #include "buffer.h"
diff --git a/sftp-glob.c b/sftp-glob.c
index 0342de4..f8549ea 100644
--- a/sftp-glob.c
+++ b/sftp-glob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-glob.c,v 1.20 2006/07/10 16:01:57 stevesk Exp $ */
+/* $OpenBSD: sftp-glob.c,v 1.21 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -21,8 +21,9 @@
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
- 
+
 #include <dirent.h>
+#include <string.h>
 
 #include "xmalloc.h"
 
diff --git a/sftp-server.c b/sftp-server.c
index 3c254e3..6067f02 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.64 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.65 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000-2004 Markus Friedl.  All rights reserved.
  *
@@ -23,8 +23,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <pwd.h>
-#include <unistd.h>
+#include <string.h>
 #include <time.h>
+#include <unistd.h>
 
 #include "buffer.h"
 #include "bufaux.h"
diff --git a/sftp.c b/sftp.c
index 1a88f33..2da6c72 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.86 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: sftp.c,v 1.87 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -36,6 +36,7 @@
 typedef void EditLine;
 #endif
 #include <signal.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "xmalloc.h"
diff --git a/ssh-add.c b/ssh-add.c
index 974a162..f79ffb9 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.84 2006/07/17 01:31:09 stevesk Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.85 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -44,6 +44,7 @@
 
 #include <fcntl.h>
 #include <pwd.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/ssh-agent.c b/ssh-agent.c
index a0713b2..5bf4dbc 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.145 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.146 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -45,6 +45,9 @@
 #include "openbsd-compat/sys-queue.h"
 #include <sys/resource.h>
 
+#include <openssl/evp.h>
+#include <openssl/md5.h>
+
 #include <errno.h>
 #include <fcntl.h>
 #ifdef HAVE_PATHS_H
@@ -52,11 +55,9 @@
 #endif
 #include <signal.h>
 #include <time.h>
+#include <string.h>
 #include <unistd.h>
 
-#include <openssl/evp.h>
-#include <openssl/md5.h>
-
 #include "ssh.h"
 #include "rsa.h"
 #include "buffer.h"
diff --git a/ssh-dss.c b/ssh-dss.c
index d16f75e..a8d45a2 100644
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-dss.c,v 1.21 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: ssh-dss.c,v 1.22 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -28,6 +28,8 @@
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "buffer.h"
 #include "bufaux.h"
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 56ad725..f2d3712 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.149 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.150 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -30,6 +30,7 @@
 # include <paths.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "xmalloc.h"
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index fd71f72..30df751 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.68 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.69 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
  *
@@ -11,16 +11,18 @@
  
 #include "openbsd-compat/sys-queue.h"
 #include <sys/resource.h>
+
+#include <openssl/bn.h>
+
 #if defined(HAVE_NETDB_H)
 # include <netdb.h>
 #endif
 #include <errno.h>
 #include <stdarg.h>
 #include <setjmp.h>
+#include <string.h>
 #include <unistd.h>
 
-#include <openssl/bn.h>
-
 #include "xmalloc.h"
 #include "ssh.h"
 #include "ssh1.h"
diff --git a/ssh-keysign.c b/ssh-keysign.c
index b558e54..435b839 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keysign.c,v 1.26 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.27 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -29,6 +29,7 @@
 #include <paths.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <openssl/evp.h>
diff --git a/ssh-rsa.c b/ssh-rsa.c
index 4580c06..236f77a 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-rsa.c,v 1.37 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: ssh-rsa.c,v 1.38 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
  *
@@ -19,6 +19,8 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 
+#include <string.h>
+
 #include "xmalloc.h"
 #include "log.h"
 #include "buffer.h"
diff --git a/ssh.c b/ssh.c
index e482eb1..d0d9457 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.288 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: ssh.c,v 1.289 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -63,6 +63,7 @@
 #include <pwd.h>
 #include <signal.h>
 #include <stddef.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <openssl/evp.h>
diff --git a/sshconnect.c b/sshconnect.c
index 1c69044..f33cf52 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.192 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.193 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -31,6 +31,7 @@
 #include <paths.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "ssh.h"
diff --git a/sshconnect1.c b/sshconnect1.c
index 5467f04..ab52162 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect1.c,v 1.65 2006/04/25 08:02:27 dtucker Exp $ */
+/* $OpenBSD: sshconnect1.c,v 1.66 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -18,6 +18,8 @@
 #include <openssl/bn.h>
 #include <openssl/md5.h>
 
+#include <string.h>
+
 #include "ssh.h"
 #include "ssh1.h"
 #include "xmalloc.h"
diff --git a/sshconnect2.c b/sshconnect2.c
index f55002b..41be0b9 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.157 2006/07/20 15:26:15 stevesk Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.158 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -30,6 +30,7 @@
 #include <sys/stat.h>
 
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "openbsd-compat/sys-queue.h"
diff --git a/sshd.c b/sshd.c
index 3da176d..6428f42 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.338 2006/07/12 22:28:52 stevesk Exp $ */
+/* $OpenBSD: sshd.c,v 1.339 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -63,6 +63,7 @@
 #include <grp.h>
 #include <pwd.h>
 #include <signal.h>
+#include <string.h>
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
diff --git a/sshlogin.c b/sshlogin.c
index ea313e8..8d811fa 100644
--- a/sshlogin.c
+++ b/sshlogin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshlogin.c,v 1.21 2006/07/22 19:08:54 stevesk Exp $ */
+/* $OpenBSD: sshlogin.c,v 1.22 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -45,6 +45,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <string.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/sshpty.c b/sshpty.c
index 931c91f..719a793 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshpty.c,v 1.24 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: sshpty.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -26,6 +26,7 @@
 # include <paths.h>
 #endif
 #include <pwd.h>
+#include <string.h>
 #include <termios.h>
 #ifdef HAVE_UTIL_H
 # include <util.h>
diff --git a/ttymodes.c b/ttymodes.c
index b463054..680909b 100644
--- a/ttymodes.c
+++ b/ttymodes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttymodes.c,v 1.24 2006/07/11 20:07:25 stevesk Exp $ */
+/* $OpenBSD: ttymodes.c,v 1.25 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -46,6 +46,7 @@
 #include "includes.h"
 
 #include <errno.h>
+#include <string.h>
 #include <termios.h>
 
 #include "packet.h"
diff --git a/uidswap.c b/uidswap.c
index 2fe5fea..255f914 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uidswap.c,v 1.32 2006/07/17 01:31:10 stevesk Exp $ */
+/* $OpenBSD: uidswap.c,v 1.33 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <pwd.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <grp.h>
diff --git a/xmalloc.c b/xmalloc.c
index 8f9c3e1..e7a1486 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.c,v 1.22 2006/07/10 16:37:36 stevesk Exp $ */
+/* $OpenBSD: xmalloc.c,v 1.23 2006/07/22 20:48:23 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -16,6 +16,7 @@
 #include "includes.h"
 
 #include <stdarg.h>
+#include <string.h>
 
 #include "xmalloc.h"
 #include "log.h"