Showing with 3,672 additions and 2,185 deletions.
  1. +12 −6 Makefile.in
  2. +3 −3 OVERVIEW
  3. +7 −8 PROTOCOL
  4. +2 −2 PROTOCOL.agent
  5. +7 −1 PROTOCOL.mux
  6. +1 −1 README
  7. +1 −2 addrmatch.c
  8. +0 −2 auth-chall.c
  9. +29 −38 auth-options.c
  10. +2 −2 auth-pam.c
  11. +4 −4 auth.c
  12. +3 −3 auth.h
  13. +2 −3 auth2-hostbased.c
  14. +496 −133 auth2-pubkey.c
  15. +3 −7 authfd.c
  16. +10 −5 authfile.c
  17. +1 −0 buffer.h
  18. +20 −15 canohost.c
  19. +45 −20 channels.c
  20. +3 −2 channels.h
  21. +3 −1 cipher-aesctr.c
  22. +1 −4 cipher.h
  23. +49 −27 clientloop.c
  24. +40 −12 compat.c
  25. +3 −1 compat.h
  26. +6 −0 config.guess
  27. +55 −14 configure.ac
  28. +1 −1 contrib/redhat/openssh.spec
  29. +1 −1 contrib/suse/openssh.spec
  30. +9 −8 defines.h
  31. +44 −5 dh.c
  32. +2 −1 dh.h
  33. +2 −2 digest-libc.c
  34. +3 −19 dispatch.c
  35. +2 −2 dns.h
  36. +2 −4 groupaccess.c
  37. +1 −0 gss-genr.c
  38. +25 −15 gss-serv.c
  39. +2 −2 hmac.c
  40. +6 −5 hostfile.c
  41. +1 −1 includes.h
  42. +6 −2 kex.c
  43. +6 −1 kexc25519.c
  44. +2 −1 kexc25519s.c
  45. +13 −20 kexgexc.c
  46. +13 −36 kexgexs.c
  47. +3 −3 key.c
  48. +2 −3 key.h
  49. +6 −6 krl.c
  50. +1 −2 log.c
  51. +6 −8 match.c
  52. +3 −3 match.h
  53. +2 −2 misc.c
  54. +246 −261 moduli
  55. +20 −12 monitor.c
  56. +3 −1 monitor_fdpass.c
  57. +2 −0 monitor_mm.c
  58. +10 −9 monitor_wrap.c
  59. +3 −3 monitor_wrap.h
  60. +18 −5 mux.c
  61. +15 −17 myproposal.h
  62. +34 −2 opacket.c
  63. +5 −4 opacket.h
  64. +10 −8 openbsd-compat/bcrypt_pbkdf.c
  65. +2 −0 openbsd-compat/blowfish.c
  66. +1 −1 openbsd-compat/bsd-cygwin_util.c
  67. +7 −7 openbsd-compat/bsd-misc.c
  68. +2 −2 openbsd-compat/bsd-misc.h
  69. +3 −0 openbsd-compat/fake-rfc2553.h
  70. +10 −2 openbsd-compat/openbsd-compat.h
  71. +8 −0 openbsd-compat/readpassphrase.c
  72. +2 −0 openbsd-compat/reallocarray.c
  73. +2 −0 openbsd-compat/rmd160.c
  74. +34 −16 packet.c
  75. +2 −2 packet.h
  76. +38 −34 readconf.c
  77. +3 −2 readconf.h
  78. +19 −11 regress/Makefile
  79. +1 −1 regress/README.regress
  80. +2 −2 regress/agent-timeout.sh
  81. +4 −4 regress/agent.sh
  82. +2 −2 regress/broken-pipe.sh
  83. +79 −90 regress/cert-hostkey.sh
  84. +34 −30 regress/cert-userkey.sh
  85. +12 −11 regress/cfgmatch.sh
  86. +75 −0 regress/cfgparse.sh
  87. +7 −3 regress/cipher-speed.sh
  88. +4 −4 regress/connect-privsep.sh
  89. +2 −2 regress/connect.sh
  90. +2 −2 regress/dynamic-forward.sh
  91. +2 −2 regress/exit-status.sh
  92. +14 −12 regress/forcecommand.sh
  93. +3 −3 regress/forward-control.sh
  94. +13 −7 regress/forwarding.sh
  95. +2 −2 regress/host-expand.sh
  96. +5 −4 regress/hostkey-agent.sh
  97. +8 −9 regress/hostkey-rotate.sh
  98. +3 −3 regress/integrity.sh
  99. +2 −2 regress/kextype.sh
  100. +5 −5 regress/key-options.sh
  101. +7 −2 regress/keygen-change.sh
  102. +11 −11 regress/keygen-knownhosts.sh
  103. +48 −11 regress/keys-command.sh
  104. +7 −2 regress/keyscan.sh
  105. +13 −1 regress/keytype.sh
  106. +2 −2 regress/localcommand.sh
  107. +1 −1 regress/multiplex.sh
  108. +102 −46 regress/netcat.c
  109. +141 −0 regress/principals-command.sh
  110. +4 −2 regress/proto-mismatch.sh
  111. +6 −4 regress/proto-version.sh
  112. +3 −3 regress/proxy-connect.sh
  113. +13 −11 regress/reconfigure.sh
  114. +2 −2 regress/reexec.sh
  115. +3 −3 regress/ssh-com.sh
  116. +3 −3 regress/ssh2putty.sh
  117. +3 −5 regress/sshd-log-wrapper.sh
  118. +2 −2 regress/stderr-data.sh
  119. +80 −10 regress/test-exec.sh
  120. +2 −2 regress/transfer.sh
  121. +7 −3 regress/try-ciphers.sh
  122. +1 −1 regress/unittests/Makefile.inc
  123. +4 −0 regress/unittests/bitmap/tests.c
  124. +34 −4 regress/unittests/hostkeys/test_iterate.c
  125. +16 −1 regress/unittests/kex/test_kex.c
  126. +4 −4 regress/unittests/sshbuf/test_sshbuf_getput_crypto.c
  127. +2 −2 regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
  128. +3 −3 regress/unittests/sshkey/mktestdata.sh
  129. +12 −10 regress/unittests/sshkey/test_file.c
  130. +3 −1 regress/unittests/sshkey/test_fuzz.c
  131. +19 −8 regress/unittests/sshkey/test_sshkey.c
  132. +10 −10 regress/unittests/sshkey/testdata/dsa_1
  133. +1 −1 regress/unittests/sshkey/testdata/dsa_1-cert.fp
  134. +1 −1 regress/unittests/sshkey/testdata/dsa_1-cert.pub
  135. +1 −1 regress/unittests/sshkey/testdata/dsa_1.fp
  136. +1 −1 regress/unittests/sshkey/testdata/dsa_1.fp.bb
  137. +1 −1 regress/unittests/sshkey/testdata/dsa_1.param.g
  138. +1 −1 regress/unittests/sshkey/testdata/dsa_1.param.priv
  139. +1 −1 regress/unittests/sshkey/testdata/dsa_1.param.pub
  140. +1 −1 regress/unittests/sshkey/testdata/dsa_1.pub
  141. +11 −11 regress/unittests/sshkey/testdata/dsa_1_pw
  142. +10 −10 regress/unittests/sshkey/testdata/dsa_2
  143. +1 −1 regress/unittests/sshkey/testdata/dsa_2.fp
  144. +1 −1 regress/unittests/sshkey/testdata/dsa_2.fp.bb
  145. +1 −1 regress/unittests/sshkey/testdata/dsa_2.pub
  146. +10 −10 regress/unittests/sshkey/testdata/dsa_n
  147. +19 −20 regress/unittests/sshkey/testdata/dsa_n_pw
  148. +3 −3 regress/unittests/sshkey/testdata/ecdsa_1
  149. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1-cert.fp
  150. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1-cert.pub
  151. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1.fp
  152. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1.fp.bb
  153. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1.param.priv
  154. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1.param.pub
  155. +1 −1 regress/unittests/sshkey/testdata/ecdsa_1.pub
  156. +4 −4 regress/unittests/sshkey/testdata/ecdsa_1_pw
  157. +5 −5 regress/unittests/sshkey/testdata/ecdsa_2
  158. +1 −1 regress/unittests/sshkey/testdata/ecdsa_2.fp
  159. +1 −1 regress/unittests/sshkey/testdata/ecdsa_2.fp.bb
  160. +1 −1 regress/unittests/sshkey/testdata/ecdsa_2.param.priv
  161. +1 −1 regress/unittests/sshkey/testdata/ecdsa_2.param.pub
  162. +1 −1 regress/unittests/sshkey/testdata/ecdsa_2.pub
  163. +3 −3 regress/unittests/sshkey/testdata/ecdsa_n
  164. +7 −7 regress/unittests/sshkey/testdata/ecdsa_n_pw
  165. +4 −4 regress/unittests/sshkey/testdata/ed25519_1
  166. +1 −1 regress/unittests/sshkey/testdata/ed25519_1-cert.fp
  167. +1 −1 regress/unittests/sshkey/testdata/ed25519_1-cert.pub
  168. +1 −1 regress/unittests/sshkey/testdata/ed25519_1.fp
  169. +1 −1 regress/unittests/sshkey/testdata/ed25519_1.fp.bb
  170. +1 −1 regress/unittests/sshkey/testdata/ed25519_1.pub
  171. +6 −6 regress/unittests/sshkey/testdata/ed25519_1_pw
  172. +4 −4 regress/unittests/sshkey/testdata/ed25519_2
  173. +1 −1 regress/unittests/sshkey/testdata/ed25519_2.fp
  174. +1 −1 regress/unittests/sshkey/testdata/ed25519_2.fp.bb
  175. +1 −1 regress/unittests/sshkey/testdata/ed25519_2.pub
  176. BIN regress/unittests/sshkey/testdata/rsa1_1
  177. +1 −1 regress/unittests/sshkey/testdata/rsa1_1.fp
  178. +1 −1 regress/unittests/sshkey/testdata/rsa1_1.fp.bb
  179. +1 −1 regress/unittests/sshkey/testdata/rsa1_1.param.n
  180. +1 −1 regress/unittests/sshkey/testdata/rsa1_1.pub
  181. BIN regress/unittests/sshkey/testdata/rsa1_1_pw
  182. BIN regress/unittests/sshkey/testdata/rsa1_2
  183. +1 −1 regress/unittests/sshkey/testdata/rsa1_2.fp
  184. +1 −1 regress/unittests/sshkey/testdata/rsa1_2.fp.bb
  185. +1 −1 regress/unittests/sshkey/testdata/rsa1_2.param.n
  186. +1 −1 regress/unittests/sshkey/testdata/rsa1_2.pub
  187. +13 −10 regress/unittests/sshkey/testdata/rsa_1
  188. +1 −1 regress/unittests/sshkey/testdata/rsa_1-cert.fp
  189. +1 −1 regress/unittests/sshkey/testdata/rsa_1-cert.pub
  190. +1 −1 regress/unittests/sshkey/testdata/rsa_1.fp
  191. +1 −1 regress/unittests/sshkey/testdata/rsa_1.fp.bb
  192. +1 −1 regress/unittests/sshkey/testdata/rsa_1.param.n
  193. +1 −1 regress/unittests/sshkey/testdata/rsa_1.param.p
  194. +1 −1 regress/unittests/sshkey/testdata/rsa_1.param.q
  195. +1 −1 regress/unittests/sshkey/testdata/rsa_1.pub
  196. +14 −11 regress/unittests/sshkey/testdata/rsa_1_pw
  197. +25 −25 regress/unittests/sshkey/testdata/rsa_2
  198. +1 −1 regress/unittests/sshkey/testdata/rsa_2.fp
  199. +1 −1 regress/unittests/sshkey/testdata/rsa_2.fp.bb
  200. +1 −1 regress/unittests/sshkey/testdata/rsa_2.param.n
  201. +1 −1 regress/unittests/sshkey/testdata/rsa_2.param.p
  202. +1 −1 regress/unittests/sshkey/testdata/rsa_2.param.q
  203. +1 −1 regress/unittests/sshkey/testdata/rsa_2.pub
  204. +13 −10 regress/unittests/sshkey/testdata/rsa_n
  205. +15 −12 regress/unittests/sshkey/testdata/rsa_n_pw
  206. +2 −2 regress/unittests/test_helper/fuzz.c
  207. +2 −2 regress/unittests/test_helper/test_helper.c
  208. +20 −0 regress/valgrind-unit.sh
  209. +2 −2 regress/yes-head.sh
  210. +2 −2 rijndael.c
  211. +91 −20 sandbox-seccomp-filter.c
  212. +10 −11 sandbox-systrace.c
  213. +3 −2 scp.1
  214. +2 −2 scp.c
  215. +156 −36 servconf.c
  216. +12 −4 servconf.h
  217. +5 −5 serverloop.c
  218. +4 −4 session.c
  219. +6 −3 sftp-client.c
  220. +3 −3 sftp-client.h
  221. +3 −4 sftp-server.c
  222. +10 −8 ssh-add.1
  223. +23 −12 ssh-add.c
  224. +9 −4 ssh-agent.1
  225. +62 −29 ssh-agent.c
  226. +4 −3 ssh-keygen.1
  227. +180 −243 ssh-keygen.c
  228. +9 −4 ssh-keyscan.c
  229. +3 −2 ssh-keysign.c
  230. +21 −13 ssh-pkcs11.c
  231. +2 −2 ssh-rsa.c
  232. +30 −11 ssh.1
  233. +20 −5 ssh.c
  234. +2 −2 ssh.h
  235. +4 −0 ssh_api.c
  236. +2 −1 ssh_api.h
  237. +50 −17 ssh_config.5
  238. +4 −2 sshbuf-misc.c
  239. +6 −4 sshconnect.c
  240. +29 −15 sshconnect2.c
  241. +9 −10 sshd.8
  242. +32 −19 sshd.c
  243. +2 −2 sshd_config
  244. +143 −23 sshd_config.5
  245. +132 −176 sshkey.c
  246. +4 −6 sshkey.h
  247. +2 −2 sshpty.c
  248. +3 −3 uidswap.c
  249. +2 −2 uuencode.c
  250. +2 −2 version.h
  251. +7 −13 xmalloc.c
  252. +2 −2 xmalloc.h
