Compare commits

...
19 Commits
Author SHA1 Message Date
Darren Tucker f8eb9c95fc - (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find
pkg-config so it does the right thing when cross-compiling.  Patch from
   cjwatson at debian org.
2012-05-19 15:25:03 +10:00
Darren Tucker 6d9e1decdb - (dtucker) [configure.ac] bz#2010: fix non-portable shell construct. Patch
from cjwatson at debian org.
2012-05-19 14:26:10 +10:00
Darren Tucker 0d78011431 - (dtucker) [configure.ac] Include <sys/param.h> rather than <sys/types.h>
to fix building on some plaforms.  Fom bowman at math utah edu and
   des at des no.
2012-05-04 11:05:22 +10:00
Darren Tucker d0d3fff483 - (dtucker) [regress/addrmatch.sh] skip tests when running on a non-ipv6
platform rather than exiting early, so that we still clean up and return
   status to test-exec.sh
2012-04-27 10:55:39 +10:00
Damien Miller 025bfd11d9 - (djm) [auth-krb5.c] Save errno across calls that might modify it;
ok dtucker@
2012-04-26 09:52:15 +10:00
Damien Miller 7584cb1ac4 - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
via Niels
2012-04-26 09:51:26 +10:00
Damien Miller ba77e1f673 - [email protected] 2012/04/23 08:18:17
[channels.c]
     fix function proto/source mismatch
2012-04-23 18:21:05 +10:00
Damien Miller 70b2d5550b - [email protected] 2012/04/20 16:26:22
[ssh.1]
     use "brackets" instead of "braces", for consistency;
2012-04-22 11:26:10 +10:00
Damien Miller 4922315d1d - [email protected] 2012/04/20 03:24:23
[sftp.c]
     setlinebuf(3) is more readable than setvbuf(.., _IOLBF, ...)
2012-04-22 11:25:47 +10:00
Damien Miller 8fef9ebbab - [email protected] 2012/04/12 02:43:55
[sshd_config sshd_config.5]
     mention AuthorizedPrincipalsFile=none default
2012-04-22 11:25:10 +10:00
Damien Miller 23528816dc - [email protected] 2012/04/12 02:42:32
[servconf.c servconf.h sshd.c sshd_config sshd_config.5]
     VersionAddendum option to allow server operators to append some arbitrary
     text to the SSH-... banner; ok deraadt@ "don't care" markus@
2012-04-22 11:24:43 +10:00
Damien Miller 839f743464 - [email protected] 2012/04/11 13:34:17
[ssh-keyscan.1 ssh-keyscan.c]
     now that sshd defaults to offering ECDSA keys, ssh-keyscan should also
     look for them by default; bz#1971
2012-04-22 11:24:21 +10:00
Damien Miller a116d13c4d - [email protected] 2012/04/11 13:26:40
[sshd.c]
     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
     while; ok deraadt@ markus@
2012-04-22 11:23:46 +10:00
Damien Miller 9fed161e67 - [email protected] 2012/04/11 13:17:54
[auth.c]
     Support "none" as an argument for AuthorizedPrincipalsFile to indicate
     no file should be read.
2012-04-22 11:21:43 +10:00
Damien Miller a6508753db - [email protected] 2012/04/11 13:16:19
[channels.c channels.h clientloop.c serverloop.c]
     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
     while; ok deraadt@ markus@
2012-04-22 11:21:10 +10:00
Damien Miller c6081482b2 - [email protected] 2012/03/29 23:54:36
[channels.c channels.h servconf.c]
     Add PermitOpen none option based on patch from Loganaden Velvindron
     (bz #1949).  ok djm@
2012-04-22 11:18:53 +10:00
Damien Miller 48348fc3b4 - [email protected] 2012/03/28 07:23:22
[PROTOCOL.certkeys]
     explain certificate extensions/crit split rationale. Mention requirement
     that each appear at most once per cert.
2012-04-22 11:08:30 +10:00
Damien Miller 29cd188887 - [email protected] 2012/03/15 03:10:27
[session.c]
     root should always be excluded from the test for /etc/nologin instead
     of having it always enforced even when marked as ignorenologin.  This
     regressed when the logic was incompletely flipped around in rev 1.251
     ok halex@ millert@
2012-04-22 11:08:10 +10:00
Damien Miller a563cced06 - [email protected] 2012/02/29 11:21:26
[ssh-keygen.c]
     allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
2012-04-22 11:07:28 +10:00
23 changed files with 206 additions and 71 deletions
+12
View File
@@ -1,3 +1,15 @@
20120519
- (dtucker) [configure.ac] bz#2010: fix non-portable shell construct. Patch
from cjwatson at debian org.
- (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find
pkg-config so it does the right thing when cross-compiling. Patch from
cjwatson at debian org.
20120504
- (dtucker) [configure.ac] Include <sys/param.h> rather than <sys/types.h>
to fix building on some plaforms. Fom bowman at math utah edu and
des at des no.
20120420
- (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
[contrib/suse/openssh.spec] Update for release 6.0
+12 -3
View File
@@ -162,6 +162,13 @@ extensions is a set of zero or more optional extensions. These extensions
are not critical, and an implementation that encounters one that it does
not recognise may safely ignore it.
Generally, critical options are used to control features that restrict
access where extensions are used to enable features that grant access.
This ensures that certificates containing unknown restrictions do not
inadvertently grant access while allowing new protocol features to be
enabled via extensions without breaking certificates' backwards
compatibility.
The reserved field is currently unused and is ignored in this version of
the protocol.
@@ -189,7 +196,7 @@ is a sequence of zero or more tuples:
string data
Options must be lexically ordered by "name" if they appear in the
sequence.
sequence. Each named option may only appear once in a certificate.
The name field identifies the option and the data field encodes
option-specific information (see below). All options are
@@ -220,7 +227,9 @@ Extensions
The extensions section of the certificate specifies zero or more
non-critical certificate extensions. The encoding and ordering of
extensions in this field is identical to that of the critical options.
extensions in this field is identical to that of the critical options,
as is the requirement that each name appear only once.
If an implementation does not recognise an extension, then it should
ignore it.
@@ -253,4 +262,4 @@ permit-user-rc empty Flag indicating that execution of
of this script will not be permitted if
this option is not present.
$OpenBSD: PROTOCOL.certkeys,v 1.8 2010/08/31 11:54:45 djm Exp $
$OpenBSD: PROTOCOL.certkeys,v 1.9 2012/03/28 07:23:22 djm Exp $
+7 -5
View File
@@ -226,7 +226,7 @@ krb5_cleanup_proc(Authctxt *authctxt)
#ifndef HEIMDAL
krb5_error_code
ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
int tmpfd, ret;
int tmpfd, ret, oerrno;
char ccname[40];
mode_t old_umask;
@@ -237,16 +237,18 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
old_umask = umask(0177);
tmpfd = mkstemp(ccname + strlen("FILE:"));
oerrno = errno;
umask(old_umask);
if (tmpfd == -1) {
logit("mkstemp(): %.100s", strerror(errno));
return errno;
logit("mkstemp(): %.100s", strerror(oerrno));
return oerrno;
}
if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno));
oerrno = errno;
logit("fchmod(): %.100s", strerror(oerrno));
close(tmpfd);
return errno;
return oerrno;
}
close(tmpfd);
+2 -1
View File
@@ -209,6 +209,7 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
* Authentication is accepted if the encrypted passwords
* are identical.
*/
return (strcmp(encrypted_password, pw_password) == 0);
return encrypted_password != NULL &&
strcmp(encrypted_password, pw_password) == 0;
}
#endif
+3 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth.c,v 1.94 2011/05/23 03:33:38 djm Exp $ */
/* $OpenBSD: auth.c,v 1.95 2012/04/11 13:17:54 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -357,7 +357,8 @@ expand_authorized_keys(const char *filename, struct passwd *pw)
char *
authorized_principals_file(struct passwd *pw)
{
if (options.authorized_principals_file == NULL)
if (options.authorized_principals_file == NULL ||
strcasecmp(options.authorized_principals_file, "none") == 0)
return NULL;
return expand_authorized_keys(options.authorized_principals_file, pw);
}
+58 -9
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.c,v 1.315 2011/09/23 07:45:05 markus Exp $ */
/* $OpenBSD: channels.c,v 1.318 2012/04/23 08:18:17 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -311,6 +311,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->istate = CHAN_INPUT_OPEN;
c->flags = 0;
channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, 0);
c->notbefore = 0;
c->self = found;
c->type = type;
c->ctype = ctype;
@@ -1339,6 +1340,8 @@ channel_post_x11_listener(Channel *c, fd_set *readset, fd_set *writeset)
}
if (newsock < 0) {
error("accept: %.100s", strerror(errno));
if (errno == EMFILE || errno == ENFILE)
c->notbefore = time(NULL) + 1;
return;
}
set_nodelay(newsock);
@@ -1482,6 +1485,8 @@ channel_post_port_listener(Channel *c, fd_set *readset, fd_set *writeset)
newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (newsock < 0) {
error("accept: %.100s", strerror(errno));
if (errno == EMFILE || errno == ENFILE)
c->notbefore = time(NULL) + 1;
return;
}
set_nodelay(newsock);
@@ -1514,7 +1519,10 @@ channel_post_auth_listener(Channel *c, fd_set *readset, fd_set *writeset)
addrlen = sizeof(addr);
newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen);
if (newsock < 0) {
error("accept from auth socket: %.100s", strerror(errno));
error("accept from auth socket: %.100s",
strerror(errno));
if (errno == EMFILE || errno == ENFILE)
c->notbefore = time(NULL) + 1;
return;
}
nc = channel_new("accepted auth socket",
@@ -1917,6 +1925,8 @@ channel_post_mux_listener(Channel *c, fd_set *readset, fd_set *writeset)
if ((newsock = accept(c->sock, (struct sockaddr*)&addr,
&addrlen)) == -1) {
error("%s accept: %s", __func__, strerror(errno));
if (errno == EMFILE || errno == ENFILE)
c->notbefore = time(NULL) + 1;
return;
}
@@ -2067,16 +2077,21 @@ channel_garbage_collect(Channel *c)
}
static void
channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset)
channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset,
time_t *unpause_secs)
{
static int did_init = 0;
u_int i, oalloc;
Channel *c;
time_t now;
if (!did_init) {
channel_handler_init();
did_init = 1;
}
now = time(NULL);
if (unpause_secs != NULL)
*unpause_secs = 0;
for (i = 0, oalloc = channels_alloc; i < oalloc; i++) {
c = channels[i];
if (c == NULL)
@@ -2087,10 +2102,30 @@ channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset)
else
continue;
}
if (ftab[c->type] != NULL)
(*ftab[c->type])(c, readset, writeset);
if (ftab[c->type] != NULL) {
/*
* Run handlers that are not paused.
*/
if (c->notbefore <= now)
(*ftab[c->type])(c, readset, writeset);
else if (unpause_secs != NULL) {
/*
* Collect the time that the earliest
* channel comes off pause.
*/
debug3("%s: chan %d: skip for %d more seconds",
__func__, c->self,
(int)(c->notbefore - now));
if (*unpause_secs == 0 ||
(c->notbefore - now) < *unpause_secs)
*unpause_secs = c->notbefore - now;
}
}
channel_garbage_collect(c);
}
if (unpause_secs != NULL && *unpause_secs != 0)
debug3("%s: first channel unpauses in %d seconds",
__func__, (int)*unpause_secs);
}
/*
@@ -2099,7 +2134,7 @@ channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset)
*/
void
channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
u_int *nallocp, int rekeying)
u_int *nallocp, time_t *minwait_secs, int rekeying)
{
u_int n, sz, nfdset;
@@ -2122,7 +2157,8 @@ channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
memset(*writesetp, 0, sz);
if (!rekeying)
channel_handler(channel_pre, *readsetp, *writesetp);
channel_handler(channel_pre, *readsetp, *writesetp,
minwait_secs);
}
/*
@@ -2132,7 +2168,7 @@ channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
void
channel_after_select(fd_set *readset, fd_set *writeset)
{
channel_handler(channel_post, readset, writeset);
channel_handler(channel_post, readset, writeset, NULL);
}
@@ -3126,6 +3162,17 @@ channel_add_adm_permitted_opens(char *host, int port)
return ++num_adm_permitted_opens;
}
void
channel_disable_adm_local_opens(void)
{
if (num_adm_permitted_opens == 0) {
permitted_adm_opens = xmalloc(sizeof(*permitted_adm_opens));
permitted_adm_opens[num_adm_permitted_opens].host_to_connect
= NULL;
num_adm_permitted_opens = 1;
}
}
void
channel_clear_permitted_opens(void)
{
@@ -3167,7 +3214,9 @@ channel_print_adm_permitted_opens(void)
return;
}
for (i = 0; i < num_adm_permitted_opens; i++)
if (permitted_adm_opens[i].host_to_connect != NULL)
if (permitted_adm_opens[i].host_to_connect == NULL)
printf(" none");
else
printf(" %s:%d", permitted_adm_opens[i].host_to_connect,
permitted_adm_opens[i].port_to_connect);
printf("\n");
+5 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.h,v 1.109 2011/09/23 07:45:05 markus Exp $ */
/* $OpenBSD: channels.h,v 1.111 2012/04/11 13:16:19 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -105,6 +105,7 @@ struct Channel {
int wfd_isatty; /* wfd is a tty */
int client_tty; /* (client) TTY has been requested */
int force_drain; /* force close on iEOF */
time_t notbefore; /* Pause IO until deadline (time_t) */
int delayed; /* post-select handlers for newly created
* channels are delayed until the first call
* to a matching pre-select handler.
@@ -238,7 +239,8 @@ void channel_input_status_confirm(int, u_int32_t, void *);
/* file descriptor handling (read/write) */
void channel_prepare_select(fd_set **, fd_set **, int *, u_int*, int);
void channel_prepare_select(fd_set **, fd_set **, int *, u_int*,
time_t*, int);
void channel_after_select(fd_set *, fd_set *);
void channel_output_poll(void);
@@ -253,6 +255,7 @@ void channel_set_af(int af);
void channel_permit_all_opens(void);
void channel_add_permitted_opens(char *, int);
int channel_add_adm_permitted_opens(char *, int);
void channel_disable_adm_local_opens(void);
void channel_update_permitted_opens(int, int);
void channel_clear_permitted_opens(void);
void channel_clear_adm_permitted_opens(void);
+6 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: clientloop.c,v 1.238 2012/01/18 21:46:43 dtucker Exp $ */
/* $OpenBSD: clientloop.c,v 1.239 2012/04/11 13:16:19 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -583,10 +583,12 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
{
struct timeval tv, *tvp;
int timeout_secs;
time_t minwait_secs;
int ret;
/* Add any selections by the channel mechanism. */
channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, rekeying);
channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
&minwait_secs, rekeying);
if (!compat20) {
/* Read from the connection, unless our buffers are full. */
@@ -639,6 +641,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
if (timeout_secs < 0)
timeout_secs = 0;
}
if (minwait_secs != 0)
timeout_secs = MIN(timeout_secs, (int)minwait_secs);
if (timeout_secs == INT_MAX)
tvp = NULL;
else {
+5 -5
View File
@@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.489 2012/04/19 11:46:38 djm Exp $
# $Id: configure.ac,v 1.489.2.3 2012/05/19 05:25:04 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [[email protected]])
AC_REVISION($Revision: 1.489 $)
AC_REVISION($Revision: 1.489.2.3 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -1410,7 +1410,7 @@ AC_ARG_WITH([libedit],
[ --with-libedit[[=PATH]] Enable libedit support for sftp],
[ if test "x$withval" != "xno" ; then
if test "x$withval" = "xyes" ; then
AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no])
if test "x$PKGCONFIG" != "xno"; then
AC_MSG_CHECKING([if $PKGCONFIG knows about libedit])
if "$PKGCONFIG" libedit; then
@@ -2591,7 +2591,7 @@ elif test "x$sandbox_arg" = "xdarwin" || \
AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)])
elif test "x$sandbox_arg" = "xseccomp_filter" || \
( test -z "$sandbox_arg" && \
test "x$have_seccomp_filter" == "x1" && \
test "x$have_seccomp_filter" = "x1" && \
test "x$ac_cv_header_linux_audit_h" = "xyes" && \
test "x$have_seccomp_audit_arch" = "x1" && \
test "x$have_linux_no_new_privs" = "x1" && \
@@ -3234,7 +3234,7 @@ fi
AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
+4 -2
View File
@@ -1,3 +1,5 @@
PKG_CONFIG = pkg-config
all:
@echo "Valid targets: gnome-ssh-askpass1 gnome-ssh-askpass2"
@@ -7,9 +9,9 @@ gnome-ssh-askpass1: gnome-ssh-askpass1.c
`gnome-config --libs gnome gnomeui`
gnome-ssh-askpass2: gnome-ssh-askpass2.c
$(CC) `pkg-config --cflags gtk+-2.0` \
$(CC) `$(PKG_CONFIG) --cflags gtk+-2.0` \
gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \
`pkg-config --libs gtk+-2.0 x11`
`$(PKG_CONFIG) --libs gtk+-2.0 x11`
clean:
rm -f *.o gnome-ssh-askpass1 gnome-ssh-askpass2 gnome-ssh-askpass
+2 -1
View File
@@ -33,13 +33,14 @@ run_trial user 19.0.0.1 somehost no "deny, no match"
run_trial user 10.255.255.254 somehost yes "permit, list middle"
run_trial user 192.168.30.1 192.168.0.1 no "deny, faked IP in hostname"
run_trial user 1.1.1.1 somehost.example.com yes "permit, bare IP4 address"
test "$TEST_SSH_IPV6" = "no" && exit
if test "$TEST_SSH_IPV6" != "no"; then
run_trial user ::1 somehost.example.com yes "permit, bare IP6 address"
run_trial user ::2 somehost.exaple.com no "deny IPv6"
run_trial user ::3 somehost no "deny IP6 negated"
run_trial user ::4 somehost no "deny, IP6 no match"
run_trial user 2000::1 somehost yes "permit, IP6 network"
run_trial user 2001::1 somehost no "deny, IP6 network"
fi
cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
rm $OBJ/sshd_proxy_bak
+31 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: servconf.c,v 1.223 2011/09/23 00:22:04 dtucker Exp $ */
/* $OpenBSD: servconf.c,v 1.225 2012/04/12 02:42:32 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -138,6 +138,7 @@ initialize_server_options(ServerOptions *options)
options->authorized_principals_file = NULL;
options->ip_qos_interactive = -1;
options->ip_qos_bulk = -1;
options->version_addendum = NULL;
}
void
@@ -277,7 +278,8 @@ fill_default_server_options(ServerOptions *options)
options->ip_qos_interactive = IPTOS_LOWDELAY;
if (options->ip_qos_bulk == -1)
options->ip_qos_bulk = IPTOS_THROUGHPUT;
if (options->version_addendum == NULL)
options->version_addendum = xstrdup("");
/* Turn privilege separation on by default */
if (use_privsep == -1)
use_privsep = PRIVSEP_ON;
@@ -323,7 +325,7 @@ typedef enum {
sUsePrivilegeSeparation, sAllowAgentForwarding,
sZeroKnowledgePasswordAuthentication, sHostCertificate,
sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
sKexAlgorithms, sIPQoS,
sKexAlgorithms, sIPQoS, sVersionAddendum,
sDeprecated, sUnsupported
} ServerOpCodes;
@@ -448,6 +450,7 @@ static struct {
{ "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
{ "ipqos", sIPQoS, SSHCFG_ALL },
{ "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL },
{ NULL, sBadOption, 0 }
};
@@ -1333,6 +1336,14 @@ process_server_config_line(ServerOptions *options, char *line,
}
break;
}
if (strcmp(arg, "none") == 0) {
if (*activep && n == -1) {
channel_clear_adm_permitted_opens();
options->num_permitted_opens = 1;
channel_disable_adm_local_opens();
}
break;
}
if (*activep && n == -1)
channel_clear_adm_permitted_opens();
for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) {
@@ -1395,6 +1406,22 @@ process_server_config_line(ServerOptions *options, char *line,
}
break;
case sVersionAddendum:
if (cp == NULL)
fatal("%.200s line %d: Missing argument.", filename,
linenum);
len = strspn(cp, WHITESPACE);
if (*activep && options->version_addendum == NULL) {
if (strcasecmp(cp + len, "none") == 0)
options->version_addendum = xstrdup("");
else if (strchr(cp + len, '\r') != NULL)
fatal("%.200s line %d: Invalid argument",
filename, linenum);
else
options->version_addendum = xstrdup(cp + len);
}
return 0;
case sDeprecated:
logit("%s line %d: Deprecated option %s",
filename, linenum, arg);
@@ -1758,6 +1785,7 @@ dump_config(ServerOptions *o)
dump_cfg_string(sRevokedKeys, o->revoked_keys_file);
dump_cfg_string(sAuthorizedPrincipalsFile,
o->authorized_principals_file);
dump_cfg_string(sVersionAddendum, o->version_addendum);
/* string arguments requiring a lookup */
dump_cfg_string(sLogLevel, log_level_name(o->log_level));
+3 -1
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: servconf.h,v 1.99 2011/06/22 21:57:01 djm Exp $ */
/* $OpenBSD: servconf.h,v 1.100 2012/04/12 02:42:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -166,6 +166,8 @@ typedef struct {
char *revoked_keys_file;
char *trusted_user_ca_keys;
char *authorized_principals_file;
char *version_addendum; /* Appended to SSH banner */
} ServerOptions;
/*
+10 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: serverloop.c,v 1.160 2011/05/15 08:09:01 djm Exp $ */
/* $OpenBSD: serverloop.c,v 1.161 2012/04/11 13:16:19 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -281,9 +281,18 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
{
struct timeval tv, *tvp;
int ret;
time_t minwait_secs;
int client_alive_scheduled = 0;
int program_alive_scheduled = 0;
/* Allocate and update select() masks for channel descriptors. */
channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
&minwait_secs, 0);
if (minwait_secs != 0)
max_time_milliseconds = MIN(max_time_milliseconds,
(u_int)minwait_secs * 1000);
/*
* if using client_alive, set the max timeout accordingly,
* and indicate that this particular timeout was for client
@@ -298,9 +307,6 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
max_time_milliseconds = options.client_alive_interval * 1000;
}
/* Allocate and update select() masks for channel descriptors. */
channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, 0);
if (compat20) {
#if 0
/* wrong: bad condition XXX */
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: session.c,v 1.259 2011/10/24 02:13:13 djm Exp $ */
/* $OpenBSD: session.c,v 1.260 2012/03/15 03:10:27 guenther Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1390,7 +1390,7 @@ do_nologin(struct passwd *pw)
struct stat sb;
#ifdef HAVE_LOGIN_CAP
if (login_getcapbool(lc, "ignorenologin", 0) && pw->pw_uid)
if (login_getcapbool(lc, "ignorenologin", 0) || pw->pw_uid == 0)
return;
nl = login_getcapstr(lc, "nologin", def_nl, def_nl);
#else
+1 -6
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sftp.c,v 1.134 2011/11/16 12:24:28 oga Exp $ */
/* $OpenBSD: sftp.c,v 1.135 2012/04/20 03:24:23 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1934,13 +1934,8 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2)
xfree(dir);
}
#if defined(HAVE_SETVBUF) && !defined(BROKEN_SETVBUF)
setvbuf(stdout, NULL, _IOLBF, 0);
setvbuf(infile, NULL, _IOLBF, 0);
#else
setlinebuf(stdout);
setlinebuf(infile);
#endif
interactive = !batchmode && isatty(STDIN_FILENO);
err = 0;
+7 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.212 2011/10/16 15:02:41 jmc Exp $ */
/* $OpenBSD: ssh-keygen.c,v 1.213 2012/02/29 11:21:26 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -265,6 +265,10 @@ do_convert_to_ssh2(struct passwd *pw, Key *k)
u_char *blob;
char comment[61];
if (k->type == KEY_RSA1) {
fprintf(stderr, "version 1 keys are not supported\n");
exit(1);
}
if (key_to_blob(k, &blob, &len) <= 0) {
fprintf(stderr, "key_to_blob failed\n");
exit(1);
@@ -288,6 +292,7 @@ static void
do_convert_to_pkcs8(Key *k)
{
switch (key_type_plain(k->type)) {
case KEY_RSA1:
case KEY_RSA:
if (!PEM_write_RSA_PUBKEY(stdout, k->rsa))
fatal("PEM_write_RSA_PUBKEY failed");
@@ -312,6 +317,7 @@ static void
do_convert_to_pem(Key *k)
{
switch (key_type_plain(k->type)) {
case KEY_RSA1:
case KEY_RSA:
if (!PEM_write_RSAPublicKey(stdout, k->rsa))
fatal("PEM_write_RSAPublicKey failed");
@@ -345,10 +351,6 @@ do_convert_to(struct passwd *pw)
exit(1);
}
}
if (k->type == KEY_RSA1) {
fprintf(stderr, "version 1 keys are not supported\n");
exit(1);
}
switch (convert_format) {
case FMT_RFC4716:
+7 -4
View File
@@ -1,4 +1,4 @@
.\" $OpenBSD: ssh-keyscan.1,v 1.29 2010/08/31 11:54:45 djm Exp $
.\" $OpenBSD: ssh-keyscan.1,v 1.30 2012/04/11 13:34:17 djm Exp $
.\"
.\" Copyright 1995, 1996 by David Mazieres <[email protected]>.
.\"
@@ -6,7 +6,7 @@
.\" permitted provided that due credit is given to the author and the
.\" OpenBSD project by leaving this copyright notice intact.
.\"
.Dd $Mdocdate: August 31 2010 $
.Dd $Mdocdate: April 11 2012 $
.Dt SSH-KEYSCAN 1
.Os
.Sh NAME
@@ -94,8 +94,11 @@ or
.Dq rsa
for protocol version 2.
Multiple values may be specified by separating them with commas.
The default is
.Dq rsa .
The default is to fetch
.Dq rsa
and
.Dq ecdsa
keys.
.It Fl v
Verbose mode.
Causes
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keyscan.c,v 1.85 2011/03/15 10:36:02 okan Exp $ */
/* $OpenBSD: ssh-keyscan.c,v 1.86 2012/04/11 13:34:17 djm Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
@@ -57,7 +57,7 @@ int ssh_port = SSH_DEFAULT_PORT;
#define KT_RSA 4
#define KT_ECDSA 8
int get_keytypes = KT_RSA; /* Get only RSA keys by default */
int get_keytypes = KT_RSA|KT_ECDSA;/* Get RSA and ECDSA keys by default */
int hash_hosts = 0; /* Hash hostname on output */
+3 -3
View File
@@ -33,8 +33,8 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: ssh.1,v 1.323 2011/09/11 06:59:05 okan Exp $
.Dd $Mdocdate: September 11 2011 $
.\" $OpenBSD: ssh.1,v 1.324 2012/04/20 16:26:22 jmc Exp $
.Dd $Mdocdate: April 20 2012 $
.Dt SSH 1
.Os
.Sh NAME
@@ -506,7 +506,7 @@ from the local machine.
Port forwardings can also be specified in the configuration file.
Privileged ports can be forwarded only when
logging in as root on the remote machine.
IPv6 addresses can be specified by enclosing the address in square braces.
IPv6 addresses can be specified by enclosing the address in square brackets.
.Pp
By default, the listening socket on the server will be bound to the loopback
interface only.
+10 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: sshd.c,v 1.388 2011/09/30 21:22:49 djm Exp $ */
/* $OpenBSD: sshd.c,v 1.390 2012/04/12 02:42:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -419,9 +419,11 @@ sshd_exchange_identification(int sock_in, int sock_out)
major = PROTOCOL_MAJOR_1;
minor = PROTOCOL_MINOR_1;
}
snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
SSH_VERSION, newline);
server_version_string = xstrdup(buf);
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
major, minor, SSH_VERSION,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, newline);
/* Send our protocol version identification. */
if (roaming_atomicio(vwrite, sock_out, server_version_string,
@@ -1174,7 +1176,10 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
if (*newsock < 0) {
if (errno != EINTR && errno != EAGAIN &&
errno != EWOULDBLOCK)
error("accept: %.100s", strerror(errno));
error("accept: %.100s",
strerror(errno));
if (errno == EMFILE || errno == ENFILE)
usleep(100 * 1000);
continue;
}
if (unset_nonblock(*newsock) == -1) {
+4 -1
View File
@@ -1,4 +1,4 @@
# $OpenBSD: sshd_config,v 1.84 2011/05/23 03:30:07 djm Exp $
# $OpenBSD: sshd_config,v 1.86 2012/04/12 02:43:55 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
@@ -49,6 +49,8 @@
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
@@ -107,6 +109,7 @@ AuthorizedKeysFile .ssh/authorized_keys
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
+10 -3
View File
@@ -33,8 +33,8 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: sshd_config.5,v 1.136 2011/09/09 00:43:00 djm Exp $
.Dd $Mdocdate: September 9 2011 $
.\" $OpenBSD: sshd_config.5,v 1.138 2012/04/12 02:43:55 djm Exp $
.Dd $Mdocdate: April 12 2012 $
.Dt SSHD_CONFIG 5
.Os
.Sh NAME
@@ -198,7 +198,9 @@ After expansion,
is taken to be an absolute path or one relative to the user's home
directory.
.Pp
The default is not to use a principals file \(en in this case, the username
The default is
.Dq none ,
i.e. not to use a principals file \(en in this case, the username
of the user must appear in a certificate's principals list for it to be
accepted.
Note that
@@ -1079,6 +1081,11 @@ is set to
.Dq sandbox
then the pre-authentication unprivileged process is subject to additional
restrictions.
.It Cm VersionAddendum
Optionally specifies additional text to append to the SSH protocol banner
sent by the server upon connection.
The default is
.Dq none .
.It Cm X11DisplayOffset
Specifies the first display number available for
.Xr sshd 8 Ns 's