@@ -433,15 +433,21 @@ uninstall:
-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1

regress-prep:
[ -d `pwd`/regress ] || mkdir -p `pwd`/regress
[ -d `pwd`/regress/unittests ] || mkdir -p `pwd`/regress/unittests
[ -d `pwd`/regress/unittests/test_helper ] || \
[ -d `pwd`/regress ] || mkdir -p `pwd`/regress
[ -d `pwd`/regress/unittests ] || mkdir -p `pwd`/regress/unittests
[ -d `pwd`/regress/unittests/test_helper ] || \
mkdir -p `pwd`/regress/unittests/test_helper
[ -d `pwd`/regress/unittests/sshbuf ] || \
[ -d `pwd`/regress/unittests/sshbuf ] || \
mkdir -p `pwd`/regress/unittests/sshbuf
[ -d `pwd`/regress/unittests/sshkey ] || \
[ -d `pwd`/regress/unittests/sshkey ] || \
mkdir -p `pwd`/regress/unittests/sshkey
[ -f `pwd`/regress/Makefile ] || \
[ -d `pwd`/regress/unittests/bitmap ] || \
mkdir -p `pwd`/regress/unittests/bitmap
[ -d `pwd`/regress/unittests/hostkeys ] || \
mkdir -p `pwd`/regress/unittests/hostkeys
[ -d `pwd`/regress/unittests/kex ] || \
mkdir -p `pwd`/regress/unittests/kex
[ -f `pwd`/regress/Makefile ] || \
ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile

regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c
@@ -65,8 +65,8 @@ these programs.
packets. CRC code comes from crc32.c.

- The code in packet.c calls the buffer manipulation routines
(buffer.c, bufaux.c), compression routines (compress.c, zlib),
and the encryption routines.
(buffer.c, bufaux.c), compression routines (zlib), and the
encryption routines.

X11, TCP/IP, and Agent forwarding

@@ -165,4 +165,4 @@ these programs.
uidswap.c uid-swapping
xmalloc.c "safe" malloc routines

$OpenBSD: OVERVIEW,v 1.11 2006/08/03 03:34:41 deraadt Exp $
$OpenBSD: OVERVIEW,v 1.12 2015/07/08 19:01:15 markus Exp $
@@ -175,7 +175,7 @@ whitelisted to receive this message upon request.

OpenSSH supports layer 2 and layer 3 tunnelling via the "tun@openssh.com"
channel type. This channel type supports forwarding of network packets
with datagram boundaries intact between endpoints equipped with
with datagram boundaries intact between endpoints equipped with
interfaces like the BSD tun(4) device. Tunnel forwarding channels are
requested by the client with the following packet:

@@ -247,7 +247,6 @@ to request that the server make a connection to a Unix domain socket.
uint32 initial window size
uint32 maximum packet size
string socket path
string reserved for future use

Similar to forwarded-tcpip, forwarded-streamlocal is sent by the
server when the client has previously send the server a streamlocal-forward
@@ -282,15 +281,15 @@ by the client cancel the forwarding of a Unix domain socket.
boolean FALSE
string socket path

2.5. connection: hostkey update and rotation "hostkeys@openssh.com"
and "hostkeys-prove@openssh.com"
2.5. connection: hostkey update and rotation "hostkeys-00@openssh.com"
and "hostkeys-prove-00@openssh.com"

OpenSSH supports a protocol extension allowing a server to inform
a client of all its protocol v.2 host keys after user-authentication
has completed.

byte SSH_MSG_GLOBAL_REQUEST
string "hostkeys@openssh.com"
string "hostkeys-00@openssh.com"
string[] hostkeys

Upon receiving this message, a client should check which of the
@@ -300,15 +299,15 @@ to request the server prove ownership of the private half of the
key.

byte SSH_MSG_GLOBAL_REQUEST
string "hostkeys-prove@openssh.com"
string "hostkeys-prove-00@openssh.com"
char 1 /* want-reply */
string[] hostkeys

When a server receives this message, it should generate a signature
using each requested key over the following:

string "hostkeys-prove-00@openssh.com"
string session identifier
string "hostkeys-prove@openssh.com"
string hostkey

These signatures should be included in the reply, in the order matching
@@ -453,4 +452,4 @@ respond with a SSH_FXP_STATUS message.
This extension is advertised in the SSH_FXP_VERSION hello with version
"1".

$OpenBSD: PROTOCOL,v 1.26 2015/02/16 22:13:32 djm Exp $
$OpenBSD: PROTOCOL,v 1.29 2015/07/17 03:09:19 djm Exp $
@@ -413,7 +413,7 @@ It may be requested using this message:

"rsa_e" and "rsa_n" are used to identify which private key to use.
"encrypted_challenge" is a challenge blob that has (presumably)
been encrypted with the public key and must be in the range
been encrypted with the public key and must be in the range
1 <= encrypted_challenge < 2^256. "session_id" is the SSH protocol 1
session ID (computed from the server host key, the server semi-ephemeral
key and the session cookie).
@@ -557,4 +557,4 @@ Locking and unlocking affects both protocol 1 and protocol 2 keys.
SSH_AGENT_CONSTRAIN_LIFETIME 1
SSH_AGENT_CONSTRAIN_CONFIRM 2

$OpenBSD: PROTOCOL.agent,v 1.7 2013/01/02 00:33:49 djm Exp $
$OpenBSD: PROTOCOL.agent,v 1.8 2015/05/08 03:56:51 djm Exp $
@@ -116,6 +116,12 @@ A client may request the master to establish a port forward:

forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC.

If listen port is (unsigned int) -2, then the listen host is treated as
a unix socket path name.

If connect port is (unsigned int) -2, then the connect host is treated
as a unix socket path name.

A server may reply with a MUX_S_OK, a MUX_S_REMOTE_PORT, a
MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE.

@@ -219,4 +225,4 @@ XXX inject packet (what about replies)
XXX server->client error/warning notifications
XXX send signals via mux

$OpenBSD: PROTOCOL.mux,v 1.9 2012/06/01 00:49:35 djm Exp $
$OpenBSD: PROTOCOL.mux,v 1.10 2015/07/17 03:04:27 djm Exp $
2 README
@@ -1,4 +1,4 @@
See http://www.openssh.com/txt/release-6.7 for the release notes.
See http://www.openssh.com/txt/release-6.9 for the release notes.

- A Japanese translation of this document and of the OpenSSH FAQ is
- available at http://www.unixuser.org/~haruyama/security/openssh/index.html
@@ -1,4 +1,4 @@
/* $OpenBSD: addrmatch.c,v 1.9 2014/01/19 11:21:51 dtucker Exp $ */
/* $OpenBSD: addrmatch.c,v 1.10 2015/07/08 19:04:21 markus Exp $ */

/*
* Copyright (c) 2004-2008 Damien Miller <djm@mindrot.org>
@@ -31,7 +31,6 @@

#include "match.h"
#include "log.h"
#include "xmalloc.h"

struct xaddr {
sa_family_t af;
@@ -30,8 +30,6 @@
#include <stdlib.h>
#include <stdio.h>

#include <stdarg.h>

#include "xmalloc.h"
#include "key.h"
#include "hostfile.h"
@@ -1,4 +1,4 @@
/* $OpenBSD: auth-options.c,v 1.65 2015/01/14 10:30:34 markus Exp $ */
/* $OpenBSD: auth-options.c,v 1.68 2015/07/03 03:43:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -209,8 +209,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
goto next_option;
}
cp = "environment=\"";
if (options.permit_user_env &&
strncasecmp(opts, cp, strlen(cp)) == 0) {
if (strncasecmp(opts, cp, strlen(cp)) == 0) {
char *s;
struct envstring *new_envstring;

@@ -236,13 +235,19 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
goto bad_option;
}
s[i] = '\0';
auth_debug_add("Adding to environment: %.900s", s);
debug("Adding to environment: %.900s", s);
opts++;
new_envstring = xcalloc(1, sizeof(struct envstring));
new_envstring->s = s;
new_envstring->next = custom_environment;
custom_environment = new_envstring;
if (options.permit_user_env) {
auth_debug_add("Adding to environment: "
"%.900s", s);
debug("Adding to environment: %.900s", s);
new_envstring = xcalloc(1,
sizeof(*new_envstring));
new_envstring->s = s;
new_envstring->next = custom_environment;
custom_environment = new_envstring;
s = NULL;
}
free(s);
goto next_option;
}
cp = "from=\"";
@@ -583,35 +588,21 @@ auth_cert_options(struct sshkey *k, struct passwd *pw)
char *cert_forced_command = NULL;
int cert_source_address_done = 0;

if (sshkey_cert_is_legacy(k)) {
/* All options are in the one field for v00 certs */
if (parse_option_list(k->cert->critical, pw,
OPTIONS_CRITICAL|OPTIONS_EXTENSIONS, 1,
&cert_no_port_forwarding_flag,
&cert_no_agent_forwarding_flag,
&cert_no_x11_forwarding_flag,
&cert_no_pty_flag,
&cert_no_user_rc,
&cert_forced_command,
&cert_source_address_done) == -1)
return -1;
} else {
/* Separate options and extensions for v01 certs */
if (parse_option_list(k->cert->critical, pw,
OPTIONS_CRITICAL, 1, NULL, NULL, NULL, NULL, NULL,
&cert_forced_command,
&cert_source_address_done) == -1)
return -1;
if (parse_option_list(k->cert->extensions, pw,
OPTIONS_EXTENSIONS, 1,
&cert_no_port_forwarding_flag,
&cert_no_agent_forwarding_flag,
&cert_no_x11_forwarding_flag,
&cert_no_pty_flag,
&cert_no_user_rc,
NULL, NULL) == -1)
return -1;
}
/* Separate options and extensions for v01 certs */
if (parse_option_list(k->cert->critical, pw,
OPTIONS_CRITICAL, 1, NULL, NULL, NULL, NULL, NULL,
&cert_forced_command,
&cert_source_address_done) == -1)
return -1;
if (parse_option_list(k->cert->extensions, pw,
OPTIONS_EXTENSIONS, 0,
&cert_no_port_forwarding_flag,
&cert_no_agent_forwarding_flag,
&cert_no_x11_forwarding_flag,
&cert_no_pty_flag,
&cert_no_user_rc,
NULL, NULL) == -1)
return -1;

no_port_forwarding_flag |= cert_no_port_forwarding_flag;
no_agent_forwarding_flag |= cert_no_agent_forwarding_flag;
@@ -738,7 +738,7 @@ sshpam_query(void *ctx, char **name, char **info,
case PAM_PROMPT_ECHO_OFF:
*num = 1;
len = plen + mlen + 1;
**prompts = xrealloc(**prompts, 1, len);
**prompts = xreallocarray(**prompts, 1, len);
strlcpy(**prompts + plen, msg, len - plen);
plen += mlen;
**echo_on = (type == PAM_PROMPT_ECHO_ON);
@@ -748,7 +748,7 @@ sshpam_query(void *ctx, char **name, char **info,
case PAM_TEXT_INFO:
/* accumulate messages */
len = plen + mlen + 2;
**prompts = xrealloc(**prompts, 1, len);
**prompts = xreallocarray(**prompts, 1, len);
strlcpy(**prompts + plen, msg, len - plen);
plen += mlen;
strlcat(**prompts + plen, "\n", len - plen);
8 auth.c
@@ -1,4 +1,4 @@
/* $OpenBSD: auth.c,v 1.109 2015/01/20 23:14:00 deraadt Exp $ */
/* $OpenBSD: auth.c,v 1.111 2015/05/01 04:17:51 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -331,13 +331,14 @@ auth_log(Authctxt *authctxt, int authenticated, int partial,
void
auth_maxtries_exceeded(Authctxt *authctxt)
{
packet_disconnect("Too many authentication failures for "
error("maximum authentication attempts exceeded for "
"%s%.100s from %.200s port %d %s",
authctxt->valid ? "" : "invalid user ",
authctxt->user,
get_remote_ipaddr(),
get_remote_port(),
compat20 ? "ssh2" : "ssh1");
packet_disconnect("Too many authentication failures");
/* NOTREACHED */
}

@@ -399,8 +400,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw)
char *
authorized_principals_file(struct passwd *pw)
{
if (options.authorized_principals_file == NULL ||
strcasecmp(options.authorized_principals_file, "none") == 0)
if (options.authorized_principals_file == NULL)
return NULL;
return expand_authorized_keys(options.authorized_principals_file, pw);
}
6 auth.h
@@ -1,4 +1,4 @@
/* $OpenBSD: auth.h,v 1.82 2015/02/16 22:13:32 djm Exp $ */
/* $OpenBSD: auth.h,v 1.84 2015/05/08 06:41:56 djm Exp $ */

/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -56,7 +56,7 @@ struct Authctxt {
int valid; /* user exists and is allowed to login */
int attempt;
int failures;
int server_caused_failure;
int server_caused_failure;
int force_pwchange;
char *user; /* username sent by the client */
char *service;
@@ -126,7 +126,7 @@ int auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **);

int auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *);
int hostbased_key_allowed(struct passwd *, const char *, char *, Key *);
int user_key_allowed(struct passwd *, Key *);
int user_key_allowed(struct passwd *, Key *, int);
void pubkey_auth_info(Authctxt *, const Key *, const char *, ...)
__attribute__((__format__ (printf, 3, 4)));
void auth2_record_userkey(Authctxt *, struct sshkey *);
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2-hostbased.c,v 1.24 2015/01/28 22:36:00 djm Exp $ */
/* $OpenBSD: auth2-hostbased.c,v 1.25 2015/05/04 06:10:48 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -109,8 +109,7 @@ userauth_hostbased(Authctxt *authctxt)
goto done;
}
if (match_pattern_list(sshkey_ssh_name(key),
options.hostbased_key_types,
strlen(options.hostbased_key_types), 0) != 1) {
options.hostbased_key_types, 0) != 1) {
logit("%s: key type %s not in HostbasedAcceptedKeyTypes",
__func__, sshkey_type(key));
goto done;