diff options
156 files changed, 16269 insertions, 139 deletions
diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 000000000..0f130a704 --- /dev/null +++ b/.bzrignore | |||
@@ -0,0 +1,51 @@ | |||
1 | ./.pc | ||
2 | ./*.out | ||
3 | ./Makefile | ||
4 | ./autom4te.cache | ||
5 | ./build-deb | ||
6 | ./build-deb-stamp | ||
7 | ./build-udeb | ||
8 | ./build-udeb-stamp | ||
9 | ./buildit.sh | ||
10 | ./buildpkg.sh | ||
11 | ./config.cache | ||
12 | ./config.h | ||
13 | ./config.log | ||
14 | ./config.status | ||
15 | ./openssh.xml | ||
16 | ./opensshd.init | ||
17 | ./scp | ||
18 | ./sftp | ||
19 | ./sftp-server | ||
20 | ./ssh | ||
21 | ./ssh-add | ||
22 | ./ssh-agent | ||
23 | ./ssh-keygen | ||
24 | ./ssh-keyscan | ||
25 | ./ssh-keysign | ||
26 | ./ssh-rand-helper | ||
27 | ./ssh_prng_cmds | ||
28 | ./sshd | ||
29 | ./stamp-h.in | ||
30 | ./survey | ||
31 | ./survey.sh | ||
32 | contrib/gnome-ssh-askpass1 | ||
33 | contrib/gnome-ssh-askpass2 | ||
34 | openbsd-compat/Makefile | ||
35 | scard/Makefile | ||
36 | debian/*.debhelper* | ||
37 | debian/*substvars | ||
38 | debian/copyright | ||
39 | debian/files | ||
40 | debian/openssh-client | ||
41 | debian/openssh-client-udeb | ||
42 | debian/openssh-server | ||
43 | debian/openssh-server-udeb | ||
44 | debian/ssh | ||
45 | debian/ssh-askpass-gnome | ||
46 | debian/ssh-krb5 | ||
47 | debian/tests/key1 | ||
48 | debian/tests/key1.pub | ||
49 | debian/tests/key2 | ||
50 | debian/tests/key2.pub | ||
51 | debian/tmp | ||
diff --git a/Makefile.in b/Makefile.in index f9799268a..839abbd48 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -26,6 +26,7 @@ ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass | |||
26 | SFTP_SERVER=$(libexecdir)/sftp-server | 26 | SFTP_SERVER=$(libexecdir)/sftp-server |
27 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign | 27 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign |
28 | SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper | 28 | SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper |
29 | SSH_DATADIR=$(datadir)/ssh | ||
29 | PRIVSEP_PATH=@PRIVSEP_PATH@ | 30 | PRIVSEP_PATH=@PRIVSEP_PATH@ |
30 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ | 31 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ |
31 | STRIP_OPT=@STRIP_OPT@ | 32 | STRIP_OPT=@STRIP_OPT@ |
@@ -37,7 +38,8 @@ PATHS= -DSSHDIR=\"$(sysconfdir)\" \ | |||
37 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ | 38 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ |
38 | -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \ | 39 | -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \ |
39 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ | 40 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ |
40 | -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" | 41 | -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ |
42 | -D_PATH_SSH_DATADIR=\"$(SSH_DATADIR)\" | ||
41 | 43 | ||
42 | CC=@CC@ | 44 | CC=@CC@ |
43 | LD=@LD@ | 45 | LD=@LD@ |
@@ -61,7 +63,7 @@ LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ | |||
61 | EXEEXT=@EXEEXT@ | 63 | EXEEXT=@EXEEXT@ |
62 | MANFMT=@MANFMT@ | 64 | MANFMT=@MANFMT@ |
63 | 65 | ||
64 | TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) | 66 | TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) ssh-vulnkey$(EXEEXT) |
65 | 67 | ||
66 | LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \ | 68 | LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \ |
67 | canohost.o channels.o cipher.o cipher-aes.o \ | 69 | canohost.o channels.o cipher.o cipher-aes.o \ |
@@ -94,10 +96,11 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ | |||
94 | sftp-server.o sftp-common.o \ | 96 | sftp-server.o sftp-common.o \ |
95 | roaming_common.o roaming_serv.o \ | 97 | roaming_common.o roaming_serv.o \ |
96 | sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ | 98 | sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ |
97 | sandbox-seccomp-filter.o | 99 | sandbox-seccomp-filter.o \ |
100 | consolekit.o | ||
98 | 101 | ||
99 | MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out | 102 | MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out ssh-vulnkey.1.out sshd_config.5.out ssh_config.5.out |
100 | MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 | 103 | MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 ssh-vulnkey.1 sshd_config.5 ssh_config.5 |
101 | MANTYPE = @MANTYPE@ | 104 | MANTYPE = @MANTYPE@ |
102 | 105 | ||
103 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out | 106 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out |
@@ -176,6 +179,9 @@ sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o s | |||
176 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o | 179 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o |
177 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) | 180 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) |
178 | 181 | ||
182 | ssh-vulnkey$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-vulnkey.o | ||
183 | $(LD) -o $@ ssh-vulnkey.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | ||
184 | |||
179 | # test driver for the loginrec code - not built by default | 185 | # test driver for the loginrec code - not built by default |
180 | logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o | 186 | logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o |
181 | $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) | 187 | $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) |
@@ -272,6 +278,7 @@ install-files: | |||
272 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) | 278 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) |
273 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) | 279 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) |
274 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | 280 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) |
281 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-vulnkey$(EXEEXT) $(DESTDIR)$(bindir)/ssh-vulnkey$(EXEEXT) | ||
275 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | 282 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
276 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | 283 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
277 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | 284 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
@@ -282,14 +289,16 @@ install-files: | |||
282 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 | 289 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 |
283 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 | 290 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 |
284 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | 291 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
292 | ln -s ../$(mansubdir)8/sshd.8 $(DESTDIR)$(mandir)/$(mansubdir)5/authorized_keys.5 | ||
285 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | 293 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 |
286 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | 294 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 |
287 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | 295 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
288 | $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 | 296 | $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 |
297 | $(INSTALL) -m 644 ssh-vulnkey.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-vulnkey.1 | ||
289 | -rm -f $(DESTDIR)$(bindir)/slogin | 298 | -rm -f $(DESTDIR)$(bindir)/slogin |
290 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin | 299 | ln -s ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin |
291 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | 300 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
292 | ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | 301 | ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
293 | 302 | ||
294 | install-sysconf: | 303 | install-sysconf: |
295 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ | 304 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ |
@@ -367,6 +376,7 @@ uninstall: | |||
367 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) | 376 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) |
368 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) | 377 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) |
369 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) | 378 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) |
379 | -rm -f $(DESTDIR)$(bindir)/ssh-vulnkey$(EXEEXT) | ||
370 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) | 380 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) |
371 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) | 381 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) |
372 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | 382 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) |
@@ -379,6 +389,7 @@ uninstall: | |||
379 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | 389 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
380 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | 390 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 |
381 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | 391 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 |
392 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-vulnkey.1 | ||
382 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | 393 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
383 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | 394 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 |
384 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | 395 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
diff --git a/auth-options.c b/auth-options.c index 80d59ee95..73e330bf5 100644 --- a/auth-options.c +++ b/auth-options.c | |||
@@ -58,9 +58,20 @@ int forced_tun_device = -1; | |||
58 | /* "principals=" option. */ | 58 | /* "principals=" option. */ |
59 | char *authorized_principals = NULL; | 59 | char *authorized_principals = NULL; |
60 | 60 | ||
61 | /* Throttle log messages. */ | ||
62 | int logged_from_hostip = 0; | ||
63 | int logged_cert_hostip = 0; | ||
64 | |||
61 | extern ServerOptions options; | 65 | extern ServerOptions options; |
62 | 66 | ||
63 | void | 67 | void |
68 | auth_start_parse_options(void) | ||
69 | { | ||
70 | logged_from_hostip = 0; | ||
71 | logged_cert_hostip = 0; | ||
72 | } | ||
73 | |||
74 | void | ||
64 | auth_clear_options(void) | 75 | auth_clear_options(void) |
65 | { | 76 | { |
66 | no_agent_forwarding_flag = 0; | 77 | no_agent_forwarding_flag = 0; |
@@ -288,10 +299,13 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) | |||
288 | /* FALLTHROUGH */ | 299 | /* FALLTHROUGH */ |
289 | case 0: | 300 | case 0: |
290 | free(patterns); | 301 | free(patterns); |
291 | logit("Authentication tried for %.100s with " | 302 | if (!logged_from_hostip) { |
292 | "correct key but not from a permitted " | 303 | logit("Authentication tried for %.100s with " |
293 | "host (host=%.200s, ip=%.200s).", | 304 | "correct key but not from a permitted " |
294 | pw->pw_name, remote_host, remote_ip); | 305 | "host (host=%.200s, ip=%.200s).", |
306 | pw->pw_name, remote_host, remote_ip); | ||
307 | logged_from_hostip = 1; | ||
308 | } | ||
295 | auth_debug_add("Your host '%.200s' is not " | 309 | auth_debug_add("Your host '%.200s' is not " |
296 | "permitted to use this key for login.", | 310 | "permitted to use this key for login.", |
297 | remote_host); | 311 | remote_host); |
@@ -513,11 +527,14 @@ parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw, | |||
513 | break; | 527 | break; |
514 | case 0: | 528 | case 0: |
515 | /* no match */ | 529 | /* no match */ |
516 | logit("Authentication tried for %.100s " | 530 | if (!logged_cert_hostip) { |
517 | "with valid certificate but not " | 531 | logit("Authentication tried for %.100s " |
518 | "from a permitted host " | 532 | "with valid certificate but not " |
519 | "(ip=%.200s).", pw->pw_name, | 533 | "from a permitted host " |
520 | remote_ip); | 534 | "(ip=%.200s).", pw->pw_name, |
535 | remote_ip); | ||
536 | logged_cert_hostip = 1; | ||
537 | } | ||
521 | auth_debug_add("Your address '%.200s' " | 538 | auth_debug_add("Your address '%.200s' " |
522 | "is not permitted to use this " | 539 | "is not permitted to use this " |
523 | "certificate for login.", | 540 | "certificate for login.", |
diff --git a/auth-options.h b/auth-options.h index 7455c9454..a3f0a02da 100644 --- a/auth-options.h +++ b/auth-options.h | |||
@@ -33,6 +33,7 @@ extern int forced_tun_device; | |||
33 | extern int key_is_cert_authority; | 33 | extern int key_is_cert_authority; |
34 | extern char *authorized_principals; | 34 | extern char *authorized_principals; |
35 | 35 | ||
36 | void auth_start_parse_options(void); | ||
36 | int auth_parse_options(struct passwd *, char *, char *, u_long); | 37 | int auth_parse_options(struct passwd *, char *, char *, u_long); |
37 | void auth_clear_options(void); | 38 | void auth_clear_options(void); |
38 | int auth_cert_options(Key *, struct passwd *); | 39 | int auth_cert_options(Key *, struct passwd *); |
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c index b21a0f4a2..891ec3297 100644 --- a/auth-rh-rsa.c +++ b/auth-rh-rsa.c | |||
@@ -44,7 +44,7 @@ auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost, | |||
44 | { | 44 | { |
45 | HostStatus host_status; | 45 | HostStatus host_status; |
46 | 46 | ||
47 | if (auth_key_is_revoked(client_host_key)) | 47 | if (auth_key_is_revoked(client_host_key, 0)) |
48 | return 0; | 48 | return 0; |
49 | 49 | ||
50 | /* Check if we would accept it using rhosts authentication. */ | 50 | /* Check if we would accept it using rhosts authentication. */ |
diff --git a/auth-rhosts.c b/auth-rhosts.c index 06ae7f0b9..f20278797 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c | |||
@@ -256,8 +256,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | if (options.strict_modes && | 258 | if (options.strict_modes && |
259 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 259 | !secure_permissions(&st, pw->pw_uid)) { |
260 | (st.st_mode & 022) != 0)) { | ||
261 | logit("Rhosts authentication refused for %.100s: " | 260 | logit("Rhosts authentication refused for %.100s: " |
262 | "bad ownership or modes for home directory.", pw->pw_name); | 261 | "bad ownership or modes for home directory.", pw->pw_name); |
263 | auth_debug_add("Rhosts authentication refused for %.100s: " | 262 | auth_debug_add("Rhosts authentication refused for %.100s: " |
@@ -283,8 +282,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
283 | * allowing access to their account by anyone. | 282 | * allowing access to their account by anyone. |
284 | */ | 283 | */ |
285 | if (options.strict_modes && | 284 | if (options.strict_modes && |
286 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 285 | !secure_permissions(&st, pw->pw_uid)) { |
287 | (st.st_mode & 022) != 0)) { | ||
288 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", | 286 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", |
289 | pw->pw_name, buf); | 287 | pw->pw_name, buf); |
290 | auth_debug_add("Bad file modes for %.200s", buf); | 288 | auth_debug_add("Bad file modes for %.200s", buf); |
diff --git a/auth-rsa.c b/auth-rsa.c index 545aa496a..9b139c928 100644 --- a/auth-rsa.c +++ b/auth-rsa.c | |||
@@ -174,6 +174,8 @@ rsa_key_allowed_in_file(struct passwd *pw, char *file, | |||
174 | if ((f = auth_openkeyfile(file, pw, options.strict_modes)) == NULL) | 174 | if ((f = auth_openkeyfile(file, pw, options.strict_modes)) == NULL) |
175 | return 0; | 175 | return 0; |
176 | 176 | ||
177 | auth_start_parse_options(); | ||
178 | |||
177 | /* | 179 | /* |
178 | * Go though the accepted keys, looking for the current key. If | 180 | * Go though the accepted keys, looking for the current key. If |
179 | * found, perform a challenge-response dialog to verify that the | 181 | * found, perform a challenge-response dialog to verify that the |
@@ -237,7 +239,7 @@ rsa_key_allowed_in_file(struct passwd *pw, char *file, | |||
237 | free(fp); | 239 | free(fp); |
238 | 240 | ||
239 | /* Never accept a revoked key */ | 241 | /* Never accept a revoked key */ |
240 | if (auth_key_is_revoked(key)) | 242 | if (auth_key_is_revoked(key, 0)) |
241 | break; | 243 | break; |
242 | 244 | ||
243 | /* We have found the desired key. */ | 245 | /* We have found the desired key. */ |
@@ -59,6 +59,7 @@ | |||
59 | #include "servconf.h" | 59 | #include "servconf.h" |
60 | #include "key.h" | 60 | #include "key.h" |
61 | #include "hostfile.h" | 61 | #include "hostfile.h" |
62 | #include "authfile.h" | ||
62 | #include "auth.h" | 63 | #include "auth.h" |
63 | #include "auth-options.h" | 64 | #include "auth-options.h" |
64 | #include "canohost.h" | 65 | #include "canohost.h" |
@@ -407,8 +408,7 @@ check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host, | |||
407 | user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); | 408 | user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); |
408 | if (options.strict_modes && | 409 | if (options.strict_modes && |
409 | (stat(user_hostfile, &st) == 0) && | 410 | (stat(user_hostfile, &st) == 0) && |
410 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 411 | !secure_permissions(&st, pw->pw_uid)) { |
411 | (st.st_mode & 022) != 0)) { | ||
412 | logit("Authentication refused for %.100s: " | 412 | logit("Authentication refused for %.100s: " |
413 | "bad owner or modes for %.200s", | 413 | "bad owner or modes for %.200s", |
414 | pw->pw_name, user_hostfile); | 414 | pw->pw_name, user_hostfile); |
@@ -470,8 +470,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir, | |||
470 | snprintf(err, errlen, "%s is not a regular file", buf); | 470 | snprintf(err, errlen, "%s is not a regular file", buf); |
471 | return -1; | 471 | return -1; |
472 | } | 472 | } |
473 | if ((!platform_sys_dir_uid(stp->st_uid) && stp->st_uid != uid) || | 473 | if (!secure_permissions(stp, uid)) { |
474 | (stp->st_mode & 022) != 0) { | ||
475 | snprintf(err, errlen, "bad ownership or modes for file %s", | 474 | snprintf(err, errlen, "bad ownership or modes for file %s", |
476 | buf); | 475 | buf); |
477 | return -1; | 476 | return -1; |
@@ -486,8 +485,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir, | |||
486 | strlcpy(buf, cp, sizeof(buf)); | 485 | strlcpy(buf, cp, sizeof(buf)); |
487 | 486 | ||
488 | if (stat(buf, &st) < 0 || | 487 | if (stat(buf, &st) < 0 || |
489 | (!platform_sys_dir_uid(st.st_uid) && st.st_uid != uid) || | 488 | !secure_permissions(&st, uid)) { |
490 | (st.st_mode & 022) != 0) { | ||
491 | snprintf(err, errlen, | 489 | snprintf(err, errlen, |
492 | "bad ownership or modes for directory %s", buf); | 490 | "bad ownership or modes for directory %s", buf); |
493 | return -1; | 491 | return -1; |
@@ -657,10 +655,34 @@ getpwnamallow(const char *user) | |||
657 | 655 | ||
658 | /* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ | 656 | /* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ |
659 | int | 657 | int |
660 | auth_key_is_revoked(Key *key) | 658 | auth_key_is_revoked(Key *key, int hostkey) |
661 | { | 659 | { |
662 | char *key_fp; | 660 | char *key_fp; |
663 | 661 | ||
662 | if (blacklisted_key(key, &key_fp) == 1) { | ||
663 | if (options.permit_blacklisted_keys) { | ||
664 | if (hostkey) | ||
665 | error("Host key %s blacklisted (see " | ||
666 | "ssh-vulnkey(1)); continuing anyway", | ||
667 | key_fp); | ||
668 | else | ||
669 | logit("Public key %s from %s blacklisted (see " | ||
670 | "ssh-vulnkey(1)); continuing anyway", | ||
671 | key_fp, get_remote_ipaddr()); | ||
672 | free(key_fp); | ||
673 | } else { | ||
674 | if (hostkey) | ||
675 | error("Host key %s blacklisted (see " | ||
676 | "ssh-vulnkey(1))", key_fp); | ||
677 | else | ||
678 | logit("Public key %s from %s blacklisted (see " | ||
679 | "ssh-vulnkey(1))", | ||
680 | key_fp, get_remote_ipaddr()); | ||
681 | free(key_fp); | ||
682 | return 1; | ||
683 | } | ||
684 | } | ||
685 | |||
664 | if (options.revoked_keys_file == NULL) | 686 | if (options.revoked_keys_file == NULL) |
665 | return 0; | 687 | return 0; |
666 | switch (ssh_krl_file_contains_key(options.revoked_keys_file, key)) { | 688 | switch (ssh_krl_file_contains_key(options.revoked_keys_file, key)) { |
@@ -59,6 +59,7 @@ struct Authctxt { | |||
59 | char *service; | 59 | char *service; |
60 | struct passwd *pw; /* set if 'valid' */ | 60 | struct passwd *pw; /* set if 'valid' */ |
61 | char *style; | 61 | char *style; |
62 | char *role; | ||
62 | void *kbdintctxt; | 63 | void *kbdintctxt; |
63 | char *info; /* Extra info for next auth_log */ | 64 | char *info; /* Extra info for next auth_log */ |
64 | void *jpake_ctx; | 65 | void *jpake_ctx; |
@@ -190,7 +191,7 @@ char *authorized_principals_file(struct passwd *); | |||
190 | 191 | ||
191 | FILE *auth_openkeyfile(const char *, struct passwd *, int); | 192 | FILE *auth_openkeyfile(const char *, struct passwd *, int); |
192 | FILE *auth_openprincipals(const char *, struct passwd *, int); | 193 | FILE *auth_openprincipals(const char *, struct passwd *, int); |
193 | int auth_key_is_revoked(Key *); | 194 | int auth_key_is_revoked(Key *, int); |
194 | 195 | ||
195 | HostStatus | 196 | HostStatus |
196 | check_key_in_hostfiles(struct passwd *, Key *, const char *, | 197 | check_key_in_hostfiles(struct passwd *, Key *, const char *, |
@@ -380,7 +380,7 @@ void | |||
380 | do_authentication(Authctxt *authctxt) | 380 | do_authentication(Authctxt *authctxt) |
381 | { | 381 | { |
382 | u_int ulen; | 382 | u_int ulen; |
383 | char *user, *style = NULL; | 383 | char *user, *style = NULL, *role = NULL; |
384 | 384 | ||
385 | /* Get the name of the user that we wish to log in as. */ | 385 | /* Get the name of the user that we wish to log in as. */ |
386 | packet_read_expect(SSH_CMSG_USER); | 386 | packet_read_expect(SSH_CMSG_USER); |
@@ -389,11 +389,17 @@ do_authentication(Authctxt *authctxt) | |||
389 | user = packet_get_cstring(&ulen); | 389 | user = packet_get_cstring(&ulen); |
390 | packet_check_eom(); | 390 | packet_check_eom(); |
391 | 391 | ||
392 | if ((role = strchr(user, '/')) != NULL) | ||
393 | *role++ = '\0'; | ||
394 | |||
392 | if ((style = strchr(user, ':')) != NULL) | 395 | if ((style = strchr(user, ':')) != NULL) |
393 | *style++ = '\0'; | 396 | *style++ = '\0'; |
397 | else if (role && (style = strchr(role, ':')) != NULL) | ||
398 | *style++ = '\0'; | ||
394 | 399 | ||
395 | authctxt->user = user; | 400 | authctxt->user = user; |
396 | authctxt->style = style; | 401 | authctxt->style = style; |
402 | authctxt->role = role; | ||
397 | 403 | ||
398 | /* Verify that the user is a valid user. */ | 404 | /* Verify that the user is a valid user. */ |
399 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) | 405 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) |
diff --git a/auth2-hostbased.c b/auth2-hostbased.c index a344dcc1f..3a17f1bf2 100644 --- a/auth2-hostbased.c +++ b/auth2-hostbased.c | |||
@@ -150,7 +150,7 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, | |||
150 | int len; | 150 | int len; |
151 | char *fp; | 151 | char *fp; |
152 | 152 | ||
153 | if (auth_key_is_revoked(key)) | 153 | if (auth_key_is_revoked(key, 0)) |
154 | return 0; | 154 | return 0; |
155 | 155 | ||
156 | resolvedname = get_canonical_hostname(options.use_dns); | 156 | resolvedname = get_canonical_hostname(options.use_dns); |
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index 2b3ecb104..7c0ceee55 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -257,6 +257,7 @@ match_principals_file(char *file, struct passwd *pw, struct KeyCert *cert) | |||
257 | restore_uid(); | 257 | restore_uid(); |
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | auth_start_parse_options(); | ||
260 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { | 261 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { |
261 | /* Skip leading whitespace. */ | 262 | /* Skip leading whitespace. */ |
262 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | 263 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) |
@@ -318,6 +319,7 @@ check_authkeys_file(FILE *f, char *file, Key* key, struct passwd *pw) | |||
318 | found_key = 0; | 319 | found_key = 0; |
319 | 320 | ||
320 | found = NULL; | 321 | found = NULL; |
322 | auth_start_parse_options(); | ||
321 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { | 323 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { |
322 | char *cp, *key_options = NULL; | 324 | char *cp, *key_options = NULL; |
323 | if (found != NULL) | 325 | if (found != NULL) |
@@ -453,6 +455,7 @@ user_cert_trusted_ca(struct passwd *pw, Key *key) | |||
453 | if (key_cert_check_authority(key, 0, 1, | 455 | if (key_cert_check_authority(key, 0, 1, |
454 | principals_file == NULL ? pw->pw_name : NULL, &reason) != 0) | 456 | principals_file == NULL ? pw->pw_name : NULL, &reason) != 0) |
455 | goto fail_reason; | 457 | goto fail_reason; |
458 | auth_start_parse_options(); | ||
456 | if (auth_cert_options(key, pw) != 0) | 459 | if (auth_cert_options(key, pw) != 0) |
457 | goto out; | 460 | goto out; |
458 | 461 | ||
@@ -647,9 +650,10 @@ user_key_allowed(struct passwd *pw, Key *key) | |||
647 | u_int success, i; | 650 | u_int success, i; |
648 | char *file; | 651 | char *file; |
649 | 652 | ||
650 | if (auth_key_is_revoked(key)) | 653 | if (auth_key_is_revoked(key, 0)) |
651 | return 0; | 654 | return 0; |
652 | if (key_is_cert(key) && auth_key_is_revoked(key->cert->signature_key)) | 655 | if (key_is_cert(key) && |
656 | auth_key_is_revoked(key->cert->signature_key, 0)) | ||
653 | return 0; | 657 | return 0; |
654 | 658 | ||
655 | success = user_cert_trusted_ca(pw, key); | 659 | success = user_cert_trusted_ca(pw, key); |
@@ -222,7 +222,7 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
222 | { | 222 | { |
223 | Authctxt *authctxt = ctxt; | 223 | Authctxt *authctxt = ctxt; |
224 | Authmethod *m = NULL; | 224 | Authmethod *m = NULL; |
225 | char *user, *service, *method, *style = NULL; | 225 | char *user, *service, *method, *style = NULL, *role = NULL; |
226 | int authenticated = 0; | 226 | int authenticated = 0; |
227 | 227 | ||
228 | if (authctxt == NULL) | 228 | if (authctxt == NULL) |
@@ -234,8 +234,13 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
234 | debug("userauth-request for user %s service %s method %s", user, service, method); | 234 | debug("userauth-request for user %s service %s method %s", user, service, method); |
235 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); | 235 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); |
236 | 236 | ||
237 | if ((role = strchr(user, '/')) != NULL) | ||
238 | *role++ = 0; | ||
239 | |||
237 | if ((style = strchr(user, ':')) != NULL) | 240 | if ((style = strchr(user, ':')) != NULL) |
238 | *style++ = 0; | 241 | *style++ = 0; |
242 | else if (role && (style = strchr(role, ':')) != NULL) | ||
243 | *style++ = '\0'; | ||
239 | 244 | ||
240 | if (authctxt->attempt++ == 0) { | 245 | if (authctxt->attempt++ == 0) { |
241 | /* setup auth context */ | 246 | /* setup auth context */ |
@@ -259,8 +264,9 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt) | |||
259 | use_privsep ? " [net]" : ""); | 264 | use_privsep ? " [net]" : ""); |
260 | authctxt->service = xstrdup(service); | 265 | authctxt->service = xstrdup(service); |
261 | authctxt->style = style ? xstrdup(style) : NULL; | 266 | authctxt->style = style ? xstrdup(style) : NULL; |
267 | authctxt->role = role ? xstrdup(role) : NULL; | ||
262 | if (use_privsep) | 268 | if (use_privsep) |
263 | mm_inform_authserv(service, style); | 269 | mm_inform_authserv(service, style, role); |
264 | userauth_banner(); | 270 | userauth_banner(); |
265 | if (auth2_setup_methods_lists(authctxt) != 0) | 271 | if (auth2_setup_methods_lists(authctxt) != 0) |
266 | packet_disconnect("no authentication methods enabled"); | 272 | packet_disconnect("no authentication methods enabled"); |
diff --git a/authfile.c b/authfile.c index 63ae16bbd..cb95cfcb8 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #include "rsa.h" | 68 | #include "rsa.h" |
69 | #include "misc.h" | 69 | #include "misc.h" |
70 | #include "atomicio.h" | 70 | #include "atomicio.h" |
71 | #include "pathnames.h" | ||
71 | 72 | ||
72 | #define MAX_KEY_FILE_SIZE (1024 * 1024) | 73 | #define MAX_KEY_FILE_SIZE (1024 * 1024) |
73 | 74 | ||
@@ -944,3 +945,139 @@ key_in_file(Key *key, const char *filename, int strict_type) | |||
944 | return ret; | 945 | return ret; |
945 | } | 946 | } |
946 | 947 | ||
948 | /* Scan a blacklist of known-vulnerable keys in blacklist_file. */ | ||
949 | static int | ||
950 | blacklisted_key_in_file(Key *key, const char *blacklist_file, char **fp) | ||
951 | { | ||
952 | int fd = -1; | ||
953 | char *dgst_hex = NULL; | ||
954 | char *dgst_packed = NULL, *p; | ||
955 | int i; | ||
956 | size_t line_len; | ||
957 | struct stat st; | ||
958 | char buf[256]; | ||
959 | off_t start, lower, upper; | ||
960 | int ret = 0; | ||
961 | |||
962 | debug("Checking blacklist file %s", blacklist_file); | ||
963 | fd = open(blacklist_file, O_RDONLY); | ||
964 | if (fd < 0) { | ||
965 | ret = -1; | ||
966 | goto out; | ||
967 | } | ||
968 | |||
969 | dgst_hex = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); | ||
970 | /* Remove all colons */ | ||
971 | dgst_packed = xcalloc(1, strlen(dgst_hex) + 1); | ||
972 | for (i = 0, p = dgst_packed; dgst_hex[i]; i++) | ||
973 | if (dgst_hex[i] != ':') | ||
974 | *p++ = dgst_hex[i]; | ||
975 | /* Only compare least-significant 80 bits (to keep the blacklist | ||
976 | * size down) | ||
977 | */ | ||
978 | line_len = strlen(dgst_packed + 12); | ||
979 | if (line_len > 32) | ||
980 | goto out; | ||
981 | |||
982 | /* Skip leading comments */ | ||
983 | start = 0; | ||
984 | for (;;) { | ||
985 | ssize_t r; | ||
986 | char *newline; | ||
987 | |||
988 | r = atomicio(read, fd, buf, sizeof(buf)); | ||
989 | if (r <= 0) | ||
990 | goto out; | ||
991 | if (buf[0] != '#') | ||
992 | break; | ||
993 | |||
994 | newline = memchr(buf, '\n', sizeof(buf)); | ||
995 | if (!newline) | ||
996 | goto out; | ||
997 | start += newline + 1 - buf; | ||
998 | if (lseek(fd, start, SEEK_SET) < 0) | ||
999 | goto out; | ||
1000 | } | ||
1001 | |||
1002 | /* Initialise binary search record numbers */ | ||
1003 | if (fstat(fd, &st) < 0) | ||
1004 | goto out; | ||
1005 | lower = 0; | ||
1006 | upper = (st.st_size - start) / (line_len + 1); | ||
1007 | |||
1008 | while (lower != upper) { | ||
1009 | off_t cur; | ||
1010 | int cmp; | ||
1011 | |||
1012 | cur = lower + (upper - lower) / 2; | ||
1013 | |||
1014 | /* Read this line and compare to digest; this is | ||
1015 | * overflow-safe since cur < max(off_t) / (line_len + 1) */ | ||
1016 | if (lseek(fd, start + cur * (line_len + 1), SEEK_SET) < 0) | ||
1017 | break; | ||
1018 | if (atomicio(read, fd, buf, line_len) != line_len) | ||
1019 | break; | ||
1020 | cmp = memcmp(buf, dgst_packed + 12, line_len); | ||
1021 | if (cmp < 0) { | ||
1022 | if (cur == lower) | ||
1023 | break; | ||
1024 | lower = cur; | ||
1025 | } else if (cmp > 0) { | ||
1026 | if (cur == upper) | ||
1027 | break; | ||
1028 | upper = cur; | ||
1029 | } else { | ||
1030 | debug("Found %s in blacklist", dgst_hex); | ||
1031 | ret = 1; | ||
1032 | break; | ||
1033 | } | ||
1034 | } | ||
1035 | |||
1036 | out: | ||
1037 | free(dgst_packed); | ||
1038 | if (ret != 1 && dgst_hex) { | ||
1039 | free(dgst_hex); | ||
1040 | dgst_hex = NULL; | ||
1041 | } | ||
1042 | if (fp) | ||
1043 | *fp = dgst_hex; | ||
1044 | if (fd >= 0) | ||
1045 | close(fd); | ||
1046 | return ret; | ||
1047 | } | ||
1048 | |||
1049 | /* | ||
1050 | * Scan blacklists of known-vulnerable keys. If a vulnerable key is found, | ||
1051 | * its fingerprint is returned in *fp, unless fp is NULL. | ||
1052 | */ | ||
1053 | int | ||
1054 | blacklisted_key(Key *key, char **fp) | ||
1055 | { | ||
1056 | Key *public; | ||
1057 | char *blacklist_file; | ||
1058 | int ret, ret2; | ||
1059 | |||
1060 | public = key_demote(key); | ||
1061 | if (public->type == KEY_RSA1) | ||
1062 | public->type = KEY_RSA; | ||
1063 | |||
1064 | xasprintf(&blacklist_file, "%s.%s-%u", | ||
1065 | _PATH_BLACKLIST, key_type(public), key_size(public)); | ||
1066 | ret = blacklisted_key_in_file(public, blacklist_file, fp); | ||
1067 | free(blacklist_file); | ||
1068 | if (ret > 0) { | ||
1069 | key_free(public); | ||
1070 | return ret; | ||
1071 | } | ||
1072 | |||
1073 | xasprintf(&blacklist_file, "%s.%s-%u", | ||
1074 | _PATH_BLACKLIST_CONFIG, key_type(public), key_size(public)); | ||
1075 | ret2 = blacklisted_key_in_file(public, blacklist_file, fp); | ||
1076 | free(blacklist_file); | ||
1077 | if (ret2 > ret) | ||
1078 | ret = ret2; | ||
1079 | |||
1080 | key_free(public); | ||
1081 | return ret; | ||
1082 | } | ||
1083 | |||
diff --git a/authfile.h b/authfile.h index 78349beb5..3f2bdcb06 100644 --- a/authfile.h +++ b/authfile.h | |||
@@ -28,4 +28,6 @@ Key *key_load_private_pem(int, int, const char *, char **); | |||
28 | int key_perm_ok(int, const char *); | 28 | int key_perm_ok(int, const char *); |
29 | int key_in_file(Key *, const char *, int); | 29 | int key_in_file(Key *, const char *, int); |
30 | 30 | ||
31 | int blacklisted_key(Key *key, char **fp); | ||
32 | |||
31 | #endif | 33 | #endif |
diff --git a/clientloop.c b/clientloop.c index 86695cc16..35550eb4d 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -563,16 +563,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
563 | static void | 563 | static void |
564 | server_alive_check(void) | 564 | server_alive_check(void) |
565 | { | 565 | { |
566 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | 566 | if (compat20) { |
567 | logit("Timeout, server %s not responding.", host); | 567 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { |
568 | cleanup_exit(255); | 568 | logit("Timeout, server %s not responding.", host); |
569 | cleanup_exit(255); | ||
570 | } | ||
571 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
572 | packet_put_cstring("keepalive@openssh.com"); | ||
573 | packet_put_char(1); /* boolean: want reply */ | ||
574 | packet_send(); | ||
575 | /* Insert an empty placeholder to maintain ordering */ | ||
576 | client_register_global_confirm(NULL, NULL); | ||
577 | } else { | ||
578 | packet_send_ignore(0); | ||
579 | packet_send(); | ||
569 | } | 580 | } |
570 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
571 | packet_put_cstring("keepalive@openssh.com"); | ||
572 | packet_put_char(1); /* boolean: want reply */ | ||
573 | packet_send(); | ||
574 | /* Insert an empty placeholder to maintain ordering */ | ||
575 | client_register_global_confirm(NULL, NULL); | ||
576 | } | 581 | } |
577 | 582 | ||
578 | /* | 583 | /* |
@@ -634,7 +639,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
634 | */ | 639 | */ |
635 | 640 | ||
636 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ | 641 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ |
637 | if (options.server_alive_interval > 0 && compat20) { | 642 | if (options.server_alive_interval > 0) { |
638 | timeout_secs = options.server_alive_interval; | 643 | timeout_secs = options.server_alive_interval; |
639 | server_alive_time = now + options.server_alive_interval; | 644 | server_alive_time = now + options.server_alive_interval; |
640 | } | 645 | } |
@@ -1712,8 +1717,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1712 | exit_status = 0; | 1717 | exit_status = 0; |
1713 | } | 1718 | } |
1714 | 1719 | ||
1715 | if (received_signal) | 1720 | if (received_signal) { |
1716 | fatal("Killed by signal %d.", (int) received_signal); | 1721 | debug("Killed by signal %d.", (int) received_signal); |
1722 | cleanup_exit((int) received_signal + 128); | ||
1723 | } | ||
1717 | 1724 | ||
1718 | /* | 1725 | /* |
1719 | * In interactive mode (with pseudo tty) display a message indicating | 1726 | * In interactive mode (with pseudo tty) display a message indicating |
@@ -738,6 +738,7 @@ with_privsep_user | |||
738 | with_sandbox | 738 | with_sandbox |
739 | with_selinux | 739 | with_selinux |
740 | with_kerberos5 | 740 | with_kerberos5 |
741 | with_consolekit | ||
741 | with_privsep_path | 742 | with_privsep_path |
742 | with_xauth | 743 | with_xauth |
743 | enable_strip | 744 | enable_strip |
@@ -1428,6 +1429,7 @@ Optional Packages: | |||
1428 | --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter) | 1429 | --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter) |
1429 | --with-selinux Enable SELinux support | 1430 | --with-selinux Enable SELinux support |
1430 | --with-kerberos5=PATH Enable Kerberos 5 support | 1431 | --with-kerberos5=PATH Enable Kerberos 5 support |
1432 | --with-consolekit Enable ConsoleKit support | ||
1431 | --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty) | 1433 | --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty) |
1432 | --with-xauth=PATH Specify path to xauth program | 1434 | --with-xauth=PATH Specify path to xauth program |
1433 | --with-maildir=/path/to/mail Specify your system mail directory | 1435 | --with-maildir=/path/to/mail Specify your system mail directory |
@@ -16375,6 +16377,135 @@ fi | |||
16375 | 16377 | ||
16376 | 16378 | ||
16377 | 16379 | ||
16380 | # Check whether user wants ConsoleKit support | ||
16381 | CONSOLEKIT_MSG="no" | ||
16382 | LIBCK_CONNECTOR="" | ||
16383 | |||
16384 | # Check whether --with-consolekit was given. | ||
16385 | if test "${with_consolekit+set}" = set; then : | ||
16386 | withval=$with_consolekit; if test "x$withval" != "xno" ; then | ||
16387 | if test -n "$ac_tool_prefix"; then | ||
16388 | # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. | ||
16389 | set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 | ||
16390 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
16391 | $as_echo_n "checking for $ac_word... " >&6; } | ||
16392 | if ${ac_cv_path_PKGCONFIG+:} false; then : | ||
16393 | $as_echo_n "(cached) " >&6 | ||
16394 | else | ||
16395 | case $PKGCONFIG in | ||
16396 | [\\/]* | ?:[\\/]*) | ||
16397 | ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. | ||
16398 | ;; | ||
16399 | *) | ||
16400 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
16401 | for as_dir in $PATH | ||
16402 | do | ||
16403 | IFS=$as_save_IFS | ||
16404 | test -z "$as_dir" && as_dir=. | ||
16405 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
16406 | if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then | ||
16407 | ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" | ||
16408 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
16409 | break 2 | ||
16410 | fi | ||
16411 | done | ||
16412 | done | ||
16413 | IFS=$as_save_IFS | ||
16414 | |||
16415 | ;; | ||
16416 | esac | ||
16417 | fi | ||
16418 | PKGCONFIG=$ac_cv_path_PKGCONFIG | ||
16419 | if test -n "$PKGCONFIG"; then | ||
16420 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 | ||
16421 | $as_echo "$PKGCONFIG" >&6; } | ||
16422 | else | ||
16423 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
16424 | $as_echo "no" >&6; } | ||
16425 | fi | ||
16426 | |||
16427 | |||
16428 | fi | ||
16429 | if test -z "$ac_cv_path_PKGCONFIG"; then | ||
16430 | ac_pt_PKGCONFIG=$PKGCONFIG | ||
16431 | # Extract the first word of "pkg-config", so it can be a program name with args. | ||
16432 | set dummy pkg-config; ac_word=$2 | ||
16433 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
16434 | $as_echo_n "checking for $ac_word... " >&6; } | ||
16435 | if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : | ||
16436 | $as_echo_n "(cached) " >&6 | ||
16437 | else | ||
16438 | case $ac_pt_PKGCONFIG in | ||
16439 | [\\/]* | ?:[\\/]*) | ||
16440 | ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. | ||
16441 | ;; | ||
16442 | *) | ||
16443 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
16444 | for as_dir in $PATH | ||
16445 | do | ||
16446 | IFS=$as_save_IFS | ||
16447 | test -z "$as_dir" && as_dir=. | ||
16448 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
16449 | if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then | ||
16450 | ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" | ||
16451 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
16452 | break 2 | ||
16453 | fi | ||
16454 | done | ||
16455 | done | ||
16456 | IFS=$as_save_IFS | ||
16457 | |||
16458 | ;; | ||
16459 | esac | ||
16460 | fi | ||
16461 | ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG | ||
16462 | if test -n "$ac_pt_PKGCONFIG"; then | ||
16463 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 | ||
16464 | $as_echo "$ac_pt_PKGCONFIG" >&6; } | ||
16465 | else | ||
16466 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
16467 | $as_echo "no" >&6; } | ||
16468 | fi | ||
16469 | |||
16470 | if test "x$ac_pt_PKGCONFIG" = x; then | ||
16471 | PKGCONFIG="no" | ||
16472 | else | ||
16473 | case $cross_compiling:$ac_tool_warned in | ||
16474 | yes:) | ||
16475 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | ||
16476 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | ||
16477 | ac_tool_warned=yes ;; | ||
16478 | esac | ||
16479 | PKGCONFIG=$ac_pt_PKGCONFIG | ||
16480 | fi | ||
16481 | else | ||
16482 | PKGCONFIG="$ac_cv_path_PKGCONFIG" | ||
16483 | fi | ||
16484 | |||
16485 | if test "$PKGCONFIG" != "no"; then | ||
16486 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ck-connector" >&5 | ||
16487 | $as_echo_n "checking for ck-connector... " >&6; } | ||
16488 | if $PKGCONFIG --exists ck-connector; then | ||
16489 | CKCON_CFLAGS=`$PKGCONFIG --cflags ck-connector` | ||
16490 | CKCON_LIBS=`$PKGCONFIG --libs ck-connector` | ||
16491 | CPPFLAGS="$CPPFLAGS $CKCON_CFLAGS" | ||
16492 | SSHDLIBS="$SSHDLIBS $CKCON_LIBS" | ||
16493 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
16494 | $as_echo "yes" >&6; } | ||
16495 | |||
16496 | $as_echo "#define USE_CONSOLEKIT 1" >>confdefs.h | ||
16497 | |||
16498 | CONSOLEKIT_MSG="yes" | ||
16499 | else | ||
16500 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
16501 | $as_echo "no" >&6; } | ||
16502 | fi | ||
16503 | fi | ||
16504 | fi | ||
16505 | |||
16506 | fi | ||
16507 | |||
16508 | |||
16378 | # Looking for programs, paths and files | 16509 | # Looking for programs, paths and files |
16379 | 16510 | ||
16380 | PRIVSEP_PATH=/var/empty | 16511 | PRIVSEP_PATH=/var/empty |
@@ -18902,6 +19033,7 @@ echo " MD5 password support: $MD5_MSG" | |||
18902 | echo " libedit support: $LIBEDIT_MSG" | 19033 | echo " libedit support: $LIBEDIT_MSG" |
18903 | echo " Solaris process contract support: $SPC_MSG" | 19034 | echo " Solaris process contract support: $SPC_MSG" |
18904 | echo " Solaris project support: $SP_MSG" | 19035 | echo " Solaris project support: $SP_MSG" |
19036 | echo " ConsoleKit support: $CONSOLEKIT_MSG" | ||
18905 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 19037 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
18906 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 19038 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
18907 | echo " BSD Auth support: $BSD_AUTH_MSG" | 19039 | echo " BSD Auth support: $BSD_AUTH_MSG" |
diff --git a/configure.ac b/configure.ac index 4c1a6589e..d7d500a33 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -3841,6 +3841,30 @@ AC_ARG_WITH([kerberos5], | |||
3841 | AC_SUBST([GSSLIBS]) | 3841 | AC_SUBST([GSSLIBS]) |
3842 | AC_SUBST([K5LIBS]) | 3842 | AC_SUBST([K5LIBS]) |
3843 | 3843 | ||
3844 | # Check whether user wants ConsoleKit support | ||
3845 | CONSOLEKIT_MSG="no" | ||
3846 | LIBCK_CONNECTOR="" | ||
3847 | AC_ARG_WITH(consolekit, | ||
3848 | [ --with-consolekit Enable ConsoleKit support], | ||
3849 | [ if test "x$withval" != "xno" ; then | ||
3850 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
3851 | if test "$PKGCONFIG" != "no"; then | ||
3852 | AC_MSG_CHECKING([for ck-connector]) | ||
3853 | if $PKGCONFIG --exists ck-connector; then | ||
3854 | CKCON_CFLAGS=`$PKGCONFIG --cflags ck-connector` | ||
3855 | CKCON_LIBS=`$PKGCONFIG --libs ck-connector` | ||
3856 | CPPFLAGS="$CPPFLAGS $CKCON_CFLAGS" | ||
3857 | SSHDLIBS="$SSHDLIBS $CKCON_LIBS" | ||
3858 | AC_MSG_RESULT([yes]) | ||
3859 | AC_DEFINE(USE_CONSOLEKIT, 1, [Define if you want ConsoleKit support.]) | ||
3860 | CONSOLEKIT_MSG="yes" | ||
3861 | else | ||
3862 | AC_MSG_RESULT([no]) | ||
3863 | fi | ||
3864 | fi | ||
3865 | fi ] | ||
3866 | ) | ||
3867 | |||
3844 | # Looking for programs, paths and files | 3868 | # Looking for programs, paths and files |
3845 | 3869 | ||
3846 | PRIVSEP_PATH=/var/empty | 3870 | PRIVSEP_PATH=/var/empty |
@@ -4641,6 +4665,7 @@ echo " MD5 password support: $MD5_MSG" | |||
4641 | echo " libedit support: $LIBEDIT_MSG" | 4665 | echo " libedit support: $LIBEDIT_MSG" |
4642 | echo " Solaris process contract support: $SPC_MSG" | 4666 | echo " Solaris process contract support: $SPC_MSG" |
4643 | echo " Solaris project support: $SP_MSG" | 4667 | echo " Solaris project support: $SP_MSG" |
4668 | echo " ConsoleKit support: $CONSOLEKIT_MSG" | ||
4644 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | 4669 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
4645 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | 4670 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
4646 | echo " BSD Auth support: $BSD_AUTH_MSG" | 4671 | echo " BSD Auth support: $BSD_AUTH_MSG" |
diff --git a/consolekit.c b/consolekit.c new file mode 100644 index 000000000..f1039e652 --- /dev/null +++ b/consolekit.c | |||
@@ -0,0 +1,240 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008 Colin Watson. All rights reserved. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | /* | ||
17 | * Loosely based on pam-ck-connector, which is: | ||
18 | * | ||
19 | * Copyright (c) 2007 David Zeuthen <davidz@redhat.com> | ||
20 | * | ||
21 | * Permission is hereby granted, free of charge, to any person | ||
22 | * obtaining a copy of this software and associated documentation | ||
23 | * files (the "Software"), to deal in the Software without | ||
24 | * restriction, including without limitation the rights to use, | ||
25 | * copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
26 | * copies of the Software, and to permit persons to whom the | ||
27 | * Software is furnished to do so, subject to the following | ||
28 | * conditions: | ||
29 | * | ||
30 | * The above copyright notice and this permission notice shall be | ||
31 | * included in all copies or substantial portions of the Software. | ||
32 | * | ||
33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
34 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
35 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
36 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
37 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
38 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
39 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
40 | * OTHER DEALINGS IN THE SOFTWARE. | ||
41 | */ | ||
42 | |||
43 | #include "includes.h" | ||
44 | |||
45 | #ifdef USE_CONSOLEKIT | ||
46 | |||
47 | #include <ck-connector.h> | ||
48 | |||
49 | #include "openbsd-compat/sys-queue.h" | ||
50 | #include "xmalloc.h" | ||
51 | #include "channels.h" | ||
52 | #include "key.h" | ||
53 | #include "hostfile.h" | ||
54 | #include "auth.h" | ||
55 | #include "log.h" | ||
56 | #include "servconf.h" | ||
57 | #include "canohost.h" | ||
58 | #include "session.h" | ||
59 | #include "consolekit.h" | ||
60 | |||
61 | extern ServerOptions options; | ||
62 | extern u_int utmp_len; | ||
63 | |||
64 | void | ||
65 | set_active(const char *cookie) | ||
66 | { | ||
67 | DBusError err; | ||
68 | DBusConnection *connection; | ||
69 | DBusMessage *message = NULL, *reply = NULL; | ||
70 | char *sid; | ||
71 | DBusMessageIter iter, subiter; | ||
72 | const char *interface, *property; | ||
73 | dbus_bool_t active; | ||
74 | |||
75 | dbus_error_init(&err); | ||
76 | connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err); | ||
77 | if (!connection) { | ||
78 | if (dbus_error_is_set(&err)) { | ||
79 | error("unable to open DBus connection: %s", | ||
80 | err.message); | ||
81 | dbus_error_free(&err); | ||
82 | } | ||
83 | goto out; | ||
84 | } | ||
85 | dbus_connection_set_exit_on_disconnect(connection, FALSE); | ||
86 | |||
87 | message = dbus_message_new_method_call("org.freedesktop.ConsoleKit", | ||
88 | "/org/freedesktop/ConsoleKit/Manager", | ||
89 | "org.freedesktop.ConsoleKit.Manager", | ||
90 | "GetSessionForCookie"); | ||
91 | if (!message) | ||
92 | goto out; | ||
93 | if (!dbus_message_append_args(message, DBUS_TYPE_STRING, &cookie, | ||
94 | DBUS_TYPE_INVALID)) { | ||
95 | if (dbus_error_is_set(&err)) { | ||
96 | error("unable to get current session: %s", | ||
97 | err.message); | ||
98 | dbus_error_free(&err); | ||
99 | } | ||
100 | goto out; | ||
101 | } | ||
102 | |||
103 | dbus_error_init(&err); | ||
104 | reply = dbus_connection_send_with_reply_and_block(connection, message, | ||
105 | -1, &err); | ||
106 | if (!reply) { | ||
107 | if (dbus_error_is_set(&err)) { | ||
108 | error("unable to get current session: %s", | ||
109 | err.message); | ||
110 | dbus_error_free(&err); | ||
111 | } | ||
112 | goto out; | ||
113 | } | ||
114 | |||
115 | dbus_error_init(&err); | ||
116 | if (!dbus_message_get_args(reply, &err, | ||
117 | DBUS_TYPE_OBJECT_PATH, &sid, | ||
118 | DBUS_TYPE_INVALID)) { | ||
119 | if (dbus_error_is_set(&err)) { | ||
120 | error("unable to get current session: %s", | ||
121 | err.message); | ||
122 | dbus_error_free(&err); | ||
123 | } | ||
124 | goto out; | ||
125 | } | ||
126 | dbus_message_unref(reply); | ||
127 | dbus_message_unref(message); | ||
128 | message = reply = NULL; | ||
129 | |||
130 | message = dbus_message_new_method_call("org.freedesktop.ConsoleKit", | ||
131 | sid, "org.freedesktop.DBus.Properties", "Set"); | ||
132 | if (!message) | ||
133 | goto out; | ||
134 | interface = "org.freedesktop.ConsoleKit.Session"; | ||
135 | property = "active"; | ||
136 | if (!dbus_message_append_args(message, | ||
137 | DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, | ||
138 | DBUS_TYPE_INVALID)) | ||
139 | goto out; | ||
140 | dbus_message_iter_init_append(message, &iter); | ||
141 | if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, | ||
142 | DBUS_TYPE_BOOLEAN_AS_STRING, &subiter)) | ||
143 | goto out; | ||
144 | active = TRUE; | ||
145 | if (!dbus_message_iter_append_basic(&subiter, DBUS_TYPE_BOOLEAN, | ||
146 | &active)) | ||
147 | goto out; | ||
148 | if (!dbus_message_iter_close_container(&iter, &subiter)) | ||
149 | goto out; | ||
150 | |||
151 | dbus_error_init(&err); | ||
152 | reply = dbus_connection_send_with_reply_and_block(connection, message, | ||
153 | -1, &err); | ||
154 | if (!reply) { | ||
155 | if (dbus_error_is_set(&err)) { | ||
156 | error("unable to make current session active: %s", | ||
157 | err.message); | ||
158 | dbus_error_free(&err); | ||
159 | } | ||
160 | goto out; | ||
161 | } | ||
162 | |||
163 | out: | ||
164 | if (reply) | ||
165 | dbus_message_unref(reply); | ||
166 | if (message) | ||
167 | dbus_message_unref(message); | ||
168 | } | ||
169 | |||
170 | /* | ||
171 | * We pass display separately rather than using s->display because the | ||
172 | * latter is not available in the monitor when using privsep. | ||
173 | */ | ||
174 | |||
175 | char * | ||
176 | consolekit_register(Session *s, const char *display) | ||
177 | { | ||
178 | DBusError err; | ||
179 | const char *tty = s->tty; | ||
180 | const char *remote_host_name; | ||
181 | dbus_bool_t is_local = FALSE; | ||
182 | const char *cookie = NULL; | ||
183 | |||
184 | if (s->ckc) { | ||
185 | debug("already registered with ConsoleKit"); | ||
186 | return xstrdup(ck_connector_get_cookie(s->ckc)); | ||
187 | } | ||
188 | |||
189 | s->ckc = ck_connector_new(); | ||
190 | if (!s->ckc) { | ||
191 | error("ck_connector_new failed"); | ||
192 | return NULL; | ||
193 | } | ||
194 | |||
195 | if (!tty) | ||
196 | tty = ""; | ||
197 | if (!display) | ||
198 | display = ""; | ||
199 | remote_host_name = get_remote_name_or_ip(utmp_len, options.use_dns); | ||
200 | if (!remote_host_name) | ||
201 | remote_host_name = ""; | ||
202 | |||
203 | dbus_error_init(&err); | ||
204 | if (!ck_connector_open_session_with_parameters(s->ckc, &err, | ||
205 | "unix-user", &s->pw->pw_uid, | ||
206 | "display-device", &tty, | ||
207 | "x11-display", &display, | ||
208 | "remote-host-name", &remote_host_name, | ||
209 | "is-local", &is_local, | ||
210 | NULL)) { | ||
211 | if (dbus_error_is_set(&err)) { | ||
212 | debug("%s", err.message); | ||
213 | dbus_error_free(&err); | ||
214 | } else { | ||
215 | debug("insufficient privileges or D-Bus / ConsoleKit " | ||
216 | "not available"); | ||
217 | } | ||
218 | return NULL; | ||
219 | } | ||
220 | |||
221 | debug("registered uid=%d on tty='%s' with ConsoleKit", | ||
222 | s->pw->pw_uid, s->tty); | ||
223 | |||
224 | cookie = ck_connector_get_cookie(s->ckc); | ||
225 | set_active(cookie); | ||
226 | return xstrdup(cookie); | ||
227 | } | ||
228 | |||
229 | void | ||
230 | consolekit_unregister(Session *s) | ||
231 | { | ||
232 | if (s->ckc) { | ||
233 | debug("unregistering ConsoleKit session %s", | ||
234 | ck_connector_get_cookie(s->ckc)); | ||
235 | ck_connector_unref(s->ckc); | ||
236 | s->ckc = NULL; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | #endif /* USE_CONSOLEKIT */ | ||
diff --git a/consolekit.h b/consolekit.h new file mode 100644 index 000000000..8ce371690 --- /dev/null +++ b/consolekit.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008 Colin Watson. All rights reserved. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #ifdef USE_CONSOLEKIT | ||
18 | |||
19 | struct Session; | ||
20 | |||
21 | char * consolekit_register(struct Session *, const char *); | ||
22 | void consolekit_unregister(struct Session *); | ||
23 | |||
24 | #endif /* USE_CONSOLEKIT */ | ||
diff --git a/contrib/gnome-ssh-askpass2.c b/contrib/gnome-ssh-askpass2.c index 9d97c30c0..04b3a110e 100644 --- a/contrib/gnome-ssh-askpass2.c +++ b/contrib/gnome-ssh-askpass2.c | |||
@@ -209,6 +209,8 @@ main(int argc, char **argv) | |||
209 | 209 | ||
210 | gtk_init(&argc, &argv); | 210 | gtk_init(&argc, &argv); |
211 | 211 | ||
212 | gtk_window_set_default_icon_from_file ("/usr/share/pixmaps/ssh-askpass-gnome.png", NULL); | ||
213 | |||
212 | if (argc > 1) { | 214 | if (argc > 1) { |
213 | message = g_strjoinv(" ", argv + 1); | 215 | message = g_strjoinv(" ", argv + 1); |
214 | } else { | 216 | } else { |
diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 000000000..7a67e1528 --- /dev/null +++ b/debian/NEWS | |||
@@ -0,0 +1,42 @@ | |||
1 | openssh (1:5.4p1-2) unstable; urgency=low | ||
2 | |||
3 | Smartcard support is now available using PKCS#11 tokens. If you were | ||
4 | previously using an unofficial build of Debian's OpenSSH package with | ||
5 | OpenSC-based smartcard support added, then note that commands like | ||
6 | 'ssh-add -s 0' will no longer work; you need to use 'ssh-add -s | ||
7 | /usr/lib/opensc-pkcs11.so' instead. | ||
8 | |||
9 | -- Colin Watson <cjwatson@debian.org> Sat, 10 Apr 2010 01:08:59 +0100 | ||
10 | |||
11 | openssh (1:3.8.1p1-9) experimental; urgency=low | ||
12 | |||
13 | The ssh package has been split into openssh-client and openssh-server. If | ||
14 | you had previously requested that the sshd server should not be run, then | ||
15 | that request will still be honoured. However, the recommended approach is | ||
16 | now to remove the openssh-server package if you do not want to run sshd. | ||
17 | You can remove the old /etc/ssh/sshd_not_to_be_run marker file after doing | ||
18 | that. | ||
19 | |||
20 | -- Colin Watson <cjwatson@debian.org> Mon, 2 Aug 2004 20:48:54 +0100 | ||
21 | |||
22 | openssh (1:3.5p1-1) unstable; urgency=low | ||
23 | |||
24 | This version of OpenSSH disables the environment option for public keys by | ||
25 | default, in order to avoid certain attacks (for example, LD_PRELOAD). If | ||
26 | you are using this option in an authorized_keys file, beware that the keys | ||
27 | in question will no longer work until the option is removed. | ||
28 | |||
29 | To re-enable this option, set "PermitUserEnvironment yes" in | ||
30 | /etc/ssh/sshd_config after the upgrade is complete, taking note of the | ||
31 | warning in the sshd_config(5) manual page. | ||
32 | |||
33 | -- Colin Watson <cjwatson@debian.org> Sat, 26 Oct 2002 19:41:51 +0100 | ||
34 | |||
35 | openssh (1:3.0.1p1-1) unstable; urgency=high | ||
36 | |||
37 | As of version 3, OpenSSH no longer uses separate files for ssh1 and ssh2 | ||
38 | keys. This means the authorized_keys2 and known_hosts2 files are no longer | ||
39 | needed. They will still be read in order to maintain backward | ||
40 | compatibility. | ||
41 | |||
42 | -- Matthew Vernon <matthew@debian.org> Thu, 28 Nov 2001 17:43:01 +0000 | ||
diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 000000000..f37cce4b0 --- /dev/null +++ b/debian/README.Debian | |||
@@ -0,0 +1,234 @@ | |||
1 | OpenSSH for Debian | ||
2 | ------------------ | ||
3 | |||
4 | UPGRADE ISSUES | ||
5 | ============== | ||
6 | |||
7 | Privilege Separation | ||
8 | -------------------- | ||
9 | |||
10 | As of 3.3, openssh has employed privilege separation to reduce the | ||
11 | quantity of code that runs as root, thereby reducing the impact of | ||
12 | some security holes in sshd. This now also works properly with PAM. | ||
13 | |||
14 | Privilege separation is turned on by default, so, if you decide you | ||
15 | want it turned off, you need to add "UsePrivilegeSeparation no" to | ||
16 | /etc/ssh/sshd_config. | ||
17 | |||
18 | PermitRootLogin set to yes | ||
19 | -------------------------- | ||
20 | |||
21 | This is now the default setting (in line with upstream), and people | ||
22 | who asked for an automatically-generated configuration file when | ||
23 | upgrading from potato (or on a new install) will have this setting in | ||
24 | their /etc/ssh/sshd_config file. | ||
25 | |||
26 | Should you wish to change this setting, edit /etc/ssh/sshd_config, and | ||
27 | change: | ||
28 | PermitRootLogin yes | ||
29 | to: | ||
30 | PermitRootLogin no | ||
31 | |||
32 | Having PermitRootLogin set to yes means that an attacker that knows | ||
33 | the root password can ssh in directly (without having to go via a user | ||
34 | account). If you set it to no, then they must compromise a normal user | ||
35 | account. In the vast majority of cases, this does not give added | ||
36 | security; remember that any account you su to root from is equivalent | ||
37 | to root - compromising this account gives an attacker access to root | ||
38 | easily. If you only ever log in as root from the physical console, | ||
39 | then you probably want to set this value to no. | ||
40 | |||
41 | As an aside, PermitRootLogin can also be set to "without-password" or | ||
42 | "forced-commands-only" - see sshd(8) for more details. | ||
43 | |||
44 | DO NOT FILE BUG REPORTS SAYING YOU THINK THIS DEFAULT IS INCORRECT! | ||
45 | |||
46 | The argument above is somewhat condensed; I have had this discussion | ||
47 | at great length with many people. If you think the default is | ||
48 | incorrect, and feel strongly enough to want to argue about it, then | ||
49 | send email to debian-ssh@lists.debian.org. I will close bug reports | ||
50 | claiming the default is incorrect. | ||
51 | |||
52 | SSH now uses protocol 2 by default | ||
53 | ---------------------------------- | ||
54 | |||
55 | This means all your keyfiles you used for protocol version 1 need to | ||
56 | be re-generated. The server keys are done automatically, but for RSA | ||
57 | authentication, please read the ssh-keygen manpage. | ||
58 | |||
59 | If you have an automatically generated configuration file, and decide | ||
60 | at a later stage that you do want to support protocol version 1 (not | ||
61 | recommended, but note that the ssh client shipped with Debian potato | ||
62 | only supported protocol version 1), then you need to do the following: | ||
63 | |||
64 | Change /etc/ssh/sshd_config such that: | ||
65 | Protocol 2 | ||
66 | becomes: | ||
67 | Protocol 2,1 | ||
68 | Also add the line: | ||
69 | HostKey /etc/ssh/ssh_host_key | ||
70 | |||
71 | If you do not already have an RSA1 host key in /etc/ssh/ssh_host_key, | ||
72 | you will need to generate one. To do so, run this command as root: | ||
73 | |||
74 | ssh-keygen -f /etc/ssh/ssh_host_key -N '' -t rsa1 | ||
75 | |||
76 | As of openssh-server 1:4.1p1-2, the option to support protocol version 1 | ||
77 | is no longer available via debconf. You must edit the configuration file | ||
78 | instead. | ||
79 | |||
80 | X11 Forwarding | ||
81 | -------------- | ||
82 | |||
83 | ssh's default for ForwardX11 has been changed to ``no'' because it has | ||
84 | been pointed out that logging into remote systems administered by | ||
85 | untrusted people is likely to open you up to X11 attacks, so you | ||
86 | should have to actively decide that you trust the remote machine's | ||
87 | root, before enabling X11. I strongly recommend that you do this on a | ||
88 | machine-by-machine basis, rather than just enabling it in the default | ||
89 | host settings. | ||
90 | |||
91 | In order for X11 forwarding to work, you need to install xauth on the | ||
92 | server. In Debian this is in the xbase-clients package. | ||
93 | |||
94 | As of OpenSSH 3.1, the remote $DISPLAY uses localhost by default to reduce | ||
95 | the security risks of X11 forwarding. Look up X11UseLocalhost in | ||
96 | sshd_config(8) if this is a problem. | ||
97 | |||
98 | OpenSSH 3.8 invented ForwardX11Trusted, which when set to no causes the | ||
99 | ssh client to create an untrusted X cookie so that attacks on the | ||
100 | forwarded X11 connection can't become attacks on X clients on the remote | ||
101 | machine. However, this has some problems in implementation - notably a | ||
102 | very short timeout of the untrusted cookie - breaks large numbers of | ||
103 | existing setups, and generally seems immature. The Debian package | ||
104 | therefore sets the default for this option to "yes" (in ssh itself, | ||
105 | rather than in ssh_config). | ||
106 | |||
107 | Fallback to RSH | ||
108 | --------------- | ||
109 | |||
110 | The default for this setting has been changed from Yes to No, for | ||
111 | security reasons, and to stop the delay attempting to rsh to machines | ||
112 | that don't offer the service. Simply switch it back on in either | ||
113 | /etc/ssh/ssh_config or ~/.ssh/config for those machines that you need | ||
114 | it for. | ||
115 | |||
116 | Setgid ssh-agent and environment variables | ||
117 | ------------------------------------------ | ||
118 | |||
119 | As of version 1:3.5p1-1, ssh-agent is installed setgid to prevent ptrace() | ||
120 | attacks retrieving private key material. This has the side-effect of causing | ||
121 | glibc to remove certain environment variables which might have security | ||
122 | implications for set-id programs, including LD_PRELOAD, LD_LIBRARY_PATH, and | ||
123 | TMPDIR. | ||
124 | |||
125 | If you need to set any of these environment variables, you will need to do | ||
126 | so in the program exec()ed by ssh-agent. This may involve creating a small | ||
127 | wrapper script. | ||
128 | |||
129 | Symlink Hostname invocation | ||
130 | --------------------------- | ||
131 | |||
132 | This version of ssh no longer includes support for invoking ssh with the | ||
133 | hostname as the name of the file run. People wanting this support should | ||
134 | use the ssh-argv0 script. | ||
135 | |||
136 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | ||
137 | |||
138 | OTHER ISSUES | ||
139 | ============ | ||
140 | |||
141 | /usr/bin/ssh not SUID | ||
142 | --------------------- | ||
143 | |||
144 | Due to Debian bug #164325, RhostsRSAAuthentication can only be used if ssh | ||
145 | is SUID. Until this is fixed, if that is a problem, use: | ||
146 | |||
147 | dpkg-statoverride | ||
148 | |||
149 | or if that's also missing, use this: | ||
150 | |||
151 | chown root.root /usr/bin/ssh | ||
152 | chmod 04755 /usr/bin/ssh | ||
153 | |||
154 | Authorization Forwarding | ||
155 | ------------------------ | ||
156 | |||
157 | Similarly, root on a remote server could make use of your ssh-agent | ||
158 | (while you're logged into their machine) to obtain access to machines | ||
159 | which trust your keys. This feature is therefore disabled by default. | ||
160 | You should only re-enable it for those hosts (in your ~/.ssh/config or | ||
161 | /etc/ssh/ssh_config) where you are confident that the remote machine | ||
162 | is not a threat. | ||
163 | |||
164 | Problems logging in with RSA authentication | ||
165 | ------------------------------------------- | ||
166 | |||
167 | If you have trouble logging in with RSA authentication then the | ||
168 | problem is probably caused by the fact that you have your home | ||
169 | directory writable by group, as well as user (this is the default on | ||
170 | Debian systems). | ||
171 | |||
172 | Depending upon other settings on your system (i.e. other users being | ||
173 | in your group) this could open a security hole, so you will need to | ||
174 | make your home directory writable only by yourself. Run this command, | ||
175 | as yourself: | ||
176 | |||
177 | chmod g-w ~/ | ||
178 | |||
179 | to remove group write permissions. If you use ssh-copy-id to install your | ||
180 | keys, it does this for you. | ||
181 | |||
182 | -L option of ssh nonfree | ||
183 | ------------------------ | ||
184 | |||
185 | non-free ssh supported the usage of the option -L to use a non privileged | ||
186 | port for scp. This option will not be supported by scp from openssh. | ||
187 | |||
188 | Please use instead scp -o "UsePrivilegedPort=no" as documented in the | ||
189 | manpage to scp itself. | ||
190 | |||
191 | Problem logging in because of TCP-Wrappers | ||
192 | ------------------------------------------ | ||
193 | |||
194 | ssh is compiled with support for tcp-wrappers. So if you can no longer | ||
195 | log into your system, please check that /etc/hosts.allow and /etc/hosts.deny | ||
196 | are configured so that ssh is not blocked. | ||
197 | |||
198 | Kerberos support | ||
199 | ---------------- | ||
200 | |||
201 | ssh is now compiled with Kerberos support. Unfortunately, privilege | ||
202 | separation is incompatible with Kerberos support for SSH protocol 1 and | ||
203 | parts of the support for protocol 2; you may need to run kinit after logging | ||
204 | in. | ||
205 | |||
206 | Interoperability between scp and the ssh.com SSH server | ||
207 | ------------------------------------------------------- | ||
208 | |||
209 | In version 2 and greater of the commercial SSH server produced by SSH | ||
210 | Communications Security, scp was changed to use SFTP (SSH2's file transfer | ||
211 | protocol) instead of the traditional rcp-over-ssh, thereby breaking | ||
212 | compatibility. The OpenSSH developers regard this as a bug in the ssh.com | ||
213 | server, and do not currently intend to change OpenSSH's scp to match. | ||
214 | |||
215 | Workarounds for this problem are to install scp1 on the server (scp2 will | ||
216 | fall back to it), to use sftp, or to use some other transfer mechanism such | ||
217 | as rsync-over-ssh or tar-over-ssh. | ||
218 | |||
219 | Running sshd from inittab | ||
220 | ------------------------- | ||
221 | |||
222 | Some people find it useful to run the sshd server from inittab, to make sure | ||
223 | that it always stays running. To do this, stop sshd ('/etc/init.d/ssh | ||
224 | stop'), add the following line to /etc/inittab, and run 'telinit q': | ||
225 | |||
226 | ss:2345:respawn:/usr/sbin/sshd -D | ||
227 | |||
228 | If you do this, note that you will need to stop sshd being started in the | ||
229 | normal way ('rm -f /etc/rc[2345].d/S16ssh') and that you will need to | ||
230 | restart this sshd manually on upgrades. | ||
231 | |||
232 | -- | ||
233 | Matthew Vernon <matthew@debian.org> | ||
234 | Colin Watson <cjwatson@debian.org> | ||
diff --git a/debian/README.compromised-keys b/debian/README.compromised-keys new file mode 100644 index 000000000..7a9cb7657 --- /dev/null +++ b/debian/README.compromised-keys | |||
@@ -0,0 +1,167 @@ | |||
1 | The following instructions relate to CVE-2008-0166. They were prepared by | ||
2 | Matt Zimmerman, assisted by Colin Watson. | ||
3 | |||
4 | == What Happened == | ||
5 | |||
6 | A weakness has been discovered in the random number generator used by OpenSSL | ||
7 | on Debian and Ubuntu systems. As a result of this weakness, certain encryption | ||
8 | keys are much more common than they should be, such that an attacker could | ||
9 | guess the key through a brute-force attack given minimal knowledge of the | ||
10 | system. This particularly affects the use of encryption keys in OpenSSH, | ||
11 | OpenVPN and SSL certificates. | ||
12 | |||
13 | This vulnerability only affects operating systems which (like Ubuntu) are based | ||
14 | on Debian. However, other systems can be indirectly affected if weak keys are | ||
15 | imported into them. | ||
16 | |||
17 | We consider this an extremely serious vulnerability, and urge all users to act | ||
18 | immediately to secure their systems. | ||
19 | |||
20 | == Who is affected == | ||
21 | |||
22 | Systems which are running any of the following releases: | ||
23 | |||
24 | * Debian 4.0 (etch) | ||
25 | * Ubuntu 7.04 (Feisty) | ||
26 | * Ubuntu 7.10 (Gutsy) | ||
27 | * Ubuntu 8.04 LTS (Hardy) | ||
28 | * Ubuntu "Intrepid Ibex" (development): libssl <= 0.9.8g-8 | ||
29 | |||
30 | and have openssh-server installed or have been used to create an OpenSSH key or | ||
31 | X.509 (SSL) certificate. | ||
32 | |||
33 | All OpenSSH and X.509 keys generated on such systems must be considered | ||
34 | untrustworthy, regardless of the system on which they are used, even after the | ||
35 | update has been applied. | ||
36 | |||
37 | This includes the automatically generated host keys used by OpenSSH, which are | ||
38 | the basis for its server spoofing and man-in-the-middle protection. | ||
39 | |||
40 | The specific package versions affected are: | ||
41 | |||
42 | * Debian 4.0: libssl <= 0.9.8c-4etch3 | ||
43 | * Ubuntu 7.04: libssl <= 0.9.8c-4ubuntu0.2 | ||
44 | * Ubuntu 7.10: libssl <= 0.9.8e-5ubuntu3.1 | ||
45 | * Ubuntu 8.04: libssl <= 0.9.8g-4ubuntu3 | ||
46 | |||
47 | == What to do if you are affected == | ||
48 | |||
49 | OpenSSH: | ||
50 | |||
51 | 1. Install the security updates | ||
52 | |||
53 | Once the update is applied, weak user keys will be automatically rejected | ||
54 | where possible (though they cannot be detected in all cases). If you are | ||
55 | using such keys for user authentication, they will immediately stop working | ||
56 | and will need to be replaced (see step 3). | ||
57 | |||
58 | OpenSSH host keys can be automatically regenerated when the OpenSSH security | ||
59 | update is applied. The update will prompt for confirmation before taking | ||
60 | this step. | ||
61 | |||
62 | 2. Update OpenSSH known_hosts files | ||
63 | |||
64 | The regeneration of host keys will cause a warning to be displayed when | ||
65 | connecting to the system using SSH until the host key is updated in the | ||
66 | known_hosts file. The warning will look like this: | ||
67 | |||
68 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
69 | @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ | ||
70 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
71 | IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! | ||
72 | Someone could be eavesdropping on you right now (man-in-the-middle attack)! | ||
73 | It is also possible that the RSA host key has just been changed. | ||
74 | |||
75 | In this case, the host key has simply been changed, and you should update | ||
76 | the relevant known_hosts file as indicated in the error message. | ||
77 | |||
78 | 3. Check all OpenSSH user keys | ||
79 | |||
80 | The safest course of action is to regenerate all OpenSSH user keys, | ||
81 | except where it can be established to a high degree of certainty that the | ||
82 | key was generated on an unaffected system. | ||
83 | |||
84 | Check whether your key is affected by running the ssh-vulnkey tool, included | ||
85 | in the security update. By default, ssh-vulnkey will check the standard | ||
86 | location for user keys (~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/identity), | ||
87 | your authorized_keys file (~/.ssh/authorized_keys and | ||
88 | ~/.ssh/authorized_keys2), and the system's host keys | ||
89 | (/etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key). | ||
90 | |||
91 | To check all your own keys, assuming they are in the standard | ||
92 | locations (~/.ssh/id_rsa, ~/.ssh/id_dsa, or ~/.ssh/identity): | ||
93 | |||
94 | ssh-vulnkey | ||
95 | |||
96 | To check all keys on your system: | ||
97 | |||
98 | sudo ssh-vulnkey -a | ||
99 | |||
100 | To check a key in a non-standard location: | ||
101 | |||
102 | ssh-vulnkey /path/to/key | ||
103 | |||
104 | If ssh-vulnkey says "Unknown (no blacklist information)", then it has no | ||
105 | information about whether that key is affected. If in doubt, destroy the | ||
106 | key and generate a new one. | ||
107 | |||
108 | 4. Regenerate any affected user keys | ||
109 | |||
110 | OpenSSH keys used for user authentication must be manually regenerated, | ||
111 | including those which may have since been transferred to a different system | ||
112 | after being generated. | ||
113 | |||
114 | New keys can be generated using ssh-keygen, e.g.: | ||
115 | |||
116 | $ ssh-keygen | ||
117 | Generating public/private rsa key pair. | ||
118 | Enter file in which to save the key (/home/user/.ssh/id_rsa): | ||
119 | Enter passphrase (empty for no passphrase): | ||
120 | Enter same passphrase again: | ||
121 | Your identification has been saved in /home/user/.ssh/id_rsa. | ||
122 | Your public key has been saved in /home/user/.ssh/id_rsa.pub. | ||
123 | The key fingerprint is: | ||
124 | 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 user@host | ||
125 | |||
126 | 5. Update authorized_keys files (if necessary) | ||
127 | |||
128 | Once the user keys have been regenerated, the relevant public keys must | ||
129 | be propagated to any authorized_keys files on remote systems. Be sure to | ||
130 | delete the affected key. | ||
131 | |||
132 | OpenSSL: | ||
133 | |||
134 | 1. Install the security update | ||
135 | |||
136 | 2. Create new certificates to replace any server or client certificates in use | ||
137 | on the system | ||
138 | |||
139 | 3. If certificates have been generated for use on other systems, they must be | ||
140 | found and replaced as well. | ||
141 | |||
142 | == Removing openssh-blacklist == | ||
143 | |||
144 | For the moment, the openssh-server package depends on openssh-blacklist, in | ||
145 | order that the blacklist is deployed to the maximum possible number of | ||
146 | systems to reduce the potential spread of worms exploiting this | ||
147 | vulnerability. We acknowledge that this may be inconvenient for some small | ||
148 | systems, but nevertheless feel that this was the best course of action. | ||
149 | |||
150 | If you absolutely need to remove the blacklist from your system, then you | ||
151 | can run the following commands to substitute a fake package for | ||
152 | openssh-blacklist: | ||
153 | |||
154 | sudo apt-get install equivs | ||
155 | equivs-control openssh-blacklist.ctl | ||
156 | sed -i 's/^Package:.*/Package: openssh-blacklist/' openssh-blacklist.ctl | ||
157 | sed -i 's/^# Version:.*/Version: 9:1.0/' openssh-blacklist.ctl | ||
158 | equivs-build openssh-blacklist.ctl | ||
159 | sudo dpkg -i openssh-blacklist_1.0_all.deb | ||
160 | |||
161 | Be warned: this circumvents a security measure for the sake of disk space. | ||
162 | You should only do this if you have no other option, and if you are certain | ||
163 | that no compromised keys will ever be generated on or copied onto this | ||
164 | system. | ||
165 | |||
166 | Once a sufficient amount of time and number of releases have passed, the | ||
167 | openssh-blacklist package will be phased out. | ||
diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 000000000..cf28fbd48 --- /dev/null +++ b/debian/README.source | |||
@@ -0,0 +1,223 @@ | |||
1 | Debian OpenSSH source package handling | ||
2 | ====================================== | ||
3 | |||
4 | The Debian package of OpenSSH is maintained in Bazaar | ||
5 | (http://bazaar-vcs.org/, or the 'bzr' package in Debian). You will need at | ||
6 | least version 1.16.1; the version in Debian testing as of the time of | ||
7 | writing (2009-12-21) is fine, or you can use the version in lenny-backports. | ||
8 | URLs are as follows: | ||
9 | |||
10 | Anonymous branch: http://anonscm.debian.org/bzr/pkg-ssh/openssh/trunk | ||
11 | Web browsing: http://anonscm.debian.org/loggerhead/pkg-ssh/openssh/trunk | ||
12 | Authenticated, for developers with commit access only: | ||
13 | bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/trunk | ||
14 | |||
15 | Although it's possible that I may use something like bzr-loom in the future | ||
16 | to better manage things like the Kerberos/GSSAPI patch, right now there's no | ||
17 | funny business and all that developers need to do is: | ||
18 | |||
19 | # To check out: | ||
20 | bzr co bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/trunk openssh | ||
21 | |||
22 | # To update: | ||
23 | bzr up | ||
24 | |||
25 | # To edit: | ||
26 | # hack hack hack, and 'bzr add' any new files | ||
27 | debcommit # or bzr commit | ||
28 | # note that this pushes automatically; you can use 'bzr unbind' to | ||
29 | # temporarily prevent this, or 'bzr branch' to create a local branch which | ||
30 | # you can merge later | ||
31 | |||
32 | # To release: | ||
33 | dch -r && debcommit -r | ||
34 | |||
35 | If you have lots of branches, you'll probably want to use a shared | ||
36 | repository to save space. Run 'bzr init-repo .' in an ancestor directory of | ||
37 | all your OpenSSH working directories. For example, I have a shared | ||
38 | repository in ~/src/debian/openssh/, upstream checkouts in | ||
39 | ~/src/debian/openssh/upstream/, and my own working trees in | ||
40 | ~/src/debian/openssh/trunk/. | ||
41 | |||
42 | Patch handling | ||
43 | -------------- | ||
44 | |||
45 | This package uses quilt to manage all modifications to the upstream source. | ||
46 | Changes are stored in the source package as diffs in debian/patches and | ||
47 | applied automatically by dpkg-source when the source package is extracted. | ||
48 | |||
49 | To configure quilt to use debian/patches instead of patches, you want either | ||
50 | to export QUILT_PATCHES=debian/patches in your environment or use this | ||
51 | snippet in your ~/.quiltrc: | ||
52 | |||
53 | for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do | ||
54 | if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then | ||
55 | export QUILT_PATCHES=debian/patches | ||
56 | break | ||
57 | fi | ||
58 | done | ||
59 | |||
60 | After unpacking the source package, all patches will be applied, and you can | ||
61 | use quilt normally. | ||
62 | |||
63 | If you check out the source code from bzr, then all patches will be applied, | ||
64 | but you will need to inform quilt of this manually. Do this by running: | ||
65 | |||
66 | debian/rules quilt-setup | ||
67 | |||
68 | To add a new set of changes, first run quilt push -a, and then run: | ||
69 | |||
70 | quilt new <patch> | ||
71 | |||
72 | where <patch> is a descriptive name for the patch, used as the filename in | ||
73 | debian/patches. Then, for every file that will be modified by this patch, | ||
74 | run: | ||
75 | |||
76 | quilt add <file> | ||
77 | |||
78 | before editing those files. You must tell quilt with quilt add what files | ||
79 | will be part of the patch before making changes or quilt will not work | ||
80 | properly. After editing the files, run: | ||
81 | |||
82 | quilt refresh | ||
83 | |||
84 | to save the results as a patch. | ||
85 | |||
86 | Alternately, if you already have an external patch and you just want to add | ||
87 | it to the build system, run quilt push -a and then: | ||
88 | |||
89 | quilt import -P <patch> /path/to/patch | ||
90 | quilt push -a | ||
91 | |||
92 | (add -p 0 to quilt import if needed). <patch> as above is the filename to | ||
93 | use in debian/patches. The last quilt push -a will apply the patch to make | ||
94 | sure it works properly. | ||
95 | |||
96 | To remove an existing patch from the list of patches that will be applied, | ||
97 | run: | ||
98 | |||
99 | quilt delete <patch> | ||
100 | |||
101 | You may need to run quilt pop -a to unapply patches first before running | ||
102 | this command. | ||
103 | |||
104 | You should only commit changes to bzr with all patches applied, i.e. after | ||
105 | 'quilt push -a'. | ||
106 | |||
107 | Merging new upstream releases | ||
108 | ----------------------------- | ||
109 | |||
110 | (Most developers will not need to read this section.) | ||
111 | |||
112 | Thanks to the import from Portable OpenSSH CVS provided by Launchpad | ||
113 | (https://code.launchpad.net/~vcs-imports/openssh/main, accessible by the | ||
114 | shortcut 'lp:openssh' from the bzr client), the Debian branch is a true DVCS | ||
115 | branch from upstream. This is a worthwhile property, but preserving it does | ||
116 | take a little bit of work. | ||
117 | |||
118 | Launchpad only imports CVS HEAD, but upstream sometimes produces releases | ||
119 | from a branch. We use the same software used by Launchpad to import the | ||
120 | branch as well, but a few small hacks are necessary to do good branch | ||
121 | imports. In Bazaar, it's important that the same file in different branches | ||
122 | should have the same file-id, otherwise merge attempts will try to delete | ||
123 | and re-add the file which usually doesn't work out very well. Occasionally a | ||
124 | file is added to CVS HEAD and then also added to a branch, and cscvs isn't | ||
125 | quite smart enough to spot this and copy over the file-id. We need to help | ||
126 | it out. | ||
127 | |||
128 | To fetch the necessary code: | ||
129 | |||
130 | bzr branch lp:~cjwatson/launchpad-cscvs/openssh-branch-imports | ||
131 | # or 'bzr pull' in the appropriate directory to update this, if you | ||
132 | # already have a copy | ||
133 | |||
134 | To import a branch, V_5_3 in this example: | ||
135 | |||
136 | export PATH="/path/to/cscvs/openssh-branch-imports:$PATH" | ||
137 | export PYTHONPATH=/path/to/cscvs/openssh-branch-imports/modules:/path/to/cscvs/openssh-branch-imports | ||
138 | # in a CVS checkout of :ext:anoncvs@anoncvs.mindrot.org:/cvs module | ||
139 | # openssh: | ||
140 | cscvs cache -b | ||
141 | # or 'cscvs cache -u' if you've done this before and want to update | ||
142 | cvs up -rV_5_3 | ||
143 | |||
144 | # Now we need to get a few bits of information from cscvs' cache. | ||
145 | sqlite CVS/Catalog.sqlite | ||
146 | sqlite> select csnum,log from changeset where branch = 'V_5_3' order by startdate; | ||
147 | # There will be a solid block of "Creation of branch V_5_3" changesets at | ||
148 | # the start; look for the first revision *after* this. Substitute this in | ||
149 | # the following wherever you see "CSX". | ||
150 | sqlite> select revision,filename from revision where branch = 'V_5_3' and csnum >= CSX and revision not like '%.%.%' order by filename; | ||
151 | # Anything listed here will need to be added to the openssh_ids dictionary | ||
152 | # in modules/CVS/StorageLayer.py in cscvs. Please send Colin Watson a | ||
153 | # patch if you do this. | ||
154 | |||
155 | # Next, look up the branchpoint revision in the main bzr import (bzr | ||
156 | # branch lp:openssh). It's usually easiest to just look it up by commit | ||
157 | # message and double-check the timestamp. Substitute this revision number | ||
158 | # for "BPR" in the following. /path/to/openssh/main is wherever you've | ||
159 | # checked out lp:openssh. | ||
160 | bzr branch -rBPR /path/to/openssh/main /path/to/openssh/5.3 | ||
161 | # If you're using Bazaar signed commits with a GPG agent, make sure that | ||
162 | # your agent has seen your passphrase recently. Now you can start the | ||
163 | # actual import! | ||
164 | cscvs -D4 totla -SC V_5_3.CSX: /path/to/openssh/5.3 | ||
165 | # If this fails at the end with a "directories differ" message, you may | ||
166 | # have forgotten to switch your CVS checkout to the appropriate branch | ||
167 | # with 'cvs up -r...' above. Otherwise you'll have to debug this for | ||
168 | # yourself. It's also worth double-checking that any files added to the | ||
169 | # branch have file-ids matching those on the trunk, using 'bzr ls -R | ||
170 | # --show-ids'. | ||
171 | |||
172 | Now we have a Bazaar branch corresponding to what's in CVS. Previous such | ||
173 | branches are available from Launchpad, for reference purposes: | ||
174 | |||
175 | https://code.launchpad.net/openssh | ||
176 | |||
177 | However, upstream releases involve a 'make distprep' step as well to | ||
178 | construct the tarball, and we need to import the results of this as well to | ||
179 | get a clean package. | ||
180 | |||
181 | Start by unpacking the upstream tarball (remember to check its GPG signature | ||
182 | first!). Copy the .bzr directory from the upstream branch you prepared | ||
183 | earlier. Now we have another branch, but with a working tree corresponding | ||
184 | to the upstream tarball. Modifications and deletions are handled | ||
185 | automatically, but we need to handle additions explicitly to make sure | ||
186 | file-ids are correct (see above). Run: | ||
187 | |||
188 | bzr add --file-ids-from=/path/to/openssh/debian/trunk | ||
189 | bzr st --show-ids | ||
190 | # compare this with 'bzr ls --show-ids' in the Debian trunk to make sure | ||
191 | # the result will be mergeable | ||
192 | bzr ci -m 'Import 5.3p1 tarball' | ||
193 | |||
194 | Add a parent revision for the previous tarball branch, to make it easier for | ||
195 | bzr to compute accurate merges. | ||
196 | |||
197 | bzr log -n0 /path/to/openssh/debian/trunk | less | ||
198 | # find revision number for previous tarball import, hence 'PREVIOUS' | ||
199 | bzr merge -rPREVIOUS /path/to/openssh/debian/trunk | ||
200 | # merge history only, no file changes | ||
201 | bzr revert . | ||
202 | bzr ci -m 'add 5.2p1 tarball parent revision' | ||
203 | bzr tag upstream-5.3p1 | ||
204 | |||
205 | Next, merge this into the gssapi branch | ||
206 | (bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/gssapi/). For this branch, we | ||
207 | want to ignore the normal results of merging and take only the patch from | ||
208 | http://www.sxw.org.uk/computing/patches/openssh.html; of course such a patch | ||
209 | needs to exist first! To do this, run this in the gssapi branch: | ||
210 | |||
211 | bzr merge /path/to/openssh/tarball/branch | ||
212 | bzr revert -rrevno:-1:/path/to/openssh/tarball/branch . | ||
213 | patch -p1 </path/to/openssh/gssapi/patch | ||
214 | bzr add --file-ids-from=/path/to/openssh/debian/trunk | ||
215 | # you may need to deal with applying configure.ac changes to configure | ||
216 | # here | ||
217 | bzr ci -m 'import openssh-5.3p1-gsskex-all-20100124.patch' | ||
218 | |||
219 | You should now be able to 'bzr merge' from the gssapi branch into the Debian | ||
220 | trunk, resolve conflicts, and commit. If you see lots of "Contents conflict" | ||
221 | messages, you may have got the file-ids wrong. Once you've committed the | ||
222 | merge, you can throw away the tarball branch, as all its history will have | ||
223 | been incorporated. | ||
diff --git a/debian/adjust-openssl-dependencies b/debian/adjust-openssl-dependencies new file mode 100755 index 000000000..9daa9b415 --- /dev/null +++ b/debian/adjust-openssl-dependencies | |||
@@ -0,0 +1,32 @@ | |||
1 | #! /bin/sh | ||
2 | # Attempt to tighten libssl dependencies to match the check in entropy.c. | ||
3 | # Must be run after dpkg-shlibdeps. | ||
4 | |||
5 | client=debian/openssh-client.substvars | ||
6 | server=debian/openssh-server.substvars | ||
7 | |||
8 | libssl_version="$(dpkg-query -W libssl-dev 2>/dev/null | cut -f2)" | ||
9 | if [ -z "$libssl_version" ]; then | ||
10 | echo "Can't find libssl-dev version; leaving dependencies alone." | ||
11 | exit 0 | ||
12 | fi | ||
13 | libssl_version="$(echo "$libssl_version" | sed 's/[a-z-].*//')" | ||
14 | |||
15 | libssl_package="$(sed -n 's/.*[= ]\(libssl[0-9][a-z0-9+.-]*\).*/\1/p' "$client")" | ||
16 | if [ "$libssl_package" ]; then | ||
17 | new_dep="$libssl_package (>= $libssl_version)" | ||
18 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client" | ||
19 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server" | ||
20 | fi | ||
21 | |||
22 | client_udeb=debian/openssh-client-udeb.substvars | ||
23 | server_udeb=debian/openssh-server-udeb.substvars | ||
24 | |||
25 | libcrypto_package="$(sed -n 's/.*[= ]\(libcrypto[0-9][a-z0-9+.-]*\).*/\1/p' "$client_udeb")" | ||
26 | if [ "$libcrypto_package" ]; then | ||
27 | new_dep="$libcrypto_package (>= $libssl_version)" | ||
28 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_udeb" | ||
29 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server_udeb" | ||
30 | fi | ||
31 | |||
32 | exit 0 | ||
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..a7359c9c5 --- /dev/null +++ b/debian/changelog | |||
@@ -0,0 +1,3550 @@ | |||
1 | openssh (1:6.3p1-1) UNRELEASED; urgency=low | ||
2 | |||
3 | * New upstream release (http://www.openssh.com/txt/release-6.3). | ||
4 | - sftp(1): add support for resuming partial downloads using the "reget" | ||
5 | command and on the sftp commandline or on the "get" commandline using | ||
6 | the "-a" (append) option (closes: #158590). | ||
7 | - ssh(1): add an "IgnoreUnknown" configuration option to selectively | ||
8 | suppress errors arising from unknown configuration directives (closes: | ||
9 | #436052). | ||
10 | - sftp(1): update progressmeter when data is acknowledged, not when it's | ||
11 | sent (partially addresses #708372). | ||
12 | - ssh(1): do not fatally exit when attempting to cleanup multiplexing- | ||
13 | created channels that are incompletely opened (closes: #651357). | ||
14 | * When running under Upstart, only consider the daemon started once it is | ||
15 | ready to accept connections (by raising SIGSTOP at that point and using | ||
16 | "expect stop"). | ||
17 | |||
18 | -- Colin Watson <cjwatson@debian.org> Mon, 12 Aug 2013 12:52:19 +0100 | ||
19 | |||
20 | openssh (1:6.2p2-6) unstable; urgency=low | ||
21 | |||
22 | * Update config.guess and config.sub automatically at build time. | ||
23 | dh_autoreconf does not take care of that by default because openssh does | ||
24 | not use automake. | ||
25 | |||
26 | -- Colin Watson <cjwatson@debian.org> Tue, 02 Jul 2013 22:54:49 +0100 | ||
27 | |||
28 | openssh (1:6.2p2-5) unstable; urgency=low | ||
29 | |||
30 | [ Colin Watson ] | ||
31 | * Document consequences of ssh-agent being setgid in ssh-agent(1); see | ||
32 | #711623. | ||
33 | * Use 'set -e' rather than '#! /bin/sh -e' in maintainer scripts and | ||
34 | ssh-argv0. | ||
35 | |||
36 | [ Yolanda Robla ] | ||
37 | * debian/rules: Include real distribution in SSH_EXTRAVERSION instead of | ||
38 | hardcoding Debian (LP: #1195342). | ||
39 | |||
40 | -- Colin Watson <cjwatson@debian.org> Thu, 27 Jun 2013 15:24:14 +0100 | ||
41 | |||
42 | openssh (1:6.2p2-4) unstable; urgency=low | ||
43 | |||
44 | * Fix non-portable shell in ssh-copy-id (closes: #711162). | ||
45 | * Rebuild against debhelper 9.20130604 with fixed dependencies for | ||
46 | invoke-rc.d and Upstart jobs (closes: #711159, #711364). | ||
47 | * Set SELinux context on private host keys as well as public host keys | ||
48 | (closes: #687436). | ||
49 | |||
50 | -- Colin Watson <cjwatson@debian.org> Thu, 06 Jun 2013 17:06:31 +0100 | ||
51 | |||
52 | openssh (1:6.2p2-3) unstable; urgency=low | ||
53 | |||
54 | * If the running init daemon is Upstart, then, on the first upgrade to | ||
55 | this version, check whether sysvinit is still managing sshd; if so, | ||
56 | manually stop it so that it can be restarted under upstart. We do this | ||
57 | near the end of the postinst, so it shouldn't result in any appreciable | ||
58 | extra window where sshd is not running during upgrade. | ||
59 | |||
60 | -- Colin Watson <cjwatson@debian.org> Wed, 22 May 2013 17:42:10 +0100 | ||
61 | |||
62 | openssh (1:6.2p2-2) unstable; urgency=low | ||
63 | |||
64 | * Change start condition of Upstart job to be just the standard "runlevel | ||
65 | [2345]", rather than "filesystem or runlevel [2345]"; the latter makes | ||
66 | it unreasonably difficult to ensure that urandom starts before ssh, and | ||
67 | is not really necessary since one of static-network-up and failsafe-boot | ||
68 | is guaranteed to happen and will trigger entry to the default runlevel, | ||
69 | and we don't care about ssh starting before the network (LP: #1098299). | ||
70 | * Drop conffile handling for direct upgrades from pre-split ssh package; | ||
71 | this was originally added in 1:4.3p2-7 / 1:4.3p2-8, and contained a | ||
72 | truly ghastly hack around a misbehaviour in sarge's dpkg. Since this is | ||
73 | now four Debian releases ago, we can afford to drop this and simplify | ||
74 | the packaging. | ||
75 | * Remove ssh/use_old_init_script, which was a workaround for a very old | ||
76 | bug in /etc/init.d/ssh. If anyone has ignored this for >10 years then | ||
77 | they aren't going to be convinced now (closes: #214182). | ||
78 | * Remove support for upgrading directly from ssh-nonfree. | ||
79 | * Remove lots of maintainer script support for direct upgrades from | ||
80 | pre-etch (three releases before current stable). | ||
81 | * Add #DEBHELPER# tokens to openssh-client.postinst and | ||
82 | openssh-server.postinst. | ||
83 | * Replace old manual conffile handling code with dpkg-maintscript-helper, | ||
84 | via dh_installdeb. | ||
85 | * Switch to new unified layout for Upstart jobs as documented in | ||
86 | https://wiki.ubuntu.com/UpstartCompatibleInitScripts: the init script | ||
87 | checks for a running Upstart, and we now let dh_installinit handle most | ||
88 | of the heavy lifting in maintainer scripts. Ubuntu users should be | ||
89 | essentially unaffected except that sshd may no longer start | ||
90 | automatically in chroots if the running Upstart predates 0.9.0; but the | ||
91 | main goal is simply not to break when openssh-server is installed in a | ||
92 | chroot. | ||
93 | * Remove the check for vulnerable host keys; this was first added five | ||
94 | years ago, and everyone should have upgraded through a version that | ||
95 | applied these checks by now. The ssh-vulnkey tool and the blacklisting | ||
96 | support in sshd are still here, at least for the moment. | ||
97 | * This removes the last of our uses of debconf (closes: #221531). | ||
98 | * Use the pam_loginuid session module (thanks, Laurent Bigonville; closes: | ||
99 | #677440, LP: #1067779). | ||
100 | * Bracket our session stack with calls to pam_selinux close/open (thanks, | ||
101 | Laurent Bigonville; closes: #679458). | ||
102 | * Fix dh_builddeb invocation so that we really use xz compression for | ||
103 | binary packages, as intended since 1:6.1p1-2. | ||
104 | |||
105 | -- Colin Watson <cjwatson@debian.org> Wed, 22 May 2013 09:07:42 +0100 | ||
106 | |||
107 | openssh (1:6.2p2-1) unstable; urgency=low | ||
108 | |||
109 | * New upstream release (http://www.openssh.com/txt/release-6.2p2): | ||
110 | - Only warn for missing identity files that were explicitly specified | ||
111 | (closes: #708275). | ||
112 | - Fix bug in contributed contrib/ssh-copy-id script that could result in | ||
113 | "rm *" being called on mktemp failure (closes: #708419). | ||
114 | |||
115 | -- Colin Watson <cjwatson@debian.org> Thu, 16 May 2013 14:05:06 +0100 | ||
116 | |||
117 | openssh (1:6.2p1-3) unstable; urgency=low | ||
118 | |||
119 | * Renumber Debian-specific additions to enum monitor_reqtype so that they | ||
120 | fit within a single byte (thanks, Jason Conti; LP: #1179202). | ||
121 | |||
122 | -- Colin Watson <cjwatson@debian.org> Mon, 13 May 2013 10:56:04 +0100 | ||
123 | |||
124 | openssh (1:6.2p1-2) unstable; urgency=low | ||
125 | |||
126 | * Fix build failure on Ubuntu: | ||
127 | - Include openbsd-compat/sys-queue.h from consolekit.c. | ||
128 | - Fix consolekit mismerges in monitor.c and monitor_wrap.c. | ||
129 | |||
130 | -- Colin Watson <cjwatson@debian.org> Thu, 09 May 2013 09:45:57 +0100 | ||
131 | |||
132 | openssh (1:6.2p1-1) unstable; urgency=low | ||
133 | |||
134 | * New upstream release (http://www.openssh.com/txt/release-6.2). | ||
135 | - Add support for multiple required authentication in SSH protocol 2 via | ||
136 | an AuthenticationMethods option (closes: #195716). | ||
137 | - Fix Sophie Germain formula in moduli(5) (closes: #698612). | ||
138 | - Update ssh-copy-id to Phil Hands' greatly revised version (closes: | ||
139 | #99785, #322228, #620428; LP: #518883, #835901, #1074798). | ||
140 | * Use dh-autoreconf. | ||
141 | |||
142 | -- Colin Watson <cjwatson@debian.org> Tue, 07 May 2013 11:48:16 +0100 | ||
143 | |||
144 | openssh (1:6.1p1-4) experimental; urgency=low | ||
145 | |||
146 | [ Gunnar Hjalmarsson ] | ||
147 | * debian/openssh-server.sshd.pam: Explicitly state that ~/.pam_environment | ||
148 | should be read, and move the pam_env calls from "auth" to "session" so | ||
149 | that it's also read when $HOME is encrypted (LP: #952185). | ||
150 | |||
151 | [ Stéphane Graber ] | ||
152 | * Add ssh-agent upstart user job. This implements something similar to | ||
153 | the 90x11-common_ssh-agent Xsession script. That is, start ssh-agent | ||
154 | and set the appropriate environment variables (closes: #703906). | ||
155 | |||
156 | -- Colin Watson <cjwatson@debian.org> Mon, 25 Mar 2013 16:58:04 +0000 | ||
157 | |||
158 | openssh (1:6.1p1-3) experimental; urgency=low | ||
159 | |||
160 | * Give ssh and ssh-krb5 versioned dependencies on openssh-client and | ||
161 | openssh-server, to try to reduce confusion when people run 'apt-get | ||
162 | install ssh' or similar and expect that to upgrade everything relevant. | ||
163 | * CVE-2010-5107: Improve DoS resistance by changing default of MaxStartups | ||
164 | to 10:30:100 (closes: #700102). | ||
165 | |||
166 | -- Colin Watson <cjwatson@debian.org> Fri, 08 Feb 2013 21:07:31 +0000 | ||
167 | |||
168 | openssh (1:6.1p1-2) experimental; urgency=low | ||
169 | |||
170 | * Use xz compression for binary packages. | ||
171 | * Merge from Ubuntu: | ||
172 | - Add support for registering ConsoleKit sessions on login. (This is | ||
173 | currently enabled only when building for Ubuntu.) | ||
174 | - Drop openssh-blacklist and openssh-blacklist-extra to Suggests. It's | ||
175 | been long enough since the relevant vulnerability that we shouldn't | ||
176 | need these installed by default nowadays. | ||
177 | - Add an Upstart job (not currently used by default in Debian). | ||
178 | - Add mention of ssh-keygen in ssh connect warning (Scott Moser). | ||
179 | - Install apport hooks. | ||
180 | * Only build with -j if DEB_BUILD_OPTIONS=parallel=* is used (closes: | ||
181 | #694282). | ||
182 | |||
183 | -- Colin Watson <cjwatson@debian.org> Mon, 26 Nov 2012 16:39:07 +0000 | ||
184 | |||
185 | openssh (1:6.1p1-1) experimental; urgency=low | ||
186 | |||
187 | * New upstream release (http://www.openssh.com/txt/release-6.1). | ||
188 | - Enable pre-auth sandboxing by default for new installs. | ||
189 | - Allow "PermitOpen none" to refuse all port-forwarding requests | ||
190 | (closes: #543683). | ||
191 | |||
192 | -- Colin Watson <cjwatson@debian.org> Fri, 07 Sep 2012 00:22:44 +0100 | ||
193 | |||
194 | openssh (1:6.0p1-3) unstable; urgency=low | ||
195 | |||
196 | * debconf template translations: | ||
197 | - Add Indonesian (thanks, Andika Triwidada; closes: #681670). | ||
198 | * Call restorecon on copied ~/.ssh/authorized_keys if possible, since some | ||
199 | SELinux policies require this (closes: #658675). | ||
200 | * Add ncurses-term to openssh-server's Recommends, since it's often needed | ||
201 | to support unusual terminal emulators on clients (closes: #675362). | ||
202 | |||
203 | -- Colin Watson <cjwatson@debian.org> Fri, 24 Aug 2012 06:55:36 +0100 | ||
204 | |||
205 | openssh (1:6.0p1-2) unstable; urgency=low | ||
206 | |||
207 | * Tighten libssl1.0.0 and libcrypto1.0.0-udeb dependencies to the current | ||
208 | "fix" version at build time (closes: #678661). | ||
209 | |||
210 | -- Colin Watson <cjwatson@debian.org> Sun, 24 Jun 2012 12:16:06 +0100 | ||
211 | |||
212 | openssh (1:6.0p1-1) unstable; urgency=low | ||
213 | |||
214 | [ Roger Leigh ] | ||
215 | * Display dynamic part of MOTD from /run/motd.dynamic, if it exists | ||
216 | (closes: #669699). | ||
217 | |||
218 | [ Colin Watson ] | ||
219 | * Update OpenSSH FAQ to revision 1.113, fixing missing line break (closes: | ||
220 | #669667). | ||
221 | * New upstream release (closes: #671010, | ||
222 | http://www.openssh.org/txt/release-6.0). | ||
223 | - Fix IPQoS not being set on non-mapped v4-in-v6 addressed connections | ||
224 | (closes: #643312, #650512, #671075). | ||
225 | - Add a new privilege separation sandbox implementation for Linux's new | ||
226 | seccomp sandbox, automatically enabled on platforms that support it. | ||
227 | (Note: privilege separation sandboxing is still experimental.) | ||
228 | * Fix a bashism in configure's seccomp_filter check. | ||
229 | * Add a sandbox fallback mechanism, so that behaviour on Linux depends on | ||
230 | whether the running system's kernel has seccomp_filter support, not the | ||
231 | build system's kernel (forwarded upstream as | ||
232 | https://bugzilla.mindrot.org/show_bug.cgi?id=2011). | ||
233 | |||
234 | -- Colin Watson <cjwatson@debian.org> Sat, 26 May 2012 13:48:14 +0100 | ||
235 | |||
236 | openssh (1:5.9p1-5) unstable; urgency=low | ||
237 | |||
238 | * Use dpkg-buildflags, including for hardening support; drop use of | ||
239 | hardening-includes. | ||
240 | * Fix cross-building: | ||
241 | - Allow using a cross-architecture pkg-config. | ||
242 | - Pass default LDFLAGS to contrib/Makefile. | ||
243 | - Allow dh_strip to strip gnome-ssh-askpass, rather than calling | ||
244 | 'install -s'. | ||
245 | |||
246 | -- Colin Watson <cjwatson@debian.org> Mon, 02 Apr 2012 11:20:33 +0100 | ||
247 | |||
248 | openssh (1:5.9p1-4) unstable; urgency=low | ||
249 | |||
250 | * Disable OpenSSL version check again, as its SONAME is sufficient | ||
251 | nowadays (closes: #664383). | ||
252 | |||
253 | -- Colin Watson <cjwatson@debian.org> Mon, 19 Mar 2012 11:06:30 +0000 | ||
254 | |||
255 | openssh (1:5.9p1-3) unstable; urgency=low | ||
256 | |||
257 | * debconf template translations: | ||
258 | - Update Polish (thanks, Michał Kułach; closes: #659829). | ||
259 | * Ignore errors writing to console in init script (closes: #546743). | ||
260 | * Move ssh-krb5 to Section: oldlibs. | ||
261 | |||
262 | -- Colin Watson <cjwatson@debian.org> Fri, 24 Feb 2012 08:56:18 +0000 | ||
263 | |||
264 | openssh (1:5.9p1-2) unstable; urgency=low | ||
265 | |||
266 | * Mark openssh-client and openssh-server as Multi-Arch: foreign. | ||
267 | |||
268 | -- Colin Watson <cjwatson@debian.org> Wed, 09 Nov 2011 02:06:48 +0000 | ||
269 | |||
270 | openssh (1:5.9p1-1) unstable; urgency=low | ||
271 | |||
272 | * New upstream release (http://www.openssh.org/txt/release-5.9). | ||
273 | - Introduce sandboxing of the pre-auth privsep child using an optional | ||
274 | sshd_config(5) "UsePrivilegeSeparation=sandbox" mode that enables | ||
275 | mandatory restrictions on the syscalls the privsep child can perform. | ||
276 | - Add new SHA256-based HMAC transport integrity modes from | ||
277 | http://www.ietf.org/id/draft-dbider-sha2-mac-for-ssh-02.txt. | ||
278 | - The pre-authentication sshd(8) privilege separation slave process now | ||
279 | logs via a socket shared with the master process, avoiding the need to | ||
280 | maintain /dev/log inside the chroot (closes: #75043, #429243, | ||
281 | #599240). | ||
282 | - ssh(1) now warns when a server refuses X11 forwarding (closes: | ||
283 | #504757). | ||
284 | - sshd_config(5)'s AuthorizedKeysFile now accepts multiple paths, | ||
285 | separated by whitespace (closes: #76312). The authorized_keys2 | ||
286 | fallback is deprecated but documented (closes: #560156). | ||
287 | - ssh(1) and sshd(8): set IPv6 traffic class from IPQoS, as well as IPv4 | ||
288 | ToS/DSCP (closes: #498297). | ||
289 | - ssh-add(1) now accepts keys piped from standard input. E.g. "ssh-add | ||
290 | - < /path/to/key" (closes: #229124). | ||
291 | - Clean up lost-passphrase text in ssh-keygen(1) (closes: #444691). | ||
292 | - Say "required" rather than "recommended" in unprotected-private-key | ||
293 | warning (LP: #663455). | ||
294 | * Update OpenSSH FAQ to revision 1.112. | ||
295 | |||
296 | -- Colin Watson <cjwatson@debian.org> Wed, 07 Sep 2011 23:46:00 +0100 | ||
297 | |||
298 | openssh (1:5.8p1-7) unstable; urgency=low | ||
299 | |||
300 | * Only recommend ssh-import-id when built on Ubuntu (closes: #635887). | ||
301 | * Use 'dpkg-vendor --derives-from Ubuntu' to detect Ubuntu systems rather | ||
302 | than 'lsb_release -is' so that Ubuntu derivatives behave the same way as | ||
303 | Ubuntu itself. | ||
304 | |||
305 | -- Colin Watson <cjwatson@debian.org> Fri, 29 Jul 2011 14:27:52 +0100 | ||
306 | |||
307 | openssh (1:5.8p1-6) unstable; urgency=low | ||
308 | |||
309 | * openssh-client and openssh-server Suggests: monkeysphere. | ||
310 | * Quieten logs when multiple from= restrictions are used in different | ||
311 | authorized_keys lines for the same key; it's still not ideal, but at | ||
312 | least you'll only get one log entry per key (closes: #630606). | ||
313 | * Merge from Ubuntu (Dustin Kirkland): | ||
314 | - openssh-server Recommends: ssh-import-id (no-op in Debian since that | ||
315 | package doesn't exist there, but this reduces the Ubuntu delta). | ||
316 | |||
317 | -- Colin Watson <cjwatson@debian.org> Thu, 28 Jul 2011 17:10:18 +0100 | ||
318 | |||
319 | openssh (1:5.8p1-5) unstable; urgency=low | ||
320 | |||
321 | * Drop openssh-server's dependency on openssh-blacklist to a | ||
322 | recommendation (closes: #622604). | ||
323 | * Update Vcs-* fields and README.source for Alioth changes. | ||
324 | * Backport from upstream: | ||
325 | - Make hostbased auth with ECDSA keys work correctly (closes: #633368). | ||
326 | |||
327 | -- Colin Watson <cjwatson@debian.org> Sun, 24 Jul 2011 11:06:47 +0100 | ||
328 | |||
329 | openssh (1:5.8p1-4) unstable; urgency=low | ||
330 | |||
331 | * Drop hardcoded dependencies on libssl0.9.8 and libcrypto0.9.8-udeb, | ||
332 | since the required minimum versions are rather old now anyway and | ||
333 | openssl has bumped its SONAME (thanks, Julien Cristau; closes: #620828). | ||
334 | * Remove unreachable code from openssh-server.postinst. | ||
335 | |||
336 | -- Colin Watson <cjwatson@debian.org> Mon, 04 Apr 2011 15:56:18 +0100 | ||
337 | |||
338 | openssh (1:5.8p1-3) unstable; urgency=low | ||
339 | |||
340 | * Correct ssh-keygen instruction in the changelog for 1:5.7p1-1 (thanks, | ||
341 | Joel Stanley). | ||
342 | * Allow ssh-add to read from FIFOs (thanks, Daniel Kahn Gillmor; closes: | ||
343 | #614897). | ||
344 | |||
345 | -- Colin Watson <cjwatson@debian.org> Fri, 18 Mar 2011 16:42:42 +0000 | ||
346 | |||
347 | openssh (1:5.8p1-2) unstable; urgency=low | ||
348 | |||
349 | * Upload to unstable. | ||
350 | |||
351 | -- Colin Watson <cjwatson@debian.org> Tue, 08 Feb 2011 10:59:17 +0000 | ||
352 | |||
353 | openssh (1:5.8p1-1) experimental; urgency=low | ||
354 | |||
355 | * New upstream release (http://www.openssh.org/txt/release-5.8): | ||
356 | - Fix stack information leak in legacy certificate signing | ||
357 | (http://www.openssh.com/txt/legacy-cert.adv). | ||
358 | |||
359 | -- Colin Watson <cjwatson@debian.org> Sat, 05 Feb 2011 11:13:11 +0000 | ||
360 | |||
361 | openssh (1:5.7p1-2) experimental; urgency=low | ||
362 | |||
363 | * Fix crash in ssh_selinux_setfscreatecon when SELinux is disabled | ||
364 | (LP: #708571). | ||
365 | |||
366 | -- Colin Watson <cjwatson@debian.org> Thu, 27 Jan 2011 12:14:17 +0000 | ||
367 | |||
368 | openssh (1:5.7p1-1) experimental; urgency=low | ||
369 | |||
370 | * New upstream release (http://www.openssh.org/txt/release-5.7): | ||
371 | - Implement Elliptic Curve Cryptography modes for key exchange (ECDH) | ||
372 | and host/user keys (ECDSA) as specified by RFC5656. ECDH and ECDSA | ||
373 | offer better performance than plain DH and DSA at the same equivalent | ||
374 | symmetric key length, as well as much shorter keys. | ||
375 | - sftp(1)/sftp-server(8): add a protocol extension to support a hard | ||
376 | link operation. It is available through the "ln" command in the | ||
377 | client. The old "ln" behaviour of creating a symlink is available | ||
378 | using its "-s" option or through the preexisting "symlink" command. | ||
379 | - scp(1): Add a new -3 option to scp: Copies between two remote hosts | ||
380 | are transferred through the local host (closes: #508613). | ||
381 | - ssh(1): "atomically" create the listening mux socket by binding it on | ||
382 | a temporary name and then linking it into position after listen() has | ||
383 | succeeded. This allows the mux clients to determine that the server | ||
384 | socket is either ready or stale without races (closes: #454784). | ||
385 | Stale server sockets are now automatically removed (closes: #523250). | ||
386 | - ssh(1): install a SIGCHLD handler to reap expired child process | ||
387 | (closes: #594687). | ||
388 | - ssh(1)/ssh-agent(1): honour $TMPDIR for client xauth and ssh-agent | ||
389 | temporary directories (closes: #357469, although only if you arrange | ||
390 | for ssh-agent to actually see $TMPDIR since the setgid bit will cause | ||
391 | it to be stripped off). | ||
392 | * Update to current GSSAPI patch from | ||
393 | http://www.sxw.org.uk/computing/patches/openssh-5.7p1-gsskex-all-20110125.patch: | ||
394 | - Add GSSAPIServerIdentity option. | ||
395 | * Generate ECDSA host keys on fresh installations. Upgraders who wish to | ||
396 | add such host keys should manually add 'HostKey | ||
397 | /etc/ssh/ssh_host_ecdsa_key' to /etc/ssh/sshd_config and run 'ssh-keygen | ||
398 | -q -f /etc/ssh/ssh_host_ecdsa_key -N "" -t ecdsa'. | ||
399 | * Build-depend on libssl-dev (>= 0.9.8g) to ensure sufficient ECC support. | ||
400 | * Backport SELinux build fix from CVS. | ||
401 | * Rearrange selinux-role.patch so that it links properly given this | ||
402 | SELinux build fix. | ||
403 | |||
404 | -- Colin Watson <cjwatson@debian.org> Wed, 26 Jan 2011 23:48:02 +0000 | ||
405 | |||
406 | openssh (1:5.6p1-3) experimental; urgency=low | ||
407 | |||
408 | * Drop override for desktop-file-but-no-dh_desktop-call, which Lintian no | ||
409 | longer issues. | ||
410 | * Merge 1:5.5p1-6. | ||
411 | |||
412 | -- Colin Watson <cjwatson@debian.org> Thu, 30 Dec 2010 11:48:00 +0000 | ||
413 | |||
414 | openssh (1:5.6p1-2) experimental; urgency=low | ||
415 | |||
416 | * Backport upstream patch to install a SIGCHLD handler to reap expired ssh | ||
417 | child processes, preventing lots of zombies when using ControlPersist | ||
418 | (closes: #594687). | ||
419 | |||
420 | -- Colin Watson <cjwatson@debian.org> Tue, 26 Oct 2010 14:46:40 +0100 | ||
421 | |||
422 | openssh (1:5.6p1-1) experimental; urgency=low | ||
423 | |||
424 | * New upstream release (http://www.openssh.com/txt/release-5.6): | ||
425 | - Added a ControlPersist option to ssh_config(5) that automatically | ||
426 | starts a background ssh(1) multiplex master when connecting. This | ||
427 | connection can stay alive indefinitely, or can be set to automatically | ||
428 | close after a user-specified duration of inactivity (closes: #335697, | ||
429 | #350898, #454787, #500573, #550262). | ||
430 | - Support AuthorizedKeysFile, AuthorizedPrincipalsFile, | ||
431 | HostbasedUsesNameFromPacketOnly, and PermitTunnel in sshd_config(5) | ||
432 | Match blocks (closes: #549858). | ||
433 | - sftp(1): fix ls in working directories that contain globbing | ||
434 | characters in their pathnames (LP: #530714). | ||
435 | |||
436 | -- Colin Watson <cjwatson@debian.org> Tue, 24 Aug 2010 00:37:54 +0100 | ||
437 | |||
438 | openssh (1:5.5p1-6) unstable; urgency=low | ||
439 | |||
440 | * Touch /var/run/sshd/.placeholder in the preinst so that /var/run/sshd, | ||
441 | which is intentionally no longer shipped in the openssh-server package | ||
442 | due to /var/run often being a temporary directory, is not removed on | ||
443 | upgrade (closes: #575582). | ||
444 | |||
445 | -- Colin Watson <cjwatson@debian.org> Sun, 26 Dec 2010 18:09:29 +0000 | ||
446 | |||
447 | openssh (1:5.5p1-5) unstable; urgency=low | ||
448 | |||
449 | * Use an architecture wildcard for libselinux1-dev (closes: #591740). | ||
450 | * debconf template translations: | ||
451 | - Update Danish (thanks, Joe Hansen; closes: #592800). | ||
452 | |||
453 | -- Colin Watson <cjwatson@debian.org> Mon, 23 Aug 2010 22:59:03 +0100 | ||
454 | |||
455 | openssh (1:5.5p1-4) unstable; urgency=low | ||
456 | |||
457 | [ Sebastian Andrzej Siewior ] | ||
458 | * Add powerpcspe to architecture list for libselinux1-dev build-dependency | ||
459 | (closes: #579843). | ||
460 | |||
461 | [ Colin Watson ] | ||
462 | * Allow ~/.ssh/authorized_keys and other secure files to be | ||
463 | group-writable, provided that the group in question contains only the | ||
464 | file's owner; this extends a patch previously applied to ~/.ssh/config | ||
465 | (closes: #581919). | ||
466 | * Check primary group memberships as well as supplementary group | ||
467 | memberships, and only allow group-writability by groups with exactly one | ||
468 | member, as zero-member groups are typically used by setgid binaries | ||
469 | rather than being user-private groups (closes: #581697). | ||
470 | |||
471 | -- Colin Watson <cjwatson@debian.org> Sat, 22 May 2010 23:37:20 +0100 | ||
472 | |||
473 | openssh (1:5.5p1-3) unstable; urgency=low | ||
474 | |||
475 | * Discard error messages while checking whether rsh, rlogin, and rcp | ||
476 | alternatives exist (closes: #579285). | ||
477 | * Drop IDEA key check; I don't think it works properly any more due to | ||
478 | textual changes in error output, it's only relevant for direct upgrades | ||
479 | from truly ancient versions, and it breaks upgrades if | ||
480 | /etc/ssh/ssh_host_key can't be loaded (closes: #579570). | ||
481 | |||
482 | -- Colin Watson <cjwatson@debian.org> Wed, 28 Apr 2010 22:12:47 +0100 | ||
483 | |||
484 | openssh (1:5.5p1-2) unstable; urgency=low | ||
485 | |||
486 | * Use dh_installinit -n, since our maintainer scripts already handle this | ||
487 | more carefully (thanks, Julien Cristau). | ||
488 | |||
489 | -- Colin Watson <cjwatson@debian.org> Sat, 17 Apr 2010 12:55:56 +0100 | ||
490 | |||
491 | openssh (1:5.5p1-1) unstable; urgency=low | ||
492 | |||
493 | * New upstream release: | ||
494 | - Unbreak sshd_config's AuthorizedKeysFile option for $HOME-relative | ||
495 | paths. | ||
496 | - Include a language tag when sending a protocol 2 disconnection | ||
497 | message. | ||
498 | - Make logging of certificates used for user authentication more clear | ||
499 | and consistent between CAs specified using TrustedUserCAKeys and | ||
500 | authorized_keys. | ||
501 | |||
502 | -- Colin Watson <cjwatson@debian.org> Fri, 16 Apr 2010 10:27:30 +0100 | ||
503 | |||
504 | openssh (1:5.4p1-2) unstable; urgency=low | ||
505 | |||
506 | * Borrow patch from Fedora to add DNSSEC support: if glibc 2.11 is | ||
507 | installed, the host key is published in an SSHFP RR secured with DNSSEC, | ||
508 | and VerifyHostKeyDNS=yes, then ssh will no longer prompt for host key | ||
509 | verification (closes: #572049). | ||
510 | * Convert to dh(1), and use dh_installdocs --link-doc. | ||
511 | * Drop lpia support, since Ubuntu no longer supports this architecture. | ||
512 | * Use dh_install more effectively. | ||
513 | * Add a NEWS.Debian entry about changes in smartcard support relative to | ||
514 | previous unofficial builds (closes: #231472). | ||
515 | |||
516 | -- Colin Watson <cjwatson@debian.org> Sat, 10 Apr 2010 01:08:59 +0100 | ||
517 | |||
518 | openssh (1:5.4p1-1) unstable; urgency=low | ||
519 | |||
520 | * New upstream release (LP: #535029). | ||
521 | - After a transition period of about 10 years, this release disables SSH | ||
522 | protocol 1 by default. Clients and servers that need to use the | ||
523 | legacy protocol must explicitly enable it in ssh_config / sshd_config | ||
524 | or on the command-line. | ||
525 | - Remove the libsectok/OpenSC-based smartcard code and add support for | ||
526 | PKCS#11 tokens. This support is enabled by default in the Debian | ||
527 | packaging, since it now doesn't involve additional library | ||
528 | dependencies (closes: #231472, LP: #16918). | ||
529 | - Add support for certificate authentication of users and hosts using a | ||
530 | new, minimal OpenSSH certificate format (closes: #482806). | ||
531 | - Added a 'netcat mode' to ssh(1): "ssh -W host:port ...". | ||
532 | - Add the ability to revoke keys in sshd(8) and ssh(1). (For the Debian | ||
533 | package, this overlaps with the key blacklisting facility added in | ||
534 | openssh 1:4.7p1-9, but with different file formats and slightly | ||
535 | different scopes; for the moment, I've roughly merged the two.) | ||
536 | - Various multiplexing improvements, including support for requesting | ||
537 | port-forwardings via the multiplex protocol (closes: #360151). | ||
538 | - Allow setting an explicit umask on the sftp-server(8) commandline to | ||
539 | override whatever default the user has (closes: #496843). | ||
540 | - Many sftp client improvements, including tab-completion, more options, | ||
541 | and recursive transfer support for get/put (LP: #33378). The old | ||
542 | mget/mput commands never worked properly and have been removed | ||
543 | (closes: #270399, #428082). | ||
544 | - Do not prompt for a passphrase if we fail to open a keyfile, and log | ||
545 | the reason why the open failed to debug (closes: #431538). | ||
546 | - Prevent sftp from crashing when given a "-" without a command. Also, | ||
547 | allow whitespace to follow a "-" (closes: #531561). | ||
548 | |||
549 | * Fix 'debian/rules quilt-setup' to avoid writing .orig files if some | ||
550 | patches apply with offsets. | ||
551 | * Include debian/ssh-askpass-gnome.png in the Debian tarball now that | ||
552 | we're using a source format that permits this, rather than messing | ||
553 | around with uudecode. | ||
554 | * Drop compatibility with the old gssapi mechanism used in ssh-krb5 << | ||
555 | 3.8.1p1-1. Simon Wilkinson refused this patch since the old gssapi | ||
556 | mechanism was removed due to a serious security hole, and since these | ||
557 | versions of ssh-krb5 are no longer security-supported by Debian I don't | ||
558 | think there's any point keeping client compatibility for them. | ||
559 | * Fix substitution of ETC_PAM_D_SSH, following the rename in 1:4.7p1-4. | ||
560 | * Hardcode the location of xauth to /usr/bin/xauth rather than | ||
561 | /usr/bin/X11/xauth (thanks, Aron Griffis; closes: #575725, LP: #8440). | ||
562 | xauth no longer depends on x11-common, so we're no longer guaranteed to | ||
563 | have the /usr/bin/X11 symlink available. I was taking advantage of the | ||
564 | /usr/bin/X11 symlink to smooth X's move to /usr/bin, but this is far | ||
565 | enough in the past now that it's probably safe to just use /usr/bin. | ||
566 | * Remove SSHD_OOM_ADJUST configuration. sshd now unconditionally makes | ||
567 | itself non-OOM-killable, and doesn't require configuration to avoid log | ||
568 | spam in virtualisation containers (closes: #555625). | ||
569 | * Drop Debian-specific removal of OpenSSL version check. Upstream ignores | ||
570 | the two patchlevel nybbles now, which is sufficient to address the | ||
571 | original reason this change was introduced, and it appears that any | ||
572 | change in the major/minor/fix nybbles would involve a new libssl package | ||
573 | name. (We'd still lose if the status nybble were ever changed, but that | ||
574 | would mean somebody had packaged a development/beta version rather than | ||
575 | a proper release, which doesn't appear to be normal practice.) | ||
576 | * Drop most of our "LogLevel SILENT" (-qq) patch. This was originally | ||
577 | introduced to match the behaviour of non-free SSH, in which -q does not | ||
578 | suppress fatal errors, but matching the behaviour of OpenSSH upstream is | ||
579 | much more important nowadays. We no longer document that -q does not | ||
580 | suppress fatal errors (closes: #280609). Migrate "LogLevel SILENT" to | ||
581 | "LogLevel QUIET" in sshd_config on upgrade. | ||
582 | * Policy version 3.8.4: | ||
583 | - Add a Homepage field. | ||
584 | |||
585 | -- Colin Watson <cjwatson@debian.org> Tue, 06 Apr 2010 22:38:31 +0100 | ||
586 | |||
587 | openssh (1:5.3p1-3) unstable; urgency=low | ||
588 | |||
589 | * Convert to source format 3.0 (quilt). | ||
590 | * Update README.source to match, and add a 'quilt-setup' target to | ||
591 | debian/rules for the benefit of those checking out the package from | ||
592 | revision control. | ||
593 | * All patches are now maintained separately and tagged according to DEP-3. | ||
594 | * Add GSSAPIStoreCredentialsOnRekey to 'sshd -T' configuration dump. | ||
595 | * Remove documentation of building for Debian 3.0 in README.Debian. | ||
596 | Support for this was removed in 1:4.7p1-2. | ||
597 | * Remove obsolete header from README.Debian dating from when people | ||
598 | expected non-free SSH. | ||
599 | * Update copyright years for GSSAPI patch. | ||
600 | |||
601 | -- Colin Watson <cjwatson@debian.org> Sun, 28 Feb 2010 01:35:53 +0000 | ||
602 | |||
603 | openssh (1:5.3p1-2) unstable; urgency=low | ||
604 | |||
605 | * Link with -Wl,--as-needed (closes: #560155). | ||
606 | * Install upstream sshd_config as an example (closes: #415008). | ||
607 | * Use dh_lintian. | ||
608 | * Honour DEB_BUILD_OPTIONS=nocheck. | ||
609 | |||
610 | -- Colin Watson <cjwatson@debian.org> Mon, 22 Feb 2010 12:43:24 +0000 | ||
611 | |||
612 | openssh (1:5.3p1-1) unstable; urgency=low | ||
613 | |||
614 | * New upstream release. | ||
615 | * Update to GSSAPI patch from | ||
616 | http://www.sxw.org.uk/computing/patches/openssh-5.3p1-gsskex-all-20100124.patch. | ||
617 | * Backport from upstream: | ||
618 | - Do not fall back to adding keys without constraints (ssh-add -c / -t | ||
619 | ...) when the agent refuses the constrained add request. This was a | ||
620 | useful migration measure back in 2002 when constraints were new, but | ||
621 | just adds risk now (LP: #209447). | ||
622 | * Drop change from 1:3.8p1-3 to avoid setresuid() and setresgid() system | ||
623 | calls. This only applied to Linux 2.2, which it's no longer feasible to | ||
624 | run anyway (see 1:5.2p1-2 changelog). | ||
625 | |||
626 | -- Colin Watson <cjwatson@debian.org> Tue, 26 Jan 2010 11:55:29 +0000 | ||
627 | |||
628 | openssh (1:5.2p1-2) unstable; urgency=low | ||
629 | |||
630 | [ Colin Watson ] | ||
631 | * Backport from upstream: | ||
632 | - After sshd receives a SIGHUP, ignore subsequent HUPs while sshd | ||
633 | re-execs itself. Prevents two HUPs in quick succession from resulting | ||
634 | in sshd dying (LP: #497781). | ||
635 | - Output a debug if we can't open an existing keyfile (LP: #505301). | ||
636 | * Use host compiler for ssh-askpass-gnome when cross-compiling. | ||
637 | * Don't run tests when cross-compiling. | ||
638 | * Drop change from 1:3.6.1p2-5 to disable cmsg_type check for file | ||
639 | descriptor passing when running on Linux 2.0. The previous stable | ||
640 | release of Debian dropped support for Linux 2.4, let alone 2.0, so this | ||
641 | very likely has no remaining users depending on it. | ||
642 | |||
643 | [ Kees Cook ] | ||
644 | * Implement DebianBanner server configuration flag that can be set to "no" | ||
645 | to allow sshd to run without the Debian-specific extra version in the | ||
646 | initial protocol handshake (closes: #562048). | ||
647 | |||
648 | -- Colin Watson <cjwatson@debian.org> Sat, 16 Jan 2010 01:28:58 +0000 | ||
649 | |||
650 | openssh (1:5.2p1-1) unstable; urgency=low | ||
651 | |||
652 | * New upstream release (closes: #536182). Yes, I know 5.3p1 has been out | ||
653 | for a while, but there's no GSSAPI patch available for it yet. | ||
654 | - Change the default cipher order to prefer the AES CTR modes and the | ||
655 | revised "arcfour256" mode to CBC mode ciphers that are susceptible to | ||
656 | CPNI-957037 "Plaintext Recovery Attack Against SSH". | ||
657 | - Add countermeasures to mitigate CPNI-957037-style attacks against the | ||
658 | SSH protocol's use of CBC-mode ciphers. Upon detection of an invalid | ||
659 | packet length or Message Authentication Code, ssh/sshd will continue | ||
660 | reading up to the maximum supported packet length rather than | ||
661 | immediately terminating the connection. This eliminates most of the | ||
662 | known differences in behaviour that leaked information about the | ||
663 | plaintext of injected data which formed the basis of this attack | ||
664 | (closes: #506115, LP: #379329). | ||
665 | - ForceCommand directive now accepts commandline arguments for the | ||
666 | internal-sftp server (closes: #524423, LP: #362511). | ||
667 | - Add AllowAgentForwarding to available Match keywords list (closes: | ||
668 | #540623). | ||
669 | - Make ssh(1) send the correct channel number for | ||
670 | SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to | ||
671 | avoid triggering 'Non-public channel' error messages on sshd(8) in | ||
672 | openssh-5.1. | ||
673 | - Avoid printing 'Non-public channel' warnings in sshd(8), since the | ||
674 | ssh(1) has sent incorrect channel numbers since ~2004 (this reverts a | ||
675 | behaviour introduced in openssh-5.1; closes: #496017). | ||
676 | - Disable nonfunctional ssh(1) ~C escape handler in multiplex slave | ||
677 | connections (closes: #507541). | ||
678 | - Fix "whitepsace" typo in ssh_config(5) (closes: #514313, LP: #303835). | ||
679 | * Update to GSSAPI patch from | ||
680 | http://www.sxw.org.uk/computing/patches/openssh-5.2p1-gsskex-all-20090726.patch, | ||
681 | including cascading credentials support (LP: #416958). | ||
682 | * Use x11.pc when compiling/linking gnome-ssh-askpass2 (closes: #555951). | ||
683 | * Moved to bzr.debian.org; add Vcs-Bzr and Vcs-Browser control fields. | ||
684 | * Add debian/README.source with instructions on bzr handling. | ||
685 | * Make ChrootDirectory work with SELinux (thanks, Russell Coker; closes: | ||
686 | #556644). | ||
687 | * Initialise sc to NULL in ssh_selinux_getctxbyname (thanks, Václav OvsÃk; | ||
688 | closes: #498684). | ||
689 | * Don't duplicate backslashes when displaying server banner (thanks, | ||
690 | Michał Górny; closes: #505378, LP: #425346). | ||
691 | * Use hardening-includes for hardening logic (thanks, Kees Cook; closes: | ||
692 | #561887). | ||
693 | * Update OpenSSH FAQ to revision 1.110. | ||
694 | * Remove ssh/new_config, only needed for direct upgrades from potato which | ||
695 | are no longer particularly feasible anyway (closes: #420682). | ||
696 | * Cope with insserv reordering of init script links. | ||
697 | * Remove init script stop link in rc1, as killprocs handles it already. | ||
698 | * Adjust short descriptions to avoid relying on previous experience with | ||
699 | rsh, based on suggestions from Reuben Thomas (closes: #512198). | ||
700 | * Remove manual page references to login.conf, which aren't applicable on | ||
701 | non-BSD systems (closes: #154434). | ||
702 | * Remove/adjust manual page references to BSD-specific /etc/rc (closes: | ||
703 | #513417). | ||
704 | * Refer to sshd_config(5) rather than sshd(8) in postinst-written | ||
705 | /etc/ssh/sshd_config, and add UsePAM commentary from upstream-shipped | ||
706 | configuration file (closes: #415008, although unfortunately this will | ||
707 | only be conveniently visible on new installations). | ||
708 | * Include URL to OpenBSD's ssl(8) in ssh(1), since I don't see a better | ||
709 | source for the same information among Debian's manual pages (closes: | ||
710 | #530692, LP: #456660). | ||
711 | |||
712 | -- Colin Watson <cjwatson@debian.org> Mon, 04 Jan 2010 13:23:35 +0000 | ||
713 | |||
714 | openssh (1:5.1p1-8) unstable; urgency=low | ||
715 | |||
716 | * Build with just -fPIC on mips/mipsel, not -fPIE as well (thanks, LIU Qi; | ||
717 | closes: #538313). | ||
718 | * Build-depend on libselinux1-dev on sh4 too (thanks, Nobuhiro Iwamatsu; | ||
719 | closes: #547103). | ||
720 | * Fix grammar in if-up script (closes: #549128). | ||
721 | * Pass $SSHD_OPTS when checking configuration too (thanks, "sobtwmxt"; | ||
722 | closes: #548662). | ||
723 | |||
724 | -- Colin Watson <cjwatson@debian.org> Mon, 05 Oct 2009 13:30:49 +0100 | ||
725 | |||
726 | openssh (1:5.1p1-7) unstable; urgency=low | ||
727 | |||
728 | * Update config.guess and config.sub from autotools-dev 20090611.1 | ||
729 | (closes: #538301). | ||
730 | * Set umask to 022 in the init script as well as postinsts (closes: | ||
731 | #539030). | ||
732 | * Add ${misc:Depends} to keep Lintian happy. | ||
733 | * Use 'which' rather than 'type' in maintainer scripts. | ||
734 | * Upgrade to debhelper v7. | ||
735 | |||
736 | -- Colin Watson <cjwatson@debian.org> Fri, 31 Jul 2009 16:28:10 +0100 | ||
737 | |||
738 | openssh (1:5.1p1-6) unstable; urgency=low | ||
739 | |||
740 | * Open /proc/self/oom_adj with O_RDONLY or O_WRONLY as necessary, rather | ||
741 | than O_RDWR. | ||
742 | * Disable OOM adjustment for vserver/OpenVZ (thanks, Karl Chen; closes: | ||
743 | #511771). | ||
744 | * Add ufw integration (thanks, Didier Roche; see | ||
745 | https://wiki.ubuntu.com/UbuntuFirewall#Integrating%20UFW%20with%20Packages; | ||
746 | LP: #261884). | ||
747 | * Add a comment above PermitRootLogin in sshd_config pointing to | ||
748 | README.Debian. | ||
749 | * Check if delgroup is present in openssh-client.postrm (closes: #530501). | ||
750 | * Build with -fPIC on mips/mipsel (thanks, Luk Claes; closes: #531942). | ||
751 | * Remove /var/run/sshd from openssh-server package; it will be created at | ||
752 | run-time before starting the server. | ||
753 | * Use invoke-rc.d in openssh-server's if-up script. | ||
754 | |||
755 | -- Colin Watson <cjwatson@debian.org> Fri, 05 Jun 2009 11:56:03 +0100 | ||
756 | |||
757 | openssh (1:5.1p1-5) unstable; urgency=low | ||
758 | |||
759 | * Backport from upstream CVS (Markus Friedl): | ||
760 | - packet_disconnect() on padding error, too. Should reduce the success | ||
761 | probability for the CPNI-957037 Plaintext Recovery Attack to 2^-18. | ||
762 | * Check that /var/run/sshd.pid exists and that the process ID listed there | ||
763 | corresponds to sshd before running '/etc/init.d/ssh reload' from if-up | ||
764 | script; SIGHUP is racy if called at boot before sshd has a chance to | ||
765 | install its signal handler, but fortunately the pid file is written | ||
766 | after that which lets us avoid the race (closes: #502444). | ||
767 | * While the above is a valuable sanity-check, it turns out that it doesn't | ||
768 | really fix the bug (thanks to Kevin Price for testing), so for the | ||
769 | meantime we'll just use '/etc/init.d/ssh restart', even though it is | ||
770 | unfortunately heavyweight. | ||
771 | |||
772 | -- Colin Watson <cjwatson@debian.org> Wed, 14 Jan 2009 00:34:08 +0000 | ||
773 | |||
774 | openssh (1:5.1p1-4) unstable; urgency=low | ||
775 | |||
776 | * ssh-copy-id: Strip trailing colons from hostname (closes: #226172, | ||
777 | LP: #249706; thanks to Karl Goetz for nudging this along; forwarded | ||
778 | upstream as https://bugzilla.mindrot.org/show_bug.cgi?id=1530). | ||
779 | * Backport from upstream CVS (Markus Friedl): | ||
780 | - Only send eow and no-more-sessions requests to openssh 5 and newer; | ||
781 | fixes interop problems with broken ssh v2 implementations (closes: | ||
782 | #495917). | ||
783 | * Fix double-free when failing to parse a forwarding specification given | ||
784 | using ~C (closes: #505330; forwarded upstream as | ||
785 | https://bugzilla.mindrot.org/show_bug.cgi?id=1539). | ||
786 | |||
787 | -- Colin Watson <cjwatson@debian.org> Sun, 23 Nov 2008 14:46:10 +0000 | ||
788 | |||
789 | openssh (1:5.1p1-3) unstable; urgency=low | ||
790 | |||
791 | * Remove unnecessary ssh-vulnkey output in non-verbose mode when no | ||
792 | compromised or unknown keys were found (closes: #496495). | ||
793 | * Configure with --disable-strip; dh_strip will deal with stripping | ||
794 | binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link; | ||
795 | closes: #498681). | ||
796 | * Fix handling of zero-length server banners (thanks, Tomas Mraz; closes: | ||
797 | #497026). | ||
798 | |||
799 | -- Colin Watson <cjwatson@debian.org> Tue, 30 Sep 2008 23:09:58 +0100 | ||
800 | |||
801 | openssh (1:5.1p1-2) unstable; urgency=low | ||
802 | |||
803 | * Look for $SHELL on the path when executing ProxyCommands or | ||
804 | LocalCommands (closes: #492728). | ||
805 | |||
806 | -- Colin Watson <cjwatson@debian.org> Tue, 29 Jul 2008 15:31:25 +0100 | ||
807 | |||
808 | openssh (1:5.1p1-1) unstable; urgency=low | ||
809 | |||
810 | * New upstream release (closes: #474301). Important changes not previously | ||
811 | backported to 4.7p1: | ||
812 | - 4.9/4.9p1 (http://www.openssh.com/txt/release-4.9): | ||
813 | + Added chroot(2) support for sshd(8), controlled by a new option | ||
814 | "ChrootDirectory" (closes: #139047, LP: #24777). | ||
815 | + Linked sftp-server(8) into sshd(8). The internal sftp server is used | ||
816 | when the command "internal-sftp" is specified in a Subsystem or | ||
817 | ForceCommand declaration. When used with ChrootDirectory, the | ||
818 | internal sftp server requires no special configuration of files | ||
819 | inside the chroot environment. | ||
820 | + Added a protocol extension method "posix-rename@openssh.com" for | ||
821 | sftp-server(8) to perform POSIX atomic rename() operations; sftp(1) | ||
822 | prefers this if available (closes: #308561). | ||
823 | + Removed the fixed limit of 100 file handles in sftp-server(8). | ||
824 | + ssh(8) will now skip generation of SSH protocol 1 ephemeral server | ||
825 | keys when in inetd mode and protocol 2 connections are negotiated. | ||
826 | This speeds up protocol 2 connections to inetd-mode servers that | ||
827 | also allow Protocol 1. | ||
828 | + Accept the PermitRootLogin directive in a sshd_config(5) Match | ||
829 | block. Allows for, e.g. permitting root only from the local network. | ||
830 | + Reworked sftp(1) argument splitting and escaping to be more | ||
831 | internally consistent (i.e. between sftp commands) and more | ||
832 | consistent with sh(1). Please note that this will change the | ||
833 | interpretation of some quoted strings, especially those with | ||
834 | embedded backslash escape sequences. | ||
835 | + Support "Banner=none" in sshd_config(5) to disable sending of a | ||
836 | pre-login banner (e.g. in a Match block). | ||
837 | + ssh(1) ProxyCommands are now executed with $SHELL rather than | ||
838 | /bin/sh. | ||
839 | + ssh(1)'s ConnectTimeout option is now applied to both the TCP | ||
840 | connection and the SSH banner exchange (previously it just covered | ||
841 | the TCP connection). This allows callers of ssh(1) to better detect | ||
842 | and deal with stuck servers that accept a TCP connection but don't | ||
843 | progress the protocol, and also makes ConnectTimeout useful for | ||
844 | connections via a ProxyCommand. | ||
845 | + scp(1) incorrectly reported "stalled" on slow copies (closes: | ||
846 | #140828). | ||
847 | + scp(1) date underflow for timestamps before epoch. | ||
848 | + ssh(1) used the obsolete SIG DNS RRtype for host keys in DNS, | ||
849 | instead of the current standard RRSIG. | ||
850 | + Correctly drain ACKs when a sftp(1) upload write fails midway, | ||
851 | avoids a fatal() exit from what should be a recoverable condition. | ||
852 | + Fixed ssh-keygen(1) selective host key hashing (i.e. "ssh-keygen -HF | ||
853 | hostname") to not include any IP address in the data to be hashed. | ||
854 | + Make ssh(1) skip listening on the IPv6 wildcard address when a | ||
855 | binding address of 0.0.0.0 is used against an old SSH server that | ||
856 | does not support the RFC4254 syntax for wildcard bind addresses. | ||
857 | + Enable IPV6_V6ONLY socket option on sshd(8) listen socket, as is | ||
858 | already done for X11/TCP forwarding sockets (closes: #439661). | ||
859 | + Fix FD leak that could hang a ssh(1) connection multiplexing master. | ||
860 | + Make ssh(1) -q option documentation consistent with reality. | ||
861 | + Fixed sshd(8) PAM support not calling pam_session_close(), or | ||
862 | failing to call it with root privileges (closes: #372680). | ||
863 | + Fix activation of OpenSSL engine support when requested in configure | ||
864 | (LP: #119295). | ||
865 | + Cache SELinux status earlier so we know if it's enabled after a | ||
866 | chroot (LP: #237557). | ||
867 | - 5.1/5.1p1 (http://www.openssh.com/txt/release-5.1): | ||
868 | + Introduce experimental SSH Fingerprint ASCII Visualisation to ssh(1) | ||
869 | and ssh-keygen(1). Visual fingerprint display is controlled by a new | ||
870 | ssh_config(5) option "VisualHostKey". The intent is to render SSH | ||
871 | host keys in a visual form that is amenable to easy recall and | ||
872 | rejection of changed host keys. | ||
873 | + sshd_config(5) now supports CIDR address/masklen matching in "Match | ||
874 | address" blocks, with a fallback to classic wildcard matching. | ||
875 | + sshd(8) now supports CIDR matching in ~/.ssh/authorized_keys | ||
876 | from="..." restrictions, also with a fallback to classic wildcard | ||
877 | matching. | ||
878 | + Added an extended test mode (-T) to sshd(8) to request that it write | ||
879 | its effective configuration to stdout and exit. Extended test mode | ||
880 | also supports the specification of connection parameters (username, | ||
881 | source address and hostname) to test the application of | ||
882 | sshd_config(5) Match rules. | ||
883 | + ssh(1) now prints the number of bytes transferred and the overall | ||
884 | connection throughput for SSH protocol 2 sessions when in verbose | ||
885 | mode (previously these statistics were displayed for protocol 1 | ||
886 | connections only). | ||
887 | + sftp-server(8) now supports extension methods statvfs@openssh.com | ||
888 | and fstatvfs@openssh.com that implement statvfs(2)-like operations. | ||
889 | + sftp(1) now has a "df" command to the sftp client that uses the | ||
890 | statvfs@openssh.com to produce a df(1)-like display of filesystem | ||
891 | space and inode utilisation (requires statvfs@openssh.com support on | ||
892 | the server). | ||
893 | + Added a MaxSessions option to sshd_config(5) to allow control of the | ||
894 | number of multiplexed sessions supported over a single TCP | ||
895 | connection. This allows increasing the number of allowed sessions | ||
896 | above the previous default of 10, disabling connection multiplexing | ||
897 | (MaxSessions=1) or disallowing login/shell/subsystem sessions | ||
898 | entirely (MaxSessions=0). | ||
899 | + Added a no-more-sessions@openssh.com global request extension that | ||
900 | is sent from ssh(1) to sshd(8) when the client knows that it will | ||
901 | never request another session (i.e. when session multiplexing is | ||
902 | disabled). This allows a server to disallow further session requests | ||
903 | and terminate the session in cases where the client has been | ||
904 | hijacked. | ||
905 | + ssh-keygen(1) now supports the use of the -l option in combination | ||
906 | with -F to search for a host in ~/.ssh/known_hosts and display its | ||
907 | fingerprint. | ||
908 | + ssh-keyscan(1) now defaults to "rsa" (protocol 2) keys, instead of | ||
909 | "rsa1" (LP: #129794). | ||
910 | + Added an AllowAgentForwarding option to sshd_config(8) to control | ||
911 | whether authentication agent forwarding is permitted. Note that this | ||
912 | is a loose control, as a client may install their own unofficial | ||
913 | forwarder. | ||
914 | + ssh(1) and sshd(8): avoid unnecessary malloc/copy/free when | ||
915 | receiving network data, resulting in a ~10% speedup. | ||
916 | + ssh(1) and sshd(8) will now try additional addresses when connecting | ||
917 | to a port forward destination whose DNS name resolves to more than | ||
918 | one address. The previous behaviour was to try the only first | ||
919 | address and give up if that failed. | ||
920 | + ssh(1) and sshd(8) now support signalling that channels are | ||
921 | half-closed for writing, through a channel protocol extension | ||
922 | notification "eow@openssh.com". This allows propagation of closed | ||
923 | file descriptors, so that commands such as "ssh -2 localhost od | ||
924 | /bin/ls | true" do not send unnecessary data over the wire. | ||
925 | + sshd(8): increased the default size of ssh protocol 1 ephemeral keys | ||
926 | from 768 to 1024 bits. | ||
927 | + When ssh(1) has been requested to fork after authentication ("ssh | ||
928 | -f") with ExitOnForwardFailure enabled, delay the fork until after | ||
929 | replies for any -R forwards have been seen. Allows for robust | ||
930 | detection of -R forward failure when using -f. | ||
931 | + "Match group" blocks in sshd_config(5) now support negation of | ||
932 | groups. E.g. "Match group staff,!guests". | ||
933 | + sftp(1) and sftp-server(8) now allow chmod-like operations to set | ||
934 | set[ug]id/sticky bits. | ||
935 | + The MaxAuthTries option is now permitted in sshd_config(5) match | ||
936 | blocks. | ||
937 | + Multiplexed ssh(1) sessions now support a subset of the ~ escapes | ||
938 | that are available to a primary connection. | ||
939 | + ssh(1) connection multiplexing will now fall back to creating a new | ||
940 | connection in most error cases (closes: #352830). | ||
941 | + Make ssh(1) deal more gracefully with channel requests that fail. | ||
942 | Previously it would optimistically assume that requests would always | ||
943 | succeed, which could cause hangs if they did not (e.g. when the | ||
944 | server runs out of file descriptors). | ||
945 | + ssh(1) now reports multiplexing errors via the multiplex slave's | ||
946 | stderr where possible (subject to LogLevel in the mux master). | ||
947 | + Fixed an UMAC alignment problem that manifested on Itanium | ||
948 | platforms. | ||
949 | * Remove our local version of moduli(5) now that there's one upstream. | ||
950 | * Say "GTK+" rather than "GTK" in ssh-askpass-gnome's description. | ||
951 | * Add lintian overrides for empty /usr/share/doc/openssh-client | ||
952 | directories in openssh-server and ssh (necessary due to being symlink | ||
953 | targets). | ||
954 | * Merge from Ubuntu: | ||
955 | - Add 'status' action to openssh-server init script, requiring lsb-base | ||
956 | (>= 3.2-13) (thanks, Dustin Kirkland). | ||
957 | * debconf template translations: | ||
958 | - Update Korean (thanks, Sunjae Park; closes: #484821). | ||
959 | |||
960 | -- Colin Watson <cjwatson@debian.org> Fri, 25 Jul 2008 10:45:08 +0100 | ||
961 | |||
962 | openssh (1:4.7p1-13) unstable; urgency=low | ||
963 | |||
964 | * Add some helpful advice to the end of ssh-vulnkey's output if there are | ||
965 | unknown or compromised keys (thanks, Dan Jacobson; closes: #483756). | ||
966 | * Check compromised key blacklist in ssh or ssh-add, as well as in the | ||
967 | server (LP: #232391). To override the blacklist check in ssh | ||
968 | temporarily, use 'ssh -o UseBlacklistedKeys=yes'; there is no override | ||
969 | for the blacklist check in ssh-add. | ||
970 | * Add cross-references to ssh-vulnkey(1) to ssh(1), ssh-add(1), | ||
971 | ssh-keygen(1), and sshd(8) (closes: #484451). | ||
972 | * Change openssh-client-udeb's Installer-Menu-Item from 99900 to 99999 | ||
973 | (thanks, Frans Pop). | ||
974 | * Drop openssh-client-udeb isinstallable hack, as main-menu (>= 1.26) now | ||
975 | takes care of that (thanks, Frans Pop; closes: #484404). | ||
976 | * Update DEB_BUILD_OPTIONS parsing code from policy 3.8.0. | ||
977 | * Add documentation on removing openssh-blacklist locally (see #484269). | ||
978 | * Clarify documentation of SSHD_OOM_ADJUST, and make setting it to the | ||
979 | empty string actually skip adjustment as intended (closes: #487325). | ||
980 | * Remove empty /usr/share/applications directory in ssh-askpass-gnome. | ||
981 | * debconf template translations: | ||
982 | - Update Romanian (thanks, Cătălin Feștilă; closes: #485415). | ||
983 | |||
984 | -- Colin Watson <cjwatson@debian.org> Mon, 21 Jul 2008 12:18:28 +0100 | ||
985 | |||
986 | openssh (1:4.7p1-12) unstable; urgency=low | ||
987 | |||
988 | * Fill in CVE identifier for ssh-vulnkey bug fixed in 1:4.7p1-10. | ||
989 | * Refactor rejection of blacklisted user keys into a single | ||
990 | reject_blacklisted_key function in auth.c (thanks, Dmitry V. Levin). | ||
991 | * Fix memory leak of blacklisted host keys (thanks, Dmitry V. Levin). | ||
992 | * debconf template translations: | ||
993 | - Update Dutch (thanks, Bart Cornelis; closes: #483004). | ||
994 | - Update Brazilian Portuguese (thanks, Eder L. Marques; closes: | ||
995 | #483142). | ||
996 | - Update Slovak (thanks, Ivan Masár; closes: #483517). | ||
997 | |||
998 | -- Colin Watson <cjwatson@debian.org> Thu, 29 May 2008 21:41:29 +0100 | ||
999 | |||
1000 | openssh (1:4.7p1-11) unstable; urgency=low | ||
1001 | |||
1002 | * Make init script depend on $syslog, and fix some other dependency | ||
1003 | glitches (thanks, Petter Reinholdtsen; closes: #481018). | ||
1004 | * Remove 0 and 6 from Default-Stop in init script (thanks, Kel Modderman; | ||
1005 | closes: #481151). | ||
1006 | * Restore OOM killer adjustment for child processes (thanks, Vaclav Ovsik; | ||
1007 | closes: #480020). | ||
1008 | * Allow building with heimdal-dev (LP: #125805). | ||
1009 | |||
1010 | * Check RSA1 keys without the need for a separate blacklist. Thanks to | ||
1011 | Simon Tatham for the idea. | ||
1012 | * Generate two keys with the PID forced to the same value and test that | ||
1013 | they differ, to defend against recurrences of the recent Debian OpenSSL | ||
1014 | vulnerability. | ||
1015 | * Recommend openssh-blacklist from openssh-client (closes: #481187). | ||
1016 | * Recommend openssh-blacklist-extra from openssh-client and | ||
1017 | openssh-server. | ||
1018 | * Make ssh-vulnkey report the file name and line number for each key | ||
1019 | (thanks, Heiko Schlittermann and Christopher Perry; closes: #481398). | ||
1020 | * Check for blacklists in /usr/share/ssh/ as well as /etc/ssh/ (see | ||
1021 | #481283). | ||
1022 | * Log IP addresses of hosts attempting to use blacklisted keys (closes: | ||
1023 | #481721). | ||
1024 | * Incorporate various ssh-vulnkey suggestions from Hugh Daniel: | ||
1025 | - Add -v (verbose) option, and don't print output for keys that have a | ||
1026 | blacklist file but that are not listed unless in verbose mode. | ||
1027 | - Move exit status documentation to a separate section. | ||
1028 | - Document key status descriptions. | ||
1029 | - Add key type to output. | ||
1030 | - Fix error output if ssh-vulnkey fails to read key files, with the | ||
1031 | exception of host keys unless -a was given. | ||
1032 | - In verbose mode, output the name of each file examined. | ||
1033 | * Handle leading IP addresses in ssh-vulnkey input (LP: #230497). | ||
1034 | * Fix various ssh-vulnkey problems pointed out by Solar Designer: | ||
1035 | - Fix some buffer handling inconsistencies. | ||
1036 | - Use xasprintf to build user key file names, avoiding truncation | ||
1037 | problems. | ||
1038 | - Drop to the user's UID when reading user keys with -a. | ||
1039 | - Use EUID rather than UID when run with no file names and without -a. | ||
1040 | - Reword "Unknown (no blacklist information)" to "Unknown (blacklist | ||
1041 | file not installed)". | ||
1042 | |||
1043 | * Fix typo in ssh/vulnerable_host_keys message (thanks, Esko Arajärvi). | ||
1044 | * debconf template translations: | ||
1045 | - Update Finnish (thanks, Esko Arajärvi; closes: #481530). | ||
1046 | - Update French (thanks, Christian Perrier; closes: #481576). | ||
1047 | - Update Norwegian Bokmål (thanks, Bjørn Steensrud; closes: #481591). | ||
1048 | - Update Galician (thanks, Jacobo Tarrio; closes: #481596). | ||
1049 | - Update Japanese (thanks, Kenshi Muto; closes: #481621). | ||
1050 | - Update Czech (thanks, Miroslav Kure; closes: #481624). | ||
1051 | - Update German (thanks, Helge Kreutzmann; closes: #481676). | ||
1052 | - Update Portuguese (thanks, Ricardo Silva; closes: #481781). | ||
1053 | - Update Basque (thanks, Piarres Beobide; closes: #481836). | ||
1054 | - Update Bulgarian (thanks, Damyan Ivanov; closes: #481870). | ||
1055 | - Update Vietnamese (thanks, Clytie Siddall; closes: #481876). | ||
1056 | - Update Spanish (thanks, Javier Fernandez-Sanguino Peña; closes: | ||
1057 | #482341). | ||
1058 | - Update Turkish (thanks, Mert Dirik; closes: #482548). | ||
1059 | - Update Russian (thanks, Yuri Kozlov; closes: #482887). | ||
1060 | - Update Swedish (thanks, Martin Bagge; closes: #482464). | ||
1061 | - Update Italian (thanks, Luca Monducci; closes: #482808). | ||
1062 | |||
1063 | -- Colin Watson <cjwatson@debian.org> Mon, 26 May 2008 12:21:39 +0100 | ||
1064 | |||
1065 | openssh (1:4.7p1-10) unstable; urgency=low | ||
1066 | |||
1067 | * Add a FILES section to ssh-vulnkey(1) (thanks, Hugh Daniel). | ||
1068 | * CVE-2008-2285: ssh-vulnkey handles options in authorized_keys | ||
1069 | (LP: #230029), and treats # as introducing a comment even if it is | ||
1070 | preceded by whitespace. | ||
1071 | |||
1072 | -- Colin Watson <cjwatson@debian.org> Wed, 14 May 2008 12:35:05 +0100 | ||
1073 | |||
1074 | openssh (1:4.7p1-9) unstable; urgency=critical | ||
1075 | |||
1076 | * Fill in CVE identifier for security vulnerability fixed in 1:4.7p1-8. | ||
1077 | * Mitigate OpenSSL security vulnerability (CVE-2008-0166): | ||
1078 | - Add key blacklisting support. Keys listed in | ||
1079 | /etc/ssh/blacklist.TYPE-LENGTH will be rejected for authentication by | ||
1080 | sshd, unless "PermitBlacklistedKeys yes" is set in | ||
1081 | /etc/ssh/sshd_config. | ||
1082 | - Add a new program, ssh-vulnkey, which can be used to check keys | ||
1083 | against these blacklists. | ||
1084 | - Depend on openssh-blacklist. | ||
1085 | - Force dependencies on libssl0.9.8 / libcrypto0.9.8-udeb to at least | ||
1086 | 0.9.8g-9. | ||
1087 | - Automatically regenerate known-compromised host keys, with a | ||
1088 | critical-priority debconf note. (I regret that there was no time to | ||
1089 | gather translations.) | ||
1090 | |||
1091 | -- Colin Watson <cjwatson@debian.org> Tue, 13 May 2008 12:33:38 +0100 | ||
1092 | |||
1093 | openssh (1:4.7p1-8) unstable; urgency=high | ||
1094 | |||
1095 | * Fill in CVE identifier for security vulnerability fixed in 1:4.7p1-5. | ||
1096 | * Rename KeepAlive to TCPKeepAlive in sshd_config, cleaning up from old | ||
1097 | configurations (LP: #211400). | ||
1098 | * Tweak scp's reporting of filenames in verbose mode to be a bit less | ||
1099 | confusing with spaces (thanks, Nicolas Valcárcel; LP: #89945). | ||
1100 | * Backport from 4.9p1: | ||
1101 | - CVE-2008-1657: Ignore ~/.ssh/rc if a sshd_config ForceCommand is | ||
1102 | specified. | ||
1103 | - Add no-user-rc authorized_keys option to disable execution of | ||
1104 | ~/.ssh/rc. | ||
1105 | * Backport from Simon Wilkinson's GSSAPI key exchange patch for 5.0p1: | ||
1106 | - Add code to actually implement GSSAPIStrictAcceptorCheck, which had | ||
1107 | somehow been omitted from a previous version of this patch (closes: | ||
1108 | #474246). | ||
1109 | |||
1110 | -- Colin Watson <cjwatson@debian.org> Sun, 06 Apr 2008 12:34:19 +0100 | ||
1111 | |||
1112 | openssh (1:4.7p1-7) unstable; urgency=low | ||
1113 | |||
1114 | * Ignore errors writing to oom_adj (closes: #473573). | ||
1115 | |||
1116 | -- Colin Watson <cjwatson@debian.org> Mon, 31 Mar 2008 16:24:44 +0100 | ||
1117 | |||
1118 | openssh (1:4.7p1-6) unstable; urgency=low | ||
1119 | |||
1120 | * Disable the Linux kernel's OOM-killer for the sshd parent; tweak | ||
1121 | SSHD_OOM_ADJUST in /etc/default/ssh to change this (closes: #341767). | ||
1122 | |||
1123 | -- Colin Watson <cjwatson@debian.org> Sun, 30 Mar 2008 21:14:12 +0100 | ||
1124 | |||
1125 | openssh (1:4.7p1-5) unstable; urgency=low | ||
1126 | |||
1127 | * Recommends: xauth rather than Suggests: xbase-clients. | ||
1128 | * Document in ssh(1) that '-S none' disables connection sharing | ||
1129 | (closes: #471437). | ||
1130 | * Patch from Red Hat / Fedora: | ||
1131 | - CVE-2008-1483: Don't use X11 forwarding port which can't be bound on | ||
1132 | all address families, preventing hijacking of X11 forwarding by | ||
1133 | unprivileged users when both IPv4 and IPv6 are configured (closes: | ||
1134 | #463011). | ||
1135 | * Use printf rather than echo -en (a bashism) in openssh-server.config and | ||
1136 | openssh-server.preinst. | ||
1137 | * debconf template translations: | ||
1138 | - Update Finnish (thanks, Esko Arajärvi; closes: #468563). | ||
1139 | |||
1140 | -- Colin Watson <cjwatson@debian.org> Sat, 22 Mar 2008 12:37:00 +0000 | ||
1141 | |||
1142 | openssh (1:4.7p1-4) unstable; urgency=low | ||
1143 | |||
1144 | [ Caleb Case ] | ||
1145 | * Fix configure detection of getseuserbyname and | ||
1146 | get_default_context_with_level (closes: #465614, LP: #188136). | ||
1147 | |||
1148 | [ Colin Watson ] | ||
1149 | * Include the autogenerated debian/copyright in the source package. | ||
1150 | * Move /etc/pam.d/ssh to /etc/pam.d/sshd, allowing us to stop defining | ||
1151 | SSHD_PAM_SERVICE (closes: #255870). | ||
1152 | |||
1153 | -- Colin Watson <cjwatson@debian.org> Wed, 13 Feb 2008 18:18:52 +0000 | ||
1154 | |||
1155 | openssh (1:4.7p1-3) unstable; urgency=low | ||
1156 | |||
1157 | * Improve grammar of ssh-askpass-gnome description. | ||
1158 | * Backport from upstream: | ||
1159 | - Use the correct packet maximum sizes for remote port and agent | ||
1160 | forwarding. Prevents the server from killing the connection if too | ||
1161 | much data is queued and an excessively large packet gets sent | ||
1162 | (https://bugzilla.mindrot.org/show_bug.cgi?id=1360). | ||
1163 | * Allow passing temporary daemon parameters on the init script's command | ||
1164 | line, e.g. '/etc/init.d/ssh start "-o PermitRootLogin=yes"' (thanks, | ||
1165 | Marc Haber; closes: #458547). | ||
1166 | |||
1167 | -- Colin Watson <cjwatson@debian.org> Fri, 01 Feb 2008 21:59:59 +0000 | ||
1168 | |||
1169 | openssh (1:4.7p1-2) unstable; urgency=low | ||
1170 | |||
1171 | * Adjust many relative links in faq.html to point to | ||
1172 | http://www.openssh.org/ (thanks, Dan Jacobson; mentioned in #459807). | ||
1173 | * Pass --with-mantype=doc to configure rather than build-depending on | ||
1174 | groff (closes: #460121). | ||
1175 | * Add armel to architecture list for libselinux1-dev build-dependency | ||
1176 | (closes: #460136). | ||
1177 | * Drop source-compatibility with Debian 3.0: | ||
1178 | - Remove support for building with GNOME 1. This allows simplification | ||
1179 | of our GNOME build-dependencies (see #460136). | ||
1180 | - Remove hacks to support the old PAM configuration scheme. | ||
1181 | - Remove compatibility for building without po-debconf. | ||
1182 | * Build-depend on libgtk2.0-dev rather than libgnomeui-dev. As far as I | ||
1183 | can see, the GTK2 version of ssh-askpass-gnome has never required | ||
1184 | libgnomeui-dev. | ||
1185 | |||
1186 | -- Colin Watson <cjwatson@debian.org> Fri, 11 Jan 2008 00:14:10 +0000 | ||
1187 | |||
1188 | openssh (1:4.7p1-1) unstable; urgency=low | ||
1189 | |||
1190 | * New upstream release (closes: #453367). | ||
1191 | - CVE-2007-4752: Prevent ssh(1) from using a trusted X11 cookie if | ||
1192 | creation of an untrusted cookie fails; found and fixed by Jan Pechanec | ||
1193 | (closes: #444738). | ||
1194 | - sshd(8) in new installations defaults to SSH Protocol 2 only. Existing | ||
1195 | installations are unchanged. | ||
1196 | - The SSH channel window size has been increased, and both ssh(1) | ||
1197 | sshd(8) now send window updates more aggressively. These improves | ||
1198 | performance on high-BDP (Bandwidth Delay Product) networks. | ||
1199 | - ssh(1) and sshd(8) now preserve MAC contexts between packets, which | ||
1200 | saves 2 hash calls per packet and results in 12-16% speedup for | ||
1201 | arcfour256/hmac-md5. | ||
1202 | - A new MAC algorithm has been added, UMAC-64 (RFC4418) as | ||
1203 | "umac-64@openssh.com". UMAC-64 has been measured to be approximately | ||
1204 | 20% faster than HMAC-MD5. | ||
1205 | - Failure to establish a ssh(1) TunnelForward is now treated as a fatal | ||
1206 | error when the ExitOnForwardFailure option is set. | ||
1207 | - ssh(1) returns a sensible exit status if the control master goes away | ||
1208 | without passing the full exit status. | ||
1209 | - When using a ProxyCommand in ssh(1), set the outgoing hostname with | ||
1210 | gethostname(2), allowing hostbased authentication to work. | ||
1211 | - Make scp(1) skip FIFOs rather than hanging (closes: #246774). | ||
1212 | - Encode non-printing characters in scp(1) filenames. These could cause | ||
1213 | copies to be aborted with a "protocol error". | ||
1214 | - Handle SIGINT in sshd(8) privilege separation child process to ensure | ||
1215 | that wtmp and lastlog records are correctly updated. | ||
1216 | - Report GSSAPI mechanism in errors, for libraries that support multiple | ||
1217 | mechanisms. | ||
1218 | - Improve documentation for ssh-add(1)'s -d option. | ||
1219 | - Rearrange and tidy GSSAPI code, removing server-only code being linked | ||
1220 | into the client. | ||
1221 | - Delay execution of ssh(1)'s LocalCommand until after all forwardings | ||
1222 | have been established. | ||
1223 | - In scp(1), do not truncate non-regular files. | ||
1224 | - Improve exit message from ControlMaster clients. | ||
1225 | - Prevent sftp-server(8) from reading until it runs out of buffer space, | ||
1226 | whereupon it would exit with a fatal error (closes: #365541). | ||
1227 | - pam_end() was not being called if authentication failed | ||
1228 | (closes: #405041). | ||
1229 | - Manual page datestamps updated (closes: #433181). | ||
1230 | * Install the OpenSSH FAQ in /usr/share/doc/openssh-client. | ||
1231 | - Includes documentation on copying files with colons using scp | ||
1232 | (closes: #303453). | ||
1233 | * Create /var/run/sshd on start even if /etc/ssh/sshd_not_to_be_run exists | ||
1234 | (closes: #453285). | ||
1235 | * Fix "overriden" typo in ssh(1) (thanks, A. Costa; closes: #390699). | ||
1236 | * Refactor debian/rules configure and make invocations to make development | ||
1237 | easier. | ||
1238 | * Remove the hideously old /etc/ssh/primes on upgrade (closes: #123013). | ||
1239 | * Update moduli(5) to revision 1.11 from OpenBSD CVS. | ||
1240 | * Document the non-default options we set as standard in ssh_config(5) and | ||
1241 | sshd_config(5) (closes: #327886, #345628). | ||
1242 | * Recode LICENCE to UTF-8 when concatenating it to debian/copyright. | ||
1243 | * Override desktop-file-but-no-dh_desktop-call lintian warning; the | ||
1244 | .desktop file is intentionally not installed (see 1:3.8.1p1-10). | ||
1245 | * Update copyright dates for Kerberos patch in debian/copyright.head. | ||
1246 | * Policy version 3.7.3: no changes required. | ||
1247 | |||
1248 | -- Colin Watson <cjwatson@debian.org> Mon, 24 Dec 2007 16:43:02 +0000 | ||
1249 | |||
1250 | openssh (1:4.6p1-7) unstable; urgency=low | ||
1251 | |||
1252 | * Don't build PIE executables on m68k (closes: #451192). | ||
1253 | * Use autotools-dev's recommended configure --build and --host options. | ||
1254 | * Adjust README.Debian to suggest mailing debian-ssh@lists.debian.org | ||
1255 | rather than Matthew. | ||
1256 | * Check whether deluser exists in postrm (closes: #454085). | ||
1257 | |||
1258 | -- Colin Watson <cjwatson@debian.org> Mon, 03 Dec 2007 11:11:02 +0000 | ||
1259 | |||
1260 | openssh (1:4.6p1-6) unstable; urgency=low | ||
1261 | |||
1262 | * Remove blank line between head comment and first template in | ||
1263 | debian/openssh-server.templates.master; apparently it confuses some | ||
1264 | versions of debconf. | ||
1265 | * Install authorized_keys(5) as a symlink to sshd(8) (thanks, Tomas | ||
1266 | Pospisek; closes: #441817). | ||
1267 | * Discard error output from dpkg-query in preinsts, in case the ssh | ||
1268 | metapackage is not installed. | ||
1269 | * Fix sshd/inittab advice in README.Debian to account for rc.d movement | ||
1270 | (closes: #450632). | ||
1271 | * Suppress error from debian/rules if lsb-release is not installed. | ||
1272 | * Don't ignore errors from 'make -C contrib clean'. | ||
1273 | * Adjust categories in ssh-askpass-gnome.desktop to comply with the | ||
1274 | Desktop Menu Specification. | ||
1275 | * debconf template translations: | ||
1276 | - Add Slovak (thanks, Ivan Masár; closes: #441690). | ||
1277 | - Update Brazilian Portuguese (thanks, Eder L. Marques; | ||
1278 | closes: #447145). | ||
1279 | |||
1280 | -- Colin Watson <cjwatson@debian.org> Mon, 12 Nov 2007 11:47:28 +0000 | ||
1281 | |||
1282 | openssh (1:4.6p1-5) unstable; urgency=low | ||
1283 | |||
1284 | * Identify ssh as a metapackage rather than a transitional package. It's | ||
1285 | still useful as a quick way to install both the client and the server. | ||
1286 | * ssh-copy-id now checks the exit status of ssh-add -L (thanks, Adeodato | ||
1287 | Simó; closes: #221675). | ||
1288 | * ssh-copy-id no longer prints the output of expr (thanks, Peter | ||
1289 | Eisentraut; closes: #291534). | ||
1290 | * ssh-copy-id defaults to ~/.ssh/id_rsa.pub rather than | ||
1291 | ~/.ssh/identity.pub, in line with ssh-keygen (thanks, Greg Norris; | ||
1292 | closes: #234627). | ||
1293 | * Build-depend on libselinux1-dev on lpia. | ||
1294 | * openssh-client Suggests: keychain. | ||
1295 | * debconf template translations: | ||
1296 | - Update Catalan (thanks, Jordà Polo; closes: #431970). | ||
1297 | |||
1298 | -- Colin Watson <cjwatson@debian.org> Mon, 30 Jul 2007 09:34:38 +0100 | ||
1299 | |||
1300 | openssh (1:4.6p1-4) unstable; urgency=low | ||
1301 | |||
1302 | * Don't build PIE executables on hppa, as they crash. | ||
1303 | |||
1304 | -- Colin Watson <cjwatson@debian.org> Thu, 05 Jul 2007 11:06:54 +0100 | ||
1305 | |||
1306 | openssh (1:4.6p1-3) unstable; urgency=low | ||
1307 | |||
1308 | * Only build PIE executables on Linux and NetBSD (closes: #430455). | ||
1309 | * Fix broken switch fallthrough when SELinux is running in permissive mode | ||
1310 | (closes: #430838). | ||
1311 | * Document that HashKnownHosts may break tab-completion (closes: #430154). | ||
1312 | |||
1313 | -- Colin Watson <cjwatson@debian.org> Fri, 29 Jun 2007 07:15:38 +0100 | ||
1314 | |||
1315 | openssh (1:4.6p1-2) unstable; urgency=low | ||
1316 | |||
1317 | * Fix ordering of SYSLOG_LEVEL_QUIET and SYSLOG_LEVEL_FATAL. | ||
1318 | * Clarify that 'ssh -q -q' still prints errors caused by bad arguments | ||
1319 | (i.e. before the logging system is initialised). | ||
1320 | * Suppress "Connection to <host> closed" and "Connection to master closed" | ||
1321 | messages at loglevel SILENT (thanks, Jaap Eldering; closes: #409788). | ||
1322 | * Suppress "Pseudo-terminal will not be allocated because stdin is not a | ||
1323 | terminal" message at loglevels QUIET and SILENT (closes: #366814). | ||
1324 | * Document the SILENT loglevel in sftp-server(8), ssh_config(5), and | ||
1325 | sshd_config(5). | ||
1326 | * Add try-restart action to init script. | ||
1327 | * Add /etc/network/if-up.d/openssh-server to restart sshd when new | ||
1328 | interfaces appear (LP: #103436). | ||
1329 | * Backport from upstream: | ||
1330 | - Move C/R -> kbdint special case to after the defaults have been | ||
1331 | loaded, which makes ChallengeResponse default to yes again. This was | ||
1332 | broken by the Match changes and not fixed properly subsequently | ||
1333 | (closes: #428968). | ||
1334 | - Silence spurious error messages from hang-on-exit fix | ||
1335 | (http://bugzilla.mindrot.org/show_bug.cgi?id=1306, closes: #429531). | ||
1336 | |||
1337 | -- Colin Watson <cjwatson@debian.org> Wed, 20 Jun 2007 11:52:44 +0100 | ||
1338 | |||
1339 | openssh (1:4.6p1-1) unstable; urgency=low | ||
1340 | |||
1341 | * New upstream release (closes: #395507, #397961, #420035). Important | ||
1342 | changes not previously backported to 4.3p2: | ||
1343 | - 4.4/4.4p1 (http://www.openssh.org/txt/release-4.4): | ||
1344 | + On portable OpenSSH, fix a GSSAPI authentication abort that could be | ||
1345 | used to determine the validity of usernames on some platforms. | ||
1346 | + Implemented conditional configuration in sshd_config(5) using the | ||
1347 | "Match" directive. This allows some configuration options to be | ||
1348 | selectively overridden if specific criteria (based on user, group, | ||
1349 | hostname and/or address) are met. So far a useful subset of | ||
1350 | post-authentication options are supported and more are expected to | ||
1351 | be added in future releases. | ||
1352 | + Add support for Diffie-Hellman group exchange key agreement with a | ||
1353 | final hash of SHA256. | ||
1354 | + Added a "ForceCommand" directive to sshd_config(5). Similar to the | ||
1355 | command="..." option accepted in ~/.ssh/authorized_keys, this forces | ||
1356 | the execution of the specified command regardless of what the user | ||
1357 | requested. This is very useful in conjunction with the new "Match" | ||
1358 | option. | ||
1359 | + Add a "PermitOpen" directive to sshd_config(5). This mirrors the | ||
1360 | permitopen="..." authorized_keys option, allowing fine-grained | ||
1361 | control over the port-forwardings that a user is allowed to | ||
1362 | establish. | ||
1363 | + Add optional logging of transactions to sftp-server(8). | ||
1364 | + ssh(1) will now record port numbers for hosts stored in | ||
1365 | ~/.ssh/known_hosts when a non-standard port has been requested | ||
1366 | (closes: #50612). | ||
1367 | + Add an "ExitOnForwardFailure" option to cause ssh(1) to exit (with a | ||
1368 | non-zero exit code) when requested port forwardings could not be | ||
1369 | established. | ||
1370 | + Extend sshd_config(5) "SubSystem" declarations to allow the | ||
1371 | specification of command-line arguments. | ||
1372 | + Replacement of all integer overflow susceptible invocations of | ||
1373 | malloc(3) and realloc(3) with overflow-checking equivalents. | ||
1374 | + Many manpage fixes and improvements. | ||
1375 | + Add optional support for OpenSSL hardware accelerators (engines), | ||
1376 | enabled using the --with-ssl-engine configure option. | ||
1377 | + Tokens in configuration files may be double-quoted in order to | ||
1378 | contain spaces (closes: #319639). | ||
1379 | + Move a debug() call out of a SIGCHLD handler, fixing a hang when the | ||
1380 | session exits very quickly (closes: #307890). | ||
1381 | + Fix some incorrect buffer allocation calculations (closes: #410599). | ||
1382 | + ssh-add doesn't ask for a passphrase if key file permissions are too | ||
1383 | liberal (closes: #103677). | ||
1384 | + Likewise, ssh doesn't ask either (closes: #99675). | ||
1385 | - 4.6/4.6p1 (http://www.openssh.org/txt/release-4.6): | ||
1386 | + sshd now allows the enabling and disabling of authentication methods | ||
1387 | on a per user, group, host and network basis via the Match directive | ||
1388 | in sshd_config. | ||
1389 | + Fixed an inconsistent check for a terminal when displaying scp | ||
1390 | progress meter (closes: #257524). | ||
1391 | + Fix "hang on exit" when background processes are running at the time | ||
1392 | of exit on a ttyful/login session (closes: #88337). | ||
1393 | * Update to current GSSAPI patch from | ||
1394 | http://www.sxw.org.uk/computing/patches/openssh-4.6p1-gsskex-20070312.patch; | ||
1395 | install ChangeLog.gssapi. | ||
1396 | * Build the .deb --with-ssl-engine (closes: #408027, LP: #119295). | ||
1397 | * Use LSB functions in init scripts, and add an LSB-style header (partly | ||
1398 | from Ubuntu and partly thanks to Christian Perrier; closes: #389038). | ||
1399 | * Move init script start links to S16, move rc1 stop link to K84, and | ||
1400 | remove rc0 and rc6 stop links altogether (the last part from Ubuntu; | ||
1401 | closes: #122188). | ||
1402 | * Emit a slightly more informative message from the init script if | ||
1403 | /dev/null has somehow become not a character device (closes: #369964). | ||
1404 | * Belatedly build-depend on zlib1g-dev (>= 1:1.2.3-1) (closes: #333447). | ||
1405 | * Merge from Ubuntu: | ||
1406 | - Build position-independent executables (only for debs, not for udebs) | ||
1407 | to take advantage of address space layout randomisation. | ||
1408 | - If building on Ubuntu, add /sbin, /usr/sbin, and /usr/local/sbin to | ||
1409 | the default path. | ||
1410 | * Use ${binary:Version} rather than ${Source-Version} in openssh-server -> | ||
1411 | openssh-client dependency. | ||
1412 | |||
1413 | -- Colin Watson <cjwatson@debian.org> Wed, 13 Jun 2007 00:28:26 +0100 | ||
1414 | |||
1415 | openssh (1:4.3p2-11) unstable; urgency=low | ||
1416 | |||
1417 | * It's been four and a half years now since I took over as "temporary" | ||
1418 | maintainer, so the Maintainer field is getting a bit inaccurate. Set | ||
1419 | Maintainer to debian-ssh@lists.debian.org and leave Matthew and myself | ||
1420 | as Uploaders. | ||
1421 | * Use dpkg-query to fetch conffile md5sums rather than parsing | ||
1422 | /var/lib/dpkg/status directly. | ||
1423 | * openssh-client Suggests: libpam-ssh (closes: #427840). | ||
1424 | * Use 'start-stop-daemon --oknodo' so that openssh-server's init script | ||
1425 | exits successfully if sshd is already running (closes: #426858). | ||
1426 | |||
1427 | * Apply results of debconf templates and package descriptions review by | ||
1428 | debian-l10n-english (closes: #420107, #420742). | ||
1429 | * debconf template translations: | ||
1430 | - Update Dutch (thanks, Machteld de Kok; closes: #419260). | ||
1431 | - Update Norwegian Bokmål (thanks, Bjørn Steensrud; closes: #420630). | ||
1432 | - Update Galician (thanks, Jacobo Tarrio; closes: #420635). | ||
1433 | - Update Spanish (thanks, Javier Fernández-Sanguino Peña; | ||
1434 | closes: #420651). | ||
1435 | - Update Swedish (thanks, Daniel Nylander; closes: #420663). | ||
1436 | - Add Bulgarian (thanks, Damyan Ivanov; closes: #420703). | ||
1437 | - Add Tamil (thanks, Tirumurti Vasudevan; closes: #420739). | ||
1438 | - Update German (thanks, Helge Kreutzmann; closes: #420743). | ||
1439 | - Update Japanese (thanks, Kenshi Muto; closes: #420946). | ||
1440 | - Add Basque (thanks, Piarres Beobide; closes: #421238). | ||
1441 | - Update Italian (thanks, Luca Monducci; closes: #421348). | ||
1442 | - Update Czech (thanks, Miroslav Kure; closes: #421484). | ||
1443 | - Update Romanian (thanks, Igor Stirbu; closes: #421760). | ||
1444 | - Update Russian (thanks, Yuriy Talakan' and Sergey Alyoshin; | ||
1445 | closes: #420862). | ||
1446 | - Update Dutch (thanks, Bart Cornelis; closes: #422767). | ||
1447 | - Update Portuguese (thanks, Ricardo Silva; closes: #423112). | ||
1448 | - Update French (thanks, Christian Perrier). | ||
1449 | - Add Korean (thanks, Sunjae Park; closes: #424008). | ||
1450 | - Update Vietnamese (thanks, Clytie Siddall; closes: #426991). | ||
1451 | |||
1452 | -- Colin Watson <cjwatson@debian.org> Sun, 10 Jun 2007 08:59:42 +0100 | ||
1453 | |||
1454 | openssh (1:4.3p2-10) unstable; urgency=low | ||
1455 | |||
1456 | * Multiply openssh-client-udeb's Installer-Menu-Item by 100. | ||
1457 | * Increase MAX_SESSIONS to 64. | ||
1458 | |||
1459 | -- Colin Watson <cjwatson@debian.org> Tue, 10 Apr 2007 19:17:20 +0100 | ||
1460 | |||
1461 | openssh (1:4.3p2-9) unstable; urgency=high | ||
1462 | |||
1463 | [ Russ Allbery ] | ||
1464 | * Fix GSSAPIKeyExchange configuration file handling logic in ssh-krb5 | ||
1465 | (closes: #404863). | ||
1466 | * Fix uncommenting of GSSAPI options by ssh-krb5 (closes: #407766). | ||
1467 | |||
1468 | [ Colin Watson ] | ||
1469 | * debconf template translations: | ||
1470 | - Add Norwegian Bokmål (thanks, Bjørn Steensrud; closes: #412330). | ||
1471 | |||
1472 | -- Colin Watson <cjwatson@debian.org> Mon, 5 Mar 2007 16:13:50 +0000 | ||
1473 | |||
1474 | openssh (1:4.3p2-8) unstable; urgency=medium | ||
1475 | |||
1476 | [ Vincent Untz ] | ||
1477 | * Give the ssh-askpass-gnome window a default icon; remove unnecessary | ||
1478 | icon extension from .desktop file (closes: | ||
1479 | https://launchpad.net/bugs/27152). | ||
1480 | |||
1481 | [ Colin Watson ] | ||
1482 | * Drop versioning on ssh/ssh-krb5 Replaces, as otherwise it isn't | ||
1483 | sufficient to replace conffiles (closes: #402804). | ||
1484 | * Make GSSAPICleanupCreds a compatibility alias for | ||
1485 | GSSAPICleanupCredentials. Mark GSSUseSessionCCache and | ||
1486 | GSSAPIUseSessionCredCache as known-but-unsupported options, and migrate | ||
1487 | away from them on upgrade. | ||
1488 | * It turns out that the people who told me that removing a conffile in the | ||
1489 | preinst was sufficient to have dpkg replace it without prompting when | ||
1490 | moving a conffile between packages were very much mistaken. As far as I | ||
1491 | can tell, the only way to do this reliably is to write out the desired | ||
1492 | new text of the conffile in the preinst. This is gross, and requires | ||
1493 | shipping the text of all conffiles in the preinst too, but there's | ||
1494 | nothing for it. Fortunately this nonsense is only required for smooth | ||
1495 | upgrades from sarge. | ||
1496 | * debconf template translations: | ||
1497 | - Add Romanian (thanks, Stan Ioan-Eugen; closes: #403528). | ||
1498 | |||
1499 | -- Colin Watson <cjwatson@debian.org> Sat, 23 Dec 2006 18:38:33 +0000 | ||
1500 | |||
1501 | openssh (1:4.3p2-7) unstable; urgency=medium | ||
1502 | |||
1503 | [ Colin Watson ] | ||
1504 | * Ignore errors from usermod when changing sshd's shell, since it will | ||
1505 | fail if the sshd user is not local (closes: #398436). | ||
1506 | * Remove version control tags from /etc/ssh/moduli and /etc/ssh/ssh_config | ||
1507 | to avoid unnecessary conffile resolution steps for administrators | ||
1508 | (thanks, Jari Aalto; closes: #335259). | ||
1509 | * Fix quoting error in configure.ac and regenerate configure (thanks, Ben | ||
1510 | Pfaff; closes: #391248). | ||
1511 | * When installing openssh-client or openssh-server from scratch, remove | ||
1512 | any unchanged conffiles from the pre-split ssh package to work around a | ||
1513 | bug in sarge's dpkg (thanks, Justin Pryzby and others; closes: #335276). | ||
1514 | |||
1515 | [ Russ Allbery ] | ||
1516 | * Create transitional ssh-krb5 package which enables GSSAPI configuration | ||
1517 | in sshd_config (closes: #390986). | ||
1518 | * Default client to attempting GSSAPI authentication. | ||
1519 | * Remove obsolete GSSAPINoMICAuthentication from sshd_config if it's | ||
1520 | found. | ||
1521 | * Add ssh -K option, the converse of -k, to enable GSSAPI credential | ||
1522 | delegation (closes: #401483). | ||
1523 | |||
1524 | -- Colin Watson <cjwatson@debian.org> Wed, 6 Dec 2006 23:00:49 +0000 | ||
1525 | |||
1526 | openssh (1:4.3p2-6) unstable; urgency=low | ||
1527 | |||
1528 | * Acknowledge NMU (thanks, Manoj; closes: #394795). | ||
1529 | * Backport from 4.5p1: | ||
1530 | - Fix a bug in the sshd privilege separation monitor that weakened its | ||
1531 | verification of successful authentication. This bug is not known to be | ||
1532 | exploitable in the absence of additional vulnerabilities. | ||
1533 | * openssh-server Suggests: molly-guard (closes: #395473). | ||
1534 | * debconf template translations: | ||
1535 | - Update German (thanks, Helge Kreutzmann; closes: #395947). | ||
1536 | |||
1537 | -- Colin Watson <cjwatson@debian.org> Wed, 15 Nov 2006 00:07:32 +0000 | ||
1538 | |||
1539 | openssh (1:4.3p2-5.1) unstable; urgency=low | ||
1540 | |||
1541 | * NMU to update SELinux patch, bringing it in line with current selinux | ||
1542 | releases. The patch for this NMU is simply the Bug#394795 patch, | ||
1543 | and no other changes. (closes: #394795) | ||
1544 | |||
1545 | -- Manoj Srivastava <srivasta@debian.org> Mon, 23 Oct 2006 14:11:24 -0500 | ||
1546 | |||
1547 | openssh (1:4.3p2-5) unstable; urgency=low | ||
1548 | |||
1549 | * Remove ssh/insecure_telnetd check altogether (closes: #391081). | ||
1550 | * debconf template translations: | ||
1551 | - Update Danish (thanks, Claus Hindsgaul; closes: #390612). | ||
1552 | |||
1553 | -- Colin Watson <cjwatson@debian.org> Thu, 5 Oct 2006 09:04:19 +0100 | ||
1554 | |||
1555 | openssh (1:4.3p2-4) unstable; urgency=high | ||
1556 | |||
1557 | * Backport from 4.4p1 (since I don't have an updated version of the GSSAPI | ||
1558 | patch yet): | ||
1559 | - CVE-2006-4924: Fix a pre-authentication denial of service found by | ||
1560 | Tavis Ormandy, that would cause sshd(8) to spin until the login grace | ||
1561 | time expired (closes: #389995). | ||
1562 | - CVE-2006-5051: Fix an unsafe signal hander reported by Mark Dowd. The | ||
1563 | signal handler was vulnerable to a race condition that could be | ||
1564 | exploited to perform a pre-authentication denial of service. On | ||
1565 | portable OpenSSH, this vulnerability could theoretically lead to | ||
1566 | pre-authentication remote code execution if GSSAPI authentication is | ||
1567 | enabled, but the likelihood of successful exploitation appears remote. | ||
1568 | |||
1569 | * Read /etc/default/locale as well as /etc/environment (thanks, Raphaël | ||
1570 | Hertzog; closes: #369395). | ||
1571 | * Remove no-longer-used ssh/insecure_rshd debconf template. | ||
1572 | * Make ssh/insecure_telnetd Type: error (closes: #388946). | ||
1573 | |||
1574 | * debconf template translations: | ||
1575 | - Update Portuguese (thanks, Rui Branco; closes: #381942). | ||
1576 | - Update Spanish (thanks, Javier Fernández-Sanguino Peña; | ||
1577 | closes: #382966). | ||
1578 | |||
1579 | -- Colin Watson <cjwatson@debian.org> Fri, 29 Sep 2006 16:28:24 +0100 | ||
1580 | |||
1581 | openssh (1:4.3p2-3) unstable; urgency=low | ||
1582 | |||
1583 | * Document KeepAlive->TCPKeepAlive renaming in sshd_config(5) (closes: | ||
1584 | https://launchpad.net/bugs/50702). | ||
1585 | * Change sshd user's shell to /usr/sbin/nologin (closes: #366541). | ||
1586 | Introduces dependency on passwd for usermod. | ||
1587 | * debconf template translations: | ||
1588 | - Update French (thanks, Denis Barbier; closes: #368503). | ||
1589 | - Update Dutch (thanks, Bart Cornelis; closes: #375100). | ||
1590 | - Update Japanese (thanks, Kenshi Muto; closes: #379950). | ||
1591 | |||
1592 | -- Colin Watson <cjwatson@debian.org> Thu, 27 Jul 2006 00:12:36 +0100 | ||
1593 | |||
1594 | openssh (1:4.3p2-2) unstable; urgency=low | ||
1595 | |||
1596 | * Include commented-out pam_access example in /etc/pam.d/ssh. | ||
1597 | * On '/etc/init.d/ssh restart', create /var/run/sshd before checking the | ||
1598 | server configuration, as otherwise 'sshd -t' will complain about the | ||
1599 | lack of /var/run/sshd (closes: https://launchpad.net/bugs/45234). | ||
1600 | * debconf template translations: | ||
1601 | - Update Russian (thanks, Yuriy Talakan'; closes: #367143). | ||
1602 | - Update Czech (thanks, Miroslav Kure; closes: #367161). | ||
1603 | - Update Italian (thanks, Luca Monducci; closes: #367186). | ||
1604 | - Update Galician (thanks, Jacobo Tarrio; closes: #367318). | ||
1605 | - Update Swedish (thanks, Daniel Nylander; closes: #367971). | ||
1606 | |||
1607 | -- Colin Watson <cjwatson@debian.org> Fri, 19 May 2006 09:14:27 +0100 | ||
1608 | |||
1609 | openssh (1:4.3p2-1) unstable; urgency=low | ||
1610 | |||
1611 | * New upstream release (closes: #361032). | ||
1612 | - CVE-2006-0225: scp (as does rcp, on which it is based) invoked a | ||
1613 | subshell to perform local to local, and remote to remote copy | ||
1614 | operations. This subshell exposed filenames to shell expansion twice; | ||
1615 | allowing a local attacker to create filenames containing shell | ||
1616 | metacharacters that, if matched by a wildcard, could lead to execution | ||
1617 | of attacker-specified commands with the privilege of the user running | ||
1618 | scp (closes: #349645). | ||
1619 | - Add support for tunneling arbitrary network packets over a connection | ||
1620 | between an OpenSSH client and server via tun(4) virtual network | ||
1621 | interfaces. This allows the use of OpenSSH (4.3+) to create a true VPN | ||
1622 | between the client and server providing real network connectivity at | ||
1623 | layer 2 or 3. This feature is experimental. | ||
1624 | - Reduce default key length for new DSA keys generated by ssh-keygen | ||
1625 | back to 1024 bits. DSA is not specified for longer lengths and does | ||
1626 | not fully benefit from simply making keys longer. As per FIPS 186-2 | ||
1627 | Change Notice 1, ssh-keygen will refuse to generate a new DSA key | ||
1628 | smaller or larger than 1024 bits. | ||
1629 | - Fixed X forwarding failing to start when the X11 client is executed in | ||
1630 | background at the time of session exit. | ||
1631 | - Change ssh-keygen to generate a protocol 2 RSA key when invoked | ||
1632 | without arguments (closes: #114894). | ||
1633 | - Fix timing variance for valid vs. invalid accounts when attempting | ||
1634 | Kerberos authentication. | ||
1635 | - Ensure that ssh always returns code 255 on internal error | ||
1636 | (closes: #259865). | ||
1637 | - Cleanup wtmp files on SIGTERM when not using privsep. | ||
1638 | - Set SO_REUSEADDR on X11 listeners to avoid problems caused by | ||
1639 | lingering sockets from previous session (X11 applications can | ||
1640 | sometimes not connect to 127.0.0.1:60xx) (closes: | ||
1641 | https://launchpad.net/bugs/25528). | ||
1642 | - Ensure that fds 0, 1 and 2 are always attached in all programs, by | ||
1643 | duping /dev/null to them if necessary. | ||
1644 | - Xauth list invocation had bogus "." argument. | ||
1645 | - Remove internal assumptions on key exchange hash algorithm and output | ||
1646 | length, preparing OpenSSH for KEX methods with alternate hashes. | ||
1647 | - Ignore junk sent by a server before it sends the "SSH-" banner. | ||
1648 | - Many manual page improvements. | ||
1649 | - Lots of cleanups, including fixes to memory leaks on error paths and | ||
1650 | possible crashes. | ||
1651 | * Update to current GSSAPI patch from | ||
1652 | http://www.sxw.org.uk/computing/patches/openssh-4.3p2-gsskex-20060223.patch | ||
1653 | (closes: #352042). | ||
1654 | * debian/rules: Resynchronise CFLAGS with that generated by configure. | ||
1655 | * Restore pam_nologin to /etc/pam.d/ssh; sshd no longer checks this itself | ||
1656 | when PAM is enabled, but relies on PAM to do it. | ||
1657 | * Rename KeepAlive to TCPKeepAlive in default sshd_config | ||
1658 | (closes: #349896). | ||
1659 | * Rephrase ssh/new_config and ssh/encrypted_host_key_but_no_keygen debconf | ||
1660 | templates to make boolean short descriptions end with a question mark | ||
1661 | and to avoid use of the first person. | ||
1662 | * Ship README.tun. | ||
1663 | * Policy version 3.7.2: no changes required. | ||
1664 | * debconf template translations: | ||
1665 | - Update Italian (thanks, Luca Monducci; closes: #360348). | ||
1666 | - Add Galician (thanks, Jacobo Tarrio; closes: #361220). | ||
1667 | |||
1668 | -- Colin Watson <cjwatson@debian.org> Fri, 12 May 2006 12:48:24 +0100 | ||
1669 | |||
1670 | openssh (1:4.2p1-8) unstable; urgency=low | ||
1671 | |||
1672 | [ Frans Pop ] | ||
1673 | * Use udeb support introduced in debhelper 4.2.0 (available in sarge) | ||
1674 | rather than constructing udebs by steam. | ||
1675 | * Require debhelper 5.0.22, which generates correct shared library | ||
1676 | dependencies for udebs (closes: #360068). This build-dependency can be | ||
1677 | ignored if building on sarge. | ||
1678 | |||
1679 | [ Colin Watson ] | ||
1680 | * Switch to debhelper compatibility level 4, since we now require | ||
1681 | debhelper 4 even on sarge anyway for udeb support. | ||
1682 | |||
1683 | -- Colin Watson <cjwatson@debian.org> Fri, 31 Mar 2006 09:44:55 +0100 | ||
1684 | |||
1685 | openssh (1:4.2p1-7) unstable; urgency=low | ||
1686 | |||
1687 | * I accidentally applied the default $PATH change in 1:4.2p1-6 to the udeb | ||
1688 | rather than the deb. Fixed. | ||
1689 | |||
1690 | -- Colin Watson <cjwatson@debian.org> Wed, 1 Mar 2006 16:19:00 +0000 | ||
1691 | |||
1692 | openssh (1:4.2p1-6) unstable; urgency=low | ||
1693 | |||
1694 | * Sync default values of $PATH from shadow 1:4.0.12-6, adding /usr/bin/X11 | ||
1695 | to the normal and superuser paths and /usr/games to the normal path. | ||
1696 | * When the client receives a signal, don't fatal() with "Killed by signal | ||
1697 | %d." (which produces unhelpful noise on stderr and causes confusion for | ||
1698 | users of some applications that wrap ssh); instead, generate a debug | ||
1699 | message and exit with the traditional status (closes: #313371). | ||
1700 | * debconf template translations: | ||
1701 | - Add Swedish (thanks, Daniel Nylander; closes: #333133). | ||
1702 | - Update Spanish (thanks, Javier Fernández-Sanguino Peña; | ||
1703 | closes: #341371). | ||
1704 | - Correct erroneously-changed Last-Translator headers in Greek and | ||
1705 | Spanish translations. | ||
1706 | |||
1707 | -- Colin Watson <cjwatson@debian.org> Mon, 20 Feb 2006 16:50:55 +0000 | ||
1708 | |||
1709 | openssh (1:4.2p1-5) unstable; urgency=low | ||
1710 | |||
1711 | * Add a CVE name to the 1:4.0p1-1 changelog entry. | ||
1712 | * Build-depend on libselinux1-dev on armeb. | ||
1713 | * Only send GSSAPI proposal if GSSAPIAuthentication is enabled. | ||
1714 | * Build-depend on libssl-dev (>= 0.9.8-1) to cope with surprise OpenSSL | ||
1715 | transition, since otherwise who knows what the buildds will do. If | ||
1716 | you're building openssh yourself, you can safely ignore this and use an | ||
1717 | older libssl-dev. | ||
1718 | |||
1719 | -- Colin Watson <cjwatson@debian.org> Fri, 7 Oct 2005 12:23:42 +0100 | ||
1720 | |||
1721 | openssh (1:4.2p1-4) unstable; urgency=low | ||
1722 | |||
1723 | * Initialise token to GSS_C_EMPTY_BUFFER in ssh_gssapi_check_mechanism | ||
1724 | (closes: #328606). | ||
1725 | |||
1726 | -- Colin Watson <cjwatson@debian.org> Fri, 16 Sep 2005 12:50:16 +0100 | ||
1727 | |||
1728 | openssh (1:4.2p1-3) unstable; urgency=low | ||
1729 | |||
1730 | * Add prototype for ssh_gssapi_server_mechanisms (closes: #328372). | ||
1731 | * Interoperate with ssh-krb5 << 3.8.1p1-1 servers, which used a slightly | ||
1732 | different version of the gssapi authentication method (thanks, Aaron M. | ||
1733 | Ucko; closes: #328388). | ||
1734 | * Explicitly tell po2debconf to use the 'popular' output encoding, so that | ||
1735 | the woody-compatibility hack works even with po-debconf 0.9.0. | ||
1736 | |||
1737 | -- Colin Watson <cjwatson@debian.org> Thu, 15 Sep 2005 09:28:21 +0100 | ||
1738 | |||
1739 | openssh (1:4.2p1-2) unstable; urgency=low | ||
1740 | |||
1741 | * Annotate 1:4.2p1-1 changelog with CVE references. | ||
1742 | * Add remaining pieces of Kerberos support (closes: #152657, #275472): | ||
1743 | - Add GSSAPI key exchange support from | ||
1744 | http://www.sxw.org.uk/computing/patches/openssh.html (thanks, Stephen | ||
1745 | Frost). | ||
1746 | - Build-depend on libkrb5-dev and configure --with-kerberos5=/usr. | ||
1747 | - openssh-client and openssh-server replace ssh-krb5. | ||
1748 | - Update commented-out Kerberos/GSSAPI options in default sshd_config. | ||
1749 | - Fix HAVE_GSSAPI_KRB5_H/HAVE_GSSAPI_GSSAPI_KRB5_H typos in | ||
1750 | gss-serv-krb5.c. | ||
1751 | |||
1752 | -- Colin Watson <cjwatson@debian.org> Wed, 14 Sep 2005 18:28:49 +0100 | ||
1753 | |||
1754 | openssh (1:4.2p1-1) unstable; urgency=low | ||
1755 | |||
1756 | * New upstream release. | ||
1757 | - SECURITY (CAN-2005-2797): Fix a bug introduced in OpenSSH 4.0 that | ||
1758 | caused GatewayPorts to be incorrectly activated for dynamic ("-D") | ||
1759 | port forwardings when no listen address was explicitly specified | ||
1760 | (closes: #326065). | ||
1761 | - SECURITY (CAN-2005-2798): Fix improper delegation of GSSAPI | ||
1762 | credentials. This code is only built in openssh-krb5, not openssh, but | ||
1763 | I mention the CVE reference here anyway for completeness. | ||
1764 | - Add a new compression method ("Compression delayed") that delays zlib | ||
1765 | compression until after authentication, eliminating the risk of zlib | ||
1766 | vulnerabilities being exploited by unauthenticated users. Note that | ||
1767 | users of OpenSSH versions earlier than 3.5 will need to disable | ||
1768 | compression on the client or set "Compression yes" (losing this | ||
1769 | security benefit) on the server. | ||
1770 | - Increase the default size of new RSA/DSA keys generated by ssh-keygen | ||
1771 | from 1024 to 2048 bits (closes: #181162). | ||
1772 | - Many bugfixes and improvements to connection multiplexing. | ||
1773 | - Don't pretend to accept $HOME (closes: #208648). | ||
1774 | * debian/rules: Resynchronise CFLAGS with that generated by configure. | ||
1775 | * openssh-client and openssh-server conflict with pre-split ssh to avoid | ||
1776 | problems when ssh is left un-upgraded (closes: #324695). | ||
1777 | * Set X11Forwarding to yes in the default sshd_config (new installs only). | ||
1778 | At least when X11UseLocalhost is turned on, which is the default, the | ||
1779 | security risks of using X11 forwarding are risks to the client, not to | ||
1780 | the server (closes: #320104). | ||
1781 | |||
1782 | -- Colin Watson <cjwatson@debian.org> Wed, 14 Sep 2005 15:16:14 +0100 | ||
1783 | |||
1784 | openssh (1:4.1p1-7) unstable; urgency=low | ||
1785 | |||
1786 | * Do the IDEA host key check on a temporary file to avoid altering | ||
1787 | /etc/ssh/ssh_host_key itself (closes: #312312). | ||
1788 | * Work around the ssh-askpass alternative somehow ending up in manual mode | ||
1789 | pointing to the obsolete /usr/lib/ssh/gnome-ssh-askpass. | ||
1790 | * Add GNU/kFreeBSD support (thanks, Aurelien Jarno; closes: #318113). | ||
1791 | * Fix XSIish uses of 'test' in openssh-server.preinst. | ||
1792 | * Policy version 3.6.2: no changes required. | ||
1793 | |||
1794 | -- Colin Watson <cjwatson@debian.org> Fri, 2 Sep 2005 16:18:11 +0100 | ||
1795 | |||
1796 | openssh (1:4.1p1-6) unstable; urgency=low | ||
1797 | |||
1798 | * Fix one-character typo that meant the binaries in openssh-client and | ||
1799 | openssh-server got recompiled with the wrong options during | ||
1800 | 'debian/rules install' (closes: #317088, #317238, #317241). | ||
1801 | |||
1802 | -- Colin Watson <cjwatson@debian.org> Thu, 7 Jul 2005 10:56:16 +0100 | ||
1803 | |||
1804 | openssh (1:4.1p1-5) unstable; urgency=low | ||
1805 | |||
1806 | * Build-depend on libselinux1-dev on ppc64 too (closes: #314625). | ||
1807 | * Drop priority of ssh to extra to match the override file. | ||
1808 | * Make /usr/share/doc/openssh-server and /usr/share/doc/ssh symlinks to | ||
1809 | /usr/share/doc/openssh-client (closes: #314745). | ||
1810 | * Ship README.dns (closes: #284874). | ||
1811 | * Disable btmp logging, since Debian's /var/log/btmp has inappropriate | ||
1812 | permissions (closes: #314956). | ||
1813 | * Allow ~/.ssh/config to be group-writable, provided that the group in | ||
1814 | question contains only the file's owner (closes: #314347). | ||
1815 | * debconf template translations: | ||
1816 | - Update Brazilian Portuguese (thanks, André LuÃs Lopes; | ||
1817 | closes: #315477). | ||
1818 | - Add Vietnamese (thanks, Clytie Siddall; closes: #316636). | ||
1819 | |||
1820 | -- Colin Watson <cjwatson@debian.org> Sun, 3 Jul 2005 17:08:08 +0100 | ||
1821 | |||
1822 | openssh (1:4.1p1-4) unstable; urgency=low | ||
1823 | |||
1824 | * openssh-client and openssh-server conflict with ssh-krb5, as ssh-krb5 | ||
1825 | only conflicts with ssh (closes: #312475). | ||
1826 | * SELinux support (thanks, Manoj Srivastava; closes: #308555): | ||
1827 | - Added SELinux capability, and turned it on be default. Added | ||
1828 | restorecon calls in preinst and postinst (should not matter if the | ||
1829 | machine is not SELinux aware). By and large, the changes made should | ||
1830 | have no effect unless the rules file calls --with-selinux; and even | ||
1831 | then there should be no performance hit for machines not actively | ||
1832 | running SELinux. | ||
1833 | - Modified the preinst and postinst to call restorecon to set the | ||
1834 | security context for the generated public key files. | ||
1835 | - Added a comment to /etc/pam.d/ssh to indicate that an SELinux system | ||
1836 | may want to also include pam_selinux.so. | ||
1837 | * Re-enable ssh-askpass-gnome on the Hurd, now that its build-dependencies | ||
1838 | are available. | ||
1839 | * Restore /usr/lib/sftp-server temporarily, as a symlink to | ||
1840 | /usr/lib/openssh/sftp-server (closes: #312891). | ||
1841 | * Switch to debhelper compatibility level 3, since 2 is deprecated. | ||
1842 | * debconf template translations: | ||
1843 | - Update German (thanks, Jens Seidel; closes: #313949). | ||
1844 | |||
1845 | -- Colin Watson <cjwatson@debian.org> Fri, 17 Jun 2005 14:20:20 +0100 | ||
1846 | |||
1847 | openssh (1:4.1p1-3) unstable; urgency=low | ||
1848 | |||
1849 | * Upload to unstable. | ||
1850 | |||
1851 | -- Colin Watson <cjwatson@debian.org> Mon, 6 Jun 2005 22:28:33 +0100 | ||
1852 | |||
1853 | openssh (1:4.1p1-2) experimental; urgency=low | ||
1854 | |||
1855 | * Drop debconf support for allowing SSH protocol 1, which is discouraged | ||
1856 | and has not been the default since openssh 1:3.0.1p1-1. Users who need | ||
1857 | this should edit sshd_config instead (closes: #147212). | ||
1858 | * Since ssh-keysign isn't used by default (you need to set | ||
1859 | EnableSSHKeysign to "yes" in /etc/ssh/ssh_config), having a debconf | ||
1860 | question to ask whether it should be setuid is overkill, and the | ||
1861 | question text had got out of date anyway. Remove this question, ship | ||
1862 | ssh-keysign setuid in openssh-client.deb, and set a statoverride if the | ||
1863 | debconf question was previously set to false. | ||
1864 | * Add lintian overrides for the above (setuid-binary, | ||
1865 | no-debconf-templates). | ||
1866 | * Fix picky lintian errors about slogin symlinks. | ||
1867 | * Fix DEB_HOST_ARCH_OS/DEB_HOST_GNU_SYSTEM compatibility handling. | ||
1868 | * Apply Linux 2.2 workaround (see #239999) only on Linux. | ||
1869 | |||
1870 | -- Colin Watson <cjwatson@debian.org> Thu, 2 Jun 2005 00:55:58 +0100 | ||
1871 | |||
1872 | openssh (1:4.1p1-1) experimental; urgency=low | ||
1873 | |||
1874 | * New upstream release. | ||
1875 | - Normalise socket addresses returned by get_remote_hostname(), fixing | ||
1876 | 4-in-6 mapping issues with AllowUsers et al (closes: #192234). | ||
1877 | * Take upstream's hint and disable the unsupported USE_POSIX_THREADS | ||
1878 | (closes: #295757, #308868, and possibly others; may open other bugs). | ||
1879 | Use PAM password authentication to avoid #278394. In future I may | ||
1880 | provide two sets of binaries built with and without this option, since | ||
1881 | it seems I can't win. | ||
1882 | * Disable ChallengeResponseAuthentication in new installations, returning | ||
1883 | to PasswordAuthentication by default, since it now supports PAM and | ||
1884 | apparently works better with a non-threaded sshd (closes: #247521). | ||
1885 | * openssh-server Suggests: rssh (closes: #233012). | ||
1886 | * Change libexecdir to /usr/lib/openssh, and fix up various alternatives | ||
1887 | and configuration files to match (closes: #87900, #151321). | ||
1888 | * Fix up very old sshd_config files that refer to /usr/libexec/sftp-server | ||
1889 | (closes: #141979). | ||
1890 | |||
1891 | -- Colin Watson <cjwatson@debian.org> Tue, 31 May 2005 01:33:33 +0100 | ||
1892 | |||
1893 | openssh (1:4.0p1-1) experimental; urgency=low | ||
1894 | |||
1895 | * New upstream release. | ||
1896 | - Port-forwarding specifications now take optional bind addresses, and | ||
1897 | the server allows client-specified bind addresses for remote port | ||
1898 | forwardings when configured with "GatewayPorts clientspecified" | ||
1899 | (closes: #87253, #192206). | ||
1900 | - ssh and ssh-keyscan now support hashing of known_hosts files for | ||
1901 | improved privacy (CAN-2005-2666). ssh-keygen has new options for | ||
1902 | managing known_hosts files, which understand hashing. | ||
1903 | - sftp supports command history and editing support using libedit | ||
1904 | (closes: #287013). | ||
1905 | - Have scp and sftp wait for the spawned ssh to exit before they exit | ||
1906 | themselves, allowing ssh to restore terminal modes (closes: #257130). | ||
1907 | - Improved the handling of bad data in authorized_keys files, | ||
1908 | eliminating fatal errors on corrupt or very large keys; e.g. linefeeds | ||
1909 | in keys only produce errors in auth.log now (closes: #220726). | ||
1910 | - Add "command mode" to ssh connection multiplexing (closes: #303452). | ||
1911 | - Mention $HOME/.hushlogin in sshd(8) FILES section (closes: #163933). | ||
1912 | * Make gnome-ssh-askpass stay above other windows (thanks, Liyang HU; | ||
1913 | closes: #296487). | ||
1914 | * Remove obsolete and unnecessary ssh/forward_warning debconf note. | ||
1915 | * Hurd build fixes (although sshd still doesn't work): | ||
1916 | - Restore X forwarding fix from #102991, lost somewhere along the way. | ||
1917 | - Link with -lcrypt. | ||
1918 | - Link with -lpthread rather than -pthread. | ||
1919 | - Don't build ssh-askpass-gnome on the Hurd, until GNOME is available to | ||
1920 | satisfy build-dependencies. | ||
1921 | * Drop workaround for #242462 on amd64; it's been fixed properly upstream. | ||
1922 | * Enable HashKnownHosts by default. This only affects new entries; use | ||
1923 | 'ssh-keygen -H' to convert an entire known_hosts file to hashed format. | ||
1924 | * Note in ssh_config(5) that the SetupTimeOut option is Debian-specific | ||
1925 | (closes: #307069). | ||
1926 | * debconf template translations: | ||
1927 | - Update Czech (thanks, Miroslav Kure; closes: #298744). | ||
1928 | - Update Finnish (thanks, Matti Pöllä; closes: #303787). | ||
1929 | - Synchronise Spanish with sarge branch (thanks, Javier | ||
1930 | Fernández-Sanguino Peña; closes: #298536). | ||
1931 | - Add Ukrainian (thanks, Eugeniy Meshcheryakov; closes: #301852). | ||
1932 | |||
1933 | -- Colin Watson <cjwatson@debian.org> Thu, 26 May 2005 11:23:18 +0100 | ||
1934 | |||
1935 | openssh (1:3.9p1-3) experimental; urgency=low | ||
1936 | |||
1937 | * Explain how to run sshd from inittab in README.Debian (closes: #147360). | ||
1938 | * Add debian/watch file. | ||
1939 | |||
1940 | -- Colin Watson <cjwatson@debian.org> Fri, 18 Feb 2005 00:20:16 +0000 | ||
1941 | |||
1942 | openssh (1:3.9p1-2) experimental; urgency=low | ||
1943 | |||
1944 | * Remove pam_nologin from /etc/pam.d/ssh, as sshd's built-in support | ||
1945 | appears to be sufficient and more useful (closes: #162996). | ||
1946 | * Depend on debconf | debconf-2.0. | ||
1947 | * Drop LoginGraceTime back to the upstream default of two minutes on new | ||
1948 | installs (closes: #289573). | ||
1949 | * debconf template translations from Ubuntu bug #1232: | ||
1950 | - Update Greek (thanks, Logiotatidis George). | ||
1951 | - Update Spanish (thanks, Santiago Erquicia). | ||
1952 | |||
1953 | -- Colin Watson <cjwatson@debian.org> Sat, 15 Jan 2005 12:37:54 +0000 | ||
1954 | |||
1955 | openssh (1:3.9p1-1) experimental; urgency=low | ||
1956 | |||
1957 | * New upstream release. | ||
1958 | - PAM password authentication implemented again (closes: #238699, | ||
1959 | #242119). | ||
1960 | - Implemented the ability to pass selected environment variables between | ||
1961 | the client and the server. | ||
1962 | - Fix ssh-keyscan breakage when remote server doesn't speak SSH protocol | ||
1963 | (closes: #228828). | ||
1964 | - Fix res_query detection (closes: #242462). | ||
1965 | - 'ssh -c' documentation improved (closes: #265627). | ||
1966 | * Pass LANG and LC_* environment variables from the client by default, and | ||
1967 | accept them to the server by default in new installs, although not on | ||
1968 | upgrade (closes: #264024). | ||
1969 | * Build ssh in binary-indep, not binary-arch (thanks, LaMont Jones). | ||
1970 | * Expand on openssh-client package description (closes: #273831). | ||
1971 | |||
1972 | -- Colin Watson <cjwatson@debian.org> Tue, 4 Jan 2005 14:18:31 +0000 | ||
1973 | |||
1974 | openssh (1:3.8.1p1-14) experimental; urgency=low | ||
1975 | |||
1976 | * We use DH_COMPAT=2, so build-depend on debhelper (>= 2). | ||
1977 | * Fix timing information leak allowing discovery of invalid usernames in | ||
1978 | PAM keyboard-interactive authentication (backported from a patch by | ||
1979 | Darren Tucker; closes: #281595). | ||
1980 | * Make sure that there's a delay in PAM keyboard-interactive | ||
1981 | authentication when PermitRootLogin is not set to yes and the correct | ||
1982 | root password is entered (closes: #248747). | ||
1983 | |||
1984 | -- Colin Watson <cjwatson@debian.org> Sun, 28 Nov 2004 18:09:37 +0000 | ||
1985 | |||
1986 | openssh (1:3.8.1p1-13) experimental; urgency=low | ||
1987 | |||
1988 | * Enable threading for PAM, on Sam Hartman's advice (closes: #278394). | ||
1989 | * debconf template translations: | ||
1990 | - Update Dutch (thanks, cobaco; closes: #278715). | ||
1991 | * Correct README.Debian's ForwardX11Trusted description (closes: #280190). | ||
1992 | |||
1993 | -- Colin Watson <cjwatson@debian.org> Fri, 12 Nov 2004 12:03:13 +0000 | ||
1994 | |||
1995 | openssh (1:3.8.1p1-12) experimental; urgency=low | ||
1996 | |||
1997 | * Preserve /etc/ssh/sshd_config ownership/permissions (closes: #276754). | ||
1998 | * Shorten the version string from the form "OpenSSH_3.8.1p1 Debian | ||
1999 | 1:3.8.1p1-8.sarge.1" to "OpenSSH_3.8.1p1 Debian-8.sarge.1", as some SSH | ||
2000 | implementations apparently have problems with the long version string. | ||
2001 | This is of course a bug in those implementations, but since the extent | ||
2002 | of the problem is unknown it's best to play safe (closes: #275731). | ||
2003 | * debconf template translations: | ||
2004 | - Add Finnish (thanks, Matti Pöllä; closes: #265339). | ||
2005 | - Update Danish (thanks, Morten Brix Pedersen; closes: #275895). | ||
2006 | - Update French (thanks, Denis Barbier; closes: #276703). | ||
2007 | - Update Japanese (thanks, Kenshi Muto; closes: #277438). | ||
2008 | |||
2009 | -- Colin Watson <cjwatson@debian.org> Sun, 24 Oct 2004 19:21:17 +0100 | ||
2010 | |||
2011 | openssh (1:3.8.1p1-11) experimental; urgency=high | ||
2012 | |||
2013 | * Move sshd_config(5) to openssh-server, where it belongs. | ||
2014 | * If PasswordAuthentication is disabled, then offer to disable | ||
2015 | ChallengeResponseAuthentication too. The current PAM code will attempt | ||
2016 | password-style authentication if ChallengeResponseAuthentication is | ||
2017 | enabled (closes: #250369). | ||
2018 | * This will ask a question of anyone who installed fresh with 1:3.8p1-2 or | ||
2019 | later and then upgraded. Sorry about that ... for this reason, the | ||
2020 | default answer is to leave ChallengeResponseAuthentication enabled. | ||
2021 | |||
2022 | -- Colin Watson <cjwatson@debian.org> Wed, 6 Oct 2004 14:28:20 +0100 | ||
2023 | |||
2024 | openssh (1:3.8.1p1-10) experimental; urgency=low | ||
2025 | |||
2026 | * Don't install the ssh-askpass-gnome .desktop file by default; I've had | ||
2027 | too many GNOME people tell me it's the wrong thing to be doing. I've | ||
2028 | left it in /usr/share/doc/ssh-askpass-gnome/examples/ for now. | ||
2029 | |||
2030 | -- Colin Watson <cjwatson@debian.org> Wed, 25 Aug 2004 18:18:14 +0100 | ||
2031 | |||
2032 | openssh (1:3.8.1p1-9) experimental; urgency=low | ||
2033 | |||
2034 | * Split the ssh binary package into openssh-client and openssh-server | ||
2035 | (closes: #39741). openssh-server depends on openssh-client for some | ||
2036 | common functionality; it didn't seem worth creating yet another package | ||
2037 | for this. openssh-client is priority standard, openssh-server optional. | ||
2038 | * New transitional ssh package, priority optional, depending on | ||
2039 | openssh-client and openssh-server. May be removed once nothing depends | ||
2040 | on it. | ||
2041 | * When upgrading from ssh to openssh-{client,server}, it's very difficult | ||
2042 | for the maintainer scripts to find out what version we're upgrading from | ||
2043 | without dodgy dpkg hackery. I've therefore taken the opportunity to move | ||
2044 | a couple of debconf notes into NEWS files, namely ssh/ssh2_keys_merged | ||
2045 | and ssh/user_environment_tell. | ||
2046 | * Add a heuristic to try to make sure the sshd_config upgrade to >= 3.7 | ||
2047 | happens even though we don't know what version we're upgrading from. | ||
2048 | * Remove /etc/ssh/sshd_not_to_be_run on purge of openssh-server. For now | ||
2049 | (until sarge+2) it's still honoured to avoid breaking existing | ||
2050 | configurations, but the right approach is now to remove the | ||
2051 | openssh-server package if you don't want to run the server. Add a NEWS | ||
2052 | item to that effect. | ||
2053 | |||
2054 | -- Colin Watson <cjwatson@debian.org> Mon, 2 Aug 2004 20:48:54 +0100 | ||
2055 | |||
2056 | openssh (1:3.8.1p1-8.sarge.4) unstable; urgency=high | ||
2057 | |||
2058 | * Fix timing information leak allowing discovery of invalid usernames in | ||
2059 | PAM keyboard-interactive authentication (backported from a patch by | ||
2060 | Darren Tucker; closes: #281595). | ||
2061 | * Make sure that there's a delay in PAM keyboard-interactive | ||
2062 | authentication when PermitRootLogin is not set to yes and the correct | ||
2063 | root password is entered (closes: #248747). | ||
2064 | |||
2065 | -- Colin Watson <cjwatson@debian.org> Sun, 28 Nov 2004 12:37:16 +0000 | ||
2066 | |||
2067 | openssh (1:3.8.1p1-8.sarge.3) unstable; urgency=low | ||
2068 | |||
2069 | * Enable threading for PAM, on Sam Hartman's advice (closes: #278394). | ||
2070 | * debconf template translations: | ||
2071 | - Update Dutch (thanks, cobaco; closes: #278715). | ||
2072 | * Correct README.Debian's ForwardX11Trusted description (closes: #280190). | ||
2073 | |||
2074 | -- Colin Watson <cjwatson@debian.org> Fri, 12 Nov 2004 10:31:12 +0000 | ||
2075 | |||
2076 | openssh (1:3.8.1p1-8.sarge.2) unstable; urgency=low | ||
2077 | |||
2078 | * Preserve /etc/ssh/sshd_config ownership/permissions (closes: #276754). | ||
2079 | * Shorten the version string from the form "OpenSSH_3.8.1p1 Debian | ||
2080 | 1:3.8.1p1-8.sarge.1" to "OpenSSH_3.8.1p1 Debian-8.sarge.1", as some SSH | ||
2081 | implementations apparently have problems with the long version string. | ||
2082 | This is of course a bug in those implementations, but since the extent | ||
2083 | of the problem is unknown it's best to play safe (closes: #275731). | ||
2084 | * debconf template translations: | ||
2085 | - Add Finnish (thanks, Matti Pöllä; closes: #265339). | ||
2086 | - Update Danish (thanks, Morten Brix Pedersen; closes: #275895). | ||
2087 | - Update French (thanks, Denis Barbier; closes: #276703). | ||
2088 | - Update Japanese (thanks, Kenshi Muto; closes: #277438). | ||
2089 | |||
2090 | -- Colin Watson <cjwatson@debian.org> Sun, 24 Oct 2004 17:57:14 +0100 | ||
2091 | |||
2092 | openssh (1:3.8.1p1-8.sarge.1) unstable; urgency=high | ||
2093 | |||
2094 | * If PasswordAuthentication is disabled, then offer to disable | ||
2095 | ChallengeResponseAuthentication too. The current PAM code will attempt | ||
2096 | password-style authentication if ChallengeResponseAuthentication is | ||
2097 | enabled (closes: #250369). | ||
2098 | * This will ask a question of anyone who installed fresh with 1:3.8p1-2 or | ||
2099 | later and then upgraded. Sorry about that ... for this reason, the | ||
2100 | default answer is to leave ChallengeResponseAuthentication enabled. | ||
2101 | |||
2102 | -- Colin Watson <cjwatson@debian.org> Wed, 6 Oct 2004 14:21:55 +0100 | ||
2103 | |||
2104 | openssh (1:3.8.1p1-8) unstable; urgency=high | ||
2105 | |||
2106 | * Matthew Vernon: | ||
2107 | - Add a GPL exception to the licensing terms of the Debian patch | ||
2108 | (closes: #211644). | ||
2109 | |||
2110 | -- Colin Watson <cjwatson@debian.org> Thu, 29 Jul 2004 13:28:47 +0100 | ||
2111 | |||
2112 | openssh (1:3.8.1p1-7) unstable; urgency=low | ||
2113 | |||
2114 | * Re-enable shadow password support in openssh-server-udeb, at Bastian | ||
2115 | Blank's request (closes: #260800). | ||
2116 | |||
2117 | -- Colin Watson <cjwatson@debian.org> Thu, 22 Jul 2004 10:56:06 +0100 | ||
2118 | |||
2119 | openssh (1:3.8.1p1-6) unstable; urgency=low | ||
2120 | |||
2121 | * Implement hack in | ||
2122 | http://lists.debian.org/debian-boot/2004/07/msg01207.html to get | ||
2123 | openssh-client-udeb to show up as a retrievable debian-installer | ||
2124 | component. | ||
2125 | * Generate host keys in postinst only if the relevant HostKey directives | ||
2126 | are found in sshd_config (closes: #87946). | ||
2127 | |||
2128 | -- Colin Watson <cjwatson@debian.org> Wed, 21 Jul 2004 15:14:46 +0100 | ||
2129 | |||
2130 | openssh (1:3.8.1p1-5) unstable; urgency=medium | ||
2131 | |||
2132 | * Update German debconf template translation (thanks, Helge Kreutzmann; | ||
2133 | closes: #252226). | ||
2134 | * Remove Suggests: dnsutils, as it was only needed for | ||
2135 | make-ssh-known-hosts (#93265), which has been replaced by ssh-keyscan. | ||
2136 | * Disable shadow password support in openssh-server-udeb. | ||
2137 | * Fix non-portable shell constructs in maintainer scripts, Makefile, and | ||
2138 | ssh-copy-id (thanks, David Weinehall; closes: #258517). | ||
2139 | * Apply patch from Darren Tucker to make the PAM authentication SIGCHLD | ||
2140 | handler kill the PAM thread if its waitpid() call returns 0, as well as | ||
2141 | the previous check for -1 (closes: #252676). | ||
2142 | * Add scp and sftp to openssh-client-udeb. It might not be very 'u' any | ||
2143 | more; oh well. | ||
2144 | |||
2145 | -- Colin Watson <cjwatson@debian.org> Sat, 10 Jul 2004 13:57:27 +0100 | ||
2146 | |||
2147 | openssh (1:3.8.1p1-4) unstable; urgency=medium | ||
2148 | |||
2149 | * Kill off PAM thread if privsep slave dies (closes: #248125). | ||
2150 | |||
2151 | -- Colin Watson <cjwatson@debian.org> Fri, 28 May 2004 17:58:45 -0300 | ||
2152 | |||
2153 | openssh (1:3.8.1p1-3) unstable; urgency=low | ||
2154 | |||
2155 | * Add ssh-keygen to openssh-server-udeb. | ||
2156 | |||
2157 | -- Colin Watson <cjwatson@debian.org> Thu, 20 May 2004 16:31:52 +0100 | ||
2158 | |||
2159 | openssh (1:3.8.1p1-2) unstable; urgency=low | ||
2160 | |||
2161 | * Add Catalan debconf template translation (thanks, Aleix Badia i Bosch; | ||
2162 | closes: #248748). | ||
2163 | * openssh-client-udeb and openssh-server-udeb depend on libnss-files-udeb | ||
2164 | (not yet uploaded). | ||
2165 | * Restore ssh-askpass-gnome binary, lost by mistake. | ||
2166 | * Don't link against libnsl in udeb builds. | ||
2167 | |||
2168 | -- Colin Watson <cjwatson@debian.org> Thu, 20 May 2004 11:15:58 +0100 | ||
2169 | |||
2170 | openssh (1:3.8.1p1-1) unstable; urgency=low | ||
2171 | |||
2172 | * New upstream release. | ||
2173 | - Use a longer buffer for tty names in utmp (closes: #247538). | ||
2174 | * Make sure there's a newline at the end of sshd_config before adding | ||
2175 | 'UsePAM yes' (closes: #244829). | ||
2176 | * Generate a new .orig.tar.gz without RFC.nroff, and remove | ||
2177 | /usr/share/doc/ssh/RFC.gz (closes: #211640). It isn't DFSG-free and only | ||
2178 | documents the obsolete SSH1 protocol, not to mention that it was never a | ||
2179 | real RFC but only an Internet-Draft. It's available from | ||
2180 | http://www.free.lp.se/bamse/draft-ylonen-ssh-protocol-00.txt if you want | ||
2181 | it for some reason. | ||
2182 | * Add openssh-client-udeb and openssh-server-udeb binary packages for use | ||
2183 | in debian-installer. They still need libnss_files to be supplied in udeb | ||
2184 | form by glibc. | ||
2185 | * Work around lack of res_query weak alias in libresolv on amd64 (see | ||
2186 | #242462, awaiting real fix upstream). | ||
2187 | * Fix grammar in sshd(8) (closes: #238753). | ||
2188 | * Add .desktop file and icon for ssh-askpass-gnome (closes: #232333). | ||
2189 | * Update Polish debconf template translation (thanks, Emil Nowak; | ||
2190 | closes: #242808). | ||
2191 | * Add Turkish debconf template translation (thanks, Recai OktaÅŸ; | ||
2192 | closes: #246068). | ||
2193 | |||
2194 | -- Colin Watson <cjwatson@debian.org> Tue, 11 May 2004 23:38:10 +0100 | ||
2195 | |||
2196 | openssh (1:3.8p1-3) unstable; urgency=low | ||
2197 | |||
2198 | * Remove deprecated ReverseMappingCheck option from newly generated | ||
2199 | sshd_config files (closes: #239987). | ||
2200 | * Build everything apart from contrib in a subdirectory, to allow for | ||
2201 | multiple builds. | ||
2202 | * Some older kernels are missing setresuid() and setresgid(), so don't try | ||
2203 | to use them. setreuid() and setregid() will do well enough for our | ||
2204 | purposes (closes: #239999). | ||
2205 | |||
2206 | -- Colin Watson <cjwatson@debian.org> Mon, 5 Apr 2004 21:23:43 +0100 | ||
2207 | |||
2208 | openssh (1:3.8p1-2) unstable; urgency=medium | ||
2209 | |||
2210 | * Disable PasswordAuthentication for new installations (closes: #236810). | ||
2211 | * Turn off the new ForwardX11Trusted by default, returning to the | ||
2212 | semantics of 3.7 and earlier, since it seems immature and causes far too | ||
2213 | many problems with existing setups. See README.Debian for details | ||
2214 | (closes: #237021). | ||
2215 | |||
2216 | -- Colin Watson <cjwatson@debian.org> Wed, 10 Mar 2004 10:33:07 +0000 | ||
2217 | |||
2218 | openssh (1:3.8p1-1) unstable; urgency=low | ||
2219 | |||
2220 | * New upstream release (closes: #232281): | ||
2221 | - New PAM implementation based on that in FreeBSD. This runs PAM session | ||
2222 | modules before dropping privileges (closes: #132681, #150968). | ||
2223 | - Since PAM session modules are run as root, we can turn pam_limits back | ||
2224 | on by default, and it no longer spits out "Operation not permitted" to | ||
2225 | syslog (closes: #171673). | ||
2226 | - Password expiry works again (closes: #153235). | ||
2227 | - 'ssh -q' suppresses login banner (closes: #134589). | ||
2228 | - sshd doesn't lie to PAM about invalid usernames (closes: #157078). | ||
2229 | - ssh-add prints key comment on each prompt (closes: #181869). | ||
2230 | - Punctuation formatting fixed in man pages (closes: #191131). | ||
2231 | - EnableSSHKeysign documented in ssh_config(5) (closes: #224457). | ||
2232 | * Add 'UsePAM yes' to /etc/ssh/sshd_config on upgrade from versions older | ||
2233 | than this, to maintain the standard Debian sshd configuration. | ||
2234 | * Comment out PAMAuthenticationViaKbdInt and RhostsAuthentication in | ||
2235 | sshd_config on upgrade. Neither option is supported any more. | ||
2236 | * Privilege separation and PAM are now properly supported together, so | ||
2237 | remove both debconf questions related to them and simply set it | ||
2238 | unconditionally in newly generated sshd_config files (closes: #228838). | ||
2239 | * ServerAliveInterval implemented upstream, so ProtocolKeepAlives is now a | ||
2240 | compatibility alias. The semantics differ slightly, though; see | ||
2241 | ssh_config(5) for details. | ||
2242 | * Implement SSH1 support for ServerAliveInterval using SSH_MSG_IGNORE. As | ||
2243 | documented in ssh_config(5), it's not as good as the SSH2 version. | ||
2244 | * Remove -fno-builtin-log, -DHAVE_MMAP_ANON_SHARED, and | ||
2245 | -D__FILE_OFFSET_BITS=64 compiler options, which are no longer necessary. | ||
2246 | * Update config.guess and config.sub from autotools-dev 20040105.1. | ||
2247 | * Darren Tucker: | ||
2248 | - Reset signal status when starting pam auth thread, prevent hanging | ||
2249 | during PAM keyboard-interactive authentications. | ||
2250 | - Fix a non-security-critical segfault in PAM authentication. | ||
2251 | * Add debconf template translations: | ||
2252 | - Greek (thanks, Konstantinos Margaritis; closes: #232843). | ||
2253 | - Italian (thanks, Renato Gini; closes: #234777). | ||
2254 | |||
2255 | -- Colin Watson <cjwatson@debian.org> Sat, 6 Mar 2004 18:43:44 +0000 | ||
2256 | |||
2257 | openssh (1:3.6.1p2-12) unstable; urgency=low | ||
2258 | |||
2259 | * Update Spanish debconf template translation (thanks, Javier | ||
2260 | Fernández-Sanguino Peña; closes: #228242). | ||
2261 | * Add debconf template translations: | ||
2262 | - Czech (thanks, Miroslav Kure; closes: #230110). | ||
2263 | - Simplified Chinese (thanks, Hiei Xu; closes: #230726). | ||
2264 | |||
2265 | -- Colin Watson <cjwatson@debian.org> Wed, 11 Feb 2004 09:37:57 +0000 | ||
2266 | |||
2267 | openssh (1:3.6.1p2-11) unstable; urgency=low | ||
2268 | |||
2269 | * Comment out pam_limits in default configuration, for now at least | ||
2270 | (closes: #198254). | ||
2271 | * Use invoke-rc.d (if it exists) to run the init script. | ||
2272 | * Backport format string bug fix in sshconnect.c (closes: #225238). | ||
2273 | * ssh-copy-id exits if ssh fails (closes: #215252). | ||
2274 | |||
2275 | -- Colin Watson <cjwatson@debian.org> Sun, 4 Jan 2004 18:59:21 +0000 | ||
2276 | |||
2277 | openssh (1:3.6.1p2-10) unstable; urgency=low | ||
2278 | |||
2279 | * Use --retry in init script when restarting rather than sleeping, to make | ||
2280 | sure the old process is dead (thanks, Herbert Xu; closes: #212117). | ||
2281 | Depend on dpkg (>= 1.9.0) for start-stop-daemon's --retry option. | ||
2282 | * Update debconf template translations: | ||
2283 | - Brazilian Portuguese (thanks, Andre Luis Lopes; closes: #219844). | ||
2284 | - Danish (thanks, Morten Brix Pedersen; closes: #217964). | ||
2285 | - Japanese (thanks, Kenshi Muto; closes: #212497). | ||
2286 | - Russian (thanks, Ilgiz Kalmetev). | ||
2287 | - Spanish (thanks, Carlos Valdivia Yagüe; closes: #211832). | ||
2288 | * Add Dutch debconf template translation (thanks, cobaco; | ||
2289 | closes: #215372). | ||
2290 | * Update config.guess and config.sub from autotools-dev 20031007.1 | ||
2291 | (closes: #217696). | ||
2292 | * Implement New World Order for PAM configuration, including | ||
2293 | /etc/pam.d/common-* from /etc/pam.d/ssh (closes: #212959). | ||
2294 | - To backport this release to woody, you need to set DEB_BUILD_SSH_WOODY | ||
2295 | in your environment. See README.Debian. | ||
2296 | * Add more commentary to /etc/pam.d/ssh. | ||
2297 | |||
2298 | -- Colin Watson <cjwatson@debian.org> Sun, 16 Nov 2003 01:14:16 +0000 | ||
2299 | |||
2300 | openssh (1:3.6.1p2-9) unstable; urgency=high | ||
2301 | |||
2302 | * Merge even more buffer allocation fixes from upstream (CAN-2003-0682; | ||
2303 | closes: #211434). | ||
2304 | |||
2305 | -- Colin Watson <cjwatson@debian.org> Fri, 19 Sep 2003 10:25:25 +0100 | ||
2306 | |||
2307 | openssh (1:3.6.1p2-8) unstable; urgency=high | ||
2308 | |||
2309 | * Merge more buffer allocation fixes from new upstream version 3.7.1p1 | ||
2310 | (closes: #211324). | ||
2311 | |||
2312 | -- Colin Watson <cjwatson@debian.org> Wed, 17 Sep 2003 03:07:19 +0100 | ||
2313 | |||
2314 | openssh (1:3.6.1p2-7) unstable; urgency=high | ||
2315 | |||
2316 | * Update debconf template translations: | ||
2317 | - French (thanks, Christian Perrier; closes: #208801). | ||
2318 | - Japanese (thanks, Kenshi Muto; closes: #210380). | ||
2319 | * Some small improvements to the English templates courtesy of Christian | ||
2320 | Perrier. I've manually unfuzzied a few translations where it was | ||
2321 | obvious, on Christian's advice, but the others will have to be updated. | ||
2322 | * Document how to generate an RSA1 host key (closes: #141703). | ||
2323 | * Incorporate NMU fix for early buffer expansion vulnerability, | ||
2324 | CAN-2003-0693 (closes: #211205). Thanks to Michael Stone. | ||
2325 | |||
2326 | -- Colin Watson <cjwatson@debian.org> Tue, 16 Sep 2003 14:32:28 +0100 | ||
2327 | |||
2328 | openssh (1:3.6.1p2-6.0) unstable; urgency=high | ||
2329 | |||
2330 | * SECURITY: fix for CAN-2003-0693, buffer allocation error | ||
2331 | |||
2332 | -- Michael Stone <mstone@debian.org> Tue, 16 Sep 2003 08:27:07 -0400 | ||
2333 | |||
2334 | openssh (1:3.6.1p2-6) unstable; urgency=medium | ||
2335 | |||
2336 | * Use a more CVS-friendly means of setting SSH_VERSION. | ||
2337 | * Update Brazilian Portuguese debconf template translation (thanks, Andre | ||
2338 | Luis Lopes; closes: #208036). | ||
2339 | * Don't run 'sshd -t' in init script if the server isn't to be run | ||
2340 | (closes: #197576). | ||
2341 | * Fix login delay, spurious auth.log entry, and PermitRootLogin | ||
2342 | information leakage due to PAM issues with upstream's recent security | ||
2343 | update (thanks, Darren Tucker; closes: #99168, #192207, #193546). | ||
2344 | * Policy version 3.6.1: recode this changelog to UTF-8. | ||
2345 | |||
2346 | -- Colin Watson <cjwatson@debian.org> Wed, 3 Sep 2003 19:14:02 +0100 | ||
2347 | |||
2348 | openssh (1:3.6.1p2-5) unstable; urgency=low | ||
2349 | |||
2350 | * Disable cmsg_type check for file descriptor passing when running on | ||
2351 | Linux 2.0 (closes: #150976). Remove comments about non-functional | ||
2352 | privilege separation on 2.0 from ssh/privsep_ask and ssh/privsep_tell | ||
2353 | debconf questions and from README.Debian, since it should all now work. | ||
2354 | * Fix "defails" typo in generated sshd_config (closes: #206484). | ||
2355 | * Backport upstream patch to strip trailing whitespace (including | ||
2356 | newlines) from configuration directives (closes: #192079). | ||
2357 | |||
2358 | -- Colin Watson <cjwatson@debian.org> Wed, 27 Aug 2003 02:19:57 +0100 | ||
2359 | |||
2360 | openssh (1:3.6.1p2-4) unstable; urgency=low | ||
2361 | |||
2362 | * getent can get just one key; no need to use grep (thanks, James Troup). | ||
2363 | * Move /usr/local/bin to the front of the default path, following | ||
2364 | /etc/login.defs (closes: #201150). | ||
2365 | * Remove specifics of problematic countries from package description | ||
2366 | (closes: #197040). | ||
2367 | * Update Spanish debconf template translation (thanks, Carlos Valdivia | ||
2368 | Yagüe; closes: #198456). | ||
2369 | * Backport upstream patch to pass monitor signals through to child | ||
2370 | (closes: #164797). | ||
2371 | |||
2372 | -- Colin Watson <cjwatson@debian.org> Sun, 27 Jul 2003 17:31:15 +0100 | ||
2373 | |||
2374 | openssh (1:3.6.1p2-3) unstable; urgency=low | ||
2375 | |||
2376 | * Update French debconf template translation (thanks, Christian Perrier; | ||
2377 | closes: #194323). | ||
2378 | * Version the adduser dependency for --no-create-home (closes: #195756). | ||
2379 | * Add a version of moduli(5), namely revision 1.7 of | ||
2380 | http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man5/moduli.5 with | ||
2381 | '/etc/moduli' changed to '/etc/ssh/moduli' throughout (closes: #196061). | ||
2382 | |||
2383 | -- Colin Watson <cjwatson@debian.org> Mon, 9 Jun 2003 02:51:35 +0100 | ||
2384 | |||
2385 | openssh (1:3.6.1p2-2) unstable; urgency=low | ||
2386 | |||
2387 | * Force /etc/default/ssh to be non-executable, since dpkg apparently | ||
2388 | doesn't deal with permissions changes on conffiles (closes: #192966). | ||
2389 | * Use debconf 0.5's seen flag rather than the deprecated isdefault. | ||
2390 | * Add GPL location to copyright file. | ||
2391 | * Remove debian/postinst.old. | ||
2392 | * Switch to po-debconf, with some careful manual use of po2debconf to | ||
2393 | ensure that the source package continues to build smoothly on woody | ||
2394 | (closes: #183986). | ||
2395 | * Update debconf template translations: | ||
2396 | - Brazilian Portugese (thanks, Andre Luis Lopes; see #183986). | ||
2397 | - Japanese (thanks, Tomohiro KUBOTA; closes: #192429). | ||
2398 | * Compile with -fno-builtin-log for now, otherwise gcc-3.3 complains | ||
2399 | "log.h:59: warning: conflicting types for built-in function `log'". The | ||
2400 | OpenSSH log() function has been renamed in upstream CVS. | ||
2401 | |||
2402 | -- Colin Watson <cjwatson@debian.org> Mon, 19 May 2003 01:52:38 +0100 | ||
2403 | |||
2404 | openssh (1:3.6.1p2-1) unstable; urgency=medium | ||
2405 | |||
2406 | * New upstream release, including fix for PAM user-discovery security hole | ||
2407 | (closes: #191681). | ||
2408 | * Fix ChallengeResponseAuthentication default in generated sshd_config | ||
2409 | (closes: #106037). | ||
2410 | * Put newlines after full stops in man page documentation for | ||
2411 | ProtocolKeepAlives and SetupTimeOut. | ||
2412 | * Policy version 3.5.9: support DEB_BUILD_OPTIONS=noopt, build | ||
2413 | gnome-ssh-askpass with -g and -Wall flags. | ||
2414 | * Really ask ssh/new_config debconf question before trying to fetch its | ||
2415 | value (closes: #188721). | ||
2416 | * On purge, remove only the files we know about in /etc/ssh rather than | ||
2417 | the whole thing, and remove the directory if that leaves it empty | ||
2418 | (closes: #176679). | ||
2419 | * ssh has depended on debconf for some time now with no complaints, so: | ||
2420 | - Simplify the postinst by relying on debconf being present. (The absent | ||
2421 | case was buggy anyway.) | ||
2422 | - Get rid of "if you have not installed debconf" text in README.Debian, | ||
2423 | and generally update the "/usr/bin/ssh not SUID" entry. | ||
2424 | * More README.Debian work: | ||
2425 | - Reorganize into "UPGRADE ISSUES" and "OTHER ISSUES", in an effort to | ||
2426 | make it easier for people to find the former. The upgrade issues | ||
2427 | should probably be sorted by version somehow. | ||
2428 | - Document X11UseLocalhost under "X11 Forwarding" (closes: #150913). | ||
2429 | * Fix setting of IP flags for interactive sessions (upstream bug #541). | ||
2430 | |||
2431 | -- Colin Watson <cjwatson@debian.org> Mon, 5 May 2003 17:47:40 +0100 | ||
2432 | |||
2433 | openssh (1:3.6.1p1-1) unstable; urgency=low | ||
2434 | |||
2435 | * New upstream release (thanks, Laurence J. Lane). | ||
2436 | * debian/control: ssh-askpass-gnome is now Section: gnome, following the | ||
2437 | override file. | ||
2438 | |||
2439 | -- Colin Watson <cjwatson@debian.org> Wed, 2 Apr 2003 00:51:02 +0100 | ||
2440 | |||
2441 | openssh (1:3.6p1-1) unstable; urgency=low | ||
2442 | |||
2443 | * New upstream release. | ||
2444 | - Workaround applied upstream for a bug in the interaction of glibc's | ||
2445 | getaddrinfo() with the Linux 2.2 kernel (closes: #155814). | ||
2446 | - As such, it should now be safe to remove --with-ipv4-default, so | ||
2447 | starting sshd with -6 is no longer necessary (closes: #79861 and lots | ||
2448 | of other merged bugs). | ||
2449 | - ssh-copy-id prints usage when run without arguments (closes: #71376). | ||
2450 | - scp exits 1 if ssh fails (closes: #138400). | ||
2451 | - sshd writes to utmp's ut_addr_v6 field in IPv6 mode (closes: #167867). | ||
2452 | - 'ssh-add -c' causes ssh-agent to ask the user each time a key is used | ||
2453 | (closes: #109795). | ||
2454 | * Install /etc/default/ssh non-executable (closes: #185537). | ||
2455 | |||
2456 | -- Colin Watson <cjwatson@debian.org> Mon, 31 Mar 2003 23:00:59 +0100 | ||
2457 | |||
2458 | openssh (1:3.5p1-5) unstable; urgency=low | ||
2459 | |||
2460 | * Add /etc/default/ssh (closes: #161049). | ||
2461 | * Run the init script under 'set -e' (closes: #175010). | ||
2462 | * Change the default superuser path to include /sbin, /usr/sbin, and | ||
2463 | /usr/local/sbin (closes: #128235, #151267). Using login.defs would be | ||
2464 | nice, but that belongs to another package. Without a defined API to | ||
2465 | retrieve its settings, parsing it is off-limits. | ||
2466 | * Build ssh-askpass-gnome with GNOME 2. The source package should still | ||
2467 | support building on stable with GNOME 1, using the alternate | ||
2468 | libgnome-dev build-dependency (thanks, Colin Walters; closes: #167582). | ||
2469 | |||
2470 | -- Colin Watson <cjwatson@debian.org> Sun, 9 Mar 2003 20:12:10 +0000 | ||
2471 | |||
2472 | openssh (1:3.5p1-4) unstable; urgency=low | ||
2473 | |||
2474 | * Point rlogin and rcp alternatives at slogin and scp respectively rather | ||
2475 | than ssh (closes: #121103, #151666). Fix alternative removal to match; | ||
2476 | previously it was completely wrong anyway. | ||
2477 | * Find out whether /etc/ssh/sshd_not_to_be_run exists and set the debconf | ||
2478 | question's default using that information, rather than using debconf as | ||
2479 | a registry. Other solutions may be better in the long run, but this is | ||
2480 | at least correct (thanks, Matthew Woodcraft; closes: #84725). | ||
2481 | * Stop using pam_lastlog, as it doesn't currently work well as a session | ||
2482 | module when privilege separation is enabled; it can usually read | ||
2483 | /var/log/lastlog but can't write to it. Instead, just use sshd's | ||
2484 | built-in support, already enabled by default (closes: #151297, #169938). | ||
2485 | * Use 'ssh-keygen -q' rather than redirecting output to /dev/null. | ||
2486 | * Add a "this may take some time" warning when creating host keys on | ||
2487 | installation (part of #110094). | ||
2488 | * When restarting via the init script, check for sshd_not_to_be_run after | ||
2489 | stopping sshd (idea from Tomas Pospisek; closes: #149850). | ||
2490 | * Append /usr/sbin:/sbin to the init script's $PATH, just in case of | ||
2491 | strangeness (closes: #115138). | ||
2492 | * Fix a dpkg-statoverride call to redirect stdout to /dev/null, not | ||
2493 | stderr. | ||
2494 | * Correct copyright file typo: "orignal" -> "original" (closes: #176490). | ||
2495 | * Rebuild with libssl0.9.7 (closes: #176983). | ||
2496 | * We're up to policy version 3.5.6. DEB_BUILD_OPTIONS stuff still needs to | ||
2497 | be looked at. | ||
2498 | |||
2499 | -- Colin Watson <cjwatson@debian.org> Sat, 18 Jan 2003 01:37:23 +0000 | ||
2500 | |||
2501 | openssh (1:3.5p1-3) unstable; urgency=low | ||
2502 | |||
2503 | * Happy new year! | ||
2504 | * Use getent rather than id to find out whether the sshd user exists | ||
2505 | (closes: #150974). | ||
2506 | * Remove some duplication from the postinst's ssh-keysign setuid code. | ||
2507 | * Replace db_text with db_input throughout debian/config. (db_text has | ||
2508 | been a compatibility wrapper since debconf 0.1.5.) | ||
2509 | * Warn about PermitUserEnvironment on upgrade (closes: #167895). | ||
2510 | * Use 'make install-nokeys', and disable unused debhelper commands, | ||
2511 | thereby forward-porting the last pieces of Zack Weinberg's patch | ||
2512 | (closes: #68341). | ||
2513 | * Move the man page for gnome-ssh-askpass from the ssh package to | ||
2514 | ssh-askpass-gnome (closes: #174449). | ||
2515 | * Build with -DLOGIN_NO_ENDOPT, since Debian's /bin/login doesn't accept | ||
2516 | '--' to terminate the list of options (closes: #171554). | ||
2517 | * Add Jonathan Amery's ssh-argv0 script (closes: #111341). | ||
2518 | * Update Danish debconf template (thanks, Morten Brix Pedersen; | ||
2519 | closes: #174757). | ||
2520 | * Document setgid ssh-agent's effect on certain environment variables in | ||
2521 | README.Debian (closes: #167974). | ||
2522 | * Document interoperability problems between scp and ssh.com's server in | ||
2523 | README.Debian, and suggest some workarounds (closes: #174662). | ||
2524 | |||
2525 | -- Colin Watson <cjwatson@debian.org> Wed, 1 Jan 2003 14:18:30 +0000 | ||
2526 | |||
2527 | openssh (1:3.5p1-2) unstable; urgency=low | ||
2528 | |||
2529 | * Mention in the ssh package description that it provides both ssh and | ||
2530 | sshd (closes: #99680). | ||
2531 | * Create a system group for ssh-agent, not a user group (closes: #167669). | ||
2532 | |||
2533 | -- Colin Watson <cjwatson@debian.org> Mon, 4 Nov 2002 13:43:53 +0000 | ||
2534 | |||
2535 | openssh (1:3.5p1-1) unstable; urgency=low | ||
2536 | |||
2537 | * New upstream release. | ||
2538 | - Fixes typo in ssh-add usage (closes: #152239). | ||
2539 | - Fixes 'PermitRootLogin forced-commands-only' (closes: #166184). | ||
2540 | - ~/.ssh/environment and environment= options in ~/.ssh/authorized_keys | ||
2541 | are deprecated for security reasons and will eventually go away. For | ||
2542 | now they can be re-enabled by setting 'PermitUserEnvironment yes' in | ||
2543 | sshd_config. | ||
2544 | - ssh-agent is installed setgid to prevent ptrace() attacks. The group | ||
2545 | actually doesn't matter, as it drops privileges immediately, but to | ||
2546 | avoid confusion the postinst creates a new 'ssh' group for it. | ||
2547 | * Obsolete patches: | ||
2548 | - Solar Designer's privsep+compression patch for Linux 2.2 (see | ||
2549 | 1:3.3p1-0.0woody1). | ||
2550 | - Hostbased auth ssh-keysign backport (see 1:3.4p1-4). | ||
2551 | |||
2552 | * Remove duplicated phrase in ssh_config(5) (closes: #152404). | ||
2553 | * Source the debconf confmodule at the top of the postrm rather than at | ||
2554 | the bottom, to avoid making future non-idempotency problems worse (see | ||
2555 | #151035). | ||
2556 | * Debconf templates: | ||
2557 | - Add Polish (thanks, Grzegorz Kusnierz). | ||
2558 | - Update French (thanks, Denis Barbier; closes: #132509). | ||
2559 | - Update Spanish (thanks, Carlos Valdivia Yagüe; closes: #164716). | ||
2560 | * Write a man page for gnome-ssh-askpass, and link it to ssh-askpass.1 if | ||
2561 | this is the selected ssh-askpass alternative (closes: #67775). | ||
2562 | |||
2563 | -- Colin Watson <cjwatson@debian.org> Sat, 26 Oct 2002 19:41:51 +0100 | ||
2564 | |||
2565 | openssh (1:3.4p1-4) unstable; urgency=low | ||
2566 | |||
2567 | * Allow ssh-krb5 in ssh-askpass-gnome's dependencies (closes: #129532). | ||
2568 | * Restore Russia to list of countries where encryption is problematic (see | ||
2569 | #148951 and http://www.average.org/freecrypto/). | ||
2570 | * Drop ssh-askpass-gnome's priority to optional, per the override file. | ||
2571 | * Drop the PAM special case for hurd-i386 (closes: #99157). | ||
2572 | * s/dile/idle/ in ssh_config(5) (closes: #118331). | ||
2573 | * Note in README.Debian that you need xauth from xbase-clients on the | ||
2574 | server for X11 forwarding (closes: #140269). | ||
2575 | * Use correct path to upstream README in copyright file (closes: #146037). | ||
2576 | * Document the units for ProtocolKeepAlives (closes: #159479). | ||
2577 | * Backport upstream patch to fix hostbased auth (closes: #117114). | ||
2578 | * Add -g to CFLAGS. | ||
2579 | |||
2580 | -- Colin Watson <cjwatson@debian.org> Sun, 13 Oct 2002 18:58:53 +0100 | ||
2581 | |||
2582 | openssh (1:3.4p1-3) unstable; urgency=low | ||
2583 | |||
2584 | * Add myself to Uploaders: and begin acting as temporary maintainer, at | ||
2585 | Matthew's request. (Normal service will resume in some months' time.) | ||
2586 | * Add sharutils to Build-Depends (closes: #138465). | ||
2587 | * Stop creating the /usr/doc/ssh symlink. | ||
2588 | |||
2589 | * Fix some debconf template typos (closes: #160358). | ||
2590 | * Split debconf templates into one file per language. | ||
2591 | * Add debconf template translations: | ||
2592 | - Brazilian Portuguese (thanks, Andre Luis Lopes; closes: #106173). | ||
2593 | - Danish (thanks, Claus Hindsgaul; closes: #126607). | ||
2594 | - Japanese (thanks, Tomohiro KUBOTA; closes: #137427). | ||
2595 | - Russian (thanks, Ilgiz Kalmetev; closes: #136610). | ||
2596 | - Spanish (thanks, Carlos Valdivia Yagüe; closes: #129041). | ||
2597 | * Update debconf template translations: | ||
2598 | - French (thanks, Igor Genibel; closes: #151361). | ||
2599 | - German (thanks, Axel Noetzold; closes: #147069). | ||
2600 | * Some of these translations are fuzzy. Please send updates. | ||
2601 | |||
2602 | -- Colin Watson <cjwatson@debian.org> Sun, 13 Oct 2002 14:09:57 +0100 | ||
2603 | |||
2604 | openssh (1:3.4p1-2) unstable; urgency=high | ||
2605 | |||
2606 | * Get a security-fixed version into unstable | ||
2607 | * Also tidy README.Debian up a little | ||
2608 | |||
2609 | -- Matthew Vernon <matthew@debian.org> Fri, 28 Jun 2002 17:20:59 +0100 | ||
2610 | |||
2611 | openssh (1:3.4p1-1) testing; urgency=high | ||
2612 | |||
2613 | * Extend my tendrils back into this package (Closes: #150915, #151098) | ||
2614 | * thanks to the security team for their work | ||
2615 | * no thanks to ISS/Theo de Raadt for their handling of these bugs | ||
2616 | * save old sshd_configs to sshd_config.dpkg-old when auto-generating a | ||
2617 | new one | ||
2618 | * tell/ask the user about PriviledgeSeparation | ||
2619 | * /etc/init.d/ssh run will now create the chroot empty dir if necessary | ||
2620 | * Remove our previous statoverride on /usr/bin/ssh (only for people | ||
2621 | upgrading from a version where we'd put one in ourselves!) | ||
2622 | * Stop slandering Russia, since someone asked so nicely (Closes: #148951) | ||
2623 | * Reduce the sleep time in /etc/init.d/ssh during a restart | ||
2624 | |||
2625 | -- Matthew Vernon <matthew@debian.org> Fri, 28 Jun 2002 15:52:10 +0100 | ||
2626 | |||
2627 | openssh (1:3.4p1-0.0woody1) testing-security; urgency=high | ||
2628 | |||
2629 | * NMU by the security team. | ||
2630 | * New upstream version | ||
2631 | |||
2632 | -- Michael Stone <mstone@debian.org> Wed, 26 Jun 2002 15:40:38 -0400 | ||
2633 | |||
2634 | openssh (1:3.3p1-0.0woody4) testing-security; urgency=high | ||
2635 | |||
2636 | * NMU by the security team. | ||
2637 | * fix error when /etc/ssh/sshd_config exists on new install | ||
2638 | * check that user doesn't exist before running adduser | ||
2639 | * use openssl internal random unconditionally | ||
2640 | |||
2641 | -- Michael Stone <mstone@debian.org> Tue, 25 Jun 2002 19:44:39 -0400 | ||
2642 | |||
2643 | openssh (1:3.3p1-0.0woody3) testing-security; urgency=high | ||
2644 | |||
2645 | * NMU by the security team. | ||
2646 | * use correct home directory when sshd user is created | ||
2647 | |||
2648 | -- Michael Stone <mstone@debian.org> Tue, 25 Jun 2002 08:59:50 -0400 | ||
2649 | |||
2650 | openssh (1:3.3p1-0.0woody2) testing-security; urgency=high | ||
2651 | |||
2652 | * NMU by the security team. | ||
2653 | * Fix rsa1 key creation (Closes: #150949) | ||
2654 | * don't fail if sshd user removal fails | ||
2655 | * depends: on adduser (Closes: #150907) | ||
2656 | |||
2657 | -- Michael Stone <mstone@debian.org> Tue, 25 Jun 2002 08:59:50 -0400 | ||
2658 | |||
2659 | openssh (1:3.3p1-0.0woody1) testing-security; urgency=high | ||
2660 | |||
2661 | * NMU by the security team. | ||
2662 | * New upstream version. | ||
2663 | - Enable privilege separation by default. | ||
2664 | * Include patch from Solar Designer for privilege separation and | ||
2665 | compression on 2.2.x kernels. | ||
2666 | * Remove --disable-suid-ssh from configure. | ||
2667 | * Support setuid ssh-keysign binary instead of setuid ssh client. | ||
2668 | * Check sshd configuration before restarting. | ||
2669 | |||
2670 | -- Daniel Jacobowitz <dan@debian.org> Mon, 24 Jun 2002 13:43:44 -0400 | ||
2671 | |||
2672 | openssh (1:3.0.2p1-9) unstable; urgency=high | ||
2673 | |||
2674 | * Thanks to those who NMUd | ||
2675 | * The only change in this version is to debian/control - I've removed | ||
2676 | the bit that says you can't export it from the US - it would look | ||
2677 | pretty daft to say this about a package in main! Also, it's now OK | ||
2678 | to use crypto in France, so I've edited that comment slightly | ||
2679 | * Correct a path in README.Debian too (Closes: #138634) | ||
2680 | |||
2681 | -- Matthew Vernon <matthew@debian.org> Sun, 4 Apr 2002 09:52:59 +0100 | ||
2682 | |||
2683 | openssh (1:3.0.2p1-8.3) unstable; urgency=medium | ||
2684 | |||
2685 | * NMU | ||
2686 | * Really set urgency to medium this time (oops) | ||
2687 | * Fix priority to standard per override while I'm at it | ||
2688 | |||
2689 | -- Aaron M. Ucko <ucko@debian.org> Sun, 24 Mar 2002 09:00:08 -0500 | ||
2690 | |||
2691 | openssh (1:3.0.2p1-8.2) unstable; urgency=low | ||
2692 | |||
2693 | * NMU with maintainer's permission | ||
2694 | * Prepare for upcoming ssh-nonfree transitional packages per | ||
2695 | <http://lists.debian.org/debian-ssh/2002/debian-ssh-200203/msg00008.html> | ||
2696 | * Urgency medium because it would really be good to get this into woody | ||
2697 | before it releases | ||
2698 | * Fix sections to match override file | ||
2699 | * Reissued due to clash with non-US -> main move | ||
2700 | |||
2701 | -- Aaron M. Ucko <ucko@debian.org> Sat, 23 Mar 2002 21:21:52 -0500 | ||
2702 | |||
2703 | openssh (1:3.0.2p1-8.1) unstable; urgency=low | ||
2704 | |||
2705 | * NMU | ||
2706 | * Move from non-US to mani | ||
2707 | |||
2708 | -- LaMont Jones <lamont@debian.org> Thu, 21 Mar 2002 09:33:50 -0700 | ||
2709 | |||
2710 | openssh (1:3.0.2p1-8) unstable; urgency=critical | ||
2711 | |||
2712 | * Security fix - patch from upstream (Closes: #137209, #137210) | ||
2713 | * Undo the changes in the unreleased -7, since they appear to break | ||
2714 | things here. Accordingly, the code change is minimal, and I'm | ||
2715 | happy to get it into testing ASAP | ||
2716 | |||
2717 | -- Matthew Vernon <matthew@debian.org> Thu, 7 Mar 2002 14:25:23 +0000 | ||
2718 | |||
2719 | openssh (1:3.0.2p1-7) unstable; urgency=high | ||
2720 | |||
2721 | * Build to support IPv6 and IPv4 by default again | ||
2722 | |||
2723 | -- Matthew Vernon <matthew@debian.org> Sat, 2 Mar 2002 00:25:05 +0000 | ||
2724 | |||
2725 | openssh (1:3.0.2p1-6) unstable; urgency=high | ||
2726 | |||
2727 | * Correct error in the clean target (Closes: #130868) | ||
2728 | |||
2729 | -- Matthew Vernon <matthew@debian.org> Sat, 26 Jan 2002 00:32:00 +0000 | ||
2730 | |||
2731 | openssh (1:3.0.2p1-5) unstable; urgency=medium | ||
2732 | |||
2733 | * Include the Debian version in our identification, to make it easier to | ||
2734 | audit networks for patched versions in future | ||
2735 | |||
2736 | -- Matthew Vernon <matthew@debian.org> Mon, 21 Jan 2002 17:16:10 +0000 | ||
2737 | |||
2738 | openssh (1:3.0.2p1-4) unstable; urgency=medium | ||
2739 | |||
2740 | * If we're asked to not run sshd, stop any running sshd's first | ||
2741 | (Closes: #129327) | ||
2742 | |||
2743 | -- Matthew Vernon <matthew@debian.org> Wed, 16 Jan 2002 21:24:16 +0000 | ||
2744 | |||
2745 | openssh (1:3.0.2p1-3) unstable; urgency=high | ||
2746 | |||
2747 | * Fix /etc/pam.d/ssh to not set $MAIL (Closes: #128913) | ||
2748 | * Remove extra debconf suggestion (Closes: #128094) | ||
2749 | * Mmm. speedy bug-fixing :-) | ||
2750 | |||
2751 | -- Matthew Vernon <matthew@debian.org> Sat, 12 Jan 2002 17:23:58 +0000 | ||
2752 | |||
2753 | openssh (1:3.0.2p1-2) unstable; urgency=high | ||
2754 | |||
2755 | * Fix postinst to not automatically overwrite sshd_config (!) | ||
2756 | (Closes: #127842, #127867) | ||
2757 | * Add section in README.Debian about the PermitRootLogin setting | ||
2758 | |||
2759 | -- Matthew Vernon <matthew@debian.org> Sat, 5 Jan 2003 05:26:30 +0000 | ||
2760 | |||
2761 | openssh (1:3.0.2p1-1) unstable; urgency=high | ||
2762 | |||
2763 | * Incorporate fix from Colin's NMU | ||
2764 | * New upstream version (fixes the bug Wichert fixed) (Closes: #124035) | ||
2765 | * Capitalise IETF (Closes: #125379) | ||
2766 | * Refer to the correct sftp-server location (Closes: #126854, #126224) | ||
2767 | * Do what we're asked re SetUID ssh (Closes: #124065, #124154, #123247) | ||
2768 | * Ask people upgrading from potato if they want a new conffile | ||
2769 | (Closes: #125642) | ||
2770 | * Fix a typo in postinst (Closes: #122192, #122410, #123440) | ||
2771 | * Frob the default config a little (Closes: #122284, #125827, #125696, | ||
2772 | #123854) | ||
2773 | * Make /etc/init.d/ssh be more clear about ssh not running (Closes: | ||
2774 | #123552) | ||
2775 | * Fix typo in templates file (Closes: #123411) | ||
2776 | |||
2777 | -- Matthew Vernon <matthew@debian.org> Fri, 4 Jan 2002 16:01:52 +0000 | ||
2778 | |||
2779 | openssh (1:3.0.1p1-1.2) unstable; urgency=high | ||
2780 | |||
2781 | * Non-maintainer upload | ||
2782 | * Prevent local users from passing environment variables to the login | ||
2783 | process when UseLogin is enabled | ||
2784 | |||
2785 | -- Wichert Akkerman <wakkerma@debian.org> Mon, 3 Dec 2001 19:34:45 +0100 | ||
2786 | |||
2787 | openssh (1:3.0.1p1-1.1) unstable; urgency=low | ||
2788 | |||
2789 | * Non-maintainer upload, at Matthew's request. | ||
2790 | * Remove sa_restorer assignment to fix compilation on alpha, hppa, and | ||
2791 | ia64 (closes: #122086). | ||
2792 | |||
2793 | -- Colin Watson <cjwatson@debian.org> Sun, 2 Dec 2001 18:54:16 +0000 | ||
2794 | |||
2795 | openssh (1:3.0.1p1-1) unstable; urgency=high | ||
2796 | |||
2797 | * New upstream version (Closes: #113646, #113513, #114707, #118564) | ||
2798 | * Building with a libc that works (!) (Closes: #115228) | ||
2799 | * Patches forward-ported are -1/-2 options for scp, the improvement to | ||
2800 | 'waiting for forwarded connections to terminate...' | ||
2801 | * Fix /etc/init.d/ssh to stop sshd properly (Closes: #115228) | ||
2802 | * /etc/ssh/sshd_config is no longer a conffile but generated in the postinst | ||
2803 | * Remove suidregister leftover from postrm | ||
2804 | * Mention key we are making in the postinst | ||
2805 | * Default to not enable SSH protocol 1 support, since protocol 2 is | ||
2806 | much safer anyway. | ||
2807 | * New version of the vpn-fixes patch, from Ian Jackson | ||
2808 | * New handling of -q, and added new -qq option; thanks to Jon Amery | ||
2809 | * Experimental smartcard support not enabled, since I have no way of | ||
2810 | testing it. | ||
2811 | |||
2812 | -- Matthew Vernon <matthew@debian.org> Thu, 28 Nov 2001 17:43:01 +0000 | ||
2813 | |||
2814 | openssh (1:2.9p2-6) unstable; urgency=low | ||
2815 | |||
2816 | * check for correct file in /etc/init.d/ssh (Closes: #110876) | ||
2817 | * correct location of version 2 keys in ssh.1 (Closes: #110439) | ||
2818 | * call update-alternatives --quiet (Closes: #103314) | ||
2819 | * hack ssh-copy-id to chmod go-w (Closes: #95551) | ||
2820 | * TEMPORARY fix to provide largefile support using a -D in the cflags | ||
2821 | line. long-term, upstream will patch the autoconf stuff | ||
2822 | (Closes: #106809, #111849) | ||
2823 | * remove /etc/rc references in ssh-keygen.1 (Closes: #68350) | ||
2824 | * scp.1 patch from Adam McKenna to document -r properly (Closes: #76054) | ||
2825 | * Check for files containing a newline character (Closes: #111692) | ||
2826 | |||
2827 | -- Matthew Vernon <matthew@debian.org> Thu, 13 Sep 2001 16:47:36 +0100 | ||
2828 | |||
2829 | openssh (1:2.9p2-5) unstable; urgency=high | ||
2830 | |||
2831 | * Thanks to all the bug-fixers who helped! | ||
2832 | * remove sa_restorer assignment (Closes: #102837) | ||
2833 | * patch from Peter Benie to DTRT wrt X forwarding if the server refuses | ||
2834 | us access (Closes: #48297) | ||
2835 | * patch from upstream CVS to fix port forwarding (Closes: #107132) | ||
2836 | * patch from Jonathan Amery to document ssh-keygen behaviour | ||
2837 | (Closes:#106643, #107512) | ||
2838 | * patch to postinst from Jonathan Amery (Closes: #106411) | ||
2839 | * patch to manpage from Jonathan Amery (Closes: #107364) | ||
2840 | * patch from Matthew Vernon to make -q emit fatal errors as that is the | ||
2841 | documented behaviour (Closes: #64347) | ||
2842 | * patch from Ian Jackson to cause us to destroy a file when we scp it | ||
2843 | onto itself, rather than dumping bits of our memory into it, which was | ||
2844 | a security hole (see #51955) | ||
2845 | * patch from Jonathan Amery to document lack of Kerberos support | ||
2846 | (Closes: #103726) | ||
2847 | * patch from Matthew Vernon to make the 'waiting for connections to | ||
2848 | terminate' message more helpful (Closes: #50308) | ||
2849 | |||
2850 | -- Matthew Vernon <matthew@debian.org> Thu, 23 Aug 2001 02:14:09 +0100 | ||
2851 | |||
2852 | openssh (1:2.9p2-4) unstable; urgency=high | ||
2853 | |||
2854 | * Today's build of ssh is strawberry flavoured | ||
2855 | * Patch from mhp to reduce length of time sshd is stopped for (Closes: #106176) | ||
2856 | * Tidy up debconf template (Closes: #106152) | ||
2857 | * If called non-setuid, then setgid()'s failure should not be fatal (see | ||
2858 | #105854) | ||
2859 | |||
2860 | -- Matthew Vernon <matthew@debian.org> Sun, 22 Jul 2001 14:19:43 +0100 | ||
2861 | |||
2862 | openssh (1:2.9p2-3) unstable; urgency=low | ||
2863 | |||
2864 | * Patch from yours truly to add -1 and -2 options to scp (Closes: #106061) | ||
2865 | * Improve the IdentityFile section in the man page (Closes: #106038) | ||
2866 | |||
2867 | -- Matthew Vernon <matthew@debian.org> Sat, 21 Jul 2001 14:47:27 +0100 | ||
2868 | |||
2869 | openssh (1:2.9p2-2) unstable; urgency=low | ||
2870 | |||
2871 | * Document the protocol version 2 and IPV6 changes (Closes: #105845, #105868) | ||
2872 | * Make PrintLastLog 'no' by default (Closes: #105893) | ||
2873 | |||
2874 | -- Matthew Vernon <matthew@debian.org> Thu, 19 Jul 2001 18:36:41 +0100 | ||
2875 | |||
2876 | openssh (1:2.9p2-1) unstable; urgency=low | ||
2877 | |||
2878 | * new (several..) upstream version (Closes: #96726, #81856, #96335) | ||
2879 | * Hopefully, this will close some other bugs too | ||
2880 | |||
2881 | -- Matthew Vernon <matthew@debian.org> Tue, 17 Jul 2001 19:41:58 +0100 | ||
2882 | |||
2883 | openssh (1:2.5.2p2-3) unstable; urgency=low | ||
2884 | |||
2885 | * Taking Over this package | ||
2886 | * Patches from Robert Bihlmeyer for the Hurd (Closes: #102991) | ||
2887 | * Put PermitRootLogin back to yes (Closes: #67334, #67371, #78274) | ||
2888 | * Don't fiddle with conf-files any more (Closes: #69501) | ||
2889 | |||
2890 | -- Matthew Vernon <matthew@debian.org> Tue, 03 Jul 2001 02:58:13 +0100 | ||
2891 | |||
2892 | openssh (1:2.5.2p2-2.2) unstable; urgency=low | ||
2893 | |||
2894 | * NMU | ||
2895 | * Include Hurd compatibility patches from Robert Bihlmeyer (Closes: #76033) | ||
2896 | * Patch from Richard Kettlewell for protocolkeepalives (Closes: #99273) | ||
2897 | * Patch from Matthew Vernon for BannerTimeOut, batchmode, and | ||
2898 | documentation for protocolkeepalives. Makes ssh more generally useful | ||
2899 | for scripting uses (Closes: #82877, #99275) | ||
2900 | * Set a umask, so ourpidfile isn't world-writable (closes: #100012, | ||
2901 | #98286, #97391) | ||
2902 | |||
2903 | -- Matthew Vernon <matthew@debian.org> Thu, 28 Jun 2001 23:15:42 +0100 | ||
2904 | |||
2905 | openssh (1:2.5.2p2-2.1) unstable; urgency=low | ||
2906 | |||
2907 | * NMU | ||
2908 | * Remove duplicate Build-Depends for libssl096-dev and change it to | ||
2909 | depend on libssl-dev instaed. Also adding in virtual | real package | ||
2910 | style build-deps. (Closes: #93793, #75228) | ||
2911 | * Removing add-log entry (Closes: #79266) | ||
2912 | * This was a pam bug from a while back (Closes: #86908, #88457, #86843) | ||
2913 | * pam build-dep already exists (Closes: #93683) | ||
2914 | * libgnome-dev build-dep already exists (Closes: #93694) | ||
2915 | * No longer in non-free (Closes: #85401) | ||
2916 | * Adding in fr debconf translations (Closes: #83783) | ||
2917 | * Already suggests xbase-clients (Closes: #79741) | ||
2918 | * No need to suggest libpam-pwdb anymore (Closes: #81658) | ||
2919 | * Providing rsh-client (Closes: #79437) | ||
2920 | * hurd patch was already applied (Closes: #76033) | ||
2921 | * default set to no (Closes: #73682) | ||
2922 | * Adding in a suggests for dnsutils (Closes: #93265) | ||
2923 | * postinst bugs fixed (Closes: #88057, #88066, #88196, #88405, #88612) | ||
2924 | (Closes: #88774, #88196, #89556, #90123, #90228, #90833, #87814, #85465) | ||
2925 | * Adding in debconf dependency | ||
2926 | |||
2927 | -- Ivan E. Moore II <rkrusty@debian.org> Mon, 16 Apr 2001 14:11:04 +0100 | ||
2928 | |||
2929 | openssh (1:2.5.2p2-2) unstable; urgency=high | ||
2930 | |||
2931 | * disable the OpenSSL version check in entropy.c | ||
2932 | (closes: #93581, #93588, #93590, #93614, #93619, #93635, #93648) | ||
2933 | |||
2934 | -- Philip Hands <phil@uk.alcove.com> Wed, 11 Apr 2001 20:30:04 +0100 | ||
2935 | |||
2936 | openssh (1:2.5.2p2-1) unstable; urgency=low | ||
2937 | |||
2938 | * New upstream release | ||
2939 | * removed make-ssh-known-hosts, since ssh-keyscan does that job (closes: #86069, #87748) | ||
2940 | * fix double space indent in german templates (closes: #89493) | ||
2941 | * make postinst check for ssh_host_rsa_key | ||
2942 | * get rid of the last of the misguided debian/rules NMU debris :-/ | ||
2943 | |||
2944 | -- Philip Hands <phil@hands.com> Sat, 24 Mar 2001 20:59:33 +0000 | ||
2945 | |||
2946 | openssh (1:2.5.1p2-2) unstable; urgency=low | ||
2947 | |||
2948 | * rebuild with new debhelper (closes: #89558, #89536, #90225) | ||
2949 | * fix broken dpkg-statoverride test in postinst | ||
2950 | (closes: #89612, #90474, #90460, #89605) | ||
2951 | * NMU bug fixed but not closed in last upload (closes: #88206) | ||
2952 | |||
2953 | -- Philip Hands <phil@hands.com> Fri, 23 Mar 2001 16:11:33 +0000 | ||
2954 | |||
2955 | openssh (1:2.5.1p2-1) unstable; urgency=high | ||
2956 | |||
2957 | * New upstream release | ||
2958 | * fix typo in postinst (closes: #88110) | ||
2959 | * revert to setting PAM service name in debian/rules, backing out last | ||
2960 | NMU, which also (closes: #88101) | ||
2961 | * restore the pam lastlog/motd lines, lost during the NMUs, and sshd_config | ||
2962 | * restore printlastlog option patch | ||
2963 | * revert to using debhelper, which had been partially disabled in NMUs | ||
2964 | |||
2965 | -- Philip Hands <phil@hands.com> Tue, 13 Mar 2001 01:41:34 +0000 | ||
2966 | |||
2967 | openssh (1:2.5.1p1-1.8) unstable; urgency=high | ||
2968 | |||
2969 | * And now the old pam-bug s/sshd/ssh in ssh.c is also fixed | ||
2970 | |||
2971 | -- Christian Kurz <shorty@debian.org> Thu, 1 Mar 2001 19:48:01 +0100 | ||
2972 | |||
2973 | openssh (1:2.5.1p1-1.7) unstable; urgency=high | ||
2974 | |||
2975 | * And now we mark the correct binary as setuid, when a user requested | ||
2976 | to install it setuid. | ||
2977 | |||
2978 | -- Christian Kurz <shorty@debian.org> Thu, 1 Mar 2001 07:19:56 +0100 | ||
2979 | |||
2980 | openssh (1:2.5.1p1-1.6) unstable; urgency=high | ||
2981 | |||
2982 | * Fixes postinst to handle overrides that are already there. Damn, I | ||
2983 | should have noticed the bug earlier. | ||
2984 | |||
2985 | -- Christian Kurz <shorty@debian.org> Wed, 28 Feb 2001 22:35:00 +0100 | ||
2986 | |||
2987 | openssh (1:2.5.1p1-1.5) unstable; urgency=high | ||
2988 | |||
2989 | * Rebuild ssh with pam-support. | ||
2990 | |||
2991 | -- Christian Kurz <shorty@debian.org> Mon, 26 Feb 2001 21:55:51 +0100 | ||
2992 | |||
2993 | openssh (1:2.5.1p1-1.4) unstable; urgency=low | ||
2994 | |||
2995 | * Added Build-Depends on libssl096-dev. | ||
2996 | * Fixed sshd_config file to disallow root logins again. | ||
2997 | |||
2998 | -- Christian Kurz <shorty@debian.org> Sun, 25 Feb 2001 20:03:55 +0100 | ||
2999 | |||
3000 | openssh (1:2.5.1p1-1.3) unstable; urgency=low | ||
3001 | |||
3002 | * Fixed missing manpages for sftp.1 and ssh-keyscan.1 | ||
3003 | * Made package policy 3.5.2 compliant. | ||
3004 | |||
3005 | -- Christian Kurz <shorty@debian.org> Sun, 25 Feb 2001 15:46:26 +0100 | ||
3006 | |||
3007 | openssh (1:2.5.1p1-1.2) unstable; urgency=low | ||
3008 | |||
3009 | * Added Conflict with sftp, since we now provide our own sftp-client. | ||
3010 | * Added a fix for our broken dpkg-statoverride call in the | ||
3011 | 2.3.0p1-13. | ||
3012 | * Fixed some config pathes in the comments of sshd_config. | ||
3013 | * Removed ssh-key-exchange-vulnerability-patch since it's not needed | ||
3014 | anymore because upstream included the fix. | ||
3015 | |||
3016 | -- Christian Kurz <shorty@debian.org> Sun, 25 Feb 2001 13:46:58 +0100 | ||
3017 | |||
3018 | openssh (1:2.5.1p1-1.1) unstable; urgency=high | ||
3019 | |||
3020 | * Another NMU to get the new upstream version 2.5.1p1 into | ||
3021 | unstable. (Closes: #87123) | ||
3022 | * Corrected postinst to mark ssh as setuid. (Closes: #86391, #85766) | ||
3023 | * Key Exchange patch is already included by upstream. (Closes: #86015) | ||
3024 | * Upgrading should be possible now. (Closes: #85525, #85523) | ||
3025 | * Added --disable-suid-ssh as compile option, so ssh won't get installed | ||
3026 | suid per default. | ||
3027 | * Fixed postinst to run dpkg-statoverride only, when dpkg-statoverride | ||
3028 | is available and the mode of the binary should be 4755. And also added | ||
3029 | suggestion for a newer dpkg. | ||
3030 | (Closes: #85734, #85741, #86876) | ||
3031 | * sftp and ssh-keyscan will also be included from now on. (Closes: #79994) | ||
3032 | * scp now understands spaces in filenames (Closes: #53783, #58958, | ||
3033 | #66723) | ||
3034 | * ssh-keygen now supports showing DSA fingerprints. (Closes: #68623) | ||
3035 | * ssh doesn' t show motd anymore when switch -t is used. (Closes #69035) | ||
3036 | * ssh supports the usage of other dsa keys via the ssh command line | ||
3037 | options. (Closes: #81250) | ||
3038 | * Documentation in sshd_config fixed. (Closes: #81088) | ||
3039 | * primes file included by upstream and included now. (Closes: #82101) | ||
3040 | * scp now allows dots in the username. (Closes: #82477) | ||
3041 | * Spelling error in ssh-copy-id.1 corrected by upstream. (Closes: #78124) | ||
3042 | |||
3043 | -- Christian Kurz <shorty@debian.org> Sun, 25 Feb 2001 10:06:08 +0100 | ||
3044 | |||
3045 | openssh (1:2.3.0p1-1.13) unstable; urgency=low | ||
3046 | |||
3047 | * Config should now also be fixed with this hopefully last NMU. | ||
3048 | |||
3049 | -- Christian Kurz <shorty@debian.org> Sat, 10 Feb 2001 22:56:36 +0100 | ||
3050 | |||
3051 | openssh (1:2.3.0p1-1.12) unstable; urgency=high | ||
3052 | |||
3053 | * Added suggest for xbase-clients to control-file. (Closes #85227) | ||
3054 | * Applied patch from Markus Friedl to fix a vulnerability in | ||
3055 | the rsa keyexchange. | ||
3056 | * Fixed position of horizontal line. (Closes: #83613) | ||
3057 | * Fixed hopefully the grep problem in the config-file. (Closes: #78802) | ||
3058 | * Converted package from suidregister to dpkg-statoverride. | ||
3059 | |||
3060 | -- Christian Kurz <shorty@debian.org> Fri, 9 Feb 2001 19:43:55 +0100 | ||
3061 | |||
3062 | openssh (1:2.3.0p1-1.11) unstable; urgency=medium | ||
3063 | |||
3064 | * Fixed some typos in the german translation of the debconf | ||
3065 | template. | ||
3066 | |||
3067 | -- Christian Kurz <shorty@debian.org> Wed, 24 Jan 2001 18:22:38 +0100 | ||
3068 | |||
3069 | openssh (1:2.3.0p1-1.10) unstable; urgency=medium | ||
3070 | |||
3071 | * Fixed double printing of motd. (Closes: #82618) | ||
3072 | |||
3073 | -- Christian Kurz <shorty@debian.org> Tue, 23 Jan 2001 21:03:43 +0100 | ||
3074 | |||
3075 | openssh (1:2.3.0p1-1.9) unstable; urgency=high | ||
3076 | |||
3077 | * And the next NMU which includes the patch from Andrew Bartlett | ||
3078 | and Markus Friedl to fix the root privileges handling of openssh. | ||
3079 | (Closes: #82657) | ||
3080 | |||
3081 | -- Christian Kurz <shorty@debian.org> Wed, 17 Jan 2001 22:20:54 +0100 | ||
3082 | |||
3083 | openssh (1:2.3.0p1-1.8) unstable; urgency=high | ||
3084 | |||
3085 | * Applied fix from Ryan Murray to allow building on other architectures | ||
3086 | since the hurd patch was wrong. (Closes: #82471) | ||
3087 | |||
3088 | -- Christian Kurz <shorty@debian.org> Tue, 16 Jan 2001 22:45:51 +0100 | ||
3089 | |||
3090 | openssh (1:2.3.0p1-1.7) unstable; urgency=medium | ||
3091 | |||
3092 | * Fixed another typo on sshd_config | ||
3093 | |||
3094 | -- Christian Kurz <shorty@debian.org> Sun, 14 Jan 2001 19:01:31 +0100 | ||
3095 | |||
3096 | openssh (1:2.3.0p1-1.6) unstable; urgency=high | ||
3097 | |||
3098 | * Added Build-Dependency on groff (Closes: #81886) | ||
3099 | * Added Build-Depencency on debhelper (Closes: #82072) | ||
3100 | * Fixed entry for known_hosts in sshd_config (Closes: #82096) | ||
3101 | |||
3102 | -- Christian Kurz <shorty@debian.org> Thu, 11 Jan 2001 23:08:16 +0100 | ||
3103 | |||
3104 | openssh (1:2.3.0p1-1.5) unstable; urgency=high | ||
3105 | |||
3106 | * Fixed now also the problem with sshd used as default ipv4 and | ||
3107 | didn't use IPv6. This should be now fixed. | ||
3108 | |||
3109 | -- Christian Kurz <shorty@debian.org> Thu, 11 Jan 2001 21:25:55 +0100 | ||
3110 | |||
3111 | openssh (1:2.3.0p1-1.4) unstable; urgency=high | ||
3112 | |||
3113 | * Fixed buggy entry in postinst. | ||
3114 | |||
3115 | -- Christian Kurz <shorty@debian.org> Wed, 10 Jan 2001 23:12:16 +0100 | ||
3116 | |||
3117 | openssh (1:2.3.0p1-1.3) unstable; urgency=high | ||
3118 | |||
3119 | * After finishing the rewrite of the rules-file I had to notice that | ||
3120 | the manpage installation was broken. This should now work again. | ||
3121 | |||
3122 | -- Christian Kurz <shorty@debian.org> Wed, 10 Jan 2001 22:11:59 +0100 | ||
3123 | |||
3124 | openssh (1:2.3.0p1-1.2) unstable; urgency=high | ||
3125 | |||
3126 | * Fixed the screwed up build-dependency. | ||
3127 | * Removed --with-ipv4-default to support ipv6. | ||
3128 | * Changed makefile to use /etc/pam.d/ssh instead of /etc/pam.d/sshd. | ||
3129 | * Fixed location to sftp-server in config. | ||
3130 | * Since debian still relies on /etc/pam.d/ssh instead of moving to | ||
3131 | /etc/pam.d/sshd, I had to hack ssh.h to get ssh to use this name. | ||
3132 | * Fixed path to host key in sshd_config. | ||
3133 | |||
3134 | -- Christian Kurz <shorty@debian.org> Wed, 10 Jan 2001 08:23:47 +0100 | ||
3135 | |||
3136 | openssh (1:2.3.0p1-1.1) unstable; urgency=medium | ||
3137 | |||
3138 | * NMU with permission of Phil Hands. | ||
3139 | * New upstream release | ||
3140 | * Update Build-Depends to point to new libssl096. | ||
3141 | * This upstream release doesn't leak any information depending | ||
3142 | on the setting of PermitRootLogin (Closes: #59933) | ||
3143 | * New upstream release contains fix against forcing a client to | ||
3144 | do X/agent forwarding (Closes: #76788) | ||
3145 | * Changed template to contain correct path to the documentation | ||
3146 | (Closes: #67245) | ||
3147 | * Added --with-4in6 switch as compile option into debian/rules. | ||
3148 | * Added --with-ipv4-default as compile option into debian/rules. | ||
3149 | (Closes: #75037) | ||
3150 | * Changed default path to also contain /usr/local/bin and | ||
3151 | /usr/X11R6/bin (Closes: #62472,#54567,#62810) | ||
3152 | * Changed path to sftp-server in sshd_config to match the | ||
3153 | our package (Closes: #68347) | ||
3154 | * Replaced OpenBSDh with OpenBSD in the init-script. | ||
3155 | * Changed location to original source in copyright.head | ||
3156 | * Changed behaviour of init-script when invoked with the option | ||
3157 | restart (Closes: #68706,#72560) | ||
3158 | * Added a note about -L option of scp to README.Debian | ||
3159 | * ssh won't print now the motd if invoked with -t option | ||
3160 | (Closes: #59933) | ||
3161 | * RFC.nroff.gz get's now converted into RFC.gz. (Closes: #63867) | ||
3162 | * Added a note about tcp-wrapper support to README.Debian | ||
3163 | (Closes: #72807,#22190) | ||
3164 | * Removed two unneeded options from building process. | ||
3165 | * Added sshd.pam into debian dir and install it. | ||
3166 | * Commented out unnecessary call to dh_installinfo. | ||
3167 | * Added a line to sshd.pam so that limits will be paid attention | ||
3168 | to (Closes: #66904) | ||
3169 | * Restart Option has a Timeout of 10 seconds (Closes: 51264) | ||
3170 | * scp won't override files anymore (Closes: 51955) | ||
3171 | * Removed pam_lastlog module, so that the lastlog is now printed | ||
3172 | only once (Closes: #71742, #68335, #69592, #71495, #77781) | ||
3173 | * If password is expired, openssh now forces the user to change it. | ||
3174 | (Closes: #51747) | ||
3175 | * scp should now have no more problems with shell-init-files that | ||
3176 | produces ouput (Closes: #56280,#59873) | ||
3177 | * ssh now prints the motd correctly (Closes: #66926) | ||
3178 | * ssh upgrade should disable ssh daemon only if users has choosen | ||
3179 | to do so (Closes: #67478) | ||
3180 | * ssh can now be installed suid (Closes: #70879) | ||
3181 | * Modified debian/rules to support hurd. | ||
3182 | |||
3183 | -- Christian Kurz <shorty@debian.org> Wed, 27 Dec 2000 20:06:57 +0100 | ||
3184 | |||
3185 | openssh (1:2.2.0p1-1.1) unstable; urgency=medium | ||
3186 | |||
3187 | * Non-Maintainer Upload | ||
3188 | * Check for new returns in the new libc | ||
3189 | (closes: #72803, #74393, #72797, #71307, #71702) | ||
3190 | * Link against libssl095a (closes: #66304) | ||
3191 | * Correct check for PermitRootLogin (closes: #69448) | ||
3192 | |||
3193 | -- Ryan Murray <rmurray@debian.org> Wed, 18 Oct 2000 00:48:18 -0700 | ||
3194 | |||
3195 | openssh (1:2.2.0p1-1) unstable; urgency=low | ||
3196 | |||
3197 | * New upstream release | ||
3198 | |||
3199 | -- Philip Hands <phil@hands.com> Mon, 11 Sep 2000 14:49:43 +0100 | ||
3200 | |||
3201 | openssh (1:2.1.1p4-3) unstable; urgency=low | ||
3202 | |||
3203 | * add rsh alternatives | ||
3204 | * add -S option to scp (using Tommi Virtanen's patch) (closes: #63097) | ||
3205 | * do the IPV4_DEFAULT thing properly this time | ||
3206 | |||
3207 | -- Philip Hands <phil@hands.com> Fri, 11 Aug 2000 18:14:37 +0100 | ||
3208 | |||
3209 | openssh (1:2.1.1p4-2) unstable; urgency=low | ||
3210 | |||
3211 | * reinstate manpage .out patch from 1:1.2.3 | ||
3212 | * fix typo in postinst | ||
3213 | * only compile ssh with IPV4_DEFAULT | ||
3214 | * apply James Troup's patch to add a -o option to scp and updated manpage | ||
3215 | |||
3216 | -- Philip Hands <phil@hands.com> Sun, 30 Jul 2000 00:12:49 +0100 | ||
3217 | |||
3218 | openssh (1:2.1.1p4-1) unstable; urgency=low | ||
3219 | |||
3220 | * New upstream release | ||
3221 | |||
3222 | -- Philip Hands <phil@hands.com> Sat, 29 Jul 2000 14:46:16 +0100 | ||
3223 | |||
3224 | openssh (1:1.2.3-10) unstable; urgency=low | ||
3225 | |||
3226 | * add version to libpam-modules dependency, because old versions of | ||
3227 | pam_motd make it impossible to log in. | ||
3228 | |||
3229 | -- Philip Hands <phil@hands.com> Sat, 29 Jul 2000 13:28:22 +0100 | ||
3230 | |||
3231 | openssh (1:1.2.3-9) frozen unstable; urgency=low | ||
3232 | |||
3233 | * force location of /usr/bin/X11/xauth | ||
3234 | (closes: #64424, #66437, #66859) *RC* | ||
3235 | * typos in config (closes: #66779, #66780) | ||
3236 | * sshd_not_to_be_run could be assumed to be true, in error, if the config | ||
3237 | script died in an unusual way --- I've reversed this (closes: #66335) | ||
3238 | * Apply Zack Weinberg <zack@wolery.cumb.org>'s patch to ssh-askpass-ptk | ||
3239 | (closes: #65981) | ||
3240 | * change default for PermitRootLogin to "no" (closes: #66406) | ||
3241 | |||
3242 | -- Philip Hands <phil@hands.com> Tue, 11 Jul 2000 20:51:18 +0100 | ||
3243 | |||
3244 | openssh (1:1.2.3-8) frozen unstable; urgency=low | ||
3245 | |||
3246 | * get rid of Provides: rsh-server (this will mean that rstartd | ||
3247 | will need to change it's depends to deal with #63948, which I'm | ||
3248 | reopening) (closes: #66257) | ||
3249 | Given that this is also a trivial change, and is a reversal of a | ||
3250 | change that was mistakenly made after the freeze, I think this should | ||
3251 | also go into frozen. | ||
3252 | |||
3253 | -- Philip Hands <phil@hands.com> Wed, 28 Jun 2000 03:26:30 +0100 | ||
3254 | |||
3255 | openssh (1:1.2.3-7) frozen unstable; urgency=low | ||
3256 | |||
3257 | * check if debconf is installed before calling db_stop in postinst. | ||
3258 | This is required to allow ssh to be installed when debconf is not | ||
3259 | wanted, which probably makes it an RC upload (hopefully the last of | ||
3260 | too many). | ||
3261 | |||
3262 | -- Philip Hands <phil@hands.com> Wed, 28 Jun 2000 03:19:47 +0100 | ||
3263 | |||
3264 | openssh (1:1.2.3-6) frozen unstable; urgency=low | ||
3265 | |||
3266 | * fixed depressing little bug involving a line wrap looking like | ||
3267 | a blank line in the templates file *RC* | ||
3268 | (closes: #66090, #66078, #66083, #66182) | ||
3269 | |||
3270 | -- Philip Hands <phil@hands.com> Mon, 26 Jun 2000 00:45:05 +0100 | ||
3271 | |||
3272 | openssh (1:1.2.3-5) frozen unstable; urgency=low | ||
3273 | |||
3274 | * add code to prevent UseLogin exploit, although I think our PAM | ||
3275 | conditional code breaks UseLogin in a way that protects us from this | ||
3276 | exploit anyway. ;-) (closes: #65495) *RC* | ||
3277 | * Apply Zack Weinberg <zack@wolery.cumb.org>'s patch to fix keyboard | ||
3278 | grab vulnerability in ssh-askpass-gnome (closes: #64795) *RC* | ||
3279 | * stop redirection of sshd's file descriptors (introduced in 1:1.2.3-3) | ||
3280 | and use db_stop in the postinst to solve that problem instead | ||
3281 | (closes: #65104) | ||
3282 | * add Provides: rsh-server to ssh (closes: #63948) | ||
3283 | * provide config option not to run sshd | ||
3284 | |||
3285 | -- Philip Hands <phil@hands.com> Mon, 12 Jun 2000 23:05:11 +0100 | ||
3286 | |||
3287 | openssh (1:1.2.3-4) frozen unstable; urgency=low | ||
3288 | |||
3289 | * fixes #63436 which is *RC* | ||
3290 | * add 10 second pause in init.d restart (closes: #63844) | ||
3291 | * get rid of noenv in PAM mail line (closes: #63856) | ||
3292 | * fix host key path in make-ssh-known-hosts (closes: #63713) | ||
3293 | * change wording of SUID template (closes: #62788, #63436) | ||
3294 | |||
3295 | -- Philip Hands <phil@hands.com> Sat, 27 May 2000 11:18:06 +0100 | ||
3296 | |||
3297 | openssh (1:1.2.3-3) frozen unstable; urgency=low | ||
3298 | |||
3299 | * redirect sshd's file descriptors to /dev/null in init to | ||
3300 | prevent debconf from locking up during installation | ||
3301 | ** grave bug just submited by me ** | ||
3302 | |||
3303 | -- Philip Hands <phil@hands.com> Thu, 20 Apr 2000 17:10:59 +0100 | ||
3304 | |||
3305 | openssh (1:1.2.3-2) frozen unstable; urgency=low | ||
3306 | |||
3307 | * allow user to select SUID status of /usr/bin/ssh (closes: 62462) ** RC ** | ||
3308 | * suggest debconf | ||
3309 | * conflict with debconf{,-tiny} (<<0.2.17) so I can clean up the preinst | ||
3310 | |||
3311 | -- Philip Hands <phil@hands.com> Wed, 19 Apr 2000 17:49:15 +0100 | ||
3312 | |||
3313 | openssh (1:1.2.3-1) frozen unstable; urgency=low | ||
3314 | |||
3315 | * New upstream release | ||
3316 | * patch sshd to create extra xauth key required for localhost | ||
3317 | (closes: #49944) *** RC *** | ||
3318 | * FallbacktoRsh now defaults to ``no'' to match impression | ||
3319 | given in sshd_config | ||
3320 | * stop setting suid bit on ssh (closes: #58711, #58558) | ||
3321 | This breaks Rhosts authentication (which nobody uses) and allows | ||
3322 | the LD_PRELOAD trick to get socks working, so seems like a net benefit. | ||
3323 | |||
3324 | -- Philip Hands <phil@hands.com> Thu, 13 Apr 2000 20:01:54 +0100 | ||
3325 | |||
3326 | openssh (1:1.2.2-1.4) frozen unstable; urgency=low | ||
3327 | |||
3328 | * Recompile for frozen, contains fix for RC bug. | ||
3329 | |||
3330 | -- Tommi Virtanen <tv@debian.org> Tue, 29 Feb 2000 22:14:58 +0200 | ||
3331 | |||
3332 | openssh (1:1.2.2-1.3) unstable; urgency=low | ||
3333 | |||
3334 | * Integrated man page addition for PrintLastLog. | ||
3335 | This bug was filed on "openssh", and I ended up | ||
3336 | creating my own patch for this (closes: #59054) | ||
3337 | * Improved error message when ssh_exchange_identification | ||
3338 | gets EOF (closes: #58904) | ||
3339 | * Fixed typo (your -> you're) in debian/preinst. | ||
3340 | * Added else-clauses to config to make this upgradepath possible: | ||
3341 | oldssh -> openssh preinst fails due to upgrade_to_openssh=false | ||
3342 | -> ssh-nonfree -> openssh. Without these, debconf remembered | ||
3343 | the old answer, config didn't force asking it, and preinst always | ||
3344 | aborted (closes: #56596, #57782) | ||
3345 | * Moved setting upgrade_to_openssh isdefault flag to the place | ||
3346 | where preinst would abort. This means no double question to most | ||
3347 | users, people who currently suffer from "can't upgrade" may need | ||
3348 | to run apt-get install ssh twice. Did not do the same for | ||
3349 | use_old_init_script, as the situation is a bit different, and | ||
3350 | less common (closes: #54010, #56224) | ||
3351 | * Check for existance of ssh-keygen before attempting to use it in | ||
3352 | preinst, added warning for non-existant ssh-keygen in config. This | ||
3353 | happens when the old ssh is removed (say, due to ssh-nonfree getting | ||
3354 | installed). | ||
3355 | |||
3356 | -- Tommi Virtanen <tv@debian.org> Sun, 27 Feb 2000 21:36:43 +0200 | ||
3357 | |||
3358 | openssh (1:1.2.2-1.2) frozen unstable; urgency=low | ||
3359 | |||
3360 | * Non-maintainer upload. | ||
3361 | * Added configuration option PrintLastLog, default off due to PAM | ||
3362 | (closes: #54007, #55042) | ||
3363 | * ssh-askpass-{gnome,ptk} now provide ssh-askpass, making ssh's | ||
3364 | Suggests: line more accurate. Also closing related bugs fixed | ||
3365 | earlier, when default ssh-askpass moved to /usr/bin. | ||
3366 | (closes: #52403, #54741, #50607, #52298, #50967, #51661) | ||
3367 | * Patched to call vhangup, with autoconf detection and all | ||
3368 | (closes: #55379) | ||
3369 | * Added --with-ipv4-default workaround to a glibc bug causing | ||
3370 | slow DNS lookups, as per UPGRADING. Use -6 to really use | ||
3371 | IPv6 addresses. (closes: #57891, #58744, #58713, #57970) | ||
3372 | * Added noenv to PAM pam_mail line. Thanks to Ben Collins. | ||
3373 | (closes: #58429) | ||
3374 | * Added the UPGRADING file to the package. | ||
3375 | * Added frozen to the changelog line and recompiled before | ||
3376 | package was installed into the archive. | ||
3377 | |||
3378 | -- Tommi Virtanen <tv@debian.org> Fri, 25 Feb 2000 22:08:57 +0200 | ||
3379 | |||
3380 | openssh (1:1.2.2-1.1) frozen unstable; urgency=low | ||
3381 | |||
3382 | * Non-maintainer upload. | ||
3383 | * Integrated scp pipe buffer patch from Ben Collins | ||
3384 | <benc@debian.org>, should now work even if reading | ||
3385 | a pipe gives less than fstat st_blksize bytes. | ||
3386 | Should now work on Alpha and Sparc Linux (closes: #53697, #52071) | ||
3387 | * Made ssh depend on libssl09 (>= 0.9.4-3) (closes: #51393) | ||
3388 | * Integrated patch from Ben Collins <benc@debian.org> | ||
3389 | to do full shadow account locking and expiration | ||
3390 | checking (closes: #58165, #51747) | ||
3391 | |||
3392 | -- Tommi Virtanen <tv@debian.org> Tue, 22 Feb 2000 20:46:12 +0200 | ||
3393 | |||
3394 | openssh (1:1.2.2-1) frozen unstable; urgency=medium | ||
3395 | |||
3396 | * New upstream release (closes: #56870, #56346) | ||
3397 | * built against new libesd (closes: #56805) | ||
3398 | * add Colin Watson <cjw44@cam.ac.uk> =NULL patch | ||
3399 | (closes: #49902, #54894) | ||
3400 | * use socketpairs as suggested by Andrew Tridgell to eliminate rsync | ||
3401 | (and other) lockups | ||
3402 | * patch SSHD_PAM_SERVICE back into auth-pam.c, again :-/ | ||
3403 | (closes: #49902, #55872, #56959) | ||
3404 | * uncoment the * line in ssh_config (closes: #56444) | ||
3405 | |||
3406 | * #54894 & #49902 are release critical, so this should go in frozen | ||
3407 | |||
3408 | -- Philip Hands <phil@hands.com> Wed, 9 Feb 2000 04:52:04 +0000 | ||
3409 | |||
3410 | openssh (1:1.2.1pre24-1) unstable; urgency=low | ||
3411 | |||
3412 | * New upstream release | ||
3413 | |||
3414 | -- Philip Hands <phil@hands.com> Fri, 31 Dec 1999 02:47:24 +0000 | ||
3415 | |||
3416 | openssh (1:1.2.1pre23-1) unstable; urgency=low | ||
3417 | |||
3418 | * New upstream release | ||
3419 | * excape ? in /etc/init.d/ssh (closes: #53269) | ||
3420 | |||
3421 | -- Philip Hands <phil@hands.com> Wed, 29 Dec 1999 16:50:46 +0000 | ||
3422 | |||
3423 | openssh (1:1.2pre17-1) unstable; urgency=low | ||
3424 | |||
3425 | * New upstream release | ||
3426 | |||
3427 | -- Philip Hands <phil@hands.com> Thu, 9 Dec 1999 16:50:40 +0000 | ||
3428 | |||
3429 | openssh (1:1.2pre16-1) unstable; urgency=low | ||
3430 | |||
3431 | * New upstream release | ||
3432 | * upstream release (1.2pre14) (closes: #50299) | ||
3433 | * make ssh depend on libwrap0 (>= 7.6-1.1) (closes: #50973, #50776) | ||
3434 | * dispose of grep -q broken pipe message in config script (closes: #50855) | ||
3435 | * add make-ssh-known-hosts (closes: #50660) | ||
3436 | * add -i option to ssh-copy-id (closes: #50657) | ||
3437 | * add check for *LK* in password, indicating a locked account | ||
3438 | |||
3439 | -- Philip Hands <phil@hands.com> Wed, 8 Dec 1999 22:59:38 +0000 | ||
3440 | |||
3441 | openssh (1:1.2pre13-1) unstable; urgency=low | ||
3442 | |||
3443 | * New upstream release | ||
3444 | * make sshd.c use SSHD_PAM_SERVICE and define it as "ssh" in debian/rules | ||
3445 | * remove duplicate line in /etc/pam.d/ssh (closes: #50310) | ||
3446 | * mention ssh -A option in ssh.1 & ssh_config | ||
3447 | * enable forwarding to localhost in default ssh_config (closes: #50373) | ||
3448 | * tweak preinst to deal with debconf being `unpacked' | ||
3449 | * use --with-tcp-wrappers (closes: #49545) | ||
3450 | |||
3451 | -- Philip Hands <phil@hands.com> Sat, 20 Nov 1999 14:20:04 +0000 | ||
3452 | |||
3453 | openssh (1:1.2pre11-2) unstable; urgency=low | ||
3454 | |||
3455 | * oops, just realised that I forgot to strip out the unpleasant | ||
3456 | fiddling mentioned below (which turned not to be a fix anyway) | ||
3457 | |||
3458 | -- Philip Hands <phil@hands.com> Mon, 15 Nov 1999 01:35:23 +0000 | ||
3459 | |||
3460 | openssh (1:1.2pre11-1) unstable; urgency=low | ||
3461 | |||
3462 | * New upstream release (closes: #49722) | ||
3463 | * add 2>/dev/null to dispose of spurious message casused by grep -q | ||
3464 | (closes: #49876, #49604) | ||
3465 | * fix typo in debian/control (closes: #49841) | ||
3466 | * Do some unpleasant fiddling with upgraded keys in the preinst, which | ||
3467 | should make the keylength problem go away. (closes: #49676) | ||
3468 | * make pam_start in sshd use ``ssh'' as the service name (closes: #49956) | ||
3469 | * If /etc/ssh/NOSERVER exist, stop sshd from starting (closes: #47107) | ||
3470 | * apply Ben Collins <bcollins@debian.org>'s shadow patch | ||
3471 | * disable lastlogin and motd printing if using pam (closes: #49957) | ||
3472 | * add ssh-copy-id script and manpage | ||
3473 | |||
3474 | -- Philip Hands <phil@hands.com> Fri, 12 Nov 1999 01:03:38 +0000 | ||
3475 | |||
3476 | openssh (1:1.2pre9-1) unstable; urgency=low | ||
3477 | |||
3478 | * New upstream release | ||
3479 | * apply Chip Salzenberg <chip@valinux.com>'s SO_REUSEADDR patch | ||
3480 | to channels.c, to make forwarded ports instantly reusable | ||
3481 | * replace Pre-Depend: debconf with some check code in preinst | ||
3482 | * make the ssh-add ssh-askpass failure message more helpful | ||
3483 | * fix the ssh-agent getopts bug (closes: #49426) | ||
3484 | * fixed typo on Suggests: line (closes: #49704, #49571) | ||
3485 | * tidy up ssh package description (closes: #49642) | ||
3486 | * make ssh suid (closes: #49635) | ||
3487 | * in preinst upgrade code, ensure ssh_host_keys is mode 600 (closes: #49606) | ||
3488 | * disable agent forwarding by default, for the similar reasons as | ||
3489 | X forwarding (closes: #49586) | ||
3490 | |||
3491 | -- Philip Hands <phil@hands.com> Tue, 9 Nov 1999 09:57:47 +0000 | ||
3492 | |||
3493 | openssh (1:1.2pre7-4) unstable; urgency=low | ||
3494 | |||
3495 | * predepend on debconf (>= 0.2.17) should now allow preinst questions | ||
3496 | |||
3497 | -- Philip Hands <phil@hands.com> Sat, 6 Nov 1999 10:31:06 +0000 | ||
3498 | |||
3499 | openssh (1:1.2pre7-3) unstable; urgency=low | ||
3500 | |||
3501 | * add ssh-askpass package using Tommi Virtanen's perl-tk script | ||
3502 | * add ssh-preconfig package cludge | ||
3503 | * add usage hints to ssh-agent.1 | ||
3504 | |||
3505 | -- Philip Hands <phil@hands.com> Fri, 5 Nov 1999 00:38:33 +0000 | ||
3506 | |||
3507 | openssh (1:1.2pre7-2) unstable; urgency=low | ||
3508 | |||
3509 | * use pam patch from Ben Collins <bcollins@debian.org> | ||
3510 | * add slogin symlink to Makefile.in | ||
3511 | * change /usr/bin/login to LOGIN_PROGRAM define of /bin/login | ||
3512 | * sort out debconf usage | ||
3513 | * patch from Tommi Virtanen <tv@debian.org>'s makes ssh-add use ssh-askpass | ||
3514 | |||
3515 | -- Philip Hands <phil@hands.com> Thu, 4 Nov 1999 11:08:54 +0000 | ||
3516 | |||
3517 | openssh (1:1.2pre7-1) unstable; urgency=low | ||
3518 | |||
3519 | * New upstream release | ||
3520 | |||
3521 | -- Philip Hands <phil@hands.com> Tue, 2 Nov 1999 21:02:37 +0000 | ||
3522 | |||
3523 | openssh (1:1.2.0.pre6db1-2) unstable; urgency=low | ||
3524 | |||
3525 | * change the binary package name to ssh (the non-free branch of ssh has | ||
3526 | been renamed to ssh-nonfree) | ||
3527 | * make pam file comply with Debian standards | ||
3528 | * use an epoch to make sure openssh supercedes ssh-nonfree | ||
3529 | |||
3530 | -- Philip Hands <phil@hands.com> Sat, 30 Oct 1999 16:26:05 +0100 | ||
3531 | |||
3532 | openssh (1.2pre6db1-1) unstable; urgency=low | ||
3533 | |||
3534 | * New upstream source | ||
3535 | * sshd accepts logins now! | ||
3536 | |||
3537 | -- Dan Brosemer <odin@linuxfreak.com> Fri, 29 Oct 1999 11:13:38 -0500 | ||
3538 | |||
3539 | openssh (1.2.0.19991028-1) unstable; urgency=low | ||
3540 | |||
3541 | * New upstream source | ||
3542 | * Added test for -lnsl to configure script | ||
3543 | |||
3544 | -- Dan Brosemer <odin@linuxfreak.com> Thu, 28 Oct 1999 18:52:09 -0500 | ||
3545 | |||
3546 | openssh (1.2.0.19991027-3) unstable; urgency=low | ||
3547 | |||
3548 | * Initial release | ||
3549 | |||
3550 | -- Dan Brosemer <odin@linuxfreak.com> Wed, 27 Oct 1999 19:39:46 -0500 | ||
diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..5da17f8eb --- /dev/null +++ b/debian/clean | |||
@@ -0,0 +1 @@ | |||
config.log | |||
diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..7f8f011eb --- /dev/null +++ b/debian/compat | |||
@@ -0,0 +1 @@ | |||
7 | |||
diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..82fdde9e6 --- /dev/null +++ b/debian/control | |||
@@ -0,0 +1,137 @@ | |||
1 | Source: openssh | ||
2 | Section: net | ||
3 | Priority: standard | ||
4 | Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org> | ||
5 | Build-Depends: libwrap0-dev | libwrap-dev, zlib1g-dev (>= 1:1.2.3-1), libssl-dev (>= 0.9.8g), libpam0g-dev | libpam-dev, libgtk2.0-dev, libedit-dev, debhelper (>= 8.1.0~), libselinux1-dev [linux-any], libkrb5-dev | heimdal-dev, dpkg (>= 1.16.1~), libck-connector-dev, dh-autoreconf, autotools-dev | ||
6 | Standards-Version: 3.8.4 | ||
7 | Uploaders: Colin Watson <cjwatson@debian.org>, Matthew Vernon <matthew@debian.org> | ||
8 | Homepage: http://www.openssh.org/ | ||
9 | Vcs-Bzr: http://anonscm.debian.org/bzr/pkg-ssh/openssh/trunk | ||
10 | Vcs-Browser: http://anonscm.debian.org/loggerhead/pkg-ssh/openssh/trunk | ||
11 | |||
12 | Package: openssh-client | ||
13 | Architecture: any | ||
14 | Depends: ${shlibs:Depends}, ${misc:Depends}, adduser (>= 3.10), dpkg (>= 1.7.0), passwd | ||
15 | Recommends: xauth | ||
16 | Conflicts: ssh (<< 1:3.8.1p1-9), sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7) | ||
17 | Replaces: ssh, ssh-krb5 | ||
18 | Suggests: ssh-askpass, libpam-ssh, keychain, monkeysphere, openssh-blacklist, openssh-blacklist-extra | ||
19 | Provides: rsh-client, ssh-client | ||
20 | Multi-Arch: foreign | ||
21 | Description: secure shell (SSH) client, for secure access to remote machines | ||
22 | This is the portable version of OpenSSH, a free implementation of | ||
23 | the Secure Shell protocol as specified by the IETF secsh working | ||
24 | group. | ||
25 | . | ||
26 | Ssh (Secure Shell) is a program for logging into a remote machine | ||
27 | and for executing commands on a remote machine. | ||
28 | It provides secure encrypted communications between two untrusted | ||
29 | hosts over an insecure network. X11 connections and arbitrary TCP/IP | ||
30 | ports can also be forwarded over the secure channel. | ||
31 | It can be used to provide applications with a secure communication | ||
32 | channel. | ||
33 | . | ||
34 | This package provides the ssh, scp and sftp clients, the ssh-agent | ||
35 | and ssh-add programs to make public key authentication more convenient, | ||
36 | and the ssh-keygen, ssh-keyscan, ssh-copy-id and ssh-argv0 utilities. | ||
37 | . | ||
38 | In some countries it may be illegal to use any encryption at all | ||
39 | without a special permit. | ||
40 | . | ||
41 | ssh replaces the insecure rsh, rcp and rlogin programs, which are | ||
42 | obsolete for most purposes. | ||
43 | |||
44 | Package: openssh-server | ||
45 | Priority: optional | ||
46 | Architecture: any | ||
47 | Pre-Depends: ${misc:Pre-Depends} | ||
48 | Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 0.76-14), libpam-modules (>= 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), openssh-client (= ${binary:Version}), lsb-base (>= 4.1+Debian3), procps | ||
49 | Recommends: xauth, ncurses-term, ${openssh-server:Recommends} | ||
50 | Conflicts: ssh (<< 1:3.8.1p1-9), ssh-nonfree (<<2), ssh-socks, ssh2, sftp, rsh-client (<<0.16.1-1), ssh-krb5 (<< 1:4.3p2-7) | ||
51 | Replaces: ssh, openssh-client (<< 1:3.8.1p1-11), ssh-krb5 | ||
52 | Suggests: ssh-askpass, rssh, molly-guard, ufw, monkeysphere, openssh-blacklist, openssh-blacklist-extra | ||
53 | Provides: ssh-server | ||
54 | Multi-Arch: foreign | ||
55 | Description: secure shell (SSH) server, for secure access from remote machines | ||
56 | This is the portable version of OpenSSH, a free implementation of | ||
57 | the Secure Shell protocol as specified by the IETF secsh working | ||
58 | group. | ||
59 | . | ||
60 | Ssh (Secure Shell) is a program for logging into a remote machine | ||
61 | and for executing commands on a remote machine. | ||
62 | It provides secure encrypted communications between two untrusted | ||
63 | hosts over an insecure network. X11 connections and arbitrary TCP/IP | ||
64 | ports can also be forwarded over the secure channel. | ||
65 | It can be used to provide applications with a secure communication | ||
66 | channel. | ||
67 | . | ||
68 | This package provides the sshd server. | ||
69 | . | ||
70 | In some countries it may be illegal to use any encryption at all | ||
71 | without a special permit. | ||
72 | . | ||
73 | sshd replaces the insecure rshd program, which is obsolete for most | ||
74 | purposes. | ||
75 | |||
76 | Package: ssh | ||
77 | Priority: extra | ||
78 | Architecture: all | ||
79 | Depends: ${misc:Depends}, openssh-client (>= ${binary:Version}), openssh-server (>= ${binary:Version}) | ||
80 | Description: secure shell client and server (metapackage) | ||
81 | This metapackage is a convenient way to install both the OpenSSH client | ||
82 | and the OpenSSH server. It provides nothing in and of itself, so you | ||
83 | may remove it if nothing depends on it. | ||
84 | |||
85 | Package: ssh-krb5 | ||
86 | Section: oldlibs | ||
87 | Priority: extra | ||
88 | Architecture: all | ||
89 | Depends: ${misc:Depends}, openssh-client (>= ${binary:Version}), openssh-server (>= ${binary:Version}) | ||
90 | Description: secure shell client and server (transitional package) | ||
91 | This is a transitional package depending on the regular Debian OpenSSH | ||
92 | client and server, which now support GSSAPI natively. It will add the | ||
93 | necessary GSSAPI options to the server configuration file. You can | ||
94 | remove it once the upgrade is complete and nothing depends on it. | ||
95 | |||
96 | Package: ssh-askpass-gnome | ||
97 | Section: gnome | ||
98 | Priority: optional | ||
99 | Architecture: any | ||
100 | Depends: ${shlibs:Depends}, ${misc:Depends}, openssh-client | ssh (>= 1:1.2pre7-4) | ssh-krb5 | ||
101 | Replaces: ssh (<< 1:3.5p1-3) | ||
102 | Provides: ssh-askpass | ||
103 | Description: interactive X program to prompt users for a passphrase for ssh-add | ||
104 | This has been split out of the main openssh-client package so that | ||
105 | openssh-client does not need to depend on GTK+. | ||
106 | . | ||
107 | You probably want the ssh-askpass package instead, but this is | ||
108 | provided to add to your choice and/or confusion. | ||
109 | |||
110 | Package: openssh-client-udeb | ||
111 | XC-Package-Type: udeb | ||
112 | Section: debian-installer | ||
113 | Priority: optional | ||
114 | Architecture: any | ||
115 | Depends: ${shlibs:Depends}, libnss-files-udeb | ||
116 | XB-Installer-Menu-Item: 99999 | ||
117 | Description: secure shell client for the Debian installer | ||
118 | This is the portable version of OpenSSH, a free implementation of | ||
119 | the Secure Shell protocol as specified by the IETF secsh working | ||
120 | group. | ||
121 | . | ||
122 | This package provides the ssh client for use in debian-installer. | ||
123 | |||
124 | Package: openssh-server-udeb | ||
125 | XC-Package-Type: udeb | ||
126 | Section: debian-installer | ||
127 | Priority: optional | ||
128 | Architecture: any | ||
129 | Depends: ${shlibs:Depends}, libnss-files-udeb | ||
130 | Description: secure shell server for the Debian installer | ||
131 | This is the portable version of OpenSSH, a free implementation of | ||
132 | the Secure Shell protocol as specified by the IETF secsh working | ||
133 | group. | ||
134 | . | ||
135 | This package provides the sshd server for use in debian-installer. | ||
136 | Since it is expected to be used in specialized situations (e.g. S/390 | ||
137 | installs with no console), it does not provide any configuration. | ||
diff --git a/debian/copyright.head b/debian/copyright.head new file mode 100644 index 000000000..c59278825 --- /dev/null +++ b/debian/copyright.head | |||
@@ -0,0 +1,52 @@ | |||
1 | This package was debianized by Philip Hands <phil@hands.com> on 31 Oct 1999 | ||
2 | (with help from Dan Brosemer <odin@linuxfreak.com>) | ||
3 | |||
4 | It was downloaded from here: | ||
5 | ftp://ftp.fu-berlin.de/unix/security/openssh/openssh-2.3.0p1.tar.gz | ||
6 | |||
7 | worldwide mirrors are listed here: | ||
8 | http://www.openssh.com/ftp.html | ||
9 | |||
10 | The Debian-specific parts of the package were initially derived from the | ||
11 | original ssh package, which has since been renamed as ssh-nonfree. | ||
12 | |||
13 | The Debian patch is distributed under the terms of the GPL, which you | ||
14 | can find in /usr/share/common-licenses/GPL. | ||
15 | |||
16 | In addition, as a special exception, Matthew Vernon gives permission | ||
17 | to link the code of the Debian patch with any version of the OpenSSH | ||
18 | code which is distributed under a license identical to that listed in | ||
19 | the included Copyright file, and distribute linked combinations | ||
20 | including the two. You must obey the GNU General Public License in | ||
21 | all respects for all of the code used other than OpenSSH. If you | ||
22 | modify this file, you may extend this exception to your version of the | ||
23 | file, but you are not obligated to do so. If you do not wish to do | ||
24 | so, delete this exception statement from your version. | ||
25 | |||
26 | The upstream source for this package is a combination of the ssh | ||
27 | branch that is being maintained by the OpenBSD team (starting from | ||
28 | the last version of SSH that was distributed under a free license), | ||
29 | and porting work by Damien Miller <damien@ibs.com.au> to get it | ||
30 | working on Linux. Other people also contributed to this, and are | ||
31 | credited in /usr/share/doc/ssh/README. | ||
32 | |||
33 | This package contains Kerberos version 5 patches from | ||
34 | http://www.sxw.org.uk/computing/patches/openssh.html; this is Copyright | ||
35 | (c) 2001-2009 Simon Wilkinson and provided under the standard 2-term BSD | ||
36 | licence used elsewhere in OpenSSH. | ||
37 | |||
38 | Copyright: | ||
39 | |||
40 | Code in helper.[ch] is Copyright Internet Business Solutions and is | ||
41 | released under a X11-style license (see source file for details). | ||
42 | |||
43 | (A)RC4 code in rc4.[ch] is Copyright Damien Miller. It too is under a | ||
44 | X11-style license (see source file for details). | ||
45 | |||
46 | make-ssh-known-hosts is Copyright Tero Kivinen <Tero.Kivinen@hut.fi>, | ||
47 | and is distributed under the GPL (see source file for details). | ||
48 | |||
49 | The copyright for the original SSH version follows. It has been | ||
50 | modified with [comments] to reflect the changes that the OpenBSD folks | ||
51 | have made: | ||
52 | |||
diff --git a/debian/faq.html b/debian/faq.html new file mode 100644 index 000000000..d6eb7fda5 --- /dev/null +++ b/debian/faq.html | |||
@@ -0,0 +1,1187 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>OpenSSH FAQ</title> | ||
5 | <link rev= "made" href= "mailto:www@openbsd.org"> | ||
6 | <meta name= "resource-type" content= "document"> | ||
7 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | ||
8 | <meta name= "description" content= "the OpenSSH FAQ page"> | ||
9 | <meta name= "keywords" content= "OpenSSH,SSH,Secure Shell,faq"> | ||
10 | <meta name= "distribution" content= "global"> | ||
11 | <meta name= "copyright" content= "This document copyright 1999-2010 OpenBSD."> | ||
12 | </head> | ||
13 | |||
14 | <body bgcolor= "#ffffff" text= "#000000" link= "#23238E"> | ||
15 | <a href="http://www.openssh.org/index.html"><img alt="[OpenSSH]" height="30" width="141" src="images/smalltitle.gif" border="0"></a> | ||
16 | <p> | ||
17 | |||
18 | <h1>OpenSSH FAQ (Frequently asked questions)</h1> | ||
19 | |||
20 | <hr> | ||
21 | |||
22 | <blockquote> | ||
23 | <h3><a href= "#1.0">1.0 - What Is OpenSSH and Where Can I Get It?</a></h3> | ||
24 | <ul> | ||
25 | <li><a href= "#1.1">1.1 - What is OpenSSH and where can I download it?</a> | ||
26 | <li><a href= "#1.2">1.2 - Why should it be used?</a> | ||
27 | <li><a href= "#1.3">1.3 - What Operating Systems are supported?</a> | ||
28 | <li><a href= "#1.4">1.4 - What about copyright, usage and patents?</a> | ||
29 | <li><a href= "#1.5">1.5 - Where should I ask for help?</a> | ||
30 | <li><a href= "#1.6">1.6 - I have found a bug. Where do I report it?</a> | ||
31 | </ul> | ||
32 | |||
33 | <h3><a href= "#2.0">2.0 - General Questions</a></h3> | ||
34 | <ul> | ||
35 | <li><a href= "#2.1">2.1 - Why does ssh/scp make connections from low-numbered ports. My firewall blocks these.</a> | ||
36 | <li><a href= "#2.2">2.2 - Why is the ssh client setuid root?</a> | ||
37 | <li><a href= "#2.3">2.3 - Why does SSH 2.3 have problems interoperating with OpenSSH 2.1.1?</a> | ||
38 | <li><a href= "#2.4">2.4 - Why does OpenSSH print: Dispatch protocol error: type 20</a> | ||
39 | <li><a href= "#2.5">2.5 - Old versions of commercial SSH encrypt host keys with IDEA.</a> | ||
40 | <li><a href= "#2.6">2.6 - What are these warning messages about key lengths?</a> | ||
41 | <li><a href= "#2.7">2.7 - X11 and/or agent forwarding does not work.</a> | ||
42 | <li><a href= "#2.8">2.8 - After upgrading OpenSSH I lost SSH2 support.</a> | ||
43 | <li><a href= "#2.9">2.9 - sftp/scp fails at connection, but ssh is OK.</a> | ||
44 | <li><a href= "#2.10">2.10 - Will you add [foo] to scp?</a> | ||
45 | <li><a href= "#2.11">2.11 - How do I use port forwarding?</a> | ||
46 | <li><a href= "#2.12">2.12 - My ssh connection freezes or drops out after N minutes of inactivity.</a> | ||
47 | <li><a href= "#2.13">2.13 - How do I use scp to copy a file with a colon in it?</a> | ||
48 | <li><a href= "#2.14">2.14 - Why does OpenSSH report its version to clients?</a> | ||
49 | </ul> | ||
50 | |||
51 | <h3><a href= "#3.0">3.0 - Portable OpenSSH Questions</a></h3> | ||
52 | <ul> | ||
53 | <li><a href= "#3.1">3.1 - Spurious PAM authentication messages in logfiles.</a> | ||
54 | <li><a href= "#3.2">3.2 - Empty passwords not allowed with PAM authentication.</a> | ||
55 | <li><a href= "#3.3">3.3 - ssh(1) takes a long time to connect or log in</a> | ||
56 | <li><a href= "#3.4">3.4 - "Can't locate module net-pf-10" messages in log under Linux.</a> | ||
57 | <li><a href= "#3.5">3.5 - Password authentication doesn't work (eg on Slackware 7.0 or Red Hat Linux 6.x)</a> | ||
58 | <li><a href= "#3.6">3.6 - Configure or sshd(8) complain about lack of RSA support</a> | ||
59 | <li><a href= "#3.7">3.7 - "scp: command not found" errors</a> | ||
60 | <li><a href= "#3.8">3.8 - Unable to read passphrase</a> | ||
61 | <li><a href= "#3.9">3.9 - 'configure' missing or make fails</a> | ||
62 | <li><a href= "#3.10">3.10 - Hangs when exiting ssh</a> | ||
63 | <li><a href= "#3.11">3.11 - Why does ssh hang on exit?</a> | ||
64 | <li><a href= "#3.12">3.12 - I upgraded to OpenSSH 3.1 and X11 forwarding stopped working.</a> | ||
65 | <li><a href= "#3.13">3.13 - I upgraded to OpenSSH 3.8 and some X11 programs stopped working.</a> | ||
66 | <li><a href= "#3.14">3.14 - I copied my public key to authorized_keys but public-key authentication still doesn't work.</a> | ||
67 | <li><a href= "#3.15">3.15 - OpenSSH versions and PAM behaviour.</a> | ||
68 | <li><a href= "#3.16">3.16 - Why doesn't "w" or "who" on AIX 5.x show users logged in via ssh?</a> | ||
69 | </ul> | ||
70 | |||
71 | </blockquote> | ||
72 | |||
73 | <hr> | ||
74 | |||
75 | <h2><u><a name= "1.0">1.0 - What Is OpenSSH and Where Can I Get It?</a></u></h2> | ||
76 | |||
77 | <h2><a name= "1.1">1.1 - What is OpenSSH and where can I download it?</a></h2> | ||
78 | |||
79 | OpenSSH provides end-to-end encrypted replacement of applications such as | ||
80 | telnet, rlogin, and ftp. | ||
81 | Unlike these legacy applications, OpenSSH never passes anything | ||
82 | (including username and password) over the wire in unencrypted form, and | ||
83 | provides host authentication, to verify that you really are talking to | ||
84 | the system that you think you are and that no one else can take over | ||
85 | that session. | ||
86 | |||
87 | <p> | ||
88 | The OpenSSH suite includes the | ||
89 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1">ssh(1)</a> | ||
90 | program which replaces rlogin and telnet, and | ||
91 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=scp&sektion=1">scp(1)</a> | ||
92 | which replaces | ||
93 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=rcp&sektion=1">rcp(1)</a> and | ||
94 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ftp&sektion=1">ftp(1)</a>. | ||
95 | OpenSSH has also added | ||
96 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sftp&sektion=1">sftp(1)</a> and | ||
97 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sftp-server&sektion=8">sftp-server(8)</a> | ||
98 | which implement an easier solution for file-transfer. This is based upon the | ||
99 | <a href="http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt">secsh-filexfer</a> IETF draft. | ||
100 | |||
101 | |||
102 | <p><strong>OpenSSH consists of a number of programs.</strong> | ||
103 | |||
104 | <ul> | ||
105 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8">sshd(8)</a> - Server program run on the server machine. This listens for connections from client machines, and whenever it receives a connection, it performs authentication and starts serving the client. | ||
106 | Its behaviour is controlled by the config file <i><a | ||
107 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config&sektion=5"> | ||
108 | sshd_config(5)</a></i>. | ||
109 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1">ssh(1)</a> - This is the client program used to log into another machine or to execute commands on the other machine. <i>slogin</i> is another name for this program. | ||
110 | Its behaviour is controlled by the global config file <i><a | ||
111 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5"> | ||
112 | ssh_config(5)</a></i> and individual users' <i>$HOME/.ssh/config</i> files. | ||
113 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=scp&sektion=1">scp(1)</a> - Securely copies files from one machine to another. | ||
114 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&sektion=1">ssh-keygen(1)</a> - Used to create Pubkey Authentication (RSA or DSA) keys (host keys and user authentication keys). | ||
115 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-agent&sektion=1">ssh-agent(1)</a> - Authentication agent. This can be used to hold RSA keys for authentication. | ||
116 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-add&sektion=1">ssh-add(1)</a> - Used to register new keys with the agent. | ||
117 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sftp-server&sektion=8">sftp-server(8)</a> - SFTP server subsystem. | ||
118 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sftp&sektion=1">sftp(1)</a> - Secure file transfer program. | ||
119 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keyscan&sektion=1">ssh-keyscan(1)</a> - gather ssh public keys. | ||
120 | <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keysign&sektion=8">ssh-keysign(8)</a> - ssh helper program for hostbased authentication. | ||
121 | </ul> | ||
122 | |||
123 | <h3>Downloading</h3> | ||
124 | |||
125 | <p> | ||
126 | The most recent version of OpenSSH is included with the current | ||
127 | distribution of <a href="http://www.openbsd.org/">OpenBSD</a>, and | ||
128 | installed as part of a basic install. | ||
129 | |||
130 | <p> | ||
131 | Today, most other operating systems include some version of OpenSSH | ||
132 | (often re-badged or privately labeled), so most users can immediately | ||
133 | use it. | ||
134 | However, sometimes the included versions are quite old, and missing | ||
135 | features of the current release of OpenSSH, and you may wish to install | ||
136 | the current version, or install it on one of the few OSs that lacked it, | ||
137 | and where the OS publisher does not make a modern version available. | ||
138 | You may also wish to use OpenSSH on your embedded application. | ||
139 | |||
140 | <p> | ||
141 | Non-OpenBSD users will want to download, compile and install the | ||
142 | multi-platform <a href="http://www.openssh.org/portable.html">Portable</a> distribution from a | ||
143 | <a href="http://www.openssh.org/portable.html#mirrors">mirror</a> near you. | ||
144 | |||
145 | |||
146 | <h2><a name= "1.2">1.2 - Why should it be used?</a></h2> | ||
147 | |||
148 | <p> | ||
149 | OpenSSH is a suite of tools to help secure your network | ||
150 | connections. Here is a list of features: | ||
151 | |||
152 | |||
153 | <ul> | ||
154 | <li>Strong authentication. Closes several security holes (e.g., IP, routing, and DNS spoofing). | ||
155 | <li>Improved privacy. All communications are automatically and transparently encrypted. | ||
156 | <li>Secure X11 sessions. The program automatically sets DISPLAY on the server machine, and forwards any X11 connections over the secure channel. | ||
157 | <li>Arbitrary TCP/IP ports can be redirected through the encrypted channel in both directions (e.g., for e-cash transactions). | ||
158 | <li>No retraining needed for normal users. | ||
159 | <li>Never trusts the network. Minimal trust on the remote side of the connection. Minimal trust on domain name servers. Pure RSA authentication never trusts anything but the private key. | ||
160 | <li>Client RSA-authenticates the server machine in the beginning of every connection to prevent trojan horses (by routing or DNS spoofing) and man-in-the-middle attacks, and the server RSA-authenticates the client machine before accepting <i>.rhosts</i> or <i>/etc/hosts.equiv</i> authentication (to prevent DNS, routing, or IP-spoofing). | ||
161 | <li>Host authentication key distribution can be centrally by the administration, automatically when the first connection is made to a machine. | ||
162 | <li>Any user can create any number of user authentication RSA keys for his/her own use. | ||
163 | <li>The server program has its own server RSA key which is automatically regenerated every hour. | ||
164 | <li>An authentication agent, running in the user's laptop or local workstation, can be used to hold the user's RSA authentication keys. | ||
165 | <li>The software can be installed and used (with restricted functionality) even without root privileges. | ||
166 | <li>The client is customizable in system-wide and per-user configuration files. | ||
167 | <li>Optional compression of all data with gzip (including forwarded X11 and TCP/IP port data), which may result in significant speedups on slow connections. | ||
168 | <li>Complete replacement for rlogin, rsh, and rcp. | ||
169 | </ul> | ||
170 | |||
171 | <p> | ||
172 | Currently, almost all communications in computer networks are done | ||
173 | without encryption. As a consequence, anyone who has access to any | ||
174 | machine connected to the network can listen in on any communication. | ||
175 | This is being done by hackers, curious administrators, employers, | ||
176 | criminals, industrial spies, and governments. Some networks leak off | ||
177 | enough electromagnetic radiation that data may be captured even from a | ||
178 | distance. | ||
179 | |||
180 | |||
181 | <p> | ||
182 | When you log in, your password goes in the network in plain | ||
183 | text. Thus, any listener can then use your account to do any evil he | ||
184 | likes. Many incidents have been encountered worldwide where crackers | ||
185 | have started programs on workstations without the owner's knowledge | ||
186 | just to listen to the network and collect passwords. Programs for | ||
187 | doing this are available on the Internet, or can be built by a | ||
188 | competent programmer in a few hours. | ||
189 | |||
190 | |||
191 | <p> | ||
192 | Businesses have trade secrets, patent applications in preparation, | ||
193 | pricing information, subcontractor information, client data, personnel | ||
194 | data, financial information, etc. Currently, anyone with access to | ||
195 | the network (any machine on the network) can listen to anything that | ||
196 | goes in the network, without any regard to normal access restrictions. | ||
197 | |||
198 | |||
199 | <p> | ||
200 | Many companies are not aware that information can so easily be | ||
201 | recovered from the network. They trust that their data is safe | ||
202 | since nobody is supposed to know that there is sensitive information | ||
203 | in the network, or because so much other data is transferred in the | ||
204 | network. This is not a safe policy. | ||
205 | |||
206 | |||
207 | <h2><a name= "1.3">1.3 - What operating systems are supported?</a></h2> | ||
208 | |||
209 | <p> | ||
210 | Even though OpenSSH is developed on | ||
211 | <a href="http://www.openbsd.org/">OpenBSD</a> a wide variety of | ||
212 | ports to other operating systems exist. The portable version of OpenSSH | ||
213 | is headed by <a href="mailto:djm@openbsd.org">Damien Miller</a>. | ||
214 | For a quick overview of the portable version of OpenSSH see | ||
215 | <a href="http://www.openssh.org/portable.html">OpenSSH Portable Release</a>. | ||
216 | Currently, the supported operating systems are: | ||
217 | |||
218 | |||
219 | <ul> | ||
220 | <li>OpenBSD | ||
221 | <li>NetBSD | ||
222 | <li>FreeBSD | ||
223 | <li>AIX | ||
224 | <li>HP-UX | ||
225 | <li>IRIX | ||
226 | <li>Linux | ||
227 | <li>NeXT | ||
228 | <li>SCO | ||
229 | <li>SNI/Reliant Unix | ||
230 | <li>Solaris | ||
231 | <li>Digital Unix/Tru64/OSF | ||
232 | <li>Mac OS X | ||
233 | <li>Cygwin | ||
234 | </ul> | ||
235 | |||
236 | <p> | ||
237 | A list of vendors that include OpenSSH in their distributions | ||
238 | is located in the <a href="http://www.openssh.org/users.html">OpenSSH Users page</a>. | ||
239 | |||
240 | <h2><a name= "1.4">1.4 - What about copyrights, usage and patents?</a></h2> | ||
241 | <p> | ||
242 | The OpenSSH developers have tried very hard to keep OpenSSH free of any | ||
243 | patent or copyright problems. To do this, some options had to be | ||
244 | stripped from OpenSSH. Namely support for patented algorithms. | ||
245 | |||
246 | <p> | ||
247 | OpenSSH does not support any patented transport algorithms. In SSH1 mode, | ||
248 | only 3DES and Blowfish are available options. In SSH2 mode, only 3DES, | ||
249 | Blowfish, CAST128, Arcfour and AES can be selected. | ||
250 | The patented IDEA algorithm is not supported. | ||
251 | |||
252 | <p> | ||
253 | OpenSSH provides support for both SSH1 and SSH2 protocols. | ||
254 | |||
255 | <p> | ||
256 | Since the RSA patent has expired, there are no restrictions on the use | ||
257 | of RSA algorithm using software, including OpenBSD. | ||
258 | |||
259 | <h2><a name= "1.5">1.5 - Where should I ask for help?</a></h2> | ||
260 | <p> | ||
261 | There are many places to turn to for help. In addition to the main | ||
262 | <a href="http://www.openssh.org/index.html">OpenSSH website</a>, | ||
263 | there are many mailing lists to try. Before trying any mailing lists, | ||
264 | please search through all mailing list archives to see if your question | ||
265 | has already been answered. The OpenSSH Mailing List has been archived and | ||
266 | put in searchable form and can be found at | ||
267 | <a href="http://marc.info/?l=openssh-unix-dev&r=1&w=2">marc.info</a>. | ||
268 | |||
269 | <p> | ||
270 | For more information on subscribing to OpenSSH related mailing lists, | ||
271 | please see <a href="http://www.openssh.org/list.html">OpenSSH Mailing lists</a>. | ||
272 | |||
273 | <h2><a name= "1.6">1.6 - I have found a bug. Where do I report it?</a></h2> | ||
274 | <p> | ||
275 | Information about submitting bug reports can be found at the OpenSSH | ||
276 | <a href="http://www.openssh.org/report.html">Reporting bugs</a> page. | ||
277 | <p> | ||
278 | If you wish to report a security bug, please contact the private developers | ||
279 | list <<a href="mailto:openssh@openssh.com">openssh@openssh.com</a>>. | ||
280 | |||
281 | <h2><u><a name= "2.0">2.0 - General Questions</a></u></h2> | ||
282 | |||
283 | <h2><a name= "2.1">2.1 - Why does ssh/scp make connections from low-numbered ports.</a></h2> | ||
284 | <p> | ||
285 | The OpenSSH client uses low numbered ports for rhosts and rhosts-rsa | ||
286 | authentication because the server needs to trust the username provided by | ||
287 | the client. To get around this, you can add the below example to your | ||
288 | <i>ssh_config</i> or <i>~/.ssh/config</i> file. | ||
289 | |||
290 | |||
291 | <blockquote> | ||
292 | <table border=0 width="800"> | ||
293 | <tr> | ||
294 | <td nowrap bgcolor="#EEEEEE"> | ||
295 | <b>UsePrivilegedPort no</b> | ||
296 | </td> | ||
297 | </tr> | ||
298 | </table> | ||
299 | </blockquote> | ||
300 | |||
301 | <p> | ||
302 | Or you can specify this option on the command line, using the <b>-o</b> | ||
303 | option to | ||
304 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1">ssh(1)</a> command. | ||
305 | |||
306 | <blockquote> | ||
307 | <table border=0 width="800"> | ||
308 | <tr> | ||
309 | <td nowrap bgcolor="#EEEEEE"> | ||
310 | $ <b>ssh -o "UsePrivilegedPort no" host.com</b> | ||
311 | </td> | ||
312 | </tr> | ||
313 | </table> | ||
314 | </blockquote> | ||
315 | |||
316 | <h2><a name= "2.2">2.2 - Why is the ssh client setuid root?</a></h2> | ||
317 | |||
318 | <p> | ||
319 | In conjunction with the previous question, (<a href="#2.1">2.1</a>) | ||
320 | OpenSSH needs root authority to be able to bind to low-numbered ports to | ||
321 | facilitate <i>rhosts authentication</i>. | ||
322 | A privileged port is also required for rhosts-rsa authentication to older | ||
323 | SSH releases. | ||
324 | |||
325 | <p> | ||
326 | Additionally, for both <i>rhosts-rsa authentication</i> (in protocol | ||
327 | version 1) and <i>hostbased authentication</i> (in protocol version 2) | ||
328 | the ssh client needs to access the <i>private host key</i> in order to | ||
329 | authenticate the client machine to the server. | ||
330 | OpenSSH versions prior to 3.3 required the <code>ssh</code> binary to be | ||
331 | setuid root to enable this, and you may safely remove it if you don't | ||
332 | want to use these authentication methods. | ||
333 | |||
334 | <p> | ||
335 | Starting in OpenSSH 3.3, <code>ssh</code> is not setuid by default. <a | ||
336 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keysign">ssh-keysign</a>, | ||
337 | is used for access to the private hosts keys, and ssh does not use privileged | ||
338 | source ports by default. If you wish to use a privileged source port, you must | ||
339 | manually set the setuid bit on <code>ssh</code>. | ||
340 | |||
341 | <h2><a name= "2.3">2.3 - Why does SSH 2.3 have problems interoperating with OpenSSH 2.1.1?</a></h2> | ||
342 | |||
343 | <p> | ||
344 | SSH 2.3 and earlier versions contain a flaw in their HMAC implementation. | ||
345 | Their code was not supplying the full data block output from the digest, | ||
346 | and instead always provided 128 bits. For longer digests, this caused | ||
347 | SSH 2.3 to not interoperate with OpenSSH. | ||
348 | |||
349 | <p> | ||
350 | OpenSSH 2.2.0 detects that SSH 2.3 has this flaw. Recent versions of SSH | ||
351 | will have this bug fixed. Or you can add the following to | ||
352 | SSH 2.3 <i>sshd2_config</i>. | ||
353 | |||
354 | |||
355 | <blockquote> | ||
356 | <table border=0 width="800"> | ||
357 | <tr> | ||
358 | <td nowrap bgcolor="#EEEEEE"> | ||
359 | <b>Mac hmac-md5</b> | ||
360 | </td> | ||
361 | </tr> | ||
362 | </table> | ||
363 | </blockquote> | ||
364 | |||
365 | <h2><a name= "2.4">2.4 - Why does OpenSSH print: Dispatch protocol error: type 20</a></h2> | ||
366 | |||
367 | <p> | ||
368 | Problems in interoperation have been seen because older versions of | ||
369 | OpenSSH did not support session rekeying. However the commercial SSH 2.3 | ||
370 | tries to negotiate this feature, and you might experience connection | ||
371 | freezes or see the error message "<b>Dispatch protocol error: | ||
372 | type 20 </b>". | ||
373 | To solve this problem, either upgrade to a recent OpenSSH release or | ||
374 | disable rekeying by adding the following to your commercial SSH 2.3's | ||
375 | <i>ssh2_config</i> or <i>sshd2_config</i>. | ||
376 | |||
377 | |||
378 | <blockquote> | ||
379 | <table border=0 width="800"> | ||
380 | <tr> | ||
381 | <td nowrap bgcolor="#EEEEEE"> | ||
382 | <b>RekeyIntervalSeconds 0</b> | ||
383 | </td> | ||
384 | </tr> | ||
385 | </table> | ||
386 | </blockquote> | ||
387 | |||
388 | <h2><a name= "2.5">2.5 - Old versions of commercial SSH encrypt host keys with IDEA.</a></h2> | ||
389 | |||
390 | <p> | ||
391 | The old versions of SSH used a patented algorithm to encrypt their | ||
392 | <i>/etc/ssh/ssh_host_key</i>. This problem will manifest as | ||
393 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8">sshd(8)</a> | ||
394 | not being able to read its host key. To solve this, use the command below | ||
395 | to convert your ssh_host_key to use 3DES. | ||
396 | <b>NOTE:</b> Use the | ||
397 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&sektion=1">ssh-keygen(1)</a> | ||
398 | program from the Commercial SSH product, *NOT* OpenSSH for the example | ||
399 | below. | ||
400 | |||
401 | |||
402 | <blockquote> | ||
403 | <table border=0 width="800"> | ||
404 | <tr> | ||
405 | <td nowrap bgcolor="#EEEEEE"> | ||
406 | # <b>ssh-keygen -u -f /etc/ssh/ssh_host_key</b> | ||
407 | </td> | ||
408 | </tr> | ||
409 | </table> | ||
410 | </blockquote> | ||
411 | |||
412 | <h2><a name= "2.6">2.6 - What are these warning messages about key lengths</a></h2> | ||
413 | |||
414 | <p> | ||
415 | Commercial SSH's | ||
416 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&sektion=1">ssh-keygen(1)</a> | ||
417 | program contained a bug which caused it to occasionally generate Pubkey | ||
418 | Authentication (RSA or DSA) keys which had their Most Significant Bit | ||
419 | (MSB) unset. Such keys were advertised as being full-length, but are | ||
420 | actually, half the time, smaller than advertised. | ||
421 | |||
422 | <p> | ||
423 | OpenSSH will print warning messages when it encounters such keys. To rid | ||
424 | yourself of these message, edit your <i>known_hosts</i> files and replace the | ||
425 | incorrect key length (usually "1024") with the correct key length | ||
426 | (usually "1023"). | ||
427 | |||
428 | <h2><a name= "2.7">2.7 - X11 and/or agent forwarding does not work.</a></h2> | ||
429 | |||
430 | <p> | ||
431 | Check your <i>ssh_config</i> and <i>sshd_config</i>. The default | ||
432 | configuration files disable authentication agent and X11 forwarding. To | ||
433 | enable it, put the line below in <i>sshd_config</i>: | ||
434 | |||
435 | <blockquote> | ||
436 | <table border=0 width="800"> | ||
437 | <tr> | ||
438 | <td nowrap bgcolor="#EEEEEE"> | ||
439 | <b>X11Forwarding yes</b> | ||
440 | </td> | ||
441 | </tr> | ||
442 | </table> | ||
443 | </blockquote> | ||
444 | |||
445 | <p> | ||
446 | and put the following lines in <i>ssh_config</i>: | ||
447 | |||
448 | <blockquote> | ||
449 | <table border=0 width="800"> | ||
450 | <tr> | ||
451 | <td nowrap bgcolor="#EEEEEE"> | ||
452 | <b>ForwardAgent yes</b><br> | ||
453 | <b>ForwardX11 yes</b> | ||
454 | </td> | ||
455 | </tr> | ||
456 | </table> | ||
457 | </blockquote> | ||
458 | |||
459 | <p> | ||
460 | X11 forwarding requires a working <a | ||
461 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=xauth&sektion=1" | ||
462 | >xauth(1)</a> binary. On OpenBSD this is in the <i>xbase</i> file | ||
463 | set but will probably be different on other platforms. For OpenSSH | ||
464 | Portable, xauth must be either found at configure time or specified | ||
465 | via <b>XAuthLocation</b> in sshd_config(5) and ssh_config(5). | ||
466 | |||
467 | <p> | ||
468 | Note on agent interoperability: There are two different and | ||
469 | incompatible agent forwarding mechanisms within the SSH2 protocol. | ||
470 | OpenSSH has always used an extension of the original SSH1 agent | ||
471 | requests, however some commercial products use a different, non-free | ||
472 | agent forwarding protocol. This means that agent forwarding cannot | ||
473 | be used between OpenSSH and those products. | ||
474 | |||
475 | <p> | ||
476 | <b>NOTE:</b> For users of Linux Mandrake 7.2, Mandrake modifies the | ||
477 | <i>XAUTHORITY</i> environment variable in <i>/etc/skel/.bashrc</i>, | ||
478 | and thus any bash user's home directory. This variable is set by OpenSSH | ||
479 | and for either of the above options to work, you need to comment out | ||
480 | the line: | ||
481 | |||
482 | |||
483 | <blockquote> | ||
484 | <table border=0 width="800"> | ||
485 | <tr> | ||
486 | <td nowrap bgcolor="#EEEEEE"> | ||
487 | <b># export XAUTHORITY=$HOME/.Xauthority</b> | ||
488 | </td> | ||
489 | </tr> | ||
490 | </table> | ||
491 | </blockquote> | ||
492 | |||
493 | <h2><a name= "2.8">2.8 - After upgrading OpenSSH I lost SSH2 support.</a></h2> | ||
494 | |||
495 | <p> | ||
496 | Between versions changes can be made to <i>sshd_config</i> or | ||
497 | <i>ssh_config</i>. You should always check on these changes when upgrading | ||
498 | versions of OpenSSH. After OpenSSH Version 2.3.0 you need to add the | ||
499 | following to your <i>sshd_config</i>: | ||
500 | |||
501 | |||
502 | <blockquote> | ||
503 | <table border=0 width="800"> | ||
504 | <tr> | ||
505 | <td nowrap bgcolor="#EEEEEE"> | ||
506 | <b>HostKey /etc/ssh_host_dsa_key</b><br> | ||
507 | <b>HostKey /etc/ssh_host_rsa_key</b> | ||
508 | </td> | ||
509 | </tr> | ||
510 | </table> | ||
511 | </blockquote> | ||
512 | |||
513 | <h2><a name= "2.9">2.9 - sftp/scp fails at connection, but ssh is OK.</a></h2> | ||
514 | |||
515 | <p> | ||
516 | sftp and/or scp may fail at connection time if you have shell | ||
517 | initialization (.profile, .bashrc, .cshrc, etc) which produces output | ||
518 | for non-interactive sessions. This output confuses the sftp/scp client. | ||
519 | You can verify if your shell is doing this by executing: | ||
520 | |||
521 | <blockquote> | ||
522 | <table border=0 width="800"> | ||
523 | <tr> | ||
524 | <td nowrap bgcolor="#EEEEEE"> | ||
525 | <b>ssh yourhost /usr/bin/true</b> | ||
526 | </td> | ||
527 | </tr> | ||
528 | </table> | ||
529 | </blockquote> | ||
530 | |||
531 | <p> | ||
532 | If the above command produces any output, then you need to modify your | ||
533 | shell initialization. | ||
534 | |||
535 | <h2><a name= "2.10">2.10 - Will you add [foo] to scp?</a></h2> | ||
536 | |||
537 | <p> | ||
538 | Short Answer: no. | ||
539 | |||
540 | <p> | ||
541 | Long Answer: scp is not standardized. The closest thing it has to a | ||
542 | specification is "what rcp does". Since the same command is used on both ends | ||
543 | of the connection, adding features or options risks breaking interoperability with other | ||
544 | implementations. | ||
545 | |||
546 | <p> | ||
547 | New features are more likely in sftp, since the protocol is standardized | ||
548 | (well, a <a href="http://www.ietf.org/html.charters/OLD/secsh-charter.html"> | ||
549 | draft standard</a>), extensible, and the client and server are decoupled. | ||
550 | |||
551 | <h2><a name= "2.11">2.11 - How do I use port forwarding?</a></h2> | ||
552 | |||
553 | <p> | ||
554 | If the remote server is running sshd(8), it may be possible to | ||
555 | ``tunnel'' certain services via ssh. This may be desirable, for | ||
556 | example, to encrypt POP or SMTP connections, even though the software | ||
557 | does not directly support encrypted communications. Tunnelling uses | ||
558 | port forwarding to create a connection between the client and server. | ||
559 | The client software must be able to specify a non-standard port to | ||
560 | connect to for this to work. | ||
561 | |||
562 | <p> | ||
563 | The idea is that the user connects to the remote host using ssh, | ||
564 | and specifies which port on the client's machine should be used to | ||
565 | forward connections to the remote server. After that it is possible | ||
566 | to start the service which is to be encrypted (e.g. fetchmail, irc) | ||
567 | on the client machine, specifying the same local port passed to | ||
568 | ssh, and the connection will be tunnelled through ssh. By default, | ||
569 | the system running the forward will only accept connections from | ||
570 | itself. | ||
571 | |||
572 | <p> | ||
573 | The options most relevant to tunnelling are the -L and -R options, | ||
574 | which allow the user to forward connections, the -D option, which | ||
575 | permits dynamic port forwarding, the -g option, which permits other | ||
576 | hosts to use port forwards, and the -f option, which instructs ssh | ||
577 | to put itself in the background after authentication. See the <a | ||
578 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1" | ||
579 | >ssh(1)</a> man page for further details. | ||
580 | |||
581 | <p> | ||
582 | This is an example of tunnelling an IRC session from client machine | ||
583 | ``127.0.0.1'' (localhost) to remote server ``server.example.com'': | ||
584 | |||
585 | <blockquote> | ||
586 | <table border=0 width="800"> | ||
587 | <tr> | ||
588 | <td nowrap bgcolor="#EEEEEE"> | ||
589 | <b>ssh -f -L 1234:server.example.com:6667 server.example.com sleep 10<br> | ||
590 | irc -c '#users' -p 1234 pinky 127.0.0.1</b> | ||
591 | </td> | ||
592 | </tr> | ||
593 | </table> | ||
594 | </blockquote> | ||
595 | |||
596 | <p> | ||
597 | This tunnels a connection to IRC server server.example.com, joining | ||
598 | channel ``#users'', using the nickname ``pinky''. The local port used | ||
599 | in this example is 1234. It does not matter which port is used, as | ||
600 | long as it's greater than 1023 (remember, only root can open sockets on | ||
601 | privileged ports) and doesn't conflict with any ports already in use. | ||
602 | The connection is forwarded to port 6667 on the remote server, since | ||
603 | that's the standard port for IRC services. | ||
604 | |||
605 | <p> | ||
606 | The remote command ``sleep 10'' was specified to allow an amount | ||
607 | of time (10 seconds, in the example) to start the service which is to | ||
608 | be tunnelled. If no connections are made within the time specified, | ||
609 | ssh will exit. If more time is required, the sleep(1) value can be | ||
610 | increased appropriately or, alternatively, the example above could | ||
611 | be added as a function to the user's shell. See ksh(1) and csh(1) | ||
612 | for more details about user-defined functions. | ||
613 | |||
614 | <p> | ||
615 | ssh also has an -N option, convenient for use with port forwarding: | ||
616 | if -N is specified, it is not necessary to specify a remote command | ||
617 | (``sleep 10'' in the example above). However, use of this option | ||
618 | causes ssh to wait around for ever (as opposed to exiting after a | ||
619 | remote command has completed), and the user must take care to manually | ||
620 | kill(1) the process afterwards. | ||
621 | |||
622 | <h2><a name= "2.12">2.12 - My ssh connection freezes or drops out after N minutes of inactivity.</a></h2> | ||
623 | |||
624 | <p> | ||
625 | This is usually the result of a packet filter or NAT device | ||
626 | timing out your TCP connection due to inactivity. You can enable | ||
627 | <b>ClientAliveInterval</b> in the server's <i><a | ||
628 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config&sektion=5"> | ||
629 | sshd_config</a></i>, or enable <b>ServerAliveInterval</b> in the | ||
630 | client's <i><a | ||
631 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5"> | ||
632 | ssh_config</a></i> (the latter is available in OpenSSH 3.8 and newer). | ||
633 | |||
634 | <p> | ||
635 | Enabling either option and setting the interval for less than the time | ||
636 | it takes to time out your session will ensure that the connection is | ||
637 | kept "fresh" in the device's connection table. | ||
638 | |||
639 | <h2><a name= "2.13">2.13 - How do I use scp to copy a file with a colon in it?</a></h2> | ||
640 | |||
641 | <b><a | ||
642 | href="http://www.openbsd.org/cgi-bin/man.cgi?query=scp&sektion=1"> | ||
643 | scp</a></b> will interpret the component before the colon to be a remote | ||
644 | server name and attempt to connect to it. To prevent this, refer to | ||
645 | the file by a relative or absolute path, eg: | ||
646 | |||
647 | <blockquote> | ||
648 | <table border=0 width="800"> | ||
649 | <tr> | ||
650 | <td nowrap bgcolor="#EEEEEE"> | ||
651 | $ scp ./source:file sshserver: | ||
652 | </td> | ||
653 | </tr> | ||
654 | </table> | ||
655 | </blockquote> | ||
656 | |||
657 | <h2><a name= "2.14">2.14 - Why does OpenSSH report its version to clients?</a></h2> | ||
658 | |||
659 | <p> | ||
660 | OpenSSH, like most SSH implementations, reports its name and version to clients | ||
661 | when they connect, e.g. | ||
662 | </p> | ||
663 | |||
664 | <blockquote> | ||
665 | SSH-2.0-OpenSSH_3.9 | ||
666 | </blockquote> | ||
667 | |||
668 | <p> | ||
669 | This information is used by clients and servers to enable protocol | ||
670 | compatibility tweaks to work around changed, buggy or missing features in | ||
671 | the implementation they are talking to. This protocol feature checking is | ||
672 | still required at present because versions with incompatibilities are still | ||
673 | in wide use. | ||
674 | </p> | ||
675 | |||
676 | <h2><u><a name= "3.0">3.0 - Portable OpenSSH Questions</a></u></h2> | ||
677 | |||
678 | <h2><a name= "3.1">3.1 - Spurious PAM authentication messages in logfiles.</a></h2> | ||
679 | |||
680 | <p> | ||
681 | The portable version of OpenSSH will generate spurious authentication | ||
682 | failures at every login, similar to: | ||
683 | |||
684 | |||
685 | <blockquote> | ||
686 | <table border=0 width="800"> | ||
687 | <tr> | ||
688 | <td nowrap bgcolor="#EEEEEE"> | ||
689 | "<b>authentication failure; (uid=0) -> root for sshd service</b>" | ||
690 | </td> | ||
691 | </tr> | ||
692 | </table> | ||
693 | </blockquote> | ||
694 | |||
695 | <p> | ||
696 | These are generated because OpenSSH first tries to determine whether a | ||
697 | user needs authentication to login (e.g. empty password). Unfortunately | ||
698 | PAM likes to log all authentication events, this one included. | ||
699 | |||
700 | <p> | ||
701 | If it annoys you too much, set "<b>PermitEmptyPasswords no</b>" | ||
702 | in <i>sshd_config</i>. This will quiet the error message at the expense | ||
703 | of disabling logins to accounts with no password set. | ||
704 | This is the default if you use the supplied <i>sshd_config</i> file. | ||
705 | |||
706 | <h2><a name= "3.2">3.2 - Empty passwords not allowed with PAM authentication.</a></h2> | ||
707 | |||
708 | <p> | ||
709 | To enable empty passwords with a version of OpenSSH built with PAM you | ||
710 | must add the flag nullok to the end of the password checking module | ||
711 | in the <i>/etc/pam.d/sshd</i> file. For example: | ||
712 | |||
713 | <blockquote> | ||
714 | <table border=0 width="800"> | ||
715 | <tr> | ||
716 | <td nowrap bgcolor="#EEEEEE"> | ||
717 | auth required/lib/security/pam_unix.so shadow nodelay nullok | ||
718 | </td> | ||
719 | </tr> | ||
720 | </table> | ||
721 | </blockquote> | ||
722 | |||
723 | <p> | ||
724 | This must be done in addition to setting "<b>PermitEmptyPasswords | ||
725 | yes</b>" in the <i>sshd_config</i> file. | ||
726 | |||
727 | <p> | ||
728 | There is one caveat when using empty passwords with PAM authentication: | ||
729 | PAM will allow any password when authenticating an account with an empty | ||
730 | password. This breaks the check that | ||
731 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8">sshd(8)</a> | ||
732 | uses to determine whether an account has no password set and grant | ||
733 | users access to the account regardless of the policy specified by | ||
734 | <b>PermitEmptyPasswords</b>. For this reason, it is recommended that you | ||
735 | do not add the <b>nullok</b> directive to your PAM configuration file | ||
736 | unless you specifically wish to allow empty passwords. | ||
737 | |||
738 | |||
739 | <h2><a name= "3.3">3.3 - ssh(1) takes a long time to connect or log | ||
740 | in</a></h2> | ||
741 | |||
742 | <p> | ||
743 | Large delays (more than 10 seconds) are typically caused by a problem with | ||
744 | name resolution: | ||
745 | <ul> | ||
746 | <li>Some versions of glibc (notably glibc 2.1 shipped with Red Hat 6.1) | ||
747 | can take a long time to resolve "IPv6 or IPv4" addresses from domain | ||
748 | names. This can be worked around with by specifying <b>AddressFamily | ||
749 | inet</b> option in <i>ssh_config</i>.</li> | ||
750 | |||
751 | <li>There may be a DNS lookup problem, either at the client or server. | ||
752 | You can use the <code>nslookup</code> command to check this on both client | ||
753 | and server by looking up the other end's name and IP address. In | ||
754 | addition, on the server look up the name returned by the client's | ||
755 | IP-name lookup. You can disable most of the server-side lookups by | ||
756 | setting <b>UseDNS no</b> in <i>sshd_config</i>.</li> | ||
757 | </ul> | ||
758 | |||
759 | <p> | ||
760 | Delays less than 10 seconds can have other causes. | ||
761 | |||
762 | <ul> | ||
763 | |||
764 | <li>OpenSSH releases prior to 3.8 had an <i>moduli</i> file with | ||
765 | moduli that were just smaller than what sshd would look for, and | ||
766 | as a result, sshd would end up using moduli significantly larger | ||
767 | than requested, which resulted in a speed penalty. Replacing the | ||
768 | <i>moduli</i> file will resolve this (note that in most cases this | ||
769 | file will not be replaced during an upgrade and must be replaced | ||
770 | manually).</li> | ||
771 | |||
772 | <li>OpenSSH releases prior to 3.8 had a flaw in <code>ssh</code> that | ||
773 | would cause it to request moduli larger than intended (which when | ||
774 | combined with the above resulted in significant slowdowns). | ||
775 | Upgrading the client to 3.8 or higher will resolve this issue.</li> | ||
776 | |||
777 | <li>If either the client or server lack a kernel-based random number | ||
778 | device (eg Solaris < 9, AIX < 5.2, HP-UX < 11.11) and no | ||
779 | substitute is available (eg <a href= | ||
780 | "ftp://ftp.ayamura.org/pub/prngd/">prngd</a>) it's possible that | ||
781 | one of the programs called by <code>ssh-rand-helper</code> to | ||
782 | generate entropy is hanging. This can be investigated by running | ||
783 | it in debug mode: | ||
784 | |||
785 | <blockquote> | ||
786 | <table border=0 width="800"> | ||
787 | <tr> | ||
788 | <td nowrap bgcolor="#EEEEEE"> | ||
789 | /usr/local/libexec/ssh-rand-helper -vvv | ||
790 | </td> | ||
791 | </tr> | ||
792 | </table> | ||
793 | </blockquote> | ||
794 | |||
795 | Any significant delays should be investigated and rectified, or the | ||
796 | corresponding commands should be removed from <i>ssh_prng_cmds</i>. | ||
797 | </li> | ||
798 | |||
799 | </ul> | ||
800 | |||
801 | <h3>How slow is "slow"?</h3> | ||
802 | Under normal conditions, the speed of SSH logins is dependant on | ||
803 | CPU speed of client and server. For comparison the following are | ||
804 | typical connect times for <code>time ssh localhost true</code> | ||
805 | with a 1024-bit RSA key on otherwise unloaded hosts. OpenSSH and | ||
806 | OpenSSL were compiled with gcc 3.3.x. | ||
807 | |||
808 | <p> | ||
809 | <table> | ||
810 | <tr><th>CPU</th><th>Time (SSHv1)<a href="#3.3fn1">[1]</a></th> | ||
811 | <th>Time (SSHv2)</th></tr> | ||
812 | <tr><td>170MHz SPARC/sun4m</td><td>0.74 sec</td><td>1.25 sec</td></tr> | ||
813 | <tr><td>236MHz HPPA/8200<a href="#3.3fn2">[2]</a></td><td>0.44 sec</td> | ||
814 | <td>0.79 sec</td></tr> | ||
815 | <tr><td>375MHz PowerPC/604e</td><td>0.38 sec</td><td>0.51 sec</td></tr> | ||
816 | <tr><td>933MHz VIA Ezra</td><td>0.34 sec</td><td>0.44 sec</td></tr> | ||
817 | <tr><td>2.1GHz Athlon XP 2600+</td><td>0.14 sec</td><td>0.22 sec</td></tr> | ||
818 | </table> | ||
819 | |||
820 | <br> | ||
821 | |||
822 | <a name="3.3fn1">[1]</a> The SSHv1 protocol is faster but is | ||
823 | cryptographically weaker than SSHv2.<br> | ||
824 | |||
825 | <a name="3.3fn2">[2]</a> At the time of writing, gcc generates | ||
826 | relatively slow code on HPPA for RSA and Diffie-Hellman operations | ||
827 | (see <a href= "http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7625">gcc | ||
828 | bug #7625</a> and <a | ||
829 | href="http://marc.info/?l=openssh-unix-dev&m=102646106016694"> | ||
830 | discussion on openssh-unix-dev</a>). | ||
831 | |||
832 | <h2><a name= "3.4">3.4 - "Can't locate module net-pf-10" messages in log under Linux.</a></h2> | ||
833 | |||
834 | <p> | ||
835 | The Linux kernel is looking (via modprobe) for protocol family 10 (IPv6). | ||
836 | Either load the appropriate kernel module, enter the correct alias in | ||
837 | <i>/etc/modules.conf</i> or disable IPv6 in <i>/etc/modules.conf</i>. | ||
838 | |||
839 | |||
840 | <p> | ||
841 | For some silly reason <i>/etc/modules.conf</i> may also be named | ||
842 | <i>/etc/conf.modules</i>. | ||
843 | |||
844 | |||
845 | <h2><a name= "3.5">3.5 - Password authentication doesn't work (eg on Slackware 7.0 or Red Hat 6.x)</a></h2> | ||
846 | |||
847 | <p> | ||
848 | If the password is correct password the login is still denied, the | ||
849 | usual cause is that the system is configured to use MD5-type passwords | ||
850 | but the | ||
851 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=crypt&sektion=3" | ||
852 | >crypt(3)</a> function used by sshd doesn't understand them. | ||
853 | |||
854 | <p> | ||
855 | Affected accounts will have password strings in <i>/etc/passwd</i> | ||
856 | or <i>/etc/shadow</i> that start with <b>$1$</b>. | ||
857 | If password authentication fails for new accounts or accounts with | ||
858 | recently changed passwords, but works for old accounts, this is the | ||
859 | likely culprit. | ||
860 | |||
861 | <p> | ||
862 | The underlying cause is that some versions of OpenSSL have a crypt(3) | ||
863 | function that does not understand MD5 passwords, and the link order of | ||
864 | sshd means that OpenSSL's crypt(3) is used instead of the system's. | ||
865 | OpensSSH's configure attempts to correct for this but is not always | ||
866 | successful. | ||
867 | |||
868 | <p> | ||
869 | There are several possible solutions: | ||
870 | |||
871 | <ul> | ||
872 | <li> | ||
873 | <p> | ||
874 | Enable sshd's built-in support for MD5 passwords at build time. | ||
875 | |||
876 | <blockquote> | ||
877 | <table border=0 width="800"> | ||
878 | <tr> | ||
879 | <td nowrap bgcolor="#EEEEEE"> | ||
880 | ./configure --with-md5-passwords [options] | ||
881 | </td> | ||
882 | </tr> | ||
883 | </table> | ||
884 | </blockquote> | ||
885 | |||
886 | This is safe even if you have both types of encryption as sshd will | ||
887 | select the correct algorithm for each account automatically. | ||
888 | |||
889 | <li> | ||
890 | <p> | ||
891 | If your system has a separate libcrypt library (eg Slackware 7) then you | ||
892 | can manually add -lcrypt to the LIBS list so it's used instead of | ||
893 | OpenSSL's: | ||
894 | |||
895 | <blockquote> | ||
896 | <table border=0 width="800"> | ||
897 | <tr> | ||
898 | <td nowrap bgcolor="#EEEEEE"> | ||
899 | LIBS=-lcrypt ./configure [options] | ||
900 | </td> | ||
901 | </tr> | ||
902 | </table> | ||
903 | </blockquote> | ||
904 | |||
905 | <li> | ||
906 | <p> | ||
907 | If your platforms supports PAM, you may configure sshd to use it | ||
908 | (see <a href= "#3.15" >section 3.15</a>). This will mean that sshd will | ||
909 | not verify passwords itself but will defer to the configured PAM modules. | ||
910 | </ul> | ||
911 | |||
912 | <h2><a name= "3.6">3.6 - Configure or sshd(8) complain about lack of RSA or DSA support</a></h2> | ||
913 | |||
914 | <p> | ||
915 | Ensure that your OpenSSL libraries have been built to include RSA or DSA | ||
916 | support either internally or through RSAref. | ||
917 | |||
918 | |||
919 | <h2><a name= "3.7">3.7 - "scp: command not found" errors</a></h2> | ||
920 | |||
921 | <p> | ||
922 | <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=scp&sektion=1">scp(1)</a> | ||
923 | must be in the default PATH on both the client and the server. You may | ||
924 | need to use the <b>--with-default-path</b> option to specify a custom | ||
925 | path to search on the server. This option replaces the default path, | ||
926 | so you need to specify all the current directories on your path as well | ||
927 | as where you have installed scp. For example: | ||
928 | |||
929 | <blockquote> | ||
930 | <table border=0 width="800"> | ||
931 | <tr> | ||
932 | <td nowrap bgcolor="#EEEEEE"> | ||
933 | $ <b>./configure --with-default-path=/bin:/usr/bin:/usr/local/bin:/path/to/scp</b> | ||
934 | </td> | ||
935 | </tr> | ||
936 | </table> | ||
937 | </blockquote> | ||
938 | |||
939 | <p> | ||
940 | Note that configuration by the server's admin will take precedence over the | ||
941 | setting of <b>--with-default-path</b>. This includes resetting PATH in | ||
942 | <i>/etc/profile</i>, PATH in <i>/etc/environment</i> on AIX, or (for 3.7p1 and | ||
943 | above) setting PATH or SUPATH in <i>/etc/default/login</i> on Solaris or | ||
944 | Reliant Unix. | ||
945 | |||
946 | <h2><a name= "3.8">3.8 - Unable to read passphrase</a></h2> | ||
947 | |||
948 | <p> | ||
949 | Some operating systems set <i>/dev/tty</i> with incorrect modes, causing | ||
950 | the reading of passwords to fail with the following error: | ||
951 | |||
952 | <blockquote> | ||
953 | <table border=0 width="800"> | ||
954 | <tr> | ||
955 | <td nowrap bgcolor="#EEEEEE"> | ||
956 | You have no controlling tty. Cannot read passphrase. | ||
957 | </td> | ||
958 | </tr> | ||
959 | </table> | ||
960 | </blockquote> | ||
961 | |||
962 | <p> | ||
963 | The solution to this is to reset the permissions on <i>/dev/tty</i> | ||
964 | to mode 0666 and report the error as a bug to your OS vendor. | ||
965 | |||
966 | |||
967 | <h2><a name= "3.9">3.9 - 'configure' missing or make fails</a></h2> | ||
968 | |||
969 | <p> | ||
970 | If there is no 'configure' file in the tar.gz file that you downloaded | ||
971 | or make fails with "missing separator" errors, you have probably | ||
972 | downloaded the OpenBSD distribution of OpenSSH and are attempting to | ||
973 | compile it on another platform. Please refer to the information on the | ||
974 | <a href="http://www.openssh.org/portable.html">portable version</a>. | ||
975 | |||
976 | |||
977 | <h2><a name= "3.10">3.10 - Hangs when exiting ssh</a></h2> | ||
978 | |||
979 | <p> | ||
980 | OpenSSH may hang when exiting. This can occur when there is an active | ||
981 | background process. This is known to occur on Linux and HP-UX. | ||
982 | The problem can be verified by doing the following: | ||
983 | |||
984 | <blockquote> | ||
985 | <table border=0 width="800"> | ||
986 | <tr> | ||
987 | <td nowrap bgcolor="#EEEEEE"> | ||
988 | $ <b>sleep 20 & exit</b> | ||
989 | </td> | ||
990 | </tr> | ||
991 | </table> | ||
992 | </blockquote> | ||
993 | |||
994 | Try to use this instead: | ||
995 | <blockquote> | ||
996 | <table border=0 width="800"> | ||
997 | <tr> | ||
998 | <td nowrap bgcolor="#EEEEEE"> | ||
999 | $ <b>sleep 20 < /dev/null > /dev/null 2>&1 &</b> | ||
1000 | </td> | ||
1001 | </tr> | ||
1002 | </table> | ||
1003 | </blockquote> | ||
1004 | |||
1005 | <p> | ||
1006 | A work around for bash users is to place <b>"shopt -s huponexit"</b> | ||
1007 | in either /etc/bashrc or ~/.bashrc. Otherwise, consult your shell's | ||
1008 | man page for an option to enable it to send a HUP signal to active | ||
1009 | jobs when exiting. See <a | ||
1010 | href="http://bugzilla.mindrot.org/show_bug.cgi?id=52">bug #52</a> | ||
1011 | for other workarounds. | ||
1012 | |||
1013 | <h2><a name= "3.11">3.11 - Why does ssh hang on exit?</a></h2> | ||
1014 | |||
1015 | <p> | ||
1016 | When executing | ||
1017 | <blockquote> | ||
1018 | <table border=0 width="800"> | ||
1019 | <tr> | ||
1020 | <td nowrap bgcolor="#EEEEEE"> | ||
1021 | $ <b>ssh host command</b> | ||
1022 | </td> | ||
1023 | </tr> | ||
1024 | </table> | ||
1025 | </blockquote> | ||
1026 | ssh <b>needs</b> to hang, because it needs to wait: | ||
1027 | <ul> | ||
1028 | <li> | ||
1029 | until it can be sure that <code>command</code> does not need | ||
1030 | more input. | ||
1031 | <li> | ||
1032 | until it can be sure that <code>command</code> does not produce | ||
1033 | more output. | ||
1034 | <li> | ||
1035 | until <code>command</code> exits because sshd needs to tell | ||
1036 | the exit status from <code>command</code> to ssh. | ||
1037 | </ul> | ||
1038 | <p> | ||
1039 | |||
1040 | <h2><a name= "3.12">3.12 - I upgraded to OpenSSH 3.1 and X11 | ||
1041 | forwarding stopped working.</a></h2> | ||
1042 | |||
1043 | Starting with OpenSSH 3.1, the sshd x11 forwarding server listens on | ||
1044 | localhost by default; see the sshd <b>X11UseLocalhost</b> option to | ||
1045 | revert to prior behaviour if your older X11 clients do not function | ||
1046 | with this configuration.<p> | ||
1047 | |||
1048 | In general, X11 clients using X11 R6 should work with the default | ||
1049 | setting. Some vendors, including HP, ship X11 clients with R6 | ||
1050 | and R5 libs, so some clients will work, and others will not work. | ||
1051 | This is true for HP-UX 11.X.<p> | ||
1052 | |||
1053 | <h2><a name= "3.13">3.13 - I upgraded to OpenSSH 3.8 and some | ||
1054 | X11 programs stopped working.</a></h2> | ||
1055 | |||
1056 | <p> | ||
1057 | As documented in the <a href="http://www.openssh.org/txt/release-3.8">3.8 release notes</a>, | ||
1058 | <code>ssh</code> will now use untrusted X11 cookies by | ||
1059 | default. The previous behaviour can be restored by setting | ||
1060 | <b>ForwardX11Trusted yes</b> in <i>ssh_config</i>. | ||
1061 | |||
1062 | <p> | ||
1063 | Possible symptoms include:<br> | ||
1064 | <code>BadWindow (invalid Window parameter)<br> | ||
1065 | BadAccess (attempt to access private resource denied)<br> | ||
1066 | X Error of failed request: BadAtom (invalid Atom parameter)<br> | ||
1067 | Major opcode of failed request: 20 (X_GetProperty)<br></code> | ||
1068 | |||
1069 | <h2><a name= "3.14">3.14 - I copied my public key to authorized_keys | ||
1070 | but public-key authentication still doesn't work.</a></h2> | ||
1071 | |||
1072 | <p> | ||
1073 | Typically this is caused by the file permissions on $HOME, $HOME/.ssh or | ||
1074 | $HOME/.ssh/authorized_keys being more permissive than sshd allows by default. | ||
1075 | |||
1076 | <p> | ||
1077 | In this case, it can be solved by executing the following on the server. | ||
1078 | <blockquote> | ||
1079 | <table border=0 width="800"> | ||
1080 | <tr> | ||
1081 | <td nowrap bgcolor="#EEEEEE"> | ||
1082 | $ <b>chmod go-w $HOME $HOME/.ssh</b><br> | ||
1083 | $ <b>chmod 600 $HOME/.ssh/authorized_keys</b><br> | ||
1084 | $ <b>chown `whoami` $HOME/.ssh/authorized_keys</b><br> | ||
1085 | </td> | ||
1086 | </tr> | ||
1087 | </table> | ||
1088 | </blockquote> | ||
1089 | |||
1090 | <p> | ||
1091 | If this is not possible for some reason, an alternative is to set | ||
1092 | <b>StrictModes no</b> in <i>sshd_config</i>, however this is not | ||
1093 | recommended. | ||
1094 | |||
1095 | <h2><a name= "3.15">3.15 - OpenSSH versions and PAM behaviour.</a></h2> | ||
1096 | |||
1097 | Portable OpenSSH has a configure-time option to enable sshd's use of the | ||
1098 | <a href="http://www.opengroup.org/onlinepubs/008329799/">PAM</a> | ||
1099 | (Pluggable Authentication Modules) interface. | ||
1100 | |||
1101 | <blockquote> | ||
1102 | <table border=0 width="800"> | ||
1103 | <tr> | ||
1104 | <td nowrap bgcolor="#EEEEEE"> | ||
1105 | ./configure --with-pam [options] | ||
1106 | </td> | ||
1107 | </tr> | ||
1108 | </table> | ||
1109 | </blockquote> | ||
1110 | |||
1111 | To use PAM at all, this option must be provided at build time. | ||
1112 | The run-time behaviour when PAM is built in varies with the version of | ||
1113 | Portable OpenSSH, and on later versions it must also be enabled by setting | ||
1114 | <b>UsePAM</b> to <b>yes</b> in <i>sshd_config</i>. | ||
1115 | |||
1116 | <p> | ||
1117 | The behaviour of the relevant authentications options when PAM support is built | ||
1118 | in is summarised by the following table. | ||
1119 | |||
1120 | <p> | ||
1121 | <table border="1"> | ||
1122 | <tr> <th>Version</th> <th>UsePAM</th> <th>PasswordAuthentication</th> <th>ChallengeResponseAuthentication</th> </tr> | ||
1123 | <tr> | ||
1124 | <td><=3.6.1p2</td> | ||
1125 | <td>Not applicable</td> | ||
1126 | <td>Uses PAM</td> | ||
1127 | <td>Uses PAM if <b>PAMAuthenticationViaKbdInt</b> is enabled</td> | ||
1128 | </tr> | ||
1129 | <tr> | ||
1130 | <td>3.7p1 - 3.7.1p1</td> | ||
1131 | <td>Defaults to <b>yes</b></td> | ||
1132 | <td>Does not use PAM</td> | ||
1133 | <td>Uses PAM if <b>UsePAM</b> is enabled</td> | ||
1134 | </tr> | ||
1135 | <tr> | ||
1136 | <td>3.7.1p2 - 3.8.1p1</td> | ||
1137 | <td>Defaults to <b>no</b></td> | ||
1138 | <td>Does not use PAM <a href="#3.15fn1">[1]</a></td> | ||
1139 | <td>Uses PAM if <b>UsePAM</b> is enabled</td> | ||
1140 | </tr> | ||
1141 | <tr> | ||
1142 | <td>3.9p1</td> | ||
1143 | <td>Defaults to <b>no</b></td> | ||
1144 | <td>Uses PAM if <b>UsePAM</b> is enabled</td> | ||
1145 | <td>Uses PAM if <b>UsePAM</b> is enabled</td> | ||
1146 | </tr> | ||
1147 | </table> | ||
1148 | <p> | ||
1149 | |||
1150 | <a name= "3.15fn1">[1]</a> Some vendors, notably Redhat/Fedora, have | ||
1151 | backported the PasswordAuthentication from 3.9p1 to their 3.8x based | ||
1152 | packages. If you're using a vendor-supplied package then consult their | ||
1153 | documentation. | ||
1154 | |||
1155 | <p> | ||
1156 | OpenSSH Portable's PAM interface still has problems with a few modules, | ||
1157 | however we hope that this number will reduce in the future. As at the | ||
1158 | 3.9p1 release, the known problems are: | ||
1159 | |||
1160 | <ul> | ||
1161 | <li>Modules relying on module-private data (eg pam_dhkeys, pam_krb5, AFS) | ||
1162 | may fail to correctly establish credentials (bug <a | ||
1163 | href="http://bugzilla.mindrot.org/show_bug.cgi?id=688">#688</a>) when | ||
1164 | authenticating via <b>ChallengeResponseAuthentication</b>. | ||
1165 | <b>PasswordAuthentication</b> with 3.9p1 and above should work. | ||
1166 | </ul> | ||
1167 | |||
1168 | You can also check <a | ||
1169 | href="http://bugzilla.mindrot.org/buglist.cgi?product=Portable+OpenSSH&bug_status=RESOLVED&bug_status=NEW&bug_status=ACCEPTED&component=PAM+support" | ||
1170 | >bugzilla for current PAM issues</a>. | ||
1171 | |||
1172 | <h2><a name= "3.16">3.16 - Why doesn't "w" or "who" on AIX 5.x show users | ||
1173 | logged in via ssh?</a></h2> | ||
1174 | |||
1175 | Between AIX 4.3.3 and AIX 5.x, the format of the wtmp struct changed. This | ||
1176 | means that sshd binaries built on AIX 4.x will not correctly write wtmp | ||
1177 | entries when run on AIX 5.x. This can be fixed by simply recompiling | ||
1178 | sshd on an AIX 5.x system and using that. | ||
1179 | |||
1180 | <hr> | ||
1181 | <a href="http://www.openssh.org/index.html"><img height=24 width=24 src="back.gif" border=0 alt=OpenSSH></a> | ||
1182 | <a href="mailto:www@openbsd.org">www@openbsd.org</a> | ||
1183 | <br> | ||
1184 | <small>$OpenBSD: faq.html,v 1.113 2012/04/21 12:12:22 dtucker Exp $</small> | ||
1185 | |||
1186 | </body> | ||
1187 | </html> | ||
diff --git a/debian/gnome-ssh-askpass.1 b/debian/gnome-ssh-askpass.1 new file mode 100644 index 000000000..b74c410a8 --- /dev/null +++ b/debian/gnome-ssh-askpass.1 | |||
@@ -0,0 +1,51 @@ | |||
1 | .TH GNOME-SSH-ASKPASS 1 | ||
2 | .SH NAME | ||
3 | gnome\-ssh\-askpass \- prompts a user for a passphrase using GNOME | ||
4 | .SH SYNOPSIS | ||
5 | .B gnome\-ssh\-askpass | ||
6 | .SH DESCRIPTION | ||
7 | .B gnome\-ssh\-askpass | ||
8 | is a GNOME-based passphrase dialog for use with OpenSSH. | ||
9 | It is intended to be called by the | ||
10 | .BR ssh\-add (1) | ||
11 | program and not invoked directly. | ||
12 | It allows | ||
13 | .BR ssh\-add (1) | ||
14 | to obtain a passphrase from a user, even if not connected to a terminal | ||
15 | (assuming that an X display is available). | ||
16 | This happens automatically in the case where | ||
17 | .B ssh\-add | ||
18 | is invoked from one's | ||
19 | .B ~/.xsession | ||
20 | or as one of the GNOME startup programs, for example. | ||
21 | .PP | ||
22 | In order to be called automatically by | ||
23 | .BR ssh\-add , | ||
24 | .B gnome\-ssh\-askpass | ||
25 | should be installed as | ||
26 | .IR /usr/bin/ssh\-askpass . | ||
27 | .SH "ENVIRONMENT VARIABLES" | ||
28 | The following environment variables are recognized: | ||
29 | .TP | ||
30 | .I GNOME_SSH_ASKPASS_GRAB_SERVER | ||
31 | Causes | ||
32 | .B gnome\-ssh\-askpass | ||
33 | to grab the X server before asking for a passphrase. | ||
34 | .TP | ||
35 | .I GNOME_SSH_ASKPASS_GRAB_POINTER | ||
36 | Causes | ||
37 | .B gnome\-ssh\-askpass | ||
38 | to grab the mouse pointer using | ||
39 | .IR gdk_pointer_grab () | ||
40 | before asking for a passphrase. | ||
41 | .PP | ||
42 | Regardless of whether either of these environment variables is set, | ||
43 | .B gnome\-ssh\-askpass | ||
44 | will grab the keyboard using | ||
45 | .IR gdk_keyboard_grab (). | ||
46 | .SH AUTHOR | ||
47 | This manual page was written by Colin Watson <cjwatson@debian.org> | ||
48 | for the Debian system (but may be used by others). | ||
49 | It was based on that for | ||
50 | .B x11\-ssh\-askpass | ||
51 | by Philip Hands. | ||
diff --git a/debian/openssh-client-udeb.dirs b/debian/openssh-client-udeb.dirs new file mode 100644 index 000000000..e77248175 --- /dev/null +++ b/debian/openssh-client-udeb.dirs | |||
@@ -0,0 +1 @@ | |||
usr/bin | |||
diff --git a/debian/openssh-client-udeb.install b/debian/openssh-client-udeb.install new file mode 100644 index 000000000..b3891f02d --- /dev/null +++ b/debian/openssh-client-udeb.install | |||
@@ -0,0 +1,3 @@ | |||
1 | scp usr/bin | ||
2 | sftp usr/bin | ||
3 | ssh usr/bin | ||
diff --git a/debian/openssh-client.apport b/debian/openssh-client.apport new file mode 100644 index 000000000..3dbc8e5e6 --- /dev/null +++ b/debian/openssh-client.apport | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | '''apport hook for openssh-client | ||
4 | |||
5 | (c) 2010 Canonical Ltd. | ||
6 | Author: Chuck Short <chuck.short@canonical.com> | ||
7 | |||
8 | This program is free software; you can redistribute it and/or modify it | ||
9 | under the terms of the GNU General Public License as published by the | ||
10 | Free Software Foundation; either version 2 of the License, or (at your | ||
11 | option) any later version. See http://www.gnu.org/copyleft/gpl.html for | ||
12 | the full text of the license. | ||
13 | ''' | ||
14 | |||
15 | from apport.hookutils import * | ||
16 | |||
17 | def add_info(report, ui): | ||
18 | response = ui.yesno("The contents of your /etc/ssh/ssh_config file " | ||
19 | "may help developers diagnose your bug more " | ||
20 | "quickly. However, it may contain sensitive " | ||
21 | "information. Do you want to include it in your " | ||
22 | "bug report?") | ||
23 | |||
24 | if response == None: # user cancelled | ||
25 | raise StopIteration | ||
26 | |||
27 | elif response == True: | ||
28 | attach_conffiles(report, 'openssh-client') | ||
29 | |||
30 | attach_related_packages(report, | ||
31 | ['ssh-askpass', 'libpam-ssh', 'keychain', 'ssh-askpass-gnome']) | ||
32 | report['SSHClientVersion'] = command_output(['/usr/bin/ssh', '-V']) | ||
diff --git a/debian/openssh-client.dirs b/debian/openssh-client.dirs new file mode 100644 index 000000000..44f9ef061 --- /dev/null +++ b/debian/openssh-client.dirs | |||
@@ -0,0 +1,2 @@ | |||
1 | usr/share/apport/package-hooks | ||
2 | usr/share/lintian/overrides | ||
diff --git a/debian/openssh-client.docs b/debian/openssh-client.docs new file mode 100644 index 000000000..00fd691c4 --- /dev/null +++ b/debian/openssh-client.docs | |||
@@ -0,0 +1,7 @@ | |||
1 | ChangeLog.gssapi | ||
2 | OVERVIEW | ||
3 | README | ||
4 | README.dns | ||
5 | README.tun | ||
6 | debian/faq.html | ||
7 | debian/README.compromised-keys | ||
diff --git a/debian/openssh-client.install b/debian/openssh-client.install new file mode 100644 index 000000000..fd9e8feab --- /dev/null +++ b/debian/openssh-client.install | |||
@@ -0,0 +1,29 @@ | |||
1 | etc/ssh/moduli | ||
2 | etc/ssh/ssh_config | ||
3 | usr/bin/scp | ||
4 | usr/bin/sftp | ||
5 | usr/bin/slogin | ||
6 | usr/bin/ssh | ||
7 | usr/bin/ssh-add | ||
8 | usr/bin/ssh-agent | ||
9 | usr/bin/ssh-keygen | ||
10 | usr/bin/ssh-keyscan | ||
11 | usr/bin/ssh-vulnkey | ||
12 | usr/lib/openssh/ssh-keysign | ||
13 | usr/lib/openssh/ssh-pkcs11-helper | ||
14 | usr/share/man/man1/scp.1 | ||
15 | usr/share/man/man1/sftp.1 | ||
16 | usr/share/man/man1/slogin.1 | ||
17 | usr/share/man/man1/ssh-add.1 | ||
18 | usr/share/man/man1/ssh-agent.1 | ||
19 | usr/share/man/man1/ssh-keygen.1 | ||
20 | usr/share/man/man1/ssh-keyscan.1 | ||
21 | usr/share/man/man1/ssh-vulnkey.1 | ||
22 | usr/share/man/man1/ssh.1 | ||
23 | usr/share/man/man5/moduli.5 | ||
24 | usr/share/man/man5/ssh_config.5 | ||
25 | usr/share/man/man8/ssh-keysign.8 | ||
26 | usr/share/man/man8/ssh-pkcs11-helper.8 | ||
27 | |||
28 | contrib/ssh-copy-id usr/bin | ||
29 | debian/ssh-argv0 usr/bin | ||
diff --git a/debian/openssh-client.lintian-overrides b/debian/openssh-client.lintian-overrides new file mode 100644 index 000000000..486567744 --- /dev/null +++ b/debian/openssh-client.lintian-overrides | |||
@@ -0,0 +1 @@ | |||
openssh-client: setuid-binary usr/lib/openssh/ssh-keysign 4755 root/root | |||
diff --git a/debian/openssh-client.manpages b/debian/openssh-client.manpages new file mode 100644 index 000000000..690bd8a22 --- /dev/null +++ b/debian/openssh-client.manpages | |||
@@ -0,0 +1,2 @@ | |||
1 | contrib/ssh-copy-id.1 | ||
2 | debian/ssh-argv0.1 | ||
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst new file mode 100644 index 000000000..978b04a9b --- /dev/null +++ b/debian/openssh-client.postinst | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | action="$1" | ||
5 | oldversion="$2" | ||
6 | |||
7 | umask 022 | ||
8 | |||
9 | |||
10 | create_alternatives() { | ||
11 | # Create alternatives for the various r* tools. | ||
12 | # Make sure we don't change existing alternatives that a user might have | ||
13 | # changed, but clean up after some old alternatives that mistakenly pointed | ||
14 | # rlogin and rcp to ssh. | ||
15 | update-alternatives --quiet --remove rlogin /usr/bin/ssh | ||
16 | update-alternatives --quiet --remove rcp /usr/bin/ssh | ||
17 | for cmd in rsh rlogin rcp; do | ||
18 | scmd="s${cmd#r}" | ||
19 | if ! update-alternatives --display "$cmd" 2>/dev/null | \ | ||
20 | grep -q "$scmd"; then | ||
21 | update-alternatives --quiet --install "/usr/bin/$cmd" "$cmd" "/usr/bin/$scmd" 20 \ | ||
22 | --slave "/usr/share/man/man1/$cmd.1.gz" "$cmd.1.gz" "/usr/share/man/man1/$scmd.1.gz" | ||
23 | fi | ||
24 | done | ||
25 | } | ||
26 | |||
27 | set_ssh_agent_permissions() { | ||
28 | if ! getent group ssh >/dev/null; then | ||
29 | addgroup --system --quiet ssh | ||
30 | fi | ||
31 | if ! [ -x /usr/sbin/dpkg-statoverride ] || \ | ||
32 | ! dpkg-statoverride --list /usr/bin/ssh-agent >/dev/null ; then | ||
33 | chgrp ssh /usr/bin/ssh-agent | ||
34 | chmod 2755 /usr/bin/ssh-agent | ||
35 | fi | ||
36 | } | ||
37 | |||
38 | |||
39 | if [ "$action" = configure ]; then | ||
40 | create_alternatives | ||
41 | set_ssh_agent_permissions | ||
42 | fi | ||
43 | |||
44 | #DEBHELPER# | ||
45 | |||
46 | exit 0 | ||
diff --git a/debian/openssh-client.postrm b/debian/openssh-client.postrm new file mode 100644 index 000000000..a3b610ed1 --- /dev/null +++ b/debian/openssh-client.postrm | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | #DEBHELPER# | ||
5 | |||
6 | case $1 in | ||
7 | purge) | ||
8 | # Remove all non-conffiles that ssh might create, so that we | ||
9 | # can smoothly remove /etc/ssh if and only if the user | ||
10 | # hasn't dropped some other files in there. Conffiles have | ||
11 | # already been removed at this point. | ||
12 | rm -f /etc/ssh/moduli /etc/ssh/primes | ||
13 | rm -f /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 | ||
14 | rmdir --ignore-fail-on-non-empty /etc/ssh | ||
15 | |||
16 | if which delgroup; then | ||
17 | delgroup --quiet ssh > /dev/null || true | ||
18 | fi | ||
19 | ;; | ||
20 | esac | ||
21 | |||
22 | exit 0 | ||
diff --git a/debian/openssh-client.prerm b/debian/openssh-client.prerm new file mode 100644 index 000000000..2d631cb9c --- /dev/null +++ b/debian/openssh-client.prerm | |||
@@ -0,0 +1,39 @@ | |||
1 | #! /bin/sh | ||
2 | # prerm script for ssh | ||
3 | # | ||
4 | # see: dh_installdeb(1) | ||
5 | |||
6 | set -e | ||
7 | |||
8 | # summary of how this script can be called: | ||
9 | # * <prerm> `remove' | ||
10 | # * <old-prerm> `upgrade' <new-version> | ||
11 | # * <new-prerm> `failed-upgrade' <old-version> | ||
12 | # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> | ||
13 | # * <deconfigured's-prerm> `deconfigure' `in-favour' | ||
14 | # <package-being-installed> <version> `removing' | ||
15 | # <conflicting-package> <version> | ||
16 | # for details, see /usr/share/doc/packaging-manual/ | ||
17 | |||
18 | case "$1" in | ||
19 | remove|deconfigure) | ||
20 | update-alternatives --quiet --remove rsh /usr/bin/ssh | ||
21 | update-alternatives --quiet --remove rlogin /usr/bin/slogin | ||
22 | update-alternatives --quiet --remove rcp /usr/bin/scp | ||
23 | ;; | ||
24 | upgrade) | ||
25 | ;; | ||
26 | failed-upgrade) | ||
27 | ;; | ||
28 | *) | ||
29 | echo "prerm called with unknown argument \`$1'" >&2 | ||
30 | exit 0 | ||
31 | ;; | ||
32 | esac | ||
33 | |||
34 | # dh_installdeb will replace this with shell code automatically | ||
35 | # generated by other debhelper scripts. | ||
36 | |||
37 | #DEBHELPER# | ||
38 | |||
39 | exit 0 | ||
diff --git a/debian/openssh-server-udeb.dirs b/debian/openssh-server-udeb.dirs new file mode 100644 index 000000000..f2b0bd9da --- /dev/null +++ b/debian/openssh-server-udeb.dirs | |||
@@ -0,0 +1,3 @@ | |||
1 | usr/bin | ||
2 | usr/sbin | ||
3 | var/run/sshd | ||
diff --git a/debian/openssh-server-udeb.install b/debian/openssh-server-udeb.install new file mode 100644 index 000000000..05ccbf7af --- /dev/null +++ b/debian/openssh-server-udeb.install | |||
@@ -0,0 +1,2 @@ | |||
1 | sshd usr/sbin | ||
2 | ssh-keygen usr/bin | ||
diff --git a/debian/openssh-server.apport b/debian/openssh-server.apport new file mode 100644 index 000000000..3644bd855 --- /dev/null +++ b/debian/openssh-server.apport | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | '''apport hook for openssh-server | ||
4 | |||
5 | (c) 2010 Canonical Ltd. | ||
6 | Author: Chuck Short <chuck.short@canonical.com> | ||
7 | |||
8 | This program is free software; you can redistribute it and/or modify it | ||
9 | under the terms of the GNU General Public License as published by the | ||
10 | Free Software Foundation; either version 2 of the License, or (at your | ||
11 | option) any later version. See http://www.gnu.org/copyleft/gpl.html for | ||
12 | the full text of the license. | ||
13 | ''' | ||
14 | |||
15 | from apport.hookutils import * | ||
16 | |||
17 | def add_info(report, ui): | ||
18 | response = ui.yesno("The contents of your /etc/ssh/sshd_config file " | ||
19 | "may help developers diagnose your bug more " | ||
20 | "quickly. However, it may contain sensitive " | ||
21 | "information. Do you want to include it in your " | ||
22 | "bug report?") | ||
23 | |||
24 | if response == None: # user cancelled | ||
25 | raise StopIteration | ||
26 | |||
27 | elif response == True: | ||
28 | report['SSHDConfig'] = root_command_output(['/usr/sbin/sshd', '-T']) | ||
diff --git a/debian/openssh-server.dirs b/debian/openssh-server.dirs new file mode 100644 index 000000000..0ed9bea44 --- /dev/null +++ b/debian/openssh-server.dirs | |||
@@ -0,0 +1,10 @@ | |||
1 | etc/init.d | ||
2 | etc/default | ||
3 | etc/network/if-up.d | ||
4 | etc/ufw/applications.d | ||
5 | usr/lib/openssh | ||
6 | usr/sbin | ||
7 | usr/share/apport/package-hooks | ||
8 | usr/share/lintian/overrides | ||
9 | usr/share/man/man5 | ||
10 | usr/share/man/man8 | ||
diff --git a/debian/openssh-server.examples b/debian/openssh-server.examples new file mode 100644 index 000000000..0d0e55a7a --- /dev/null +++ b/debian/openssh-server.examples | |||
@@ -0,0 +1 @@ | |||
sshd_config | |||
diff --git a/debian/openssh-server.if-up b/debian/openssh-server.if-up new file mode 100644 index 000000000..de92866e6 --- /dev/null +++ b/debian/openssh-server.if-up | |||
@@ -0,0 +1,37 @@ | |||
1 | #! /bin/sh | ||
2 | # Reload the OpenSSH server when an interface comes up, to allow it to start | ||
3 | # listening on new addresses. | ||
4 | |||
5 | set -e | ||
6 | |||
7 | # Don't bother to restart sshd when lo is configured. | ||
8 | if [ "$IFACE" = lo ]; then | ||
9 | exit 0 | ||
10 | fi | ||
11 | |||
12 | # Only run from ifup. | ||
13 | if [ "$MODE" != start ]; then | ||
14 | exit 0 | ||
15 | fi | ||
16 | |||
17 | # OpenSSH only cares about inet and inet6. Get ye gone, strange people | ||
18 | # still using ipx. | ||
19 | if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then | ||
20 | exit 0 | ||
21 | fi | ||
22 | |||
23 | # Is /usr mounted? | ||
24 | if [ ! -e /usr/sbin/sshd ]; then | ||
25 | exit 0 | ||
26 | fi | ||
27 | |||
28 | if [ ! -f /var/run/sshd.pid ] || \ | ||
29 | [ "$(ps -p "$(cat /var/run/sshd.pid)" -o comm=)" != sshd ]; then | ||
30 | exit 0 | ||
31 | fi | ||
32 | |||
33 | # We'd like to use 'reload' here, but it has some problems; see | ||
34 | # #502444. | ||
35 | invoke-rc.d ssh restart >/dev/null 2>&1 || true | ||
36 | |||
37 | exit 0 | ||
diff --git a/debian/openssh-server.install b/debian/openssh-server.install new file mode 100644 index 000000000..8e04c4170 --- /dev/null +++ b/debian/openssh-server.install | |||
@@ -0,0 +1,6 @@ | |||
1 | usr/lib/openssh/sftp-server | ||
2 | usr/sbin/sshd | ||
3 | usr/share/man/man5/authorized_keys.5 | ||
4 | usr/share/man/man5/sshd_config.5 | ||
5 | usr/share/man/man8/sftp-server.8 | ||
6 | usr/share/man/man8/sshd.8 | ||
diff --git a/debian/openssh-server.links b/debian/openssh-server.links new file mode 100644 index 000000000..2d98b1dcb --- /dev/null +++ b/debian/openssh-server.links | |||
@@ -0,0 +1 @@ | |||
usr/lib/openssh/sftp-server usr/lib/sftp-server | |||
diff --git a/debian/openssh-server.lintian-overrides b/debian/openssh-server.lintian-overrides new file mode 100644 index 000000000..17d912cb0 --- /dev/null +++ b/debian/openssh-server.lintian-overrides | |||
@@ -0,0 +1 @@ | |||
openssh-server: package-contains-empty-directory usr/share/doc/openssh-client/ | |||
diff --git a/debian/openssh-server.maintscript b/debian/openssh-server.maintscript new file mode 100644 index 000000000..f9e3c4d53 --- /dev/null +++ b/debian/openssh-server.maintscript | |||
@@ -0,0 +1 @@ | |||
mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~ | |||
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst new file mode 100644 index 000000000..24d9a2c93 --- /dev/null +++ b/debian/openssh-server.postinst | |||
@@ -0,0 +1,294 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | action="$1" | ||
5 | oldversion="$2" | ||
6 | |||
7 | umask 022 | ||
8 | |||
9 | |||
10 | get_config_option() { | ||
11 | option="$1" | ||
12 | |||
13 | [ -f /etc/ssh/sshd_config ] || return | ||
14 | |||
15 | # TODO: actually only one '=' allowed after option | ||
16 | perl -lne 's/\s+/ /g; print if s/^\s*'"$option"'[[:space:]=]+//i' \ | ||
17 | /etc/ssh/sshd_config | ||
18 | } | ||
19 | |||
20 | |||
21 | set_config_option() { | ||
22 | option="$1" | ||
23 | value="$2" | ||
24 | |||
25 | perl -le ' | ||
26 | $option = $ARGV[0]; $value = $ARGV[1]; $done = 0; | ||
27 | while (<STDIN>) { | ||
28 | chomp; | ||
29 | (my $match = $_) =~ s/\s+/ /g; | ||
30 | if ($match =~ s/^\s*\Q$option\E\s+.*/$option $value/) { | ||
31 | $_ = $match; | ||
32 | $done = 1; | ||
33 | } | ||
34 | print; | ||
35 | } | ||
36 | print "$option $value" unless $done;' \ | ||
37 | "$option" "$value" \ | ||
38 | < /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new | ||
39 | chown --reference /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-new | ||
40 | chmod --reference /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-new | ||
41 | mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config | ||
42 | } | ||
43 | |||
44 | |||
45 | rename_config_option() { | ||
46 | oldoption="$1" | ||
47 | newoption="$2" | ||
48 | |||
49 | value="$(get_config_option "$oldoption")" | ||
50 | [ "$value" ] || return 0 | ||
51 | |||
52 | perl -le ' | ||
53 | $oldoption = $ARGV[0]; $newoption = $ARGV[1]; | ||
54 | while (<STDIN>) { | ||
55 | chomp; | ||
56 | (my $match = $_) =~ s/\s+/ /g; | ||
57 | # TODO: actually only one "=" allowed after option | ||
58 | if ($match =~ s/^(\s*)\Q$oldoption\E([[:space:]=]+)/$1$newoption$2/i) { | ||
59 | $_ = $match; | ||
60 | } | ||
61 | print; | ||
62 | }' \ | ||
63 | "$oldoption" "$newoption" \ | ||
64 | < /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new | ||
65 | chown --reference /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-new | ||
66 | chmod --reference /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-new | ||
67 | mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config | ||
68 | } | ||
69 | |||
70 | |||
71 | host_keys_required() { | ||
72 | hostkeys="$(get_config_option HostKey)" | ||
73 | if [ "$hostkeys" ]; then | ||
74 | echo "$hostkeys" | ||
75 | else | ||
76 | # No HostKey directives at all, so the server picks some | ||
77 | # defaults depending on the setting of Protocol. | ||
78 | protocol="$(get_config_option Protocol)" | ||
79 | [ "$protocol" ] || protocol=1,2 | ||
80 | if echo "$protocol" | grep 1 >/dev/null; then | ||
81 | echo /etc/ssh/ssh_host_key | ||
82 | fi | ||
83 | if echo "$protocol" | grep 2 >/dev/null; then | ||
84 | echo /etc/ssh/ssh_host_rsa_key | ||
85 | echo /etc/ssh/ssh_host_dsa_key | ||
86 | echo /etc/ssh/ssh_host_ecdsa_key | ||
87 | fi | ||
88 | fi | ||
89 | } | ||
90 | |||
91 | |||
92 | create_key() { | ||
93 | msg="$1" | ||
94 | shift | ||
95 | hostkeys="$1" | ||
96 | shift | ||
97 | file="$1" | ||
98 | shift | ||
99 | |||
100 | if echo "$hostkeys" | grep -x "$file" >/dev/null && \ | ||
101 | [ ! -f "$file" ] ; then | ||
102 | echo -n $msg | ||
103 | ssh-keygen -q -f "$file" -N '' "$@" | ||
104 | echo | ||
105 | if which restorecon >/dev/null 2>&1; then | ||
106 | restorecon "$file" "$file.pub" | ||
107 | fi | ||
108 | fi | ||
109 | } | ||
110 | |||
111 | |||
112 | create_keys() { | ||
113 | hostkeys="$(host_keys_required)" | ||
114 | |||
115 | create_key "Creating SSH1 key; this may take some time ..." \ | ||
116 | "$hostkeys" /etc/ssh/ssh_host_key -t rsa1 | ||
117 | |||
118 | create_key "Creating SSH2 RSA key; this may take some time ..." \ | ||
119 | "$hostkeys" /etc/ssh/ssh_host_rsa_key -t rsa | ||
120 | create_key "Creating SSH2 DSA key; this may take some time ..." \ | ||
121 | "$hostkeys" /etc/ssh/ssh_host_dsa_key -t dsa | ||
122 | create_key "Creating SSH2 ECDSA key; this may take some time ..." \ | ||
123 | "$hostkeys" /etc/ssh/ssh_host_ecdsa_key -t ecdsa | ||
124 | } | ||
125 | |||
126 | |||
127 | fix_loglevel_silent() { | ||
128 | if [ "$(get_config_option LogLevel)" = SILENT ]; then | ||
129 | set_config_option LogLevel QUIET | ||
130 | fi | ||
131 | } | ||
132 | |||
133 | |||
134 | create_sshdconfig() { | ||
135 | if [ -e /etc/ssh/sshd_config ] ; then | ||
136 | # Upgrade an existing sshd configuration. | ||
137 | |||
138 | # This option was renamed in 3.8p1, but we never took care | ||
139 | # of adjusting the configuration file until now. | ||
140 | if dpkg --compare-versions "$oldversion" lt 1:4.7p1-8; then | ||
141 | rename_config_option KeepAlive TCPKeepAlive | ||
142 | fi | ||
143 | |||
144 | # 'LogLevel SILENT' is now equivalent to QUIET. | ||
145 | if dpkg --compare-versions "$oldversion" lt 1:5.4p1-1; then | ||
146 | fix_loglevel_silent | ||
147 | fi | ||
148 | |||
149 | return 0 | ||
150 | fi | ||
151 | |||
152 | cat <<EOF > /etc/ssh/sshd_config | ||
153 | # Package generated configuration file | ||
154 | # See the sshd_config(5) manpage for details | ||
155 | |||
156 | # What ports, IPs and protocols we listen for | ||
157 | Port 22 | ||
158 | # Use these options to restrict which interfaces/protocols sshd will bind to | ||
159 | #ListenAddress :: | ||
160 | #ListenAddress 0.0.0.0 | ||
161 | Protocol 2 | ||
162 | # HostKeys for protocol version 2 | ||
163 | HostKey /etc/ssh/ssh_host_rsa_key | ||
164 | HostKey /etc/ssh/ssh_host_dsa_key | ||
165 | HostKey /etc/ssh/ssh_host_ecdsa_key | ||
166 | #Privilege Separation is turned on for security | ||
167 | UsePrivilegeSeparation yes | ||
168 | |||
169 | # Lifetime and size of ephemeral version 1 server key | ||
170 | KeyRegenerationInterval 3600 | ||
171 | ServerKeyBits 768 | ||
172 | |||
173 | # Logging | ||
174 | SyslogFacility AUTH | ||
175 | LogLevel INFO | ||
176 | |||
177 | # Authentication: | ||
178 | LoginGraceTime 120 | ||
179 | PermitRootLogin yes | ||
180 | StrictModes yes | ||
181 | |||
182 | RSAAuthentication yes | ||
183 | PubkeyAuthentication yes | ||
184 | #AuthorizedKeysFile %h/.ssh/authorized_keys | ||
185 | |||
186 | # Don't read the user's ~/.rhosts and ~/.shosts files | ||
187 | IgnoreRhosts yes | ||
188 | # For this to work you will also need host keys in /etc/ssh_known_hosts | ||
189 | RhostsRSAAuthentication no | ||
190 | # similar for protocol version 2 | ||
191 | HostbasedAuthentication no | ||
192 | # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication | ||
193 | #IgnoreUserKnownHosts yes | ||
194 | |||
195 | # To enable empty passwords, change to yes (NOT RECOMMENDED) | ||
196 | PermitEmptyPasswords no | ||
197 | |||
198 | # Change to yes to enable challenge-response passwords (beware issues with | ||
199 | # some PAM modules and threads) | ||
200 | ChallengeResponseAuthentication no | ||
201 | |||
202 | # Change to no to disable tunnelled clear text passwords | ||
203 | #PasswordAuthentication yes | ||
204 | |||
205 | # Kerberos options | ||
206 | #KerberosAuthentication no | ||
207 | #KerberosGetAFSToken no | ||
208 | #KerberosOrLocalPasswd yes | ||
209 | #KerberosTicketCleanup yes | ||
210 | |||
211 | # GSSAPI options | ||
212 | #GSSAPIAuthentication no | ||
213 | #GSSAPICleanupCredentials yes | ||
214 | |||
215 | X11Forwarding yes | ||
216 | X11DisplayOffset 10 | ||
217 | PrintMotd no | ||
218 | PrintLastLog yes | ||
219 | TCPKeepAlive yes | ||
220 | #UseLogin no | ||
221 | |||
222 | #MaxStartups 10:30:60 | ||
223 | #Banner /etc/issue.net | ||
224 | |||
225 | # Allow client to pass locale environment variables | ||
226 | AcceptEnv LANG LC_* | ||
227 | |||
228 | Subsystem sftp /usr/lib/openssh/sftp-server | ||
229 | |||
230 | # Set this to 'yes' to enable PAM authentication, account processing, | ||
231 | # and session processing. If this is enabled, PAM authentication will | ||
232 | # be allowed through the ChallengeResponseAuthentication and | ||
233 | # PasswordAuthentication. Depending on your PAM configuration, | ||
234 | # PAM authentication via ChallengeResponseAuthentication may bypass | ||
235 | # the setting of "PermitRootLogin without-password". | ||
236 | # If you just want the PAM account and session checks to run without | ||
237 | # PAM authentication, then enable this but set PasswordAuthentication | ||
238 | # and ChallengeResponseAuthentication to 'no'. | ||
239 | UsePAM yes | ||
240 | EOF | ||
241 | } | ||
242 | |||
243 | fix_statoverride() { | ||
244 | # Remove an erronous override for sshd (we should have overridden ssh) | ||
245 | if [ -x /usr/sbin/dpkg-statoverride ]; then | ||
246 | if dpkg-statoverride --list /usr/sbin/sshd >/dev/null ; then | ||
247 | dpkg-statoverride --remove /usr/sbin/sshd | ||
248 | fi | ||
249 | fi | ||
250 | } | ||
251 | |||
252 | setup_sshd_user() { | ||
253 | if ! getent passwd sshd >/dev/null; then | ||
254 | adduser --quiet --system --no-create-home --home /var/run/sshd --shell /usr/sbin/nologin sshd | ||
255 | fi | ||
256 | } | ||
257 | |||
258 | remove_old_init_links() { | ||
259 | # Yes, this only works with the SysV init script layout. I know. | ||
260 | # The important thing is that it doesn't actually *break* with | ||
261 | # file-rc ... | ||
262 | if [ -e /etc/rc2.d/S20ssh ]; then | ||
263 | update-rc.d -f ssh remove >/dev/null 2>&1 | ||
264 | fi | ||
265 | rm -f /etc/rc0.d/K??ssh /etc/rc1.d/K??ssh /etc/rc6.d/K??ssh | ||
266 | } | ||
267 | |||
268 | if [ "$action" = configure ]; then | ||
269 | create_sshdconfig | ||
270 | create_keys | ||
271 | fix_statoverride | ||
272 | setup_sshd_user | ||
273 | if dpkg --compare-versions "$2" lt 1:5.2p1-1; then | ||
274 | remove_old_init_links | ||
275 | fi | ||
276 | # Renamed to /etc/ssh/moduli in 2.9.9 (!) | ||
277 | if dpkg --compare-versions "$2" lt 1:4.7p1-1; then | ||
278 | rm -f /etc/ssh/primes | ||
279 | fi | ||
280 | if dpkg --compare-versions "$2" lt 1:5.5p1-6; then | ||
281 | rm -f /var/run/sshd/.placeholder | ||
282 | fi | ||
283 | if dpkg --compare-versions "$2" lt 1:6.2p2-3 && \ | ||
284 | which initctl >/dev/null && initctl version | grep -q upstart && \ | ||
285 | ! status ssh 2>/dev/null | grep -q ' start/'; then | ||
286 | # We must stop the sysvinit-controlled sshd before we can | ||
287 | # restart it under Upstart. | ||
288 | start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid || true | ||
289 | fi | ||
290 | fi | ||
291 | |||
292 | #DEBHELPER# | ||
293 | |||
294 | exit 0 | ||
diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm new file mode 100644 index 000000000..33191522b --- /dev/null +++ b/debian/openssh-server.postrm | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | #DEBHELPER# | ||
5 | |||
6 | case $1 in | ||
7 | purge) | ||
8 | # Remove all non-conffiles that ssh might create, so that we | ||
9 | # can smoothly remove /etc/ssh if and only if the user | ||
10 | # hasn't dropped some other files in there. Conffiles have | ||
11 | # already been removed at this point. | ||
12 | rm -f /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub | ||
13 | rm -f /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub | ||
14 | rm -f /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub | ||
15 | rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key.pub | ||
16 | rm -f /etc/ssh/sshd_config | ||
17 | rm -f /etc/ssh/sshd_not_to_be_run | ||
18 | rmdir --ignore-fail-on-non-empty /etc/ssh | ||
19 | |||
20 | if which deluser >/dev/null 2>&1; then | ||
21 | deluser --quiet sshd > /dev/null || true | ||
22 | fi | ||
23 | ;; | ||
24 | esac | ||
25 | |||
26 | exit 0 | ||
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst new file mode 100644 index 000000000..9fb5d350e --- /dev/null +++ b/debian/openssh-server.preinst | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | action=$1 | ||
5 | version=$2 | ||
6 | |||
7 | if [ "$action" = upgrade ] || [ "$action" = install ] | ||
8 | then | ||
9 | if dpkg --compare-versions "$version" lt 1:5.5p1-6 && \ | ||
10 | [ -d /var/run/sshd ]; then | ||
11 | # make sure /var/run/sshd is not removed on upgrades | ||
12 | touch /var/run/sshd/.placeholder | ||
13 | fi | ||
14 | fi | ||
15 | |||
16 | #DEBHELPER# | ||
17 | |||
18 | exit 0 | ||
diff --git a/debian/openssh-server.ssh.default b/debian/openssh-server.ssh.default new file mode 100644 index 000000000..304042224 --- /dev/null +++ b/debian/openssh-server.ssh.default | |||
@@ -0,0 +1,5 @@ | |||
1 | # Default settings for openssh-server. This file is sourced by /bin/sh from | ||
2 | # /etc/init.d/ssh. | ||
3 | |||
4 | # Options to pass to sshd | ||
5 | SSHD_OPTS= | ||
diff --git a/debian/openssh-server.ssh.init b/debian/openssh-server.ssh.init new file mode 100644 index 000000000..bda7a92b8 --- /dev/null +++ b/debian/openssh-server.ssh.init | |||
@@ -0,0 +1,174 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: sshd | ||
5 | # Required-Start: $remote_fs $syslog | ||
6 | # Required-Stop: $remote_fs $syslog | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: | ||
9 | # Short-Description: OpenBSD Secure Shell server | ||
10 | ### END INIT INFO | ||
11 | |||
12 | set -e | ||
13 | |||
14 | # /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon | ||
15 | |||
16 | test -x /usr/sbin/sshd || exit 0 | ||
17 | ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 | ||
18 | |||
19 | umask 022 | ||
20 | |||
21 | if test -f /etc/default/ssh; then | ||
22 | . /etc/default/ssh | ||
23 | fi | ||
24 | |||
25 | . /lib/lsb/init-functions | ||
26 | |||
27 | if [ -n "$2" ]; then | ||
28 | SSHD_OPTS="$SSHD_OPTS $2" | ||
29 | fi | ||
30 | |||
31 | # Are we running from init? | ||
32 | run_by_init() { | ||
33 | ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ] | ||
34 | } | ||
35 | |||
36 | check_for_upstart() { | ||
37 | if init_is_upstart; then | ||
38 | exit $1 | ||
39 | fi | ||
40 | } | ||
41 | |||
42 | check_for_no_start() { | ||
43 | # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists | ||
44 | if [ -e /etc/ssh/sshd_not_to_be_run ]; then | ||
45 | if [ "$1" = log_end_msg ]; then | ||
46 | log_end_msg 0 || true | ||
47 | fi | ||
48 | if ! run_by_init; then | ||
49 | log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" || true | ||
50 | fi | ||
51 | exit 0 | ||
52 | fi | ||
53 | } | ||
54 | |||
55 | check_dev_null() { | ||
56 | if [ ! -c /dev/null ]; then | ||
57 | if [ "$1" = log_end_msg ]; then | ||
58 | log_end_msg 1 || true | ||
59 | fi | ||
60 | if ! run_by_init; then | ||
61 | log_action_msg "/dev/null is not a character device!" || true | ||
62 | fi | ||
63 | exit 1 | ||
64 | fi | ||
65 | } | ||
66 | |||
67 | check_privsep_dir() { | ||
68 | # Create the PrivSep empty dir if necessary | ||
69 | if [ ! -d /var/run/sshd ]; then | ||
70 | mkdir /var/run/sshd | ||
71 | chmod 0755 /var/run/sshd | ||
72 | fi | ||
73 | } | ||
74 | |||
75 | check_config() { | ||
76 | if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then | ||
77 | /usr/sbin/sshd $SSHD_OPTS -t || exit 1 | ||
78 | fi | ||
79 | } | ||
80 | |||
81 | export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" | ||
82 | |||
83 | case "$1" in | ||
84 | start) | ||
85 | check_for_upstart 1 | ||
86 | check_privsep_dir | ||
87 | check_for_no_start | ||
88 | check_dev_null | ||
89 | log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" || true | ||
90 | if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | ||
91 | log_end_msg 0 || true | ||
92 | else | ||
93 | log_end_msg 1 || true | ||
94 | fi | ||
95 | ;; | ||
96 | stop) | ||
97 | check_for_upstart 0 | ||
98 | log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true | ||
99 | if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then | ||
100 | log_end_msg 0 || true | ||
101 | else | ||
102 | log_end_msg 1 || true | ||
103 | fi | ||
104 | ;; | ||
105 | |||
106 | reload|force-reload) | ||
107 | check_for_upstart 1 | ||
108 | check_for_no_start | ||
109 | check_config | ||
110 | log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true | ||
111 | if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then | ||
112 | log_end_msg 0 || true | ||
113 | else | ||
114 | log_end_msg 1 || true | ||
115 | fi | ||
116 | ;; | ||
117 | |||
118 | restart) | ||
119 | check_for_upstart 1 | ||
120 | check_privsep_dir | ||
121 | check_config | ||
122 | log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true | ||
123 | start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid | ||
124 | check_for_no_start log_end_msg | ||
125 | check_dev_null log_end_msg | ||
126 | if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | ||
127 | log_end_msg 0 || true | ||
128 | else | ||
129 | log_end_msg 1 || true | ||
130 | fi | ||
131 | ;; | ||
132 | |||
133 | try-restart) | ||
134 | check_for_upstart 1 | ||
135 | check_privsep_dir | ||
136 | check_config | ||
137 | log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true | ||
138 | RET=0 | ||
139 | start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid || RET="$?" | ||
140 | case $RET in | ||
141 | 0) | ||
142 | # old daemon stopped | ||
143 | check_for_no_start log_end_msg | ||
144 | check_dev_null log_end_msg | ||
145 | if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | ||
146 | log_end_msg 0 || true | ||
147 | else | ||
148 | log_end_msg 1 || true | ||
149 | fi | ||
150 | ;; | ||
151 | 1) | ||
152 | # daemon not running | ||
153 | log_progress_msg "(not running)" || true | ||
154 | log_end_msg 0 || true | ||
155 | ;; | ||
156 | *) | ||
157 | # failed to stop | ||
158 | log_progress_msg "(failed to stop)" || true | ||
159 | log_end_msg 1 || true | ||
160 | ;; | ||
161 | esac | ||
162 | ;; | ||
163 | |||
164 | status) | ||
165 | check_for_upstart 1 | ||
166 | status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $? | ||
167 | ;; | ||
168 | |||
169 | *) | ||
170 | log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}" || true | ||
171 | exit 1 | ||
172 | esac | ||
173 | |||
174 | exit 0 | ||
diff --git a/debian/openssh-server.ssh.upstart b/debian/openssh-server.ssh.upstart new file mode 100644 index 000000000..10ab744f1 --- /dev/null +++ b/debian/openssh-server.ssh.upstart | |||
@@ -0,0 +1,30 @@ | |||
1 | # ssh - OpenBSD Secure Shell server | ||
2 | # | ||
3 | # The OpenSSH server provides secure shell access to the system. | ||
4 | |||
5 | description "OpenSSH server" | ||
6 | |||
7 | start on runlevel [2345] | ||
8 | stop on runlevel [!2345] | ||
9 | |||
10 | respawn | ||
11 | respawn limit 10 5 | ||
12 | umask 022 | ||
13 | |||
14 | env SSH_SIGSTOP=1 | ||
15 | expect stop | ||
16 | |||
17 | # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log' | ||
18 | console none | ||
19 | |||
20 | pre-start script | ||
21 | test -x /usr/sbin/sshd || { stop; exit 0; } | ||
22 | test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; } | ||
23 | test -c /dev/null || { stop; exit 0; } | ||
24 | |||
25 | mkdir -p -m0755 /var/run/sshd | ||
26 | end script | ||
27 | |||
28 | # if you used to set SSHD_OPTS in /etc/default/ssh, you can change the | ||
29 | # 'exec' line here instead | ||
30 | exec /usr/sbin/sshd -D | ||
diff --git a/debian/openssh-server.sshd.pam b/debian/openssh-server.sshd.pam new file mode 100644 index 000000000..5f7ab2f60 --- /dev/null +++ b/debian/openssh-server.sshd.pam | |||
@@ -0,0 +1,52 @@ | |||
1 | # PAM configuration for the Secure Shell service | ||
2 | |||
3 | # Standard Un*x authentication. | ||
4 | @include common-auth | ||
5 | |||
6 | # Disallow non-root logins when /etc/nologin exists. | ||
7 | account required pam_nologin.so | ||
8 | |||
9 | # Uncomment and edit /etc/security/access.conf if you need to set complex | ||
10 | # access limits that are hard to express in sshd_config. | ||
11 | # account required pam_access.so | ||
12 | |||
13 | # Standard Un*x authorization. | ||
14 | @include common-account | ||
15 | |||
16 | # SELinux needs to be the first session rule. This ensures that any | ||
17 | # lingering context has been cleared. Without this it is possible that a | ||
18 | # module could execute code in the wrong domain. | ||
19 | session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close | ||
20 | |||
21 | # Set the loginuid process attribute. | ||
22 | session required pam_loginuid.so | ||
23 | |||
24 | # Standard Un*x session setup and teardown. | ||
25 | @include common-session | ||
26 | |||
27 | # Print the message of the day upon successful login. | ||
28 | # This includes a dynamically generated part from /run/motd.dynamic | ||
29 | # and a static (admin-editable) part from /etc/motd. | ||
30 | session optional pam_motd.so motd=/run/motd.dynamic noupdate | ||
31 | session optional pam_motd.so # [1] | ||
32 | |||
33 | # Print the status of the user's mailbox upon successful login. | ||
34 | session optional pam_mail.so standard noenv # [1] | ||
35 | |||
36 | # Set up user limits from /etc/security/limits.conf. | ||
37 | session required pam_limits.so | ||
38 | |||
39 | # Read environment variables from /etc/environment and | ||
40 | # /etc/security/pam_env.conf. | ||
41 | session required pam_env.so # [1] | ||
42 | # In Debian 4.0 (etch), locale-related environment variables were moved to | ||
43 | # /etc/default/locale, so read that as well. | ||
44 | session required pam_env.so user_readenv=1 envfile=/etc/default/locale | ||
45 | |||
46 | # SELinux needs to intervene at login time to ensure that the process starts | ||
47 | # in the proper default security context. Only sessions which are intended | ||
48 | # to run in the user's context should be run after this. | ||
49 | session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open | ||
50 | |||
51 | # Standard Un*x password updating. | ||
52 | @include common-password | ||
diff --git a/debian/openssh-server.ufw.profile b/debian/openssh-server.ufw.profile new file mode 100644 index 000000000..9bbe906bc --- /dev/null +++ b/debian/openssh-server.ufw.profile | |||
@@ -0,0 +1,4 @@ | |||
1 | [OpenSSH] | ||
2 | title=Secure shell server, an rshd replacement | ||
3 | description=OpenSSH is a free implementation of the Secure Shell protocol. | ||
4 | ports=22/tcp | ||
diff --git a/debian/patches/auth-log-verbosity.patch b/debian/patches/auth-log-verbosity.patch new file mode 100644 index 000000000..a6a842ecd --- /dev/null +++ b/debian/patches/auth-log-verbosity.patch | |||
@@ -0,0 +1,122 @@ | |||
1 | Description: Quieten logs when multiple from= restrictions are used | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Bug-Debian: http://bugs.debian.org/630606 | ||
4 | Forwarded: no | ||
5 | Last-Update: 2013-09-14 | ||
6 | |||
7 | Index: b/auth-options.c | ||
8 | =================================================================== | ||
9 | --- a/auth-options.c | ||
10 | +++ b/auth-options.c | ||
11 | @@ -58,9 +58,20 @@ | ||
12 | /* "principals=" option. */ | ||
13 | char *authorized_principals = NULL; | ||
14 | |||
15 | +/* Throttle log messages. */ | ||
16 | +int logged_from_hostip = 0; | ||
17 | +int logged_cert_hostip = 0; | ||
18 | + | ||
19 | extern ServerOptions options; | ||
20 | |||
21 | void | ||
22 | +auth_start_parse_options(void) | ||
23 | +{ | ||
24 | + logged_from_hostip = 0; | ||
25 | + logged_cert_hostip = 0; | ||
26 | +} | ||
27 | + | ||
28 | +void | ||
29 | auth_clear_options(void) | ||
30 | { | ||
31 | no_agent_forwarding_flag = 0; | ||
32 | @@ -288,10 +299,13 @@ | ||
33 | /* FALLTHROUGH */ | ||
34 | case 0: | ||
35 | free(patterns); | ||
36 | - logit("Authentication tried for %.100s with " | ||
37 | - "correct key but not from a permitted " | ||
38 | - "host (host=%.200s, ip=%.200s).", | ||
39 | - pw->pw_name, remote_host, remote_ip); | ||
40 | + if (!logged_from_hostip) { | ||
41 | + logit("Authentication tried for %.100s with " | ||
42 | + "correct key but not from a permitted " | ||
43 | + "host (host=%.200s, ip=%.200s).", | ||
44 | + pw->pw_name, remote_host, remote_ip); | ||
45 | + logged_from_hostip = 1; | ||
46 | + } | ||
47 | auth_debug_add("Your host '%.200s' is not " | ||
48 | "permitted to use this key for login.", | ||
49 | remote_host); | ||
50 | @@ -513,11 +527,14 @@ | ||
51 | break; | ||
52 | case 0: | ||
53 | /* no match */ | ||
54 | - logit("Authentication tried for %.100s " | ||
55 | - "with valid certificate but not " | ||
56 | - "from a permitted host " | ||
57 | - "(ip=%.200s).", pw->pw_name, | ||
58 | - remote_ip); | ||
59 | + if (!logged_cert_hostip) { | ||
60 | + logit("Authentication tried for %.100s " | ||
61 | + "with valid certificate but not " | ||
62 | + "from a permitted host " | ||
63 | + "(ip=%.200s).", pw->pw_name, | ||
64 | + remote_ip); | ||
65 | + logged_cert_hostip = 1; | ||
66 | + } | ||
67 | auth_debug_add("Your address '%.200s' " | ||
68 | "is not permitted to use this " | ||
69 | "certificate for login.", | ||
70 | Index: b/auth-options.h | ||
71 | =================================================================== | ||
72 | --- a/auth-options.h | ||
73 | +++ b/auth-options.h | ||
74 | @@ -33,6 +33,7 @@ | ||
75 | extern int key_is_cert_authority; | ||
76 | extern char *authorized_principals; | ||
77 | |||
78 | +void auth_start_parse_options(void); | ||
79 | int auth_parse_options(struct passwd *, char *, char *, u_long); | ||
80 | void auth_clear_options(void); | ||
81 | int auth_cert_options(Key *, struct passwd *); | ||
82 | Index: b/auth-rsa.c | ||
83 | =================================================================== | ||
84 | --- a/auth-rsa.c | ||
85 | +++ b/auth-rsa.c | ||
86 | @@ -174,6 +174,8 @@ | ||
87 | if ((f = auth_openkeyfile(file, pw, options.strict_modes)) == NULL) | ||
88 | return 0; | ||
89 | |||
90 | + auth_start_parse_options(); | ||
91 | + | ||
92 | /* | ||
93 | * Go though the accepted keys, looking for the current key. If | ||
94 | * found, perform a challenge-response dialog to verify that the | ||
95 | Index: b/auth2-pubkey.c | ||
96 | =================================================================== | ||
97 | --- a/auth2-pubkey.c | ||
98 | +++ b/auth2-pubkey.c | ||
99 | @@ -257,6 +257,7 @@ | ||
100 | restore_uid(); | ||
101 | return 0; | ||
102 | } | ||
103 | + auth_start_parse_options(); | ||
104 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { | ||
105 | /* Skip leading whitespace. */ | ||
106 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | ||
107 | @@ -318,6 +319,7 @@ | ||
108 | found_key = 0; | ||
109 | |||
110 | found = NULL; | ||
111 | + auth_start_parse_options(); | ||
112 | while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { | ||
113 | char *cp, *key_options = NULL; | ||
114 | if (found != NULL) | ||
115 | @@ -453,6 +455,7 @@ | ||
116 | if (key_cert_check_authority(key, 0, 1, | ||
117 | principals_file == NULL ? pw->pw_name : NULL, &reason) != 0) | ||
118 | goto fail_reason; | ||
119 | + auth_start_parse_options(); | ||
120 | if (auth_cert_options(key, pw) != 0) | ||
121 | goto out; | ||
122 | |||
diff --git a/debian/patches/authorized-keys-man-symlink.patch b/debian/patches/authorized-keys-man-symlink.patch new file mode 100644 index 000000000..e48a3cb3e --- /dev/null +++ b/debian/patches/authorized-keys-man-symlink.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Description: Install authorized_keys(5) as a symlink to sshd(8) | ||
2 | Author: Tomas Pospisek <tpo_deb@sourcepole.ch> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1720 | ||
4 | Bug-Debian: http://bugs.debian.org/441817 | ||
5 | Last-Update: 2013-09-14 | ||
6 | |||
7 | Index: b/Makefile.in | ||
8 | =================================================================== | ||
9 | --- a/Makefile.in | ||
10 | +++ b/Makefile.in | ||
11 | @@ -289,6 +289,7 @@ | ||
12 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 | ||
13 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 | ||
14 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | ||
15 | + ln -s ../$(mansubdir)8/sshd.8 $(DESTDIR)$(mandir)/$(mansubdir)5/authorized_keys.5 | ||
16 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | ||
17 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | ||
18 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | ||
diff --git a/debian/patches/consolekit.patch b/debian/patches/consolekit.patch new file mode 100644 index 000000000..fd064a848 --- /dev/null +++ b/debian/patches/consolekit.patch | |||
@@ -0,0 +1,720 @@ | |||
1 | Description: Add support for registering ConsoleKit sessions on login | ||
2 | Author: Colin Watson <cjwatson@ubuntu.com> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1450 | ||
4 | Last-Updated: 2013-09-14 | ||
5 | |||
6 | Index: b/Makefile.in | ||
7 | =================================================================== | ||
8 | --- a/Makefile.in | ||
9 | +++ b/Makefile.in | ||
10 | @@ -96,7 +96,8 @@ | ||
11 | sftp-server.o sftp-common.o \ | ||
12 | roaming_common.o roaming_serv.o \ | ||
13 | sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ | ||
14 | - sandbox-seccomp-filter.o | ||
15 | + sandbox-seccomp-filter.o \ | ||
16 | + consolekit.o | ||
17 | |||
18 | MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out ssh-vulnkey.1.out sshd_config.5.out ssh_config.5.out | ||
19 | MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 ssh-vulnkey.1 sshd_config.5 ssh_config.5 | ||
20 | Index: b/configure.ac | ||
21 | =================================================================== | ||
22 | --- a/configure.ac | ||
23 | +++ b/configure.ac | ||
24 | @@ -3841,6 +3841,30 @@ | ||
25 | AC_SUBST([GSSLIBS]) | ||
26 | AC_SUBST([K5LIBS]) | ||
27 | |||
28 | +# Check whether user wants ConsoleKit support | ||
29 | +CONSOLEKIT_MSG="no" | ||
30 | +LIBCK_CONNECTOR="" | ||
31 | +AC_ARG_WITH(consolekit, | ||
32 | + [ --with-consolekit Enable ConsoleKit support], | ||
33 | + [ if test "x$withval" != "xno" ; then | ||
34 | + AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
35 | + if test "$PKGCONFIG" != "no"; then | ||
36 | + AC_MSG_CHECKING([for ck-connector]) | ||
37 | + if $PKGCONFIG --exists ck-connector; then | ||
38 | + CKCON_CFLAGS=`$PKGCONFIG --cflags ck-connector` | ||
39 | + CKCON_LIBS=`$PKGCONFIG --libs ck-connector` | ||
40 | + CPPFLAGS="$CPPFLAGS $CKCON_CFLAGS" | ||
41 | + SSHDLIBS="$SSHDLIBS $CKCON_LIBS" | ||
42 | + AC_MSG_RESULT([yes]) | ||
43 | + AC_DEFINE(USE_CONSOLEKIT, 1, [Define if you want ConsoleKit support.]) | ||
44 | + CONSOLEKIT_MSG="yes" | ||
45 | + else | ||
46 | + AC_MSG_RESULT([no]) | ||
47 | + fi | ||
48 | + fi | ||
49 | + fi ] | ||
50 | +) | ||
51 | + | ||
52 | # Looking for programs, paths and files | ||
53 | |||
54 | PRIVSEP_PATH=/var/empty | ||
55 | @@ -4641,6 +4665,7 @@ | ||
56 | echo " libedit support: $LIBEDIT_MSG" | ||
57 | echo " Solaris process contract support: $SPC_MSG" | ||
58 | echo " Solaris project support: $SP_MSG" | ||
59 | +echo " ConsoleKit support: $CONSOLEKIT_MSG" | ||
60 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | ||
61 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | ||
62 | echo " BSD Auth support: $BSD_AUTH_MSG" | ||
63 | Index: b/configure | ||
64 | =================================================================== | ||
65 | --- a/configure | ||
66 | +++ b/configure | ||
67 | @@ -738,6 +738,7 @@ | ||
68 | with_sandbox | ||
69 | with_selinux | ||
70 | with_kerberos5 | ||
71 | +with_consolekit | ||
72 | with_privsep_path | ||
73 | with_xauth | ||
74 | enable_strip | ||
75 | @@ -1428,6 +1429,7 @@ | ||
76 | --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter) | ||
77 | --with-selinux Enable SELinux support | ||
78 | --with-kerberos5=PATH Enable Kerberos 5 support | ||
79 | + --with-consolekit Enable ConsoleKit support | ||
80 | --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty) | ||
81 | --with-xauth=PATH Specify path to xauth program | ||
82 | --with-maildir=/path/to/mail Specify your system mail directory | ||
83 | @@ -16375,6 +16377,135 @@ | ||
84 | |||
85 | |||
86 | |||
87 | +# Check whether user wants ConsoleKit support | ||
88 | +CONSOLEKIT_MSG="no" | ||
89 | +LIBCK_CONNECTOR="" | ||
90 | + | ||
91 | +# Check whether --with-consolekit was given. | ||
92 | +if test "${with_consolekit+set}" = set; then : | ||
93 | + withval=$with_consolekit; if test "x$withval" != "xno" ; then | ||
94 | + if test -n "$ac_tool_prefix"; then | ||
95 | + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. | ||
96 | +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 | ||
97 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
98 | +$as_echo_n "checking for $ac_word... " >&6; } | ||
99 | +if ${ac_cv_path_PKGCONFIG+:} false; then : | ||
100 | + $as_echo_n "(cached) " >&6 | ||
101 | +else | ||
102 | + case $PKGCONFIG in | ||
103 | + [\\/]* | ?:[\\/]*) | ||
104 | + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. | ||
105 | + ;; | ||
106 | + *) | ||
107 | + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
108 | +for as_dir in $PATH | ||
109 | +do | ||
110 | + IFS=$as_save_IFS | ||
111 | + test -z "$as_dir" && as_dir=. | ||
112 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
113 | + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then | ||
114 | + ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" | ||
115 | + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
116 | + break 2 | ||
117 | + fi | ||
118 | +done | ||
119 | + done | ||
120 | +IFS=$as_save_IFS | ||
121 | + | ||
122 | + ;; | ||
123 | +esac | ||
124 | +fi | ||
125 | +PKGCONFIG=$ac_cv_path_PKGCONFIG | ||
126 | +if test -n "$PKGCONFIG"; then | ||
127 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 | ||
128 | +$as_echo "$PKGCONFIG" >&6; } | ||
129 | +else | ||
130 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
131 | +$as_echo "no" >&6; } | ||
132 | +fi | ||
133 | + | ||
134 | + | ||
135 | +fi | ||
136 | +if test -z "$ac_cv_path_PKGCONFIG"; then | ||
137 | + ac_pt_PKGCONFIG=$PKGCONFIG | ||
138 | + # Extract the first word of "pkg-config", so it can be a program name with args. | ||
139 | +set dummy pkg-config; ac_word=$2 | ||
140 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
141 | +$as_echo_n "checking for $ac_word... " >&6; } | ||
142 | +if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : | ||
143 | + $as_echo_n "(cached) " >&6 | ||
144 | +else | ||
145 | + case $ac_pt_PKGCONFIG in | ||
146 | + [\\/]* | ?:[\\/]*) | ||
147 | + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. | ||
148 | + ;; | ||
149 | + *) | ||
150 | + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
151 | +for as_dir in $PATH | ||
152 | +do | ||
153 | + IFS=$as_save_IFS | ||
154 | + test -z "$as_dir" && as_dir=. | ||
155 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
156 | + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then | ||
157 | + ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" | ||
158 | + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
159 | + break 2 | ||
160 | + fi | ||
161 | +done | ||
162 | + done | ||
163 | +IFS=$as_save_IFS | ||
164 | + | ||
165 | + ;; | ||
166 | +esac | ||
167 | +fi | ||
168 | +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG | ||
169 | +if test -n "$ac_pt_PKGCONFIG"; then | ||
170 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 | ||
171 | +$as_echo "$ac_pt_PKGCONFIG" >&6; } | ||
172 | +else | ||
173 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
174 | +$as_echo "no" >&6; } | ||
175 | +fi | ||
176 | + | ||
177 | + if test "x$ac_pt_PKGCONFIG" = x; then | ||
178 | + PKGCONFIG="no" | ||
179 | + else | ||
180 | + case $cross_compiling:$ac_tool_warned in | ||
181 | +yes:) | ||
182 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | ||
183 | +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | ||
184 | +ac_tool_warned=yes ;; | ||
185 | +esac | ||
186 | + PKGCONFIG=$ac_pt_PKGCONFIG | ||
187 | + fi | ||
188 | +else | ||
189 | + PKGCONFIG="$ac_cv_path_PKGCONFIG" | ||
190 | +fi | ||
191 | + | ||
192 | + if test "$PKGCONFIG" != "no"; then | ||
193 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ck-connector" >&5 | ||
194 | +$as_echo_n "checking for ck-connector... " >&6; } | ||
195 | + if $PKGCONFIG --exists ck-connector; then | ||
196 | + CKCON_CFLAGS=`$PKGCONFIG --cflags ck-connector` | ||
197 | + CKCON_LIBS=`$PKGCONFIG --libs ck-connector` | ||
198 | + CPPFLAGS="$CPPFLAGS $CKCON_CFLAGS" | ||
199 | + SSHDLIBS="$SSHDLIBS $CKCON_LIBS" | ||
200 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
201 | +$as_echo "yes" >&6; } | ||
202 | + | ||
203 | +$as_echo "#define USE_CONSOLEKIT 1" >>confdefs.h | ||
204 | + | ||
205 | + CONSOLEKIT_MSG="yes" | ||
206 | + else | ||
207 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
208 | +$as_echo "no" >&6; } | ||
209 | + fi | ||
210 | + fi | ||
211 | + fi | ||
212 | + | ||
213 | +fi | ||
214 | + | ||
215 | + | ||
216 | # Looking for programs, paths and files | ||
217 | |||
218 | PRIVSEP_PATH=/var/empty | ||
219 | @@ -18902,6 +19033,7 @@ | ||
220 | echo " libedit support: $LIBEDIT_MSG" | ||
221 | echo " Solaris process contract support: $SPC_MSG" | ||
222 | echo " Solaris project support: $SP_MSG" | ||
223 | +echo " ConsoleKit support: $CONSOLEKIT_MSG" | ||
224 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | ||
225 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | ||
226 | echo " BSD Auth support: $BSD_AUTH_MSG" | ||
227 | Index: b/consolekit.c | ||
228 | =================================================================== | ||
229 | --- /dev/null | ||
230 | +++ b/consolekit.c | ||
231 | @@ -0,0 +1,240 @@ | ||
232 | +/* | ||
233 | + * Copyright (c) 2008 Colin Watson. All rights reserved. | ||
234 | + * | ||
235 | + * Permission to use, copy, modify, and distribute this software for any | ||
236 | + * purpose with or without fee is hereby granted, provided that the above | ||
237 | + * copyright notice and this permission notice appear in all copies. | ||
238 | + * | ||
239 | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
240 | + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
241 | + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
242 | + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
243 | + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
244 | + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
245 | + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
246 | + */ | ||
247 | +/* | ||
248 | + * Loosely based on pam-ck-connector, which is: | ||
249 | + * | ||
250 | + * Copyright (c) 2007 David Zeuthen <davidz@redhat.com> | ||
251 | + * | ||
252 | + * Permission is hereby granted, free of charge, to any person | ||
253 | + * obtaining a copy of this software and associated documentation | ||
254 | + * files (the "Software"), to deal in the Software without | ||
255 | + * restriction, including without limitation the rights to use, | ||
256 | + * copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
257 | + * copies of the Software, and to permit persons to whom the | ||
258 | + * Software is furnished to do so, subject to the following | ||
259 | + * conditions: | ||
260 | + * | ||
261 | + * The above copyright notice and this permission notice shall be | ||
262 | + * included in all copies or substantial portions of the Software. | ||
263 | + * | ||
264 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
265 | + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
266 | + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
267 | + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
268 | + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
269 | + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
270 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
271 | + * OTHER DEALINGS IN THE SOFTWARE. | ||
272 | + */ | ||
273 | + | ||
274 | +#include "includes.h" | ||
275 | + | ||
276 | +#ifdef USE_CONSOLEKIT | ||
277 | + | ||
278 | +#include <ck-connector.h> | ||
279 | + | ||
280 | +#include "openbsd-compat/sys-queue.h" | ||
281 | +#include "xmalloc.h" | ||
282 | +#include "channels.h" | ||
283 | +#include "key.h" | ||
284 | +#include "hostfile.h" | ||
285 | +#include "auth.h" | ||
286 | +#include "log.h" | ||
287 | +#include "servconf.h" | ||
288 | +#include "canohost.h" | ||
289 | +#include "session.h" | ||
290 | +#include "consolekit.h" | ||
291 | + | ||
292 | +extern ServerOptions options; | ||
293 | +extern u_int utmp_len; | ||
294 | + | ||
295 | +void | ||
296 | +set_active(const char *cookie) | ||
297 | +{ | ||
298 | + DBusError err; | ||
299 | + DBusConnection *connection; | ||
300 | + DBusMessage *message = NULL, *reply = NULL; | ||
301 | + char *sid; | ||
302 | + DBusMessageIter iter, subiter; | ||
303 | + const char *interface, *property; | ||
304 | + dbus_bool_t active; | ||
305 | + | ||
306 | + dbus_error_init(&err); | ||
307 | + connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err); | ||
308 | + if (!connection) { | ||
309 | + if (dbus_error_is_set(&err)) { | ||
310 | + error("unable to open DBus connection: %s", | ||
311 | + err.message); | ||
312 | + dbus_error_free(&err); | ||
313 | + } | ||
314 | + goto out; | ||
315 | + } | ||
316 | + dbus_connection_set_exit_on_disconnect(connection, FALSE); | ||
317 | + | ||
318 | + message = dbus_message_new_method_call("org.freedesktop.ConsoleKit", | ||
319 | + "/org/freedesktop/ConsoleKit/Manager", | ||
320 | + "org.freedesktop.ConsoleKit.Manager", | ||
321 | + "GetSessionForCookie"); | ||
322 | + if (!message) | ||
323 | + goto out; | ||
324 | + if (!dbus_message_append_args(message, DBUS_TYPE_STRING, &cookie, | ||
325 | + DBUS_TYPE_INVALID)) { | ||
326 | + if (dbus_error_is_set(&err)) { | ||
327 | + error("unable to get current session: %s", | ||
328 | + err.message); | ||
329 | + dbus_error_free(&err); | ||
330 | + } | ||
331 | + goto out; | ||
332 | + } | ||
333 | + | ||
334 | + dbus_error_init(&err); | ||
335 | + reply = dbus_connection_send_with_reply_and_block(connection, message, | ||
336 | + -1, &err); | ||
337 | + if (!reply) { | ||
338 | + if (dbus_error_is_set(&err)) { | ||
339 | + error("unable to get current session: %s", | ||
340 | + err.message); | ||
341 | + dbus_error_free(&err); | ||
342 | + } | ||
343 | + goto out; | ||
344 | + } | ||
345 | + | ||
346 | + dbus_error_init(&err); | ||
347 | + if (!dbus_message_get_args(reply, &err, | ||
348 | + DBUS_TYPE_OBJECT_PATH, &sid, | ||
349 | + DBUS_TYPE_INVALID)) { | ||
350 | + if (dbus_error_is_set(&err)) { | ||
351 | + error("unable to get current session: %s", | ||
352 | + err.message); | ||
353 | + dbus_error_free(&err); | ||
354 | + } | ||
355 | + goto out; | ||
356 | + } | ||
357 | + dbus_message_unref(reply); | ||
358 | + dbus_message_unref(message); | ||
359 | + message = reply = NULL; | ||
360 | + | ||
361 | + message = dbus_message_new_method_call("org.freedesktop.ConsoleKit", | ||
362 | + sid, "org.freedesktop.DBus.Properties", "Set"); | ||
363 | + if (!message) | ||
364 | + goto out; | ||
365 | + interface = "org.freedesktop.ConsoleKit.Session"; | ||
366 | + property = "active"; | ||
367 | + if (!dbus_message_append_args(message, | ||
368 | + DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, | ||
369 | + DBUS_TYPE_INVALID)) | ||
370 | + goto out; | ||
371 | + dbus_message_iter_init_append(message, &iter); | ||
372 | + if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, | ||
373 | + DBUS_TYPE_BOOLEAN_AS_STRING, &subiter)) | ||
374 | + goto out; | ||
375 | + active = TRUE; | ||
376 | + if (!dbus_message_iter_append_basic(&subiter, DBUS_TYPE_BOOLEAN, | ||
377 | + &active)) | ||
378 | + goto out; | ||
379 | + if (!dbus_message_iter_close_container(&iter, &subiter)) | ||
380 | + goto out; | ||
381 | + | ||
382 | + dbus_error_init(&err); | ||
383 | + reply = dbus_connection_send_with_reply_and_block(connection, message, | ||
384 | + -1, &err); | ||
385 | + if (!reply) { | ||
386 | + if (dbus_error_is_set(&err)) { | ||
387 | + error("unable to make current session active: %s", | ||
388 | + err.message); | ||
389 | + dbus_error_free(&err); | ||
390 | + } | ||
391 | + goto out; | ||
392 | + } | ||
393 | + | ||
394 | +out: | ||
395 | + if (reply) | ||
396 | + dbus_message_unref(reply); | ||
397 | + if (message) | ||
398 | + dbus_message_unref(message); | ||
399 | +} | ||
400 | + | ||
401 | +/* | ||
402 | + * We pass display separately rather than using s->display because the | ||
403 | + * latter is not available in the monitor when using privsep. | ||
404 | + */ | ||
405 | + | ||
406 | +char * | ||
407 | +consolekit_register(Session *s, const char *display) | ||
408 | +{ | ||
409 | + DBusError err; | ||
410 | + const char *tty = s->tty; | ||
411 | + const char *remote_host_name; | ||
412 | + dbus_bool_t is_local = FALSE; | ||
413 | + const char *cookie = NULL; | ||
414 | + | ||
415 | + if (s->ckc) { | ||
416 | + debug("already registered with ConsoleKit"); | ||
417 | + return xstrdup(ck_connector_get_cookie(s->ckc)); | ||
418 | + } | ||
419 | + | ||
420 | + s->ckc = ck_connector_new(); | ||
421 | + if (!s->ckc) { | ||
422 | + error("ck_connector_new failed"); | ||
423 | + return NULL; | ||
424 | + } | ||
425 | + | ||
426 | + if (!tty) | ||
427 | + tty = ""; | ||
428 | + if (!display) | ||
429 | + display = ""; | ||
430 | + remote_host_name = get_remote_name_or_ip(utmp_len, options.use_dns); | ||
431 | + if (!remote_host_name) | ||
432 | + remote_host_name = ""; | ||
433 | + | ||
434 | + dbus_error_init(&err); | ||
435 | + if (!ck_connector_open_session_with_parameters(s->ckc, &err, | ||
436 | + "unix-user", &s->pw->pw_uid, | ||
437 | + "display-device", &tty, | ||
438 | + "x11-display", &display, | ||
439 | + "remote-host-name", &remote_host_name, | ||
440 | + "is-local", &is_local, | ||
441 | + NULL)) { | ||
442 | + if (dbus_error_is_set(&err)) { | ||
443 | + debug("%s", err.message); | ||
444 | + dbus_error_free(&err); | ||
445 | + } else { | ||
446 | + debug("insufficient privileges or D-Bus / ConsoleKit " | ||
447 | + "not available"); | ||
448 | + } | ||
449 | + return NULL; | ||
450 | + } | ||
451 | + | ||
452 | + debug("registered uid=%d on tty='%s' with ConsoleKit", | ||
453 | + s->pw->pw_uid, s->tty); | ||
454 | + | ||
455 | + cookie = ck_connector_get_cookie(s->ckc); | ||
456 | + set_active(cookie); | ||
457 | + return xstrdup(cookie); | ||
458 | +} | ||
459 | + | ||
460 | +void | ||
461 | +consolekit_unregister(Session *s) | ||
462 | +{ | ||
463 | + if (s->ckc) { | ||
464 | + debug("unregistering ConsoleKit session %s", | ||
465 | + ck_connector_get_cookie(s->ckc)); | ||
466 | + ck_connector_unref(s->ckc); | ||
467 | + s->ckc = NULL; | ||
468 | + } | ||
469 | +} | ||
470 | + | ||
471 | +#endif /* USE_CONSOLEKIT */ | ||
472 | Index: b/consolekit.h | ||
473 | =================================================================== | ||
474 | --- /dev/null | ||
475 | +++ b/consolekit.h | ||
476 | @@ -0,0 +1,24 @@ | ||
477 | +/* | ||
478 | + * Copyright (c) 2008 Colin Watson. All rights reserved. | ||
479 | + * | ||
480 | + * Permission to use, copy, modify, and distribute this software for any | ||
481 | + * purpose with or without fee is hereby granted, provided that the above | ||
482 | + * copyright notice and this permission notice appear in all copies. | ||
483 | + * | ||
484 | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
485 | + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
486 | + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
487 | + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
488 | + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
489 | + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
490 | + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
491 | + */ | ||
492 | + | ||
493 | +#ifdef USE_CONSOLEKIT | ||
494 | + | ||
495 | +struct Session; | ||
496 | + | ||
497 | +char * consolekit_register(struct Session *, const char *); | ||
498 | +void consolekit_unregister(struct Session *); | ||
499 | + | ||
500 | +#endif /* USE_CONSOLEKIT */ | ||
501 | Index: b/monitor.c | ||
502 | =================================================================== | ||
503 | --- a/monitor.c | ||
504 | +++ b/monitor.c | ||
505 | @@ -98,6 +98,9 @@ | ||
506 | #include "jpake.h" | ||
507 | #include "roaming.h" | ||
508 | #include "authfd.h" | ||
509 | +#ifdef USE_CONSOLEKIT | ||
510 | +#include "consolekit.h" | ||
511 | +#endif | ||
512 | |||
513 | #ifdef GSSAPI | ||
514 | static Gssctxt *gsscontext = NULL; | ||
515 | @@ -193,6 +196,10 @@ | ||
516 | |||
517 | static int monitor_read_log(struct monitor *); | ||
518 | |||
519 | +#ifdef USE_CONSOLEKIT | ||
520 | +int mm_answer_consolekit_register(int, Buffer *); | ||
521 | +#endif | ||
522 | + | ||
523 | static Authctxt *authctxt; | ||
524 | static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ | ||
525 | |||
526 | @@ -285,6 +292,9 @@ | ||
527 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, | ||
528 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, | ||
529 | #endif | ||
530 | +#ifdef USE_CONSOLEKIT | ||
531 | + {MONITOR_REQ_CONSOLEKIT_REGISTER, 0, mm_answer_consolekit_register}, | ||
532 | +#endif | ||
533 | {0, 0, NULL} | ||
534 | }; | ||
535 | |||
536 | @@ -327,6 +337,9 @@ | ||
537 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, | ||
538 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, | ||
539 | #endif | ||
540 | +#ifdef USE_CONSOLEKIT | ||
541 | + {MONITOR_REQ_CONSOLEKIT_REGISTER, 0, mm_answer_consolekit_register}, | ||
542 | +#endif | ||
543 | {0, 0, NULL} | ||
544 | }; | ||
545 | |||
546 | @@ -514,6 +527,9 @@ | ||
547 | monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); | ||
548 | monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); | ||
549 | } | ||
550 | +#ifdef USE_CONSOLEKIT | ||
551 | + monitor_permit(mon_dispatch, MONITOR_REQ_CONSOLEKIT_REGISTER, 1); | ||
552 | +#endif | ||
553 | |||
554 | for (;;) | ||
555 | monitor_read(pmonitor, mon_dispatch, NULL); | ||
556 | @@ -2492,3 +2508,30 @@ | ||
557 | } | ||
558 | |||
559 | #endif /* JPAKE */ | ||
560 | + | ||
561 | +#ifdef USE_CONSOLEKIT | ||
562 | +int | ||
563 | +mm_answer_consolekit_register(int sock, Buffer *m) | ||
564 | +{ | ||
565 | + Session *s; | ||
566 | + char *tty, *display; | ||
567 | + char *cookie = NULL; | ||
568 | + | ||
569 | + debug3("%s entering", __func__); | ||
570 | + | ||
571 | + tty = buffer_get_string(m, NULL); | ||
572 | + display = buffer_get_string(m, NULL); | ||
573 | + s = session_by_tty(tty); | ||
574 | + if (s != NULL) | ||
575 | + cookie = consolekit_register(s, display); | ||
576 | + buffer_clear(m); | ||
577 | + buffer_put_cstring(m, cookie != NULL ? cookie : ""); | ||
578 | + mm_request_send(sock, MONITOR_ANS_CONSOLEKIT_REGISTER, m); | ||
579 | + | ||
580 | + free(cookie); | ||
581 | + free(display); | ||
582 | + free(tty); | ||
583 | + | ||
584 | + return (0); | ||
585 | +} | ||
586 | +#endif /* USE_CONSOLEKIT */ | ||
587 | Index: b/monitor.h | ||
588 | =================================================================== | ||
589 | --- a/monitor.h | ||
590 | +++ b/monitor.h | ||
591 | @@ -75,6 +75,8 @@ | ||
592 | |||
593 | MONITOR_REQ_AUTHROLE = 154, | ||
594 | |||
595 | + MONITOR_REQ_CONSOLEKIT_REGISTER = 156, MONITOR_ANS_CONSOLEKIT_REGISTER = 157, | ||
596 | + | ||
597 | }; | ||
598 | |||
599 | struct mm_master; | ||
600 | Index: b/monitor_wrap.c | ||
601 | =================================================================== | ||
602 | --- a/monitor_wrap.c | ||
603 | +++ b/monitor_wrap.c | ||
604 | @@ -1516,3 +1516,34 @@ | ||
605 | return success; | ||
606 | } | ||
607 | #endif /* JPAKE */ | ||
608 | + | ||
609 | +#ifdef USE_CONSOLEKIT | ||
610 | +char * | ||
611 | +mm_consolekit_register(Session *s, const char *display) | ||
612 | +{ | ||
613 | + Buffer m; | ||
614 | + char *cookie; | ||
615 | + | ||
616 | + debug3("%s entering", __func__); | ||
617 | + | ||
618 | + if (s->ttyfd == -1) | ||
619 | + return NULL; | ||
620 | + buffer_init(&m); | ||
621 | + buffer_put_cstring(&m, s->tty); | ||
622 | + buffer_put_cstring(&m, display != NULL ? display : ""); | ||
623 | + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_CONSOLEKIT_REGISTER, &m); | ||
624 | + buffer_clear(&m); | ||
625 | + | ||
626 | + mm_request_receive_expect(pmonitor->m_recvfd, | ||
627 | + MONITOR_ANS_CONSOLEKIT_REGISTER, &m); | ||
628 | + cookie = buffer_get_string(&m, NULL); | ||
629 | + buffer_free(&m); | ||
630 | + | ||
631 | + /* treat empty cookie as missing cookie */ | ||
632 | + if (strlen(cookie) == 0) { | ||
633 | + free(cookie); | ||
634 | + cookie = NULL; | ||
635 | + } | ||
636 | + return (cookie); | ||
637 | +} | ||
638 | +#endif /* USE_CONSOLEKIT */ | ||
639 | Index: b/monitor_wrap.h | ||
640 | =================================================================== | ||
641 | --- a/monitor_wrap.h | ||
642 | +++ b/monitor_wrap.h | ||
643 | @@ -131,4 +131,8 @@ | ||
644 | void mm_zfree(struct mm_master *, void *); | ||
645 | void mm_init_compression(struct mm_master *); | ||
646 | |||
647 | +#ifdef USE_CONSOLEKIT | ||
648 | +char *mm_consolekit_register(struct Session *, const char *); | ||
649 | +#endif /* USE_CONSOLEKIT */ | ||
650 | + | ||
651 | #endif /* _MM_WRAP_H_ */ | ||
652 | Index: b/session.c | ||
653 | =================================================================== | ||
654 | --- a/session.c | ||
655 | +++ b/session.c | ||
656 | @@ -92,6 +92,7 @@ | ||
657 | #include "kex.h" | ||
658 | #include "monitor_wrap.h" | ||
659 | #include "sftp.h" | ||
660 | +#include "consolekit.h" | ||
661 | |||
662 | #if defined(KRB5) && defined(USE_AFS) | ||
663 | #include <kafs.h> | ||
664 | @@ -1132,6 +1133,9 @@ | ||
665 | #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) | ||
666 | char *path = NULL; | ||
667 | #endif | ||
668 | +#ifdef USE_CONSOLEKIT | ||
669 | + const char *ckcookie = NULL; | ||
670 | +#endif /* USE_CONSOLEKIT */ | ||
671 | |||
672 | /* Initialize the environment. */ | ||
673 | envsize = 100; | ||
674 | @@ -1276,6 +1280,11 @@ | ||
675 | child_set_env(&env, &envsize, "KRB5CCNAME", | ||
676 | s->authctxt->krb5_ccname); | ||
677 | #endif | ||
678 | +#ifdef USE_CONSOLEKIT | ||
679 | + ckcookie = PRIVSEP(consolekit_register(s, s->display)); | ||
680 | + if (ckcookie) | ||
681 | + child_set_env(&env, &envsize, "XDG_SESSION_COOKIE", ckcookie); | ||
682 | +#endif /* USE_CONSOLEKIT */ | ||
683 | #ifdef USE_PAM | ||
684 | /* | ||
685 | * Pull in any environment variables that may have | ||
686 | @@ -2320,6 +2329,10 @@ | ||
687 | |||
688 | debug("session_pty_cleanup: session %d release %s", s->self, s->tty); | ||
689 | |||
690 | +#ifdef USE_CONSOLEKIT | ||
691 | + consolekit_unregister(s); | ||
692 | +#endif /* USE_CONSOLEKIT */ | ||
693 | + | ||
694 | /* Record that the user has logged out. */ | ||
695 | if (s->pid != 0) | ||
696 | record_logout(s->pid, s->tty, s->pw->pw_name); | ||
697 | Index: b/session.h | ||
698 | =================================================================== | ||
699 | --- a/session.h | ||
700 | +++ b/session.h | ||
701 | @@ -26,6 +26,8 @@ | ||
702 | #ifndef SESSION_H | ||
703 | #define SESSION_H | ||
704 | |||
705 | +struct _CkConnector; | ||
706 | + | ||
707 | #define TTYSZ 64 | ||
708 | typedef struct Session Session; | ||
709 | struct Session { | ||
710 | @@ -60,6 +62,10 @@ | ||
711 | char *name; | ||
712 | char *val; | ||
713 | } *env; | ||
714 | + | ||
715 | +#ifdef USE_CONSOLEKIT | ||
716 | + struct _CkConnector *ckc; | ||
717 | +#endif /* USE_CONSOLEKIT */ | ||
718 | }; | ||
719 | |||
720 | void do_authenticated(Authctxt *); | ||
diff --git a/debian/patches/debian-banner.patch b/debian/patches/debian-banner.patch new file mode 100644 index 000000000..981cdd697 --- /dev/null +++ b/debian/patches/debian-banner.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | Description: Add DebianBanner server configuration option | ||
2 | Setting this to "no" causes sshd to omit the Debian revision from its | ||
3 | initial protocol handshake, for those scared by package-versioning.patch. | ||
4 | Author: Kees Cook <kees@debian.org> | ||
5 | Bug-Debian: http://bugs.debian.org/562048 | ||
6 | Forwarded: not-needed | ||
7 | Last-Update: 2013-09-14 | ||
8 | |||
9 | Index: b/servconf.c | ||
10 | =================================================================== | ||
11 | --- a/servconf.c | ||
12 | +++ b/servconf.c | ||
13 | @@ -157,6 +157,7 @@ | ||
14 | options->ip_qos_interactive = -1; | ||
15 | options->ip_qos_bulk = -1; | ||
16 | options->version_addendum = NULL; | ||
17 | + options->debian_banner = -1; | ||
18 | } | ||
19 | |||
20 | void | ||
21 | @@ -310,6 +311,8 @@ | ||
22 | options->ip_qos_bulk = IPTOS_THROUGHPUT; | ||
23 | if (options->version_addendum == NULL) | ||
24 | options->version_addendum = xstrdup(""); | ||
25 | + if (options->debian_banner == -1) | ||
26 | + options->debian_banner = 1; | ||
27 | /* Turn privilege separation on by default */ | ||
28 | if (use_privsep == -1) | ||
29 | use_privsep = PRIVSEP_NOSANDBOX; | ||
30 | @@ -360,6 +363,7 @@ | ||
31 | sKexAlgorithms, sIPQoS, sVersionAddendum, | ||
32 | sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, | ||
33 | sAuthenticationMethods, sHostKeyAgent, | ||
34 | + sDebianBanner, | ||
35 | sDeprecated, sUnsupported | ||
36 | } ServerOpCodes; | ||
37 | |||
38 | @@ -501,6 +505,7 @@ | ||
39 | { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, | ||
40 | { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, | ||
41 | { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL }, | ||
42 | + { "debianbanner", sDebianBanner, SSHCFG_GLOBAL }, | ||
43 | { NULL, sBadOption, 0 } | ||
44 | }; | ||
45 | |||
46 | @@ -1648,6 +1653,10 @@ | ||
47 | } | ||
48 | return 0; | ||
49 | |||
50 | + case sDebianBanner: | ||
51 | + intptr = &options->debian_banner; | ||
52 | + goto parse_int; | ||
53 | + | ||
54 | case sDeprecated: | ||
55 | logit("%s line %d: Deprecated option %s", | ||
56 | filename, linenum, arg); | ||
57 | Index: b/servconf.h | ||
58 | =================================================================== | ||
59 | --- a/servconf.h | ||
60 | +++ b/servconf.h | ||
61 | @@ -188,6 +188,8 @@ | ||
62 | |||
63 | u_int num_auth_methods; | ||
64 | char *auth_methods[MAX_AUTH_METHODS]; | ||
65 | + | ||
66 | + int debian_banner; | ||
67 | } ServerOptions; | ||
68 | |||
69 | /* Information about the incoming connection as used by Match */ | ||
70 | Index: b/sshd.c | ||
71 | =================================================================== | ||
72 | --- a/sshd.c | ||
73 | +++ b/sshd.c | ||
74 | @@ -440,7 +440,8 @@ | ||
75 | } | ||
76 | |||
77 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", | ||
78 | - major, minor, SSH_RELEASE, | ||
79 | + major, minor, | ||
80 | + options.debian_banner ? SSH_RELEASE : SSH_RELEASE_MINIMUM, | ||
81 | *options.version_addendum == '\0' ? "" : " ", | ||
82 | options.version_addendum, newline); | ||
83 | |||
84 | Index: b/sshd_config.5 | ||
85 | =================================================================== | ||
86 | --- a/sshd_config.5 | ||
87 | +++ b/sshd_config.5 | ||
88 | @@ -404,6 +404,11 @@ | ||
89 | .Dq no . | ||
90 | The default is | ||
91 | .Dq delayed . | ||
92 | +.It Cm DebianBanner | ||
93 | +Specifies whether the distribution-specified extra version suffix is | ||
94 | +included during initial protocol handshake. | ||
95 | +The default is | ||
96 | +.Dq yes . | ||
97 | .It Cm DenyGroups | ||
98 | This keyword can be followed by a list of group name patterns, separated | ||
99 | by spaces. | ||
diff --git a/debian/patches/debian-config.patch b/debian/patches/debian-config.patch new file mode 100644 index 000000000..d005bdc2e --- /dev/null +++ b/debian/patches/debian-config.patch | |||
@@ -0,0 +1,146 @@ | |||
1 | Description: Various Debian-specific configuration changes | ||
2 | ssh: Enable ForwardX11Trusted, returning to earlier semantics which cause | ||
3 | fewer problems with existing setups (http://bugs.debian.org/237021). | ||
4 | . | ||
5 | ssh: Set 'SendEnv LANG LC_*' by default (http://bugs.debian.org/264024). | ||
6 | . | ||
7 | ssh: Enable HashKnownHosts by default to try to limit the spread of ssh | ||
8 | worms. | ||
9 | . | ||
10 | ssh: Enable GSSAPIAuthentication and disable GSSAPIDelegateCredentials by | ||
11 | default. | ||
12 | . | ||
13 | sshd: Refer to /usr/share/doc/openssh-server/README.Debian.gz alongside | ||
14 | PermitRootLogin default. | ||
15 | . | ||
16 | Document all of this, along with several sshd defaults set in | ||
17 | debian/openssh-server.postinst. | ||
18 | Author: Colin Watson <cjwatson@debian.org> | ||
19 | Author: Russ Allbery <rra@debian.org> | ||
20 | Forwarded: not-needed | ||
21 | Last-Update: 2013-09-14 | ||
22 | |||
23 | Index: b/readconf.c | ||
24 | =================================================================== | ||
25 | --- a/readconf.c | ||
26 | +++ b/readconf.c | ||
27 | @@ -1298,7 +1298,7 @@ | ||
28 | if (options->forward_x11 == -1) | ||
29 | options->forward_x11 = 0; | ||
30 | if (options->forward_x11_trusted == -1) | ||
31 | - options->forward_x11_trusted = 0; | ||
32 | + options->forward_x11_trusted = 1; | ||
33 | if (options->forward_x11_timeout == -1) | ||
34 | options->forward_x11_timeout = 1200; | ||
35 | if (options->exit_on_forward_failure == -1) | ||
36 | Index: b/ssh_config | ||
37 | =================================================================== | ||
38 | --- a/ssh_config | ||
39 | +++ b/ssh_config | ||
40 | @@ -17,9 +17,10 @@ | ||
41 | # list of available options, their meanings and defaults, please see the | ||
42 | # ssh_config(5) man page. | ||
43 | |||
44 | -# Host * | ||
45 | +Host * | ||
46 | # ForwardAgent no | ||
47 | # ForwardX11 no | ||
48 | +# ForwardX11Trusted yes | ||
49 | # RhostsRSAAuthentication no | ||
50 | # RSAAuthentication yes | ||
51 | # PasswordAuthentication yes | ||
52 | @@ -48,3 +49,7 @@ | ||
53 | # VisualHostKey no | ||
54 | # ProxyCommand ssh -q -W %h:%p gateway.example.com | ||
55 | # RekeyLimit 1G 1h | ||
56 | + SendEnv LANG LC_* | ||
57 | + HashKnownHosts yes | ||
58 | + GSSAPIAuthentication yes | ||
59 | + GSSAPIDelegateCredentials no | ||
60 | Index: b/ssh_config.5 | ||
61 | =================================================================== | ||
62 | --- a/ssh_config.5 | ||
63 | +++ b/ssh_config.5 | ||
64 | @@ -71,6 +71,22 @@ | ||
65 | host-specific declarations should be given near the beginning of the | ||
66 | file, and general defaults at the end. | ||
67 | .Pp | ||
68 | +Note that the Debian | ||
69 | +.Ic openssh-client | ||
70 | +package sets several options as standard in | ||
71 | +.Pa /etc/ssh/ssh_config | ||
72 | +which are not the default in | ||
73 | +.Xr ssh 1 : | ||
74 | +.Pp | ||
75 | +.Bl -bullet -offset indent -compact | ||
76 | +.It | ||
77 | +.Cm SendEnv No LANG LC_* | ||
78 | +.It | ||
79 | +.Cm HashKnownHosts No yes | ||
80 | +.It | ||
81 | +.Cm GSSAPIAuthentication No yes | ||
82 | +.El | ||
83 | +.Pp | ||
84 | The configuration file has the following format: | ||
85 | .Pp | ||
86 | Empty lines and lines starting with | ||
87 | @@ -501,7 +517,8 @@ | ||
88 | Remote clients will be refused access after this time. | ||
89 | .Pp | ||
90 | The default is | ||
91 | -.Dq no . | ||
92 | +.Dq yes | ||
93 | +(Debian-specific). | ||
94 | .Pp | ||
95 | See the X11 SECURITY extension specification for full details on | ||
96 | the restrictions imposed on untrusted clients. | ||
97 | Index: b/sshd_config | ||
98 | =================================================================== | ||
99 | --- a/sshd_config | ||
100 | +++ b/sshd_config | ||
101 | @@ -40,6 +40,7 @@ | ||
102 | # Authentication: | ||
103 | |||
104 | #LoginGraceTime 2m | ||
105 | +# See /usr/share/doc/openssh-server/README.Debian.gz. | ||
106 | #PermitRootLogin yes | ||
107 | #StrictModes yes | ||
108 | #MaxAuthTries 6 | ||
109 | Index: b/sshd_config.5 | ||
110 | =================================================================== | ||
111 | --- a/sshd_config.5 | ||
112 | +++ b/sshd_config.5 | ||
113 | @@ -57,6 +57,33 @@ | ||
114 | .Pq \&" | ||
115 | in order to represent arguments containing spaces. | ||
116 | .Pp | ||
117 | +Note that the Debian | ||
118 | +.Ic openssh-server | ||
119 | +package sets several options as standard in | ||
120 | +.Pa /etc/ssh/sshd_config | ||
121 | +which are not the default in | ||
122 | +.Xr sshd 8 . | ||
123 | +The exact list depends on whether the package was installed fresh or | ||
124 | +upgraded from various possible previous versions, but includes at least the | ||
125 | +following: | ||
126 | +.Pp | ||
127 | +.Bl -bullet -offset indent -compact | ||
128 | +.It | ||
129 | +.Cm Protocol No 2 | ||
130 | +.It | ||
131 | +.Cm ChallengeResponseAuthentication No no | ||
132 | +.It | ||
133 | +.Cm X11Forwarding No yes | ||
134 | +.It | ||
135 | +.Cm PrintMotd No no | ||
136 | +.It | ||
137 | +.Cm AcceptEnv No LANG LC_* | ||
138 | +.It | ||
139 | +.Cm Subsystem No sftp /usr/lib/openssh/sftp-server | ||
140 | +.It | ||
141 | +.Cm UsePAM No yes | ||
142 | +.El | ||
143 | +.Pp | ||
144 | The possible | ||
145 | keywords and their meanings are as follows (note that | ||
146 | keywords are case-insensitive and arguments are case-sensitive): | ||
diff --git a/debian/patches/dnssec-sshfp.patch b/debian/patches/dnssec-sshfp.patch new file mode 100644 index 000000000..0615de097 --- /dev/null +++ b/debian/patches/dnssec-sshfp.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | Description: Force use of DNSSEC even if "options edns0" isn't in resolv.conf | ||
2 | This allows SSHFP DNS records to be verified if glibc 2.11 is installed. | ||
3 | Origin: vendor, https://cvs.fedoraproject.org/viewvc/F-12/openssh/openssh-5.2p1-edns.patch?revision=1.1&view=markup | ||
4 | Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572049 | ||
5 | Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572049 | ||
6 | Last-Update: 2010-04-06 | ||
7 | |||
8 | Index: b/dns.c | ||
9 | =================================================================== | ||
10 | --- a/dns.c | ||
11 | +++ b/dns.c | ||
12 | @@ -196,6 +196,7 @@ | ||
13 | { | ||
14 | u_int counter; | ||
15 | int result; | ||
16 | + unsigned int rrset_flags = 0; | ||
17 | struct rrsetinfo *fingerprints = NULL; | ||
18 | |||
19 | u_int8_t hostkey_algorithm; | ||
20 | @@ -219,8 +220,19 @@ | ||
21 | return -1; | ||
22 | } | ||
23 | |||
24 | + /* | ||
25 | + * Original getrrsetbyname function, found on OpenBSD for example, | ||
26 | + * doesn't accept any flag and prerequisite for obtaining AD bit in | ||
27 | + * DNS response is set by "options edns0" in resolv.conf. | ||
28 | + * | ||
29 | + * Our version is more clever and use RRSET_FORCE_EDNS0 flag. | ||
30 | + */ | ||
31 | +#ifndef HAVE_GETRRSETBYNAME | ||
32 | + rrset_flags |= RRSET_FORCE_EDNS0; | ||
33 | +#endif | ||
34 | result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, | ||
35 | - DNS_RDATATYPE_SSHFP, 0, &fingerprints); | ||
36 | + DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints); | ||
37 | + | ||
38 | if (result) { | ||
39 | verbose("DNS lookup error: %s", dns_result_totext(result)); | ||
40 | return -1; | ||
41 | Index: b/openbsd-compat/getrrsetbyname.c | ||
42 | =================================================================== | ||
43 | --- a/openbsd-compat/getrrsetbyname.c | ||
44 | +++ b/openbsd-compat/getrrsetbyname.c | ||
45 | @@ -209,8 +209,8 @@ | ||
46 | goto fail; | ||
47 | } | ||
48 | |||
49 | - /* don't allow flags yet, unimplemented */ | ||
50 | - if (flags) { | ||
51 | + /* Allow RRSET_FORCE_EDNS0 flag only. */ | ||
52 | + if ((flags & !RRSET_FORCE_EDNS0) != 0) { | ||
53 | result = ERRSET_INVAL; | ||
54 | goto fail; | ||
55 | } | ||
56 | @@ -226,9 +226,9 @@ | ||
57 | #endif /* DEBUG */ | ||
58 | |||
59 | #ifdef RES_USE_DNSSEC | ||
60 | - /* turn on DNSSEC if EDNS0 is configured */ | ||
61 | - if (_resp->options & RES_USE_EDNS0) | ||
62 | - _resp->options |= RES_USE_DNSSEC; | ||
63 | + /* turn on DNSSEC if required */ | ||
64 | + if (flags & RRSET_FORCE_EDNS0) | ||
65 | + _resp->options |= (RES_USE_EDNS0|RES_USE_DNSSEC); | ||
66 | #endif /* RES_USE_DNSEC */ | ||
67 | |||
68 | /* make query */ | ||
69 | Index: b/openbsd-compat/getrrsetbyname.h | ||
70 | =================================================================== | ||
71 | --- a/openbsd-compat/getrrsetbyname.h | ||
72 | +++ b/openbsd-compat/getrrsetbyname.h | ||
73 | @@ -72,6 +72,9 @@ | ||
74 | #ifndef RRSET_VALIDATED | ||
75 | # define RRSET_VALIDATED 1 | ||
76 | #endif | ||
77 | +#ifndef RRSET_FORCE_EDNS0 | ||
78 | +# define RRSET_FORCE_EDNS0 0x0001 | ||
79 | +#endif | ||
80 | |||
81 | /* | ||
82 | * Return codes for getrrsetbyname() | ||
diff --git a/debian/patches/doc-hash-tab-completion.patch b/debian/patches/doc-hash-tab-completion.patch new file mode 100644 index 000000000..4c197323c --- /dev/null +++ b/debian/patches/doc-hash-tab-completion.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Description: Document that HashKnownHosts may break tab-completion | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1727 | ||
4 | Bug-Debian: http://bugs.debian.org/430154 | ||
5 | Last-Update: 2013-09-14 | ||
6 | |||
7 | Index: b/ssh_config.5 | ||
8 | =================================================================== | ||
9 | --- a/ssh_config.5 | ||
10 | +++ b/ssh_config.5 | ||
11 | @@ -587,6 +587,9 @@ | ||
12 | will not be converted automatically, | ||
13 | but may be manually hashed using | ||
14 | .Xr ssh-keygen 1 . | ||
15 | +Use of this option may break facilities such as tab-completion that rely | ||
16 | +on being able to read unhashed host names from | ||
17 | +.Pa ~/.ssh/known_hosts . | ||
18 | .It Cm HostbasedAuthentication | ||
19 | Specifies whether to try rhosts based authentication with public key | ||
20 | authentication. | ||
diff --git a/debian/patches/doc-upstart.patch b/debian/patches/doc-upstart.patch new file mode 100644 index 000000000..a471f9c4c --- /dev/null +++ b/debian/patches/doc-upstart.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Description: Refer to ssh's Upstart job as well as its init script | ||
2 | Author: Colin Watson <cjwatson@ubuntu.com> | ||
3 | Forwarded: not-needed | ||
4 | Last-Update: 2013-09-14 | ||
5 | |||
6 | Index: b/sshd.8 | ||
7 | =================================================================== | ||
8 | --- a/sshd.8 | ||
9 | +++ b/sshd.8 | ||
10 | @@ -70,7 +70,10 @@ | ||
11 | .Nm | ||
12 | listens for connections from clients. | ||
13 | It is normally started at boot from | ||
14 | -.Pa /etc/init.d/ssh . | ||
15 | +.Pa /etc/init.d/ssh | ||
16 | +(or | ||
17 | +.Pa /etc/init/ssh.conf | ||
18 | +on systems using the Upstart init daemon). | ||
19 | It forks a new | ||
20 | daemon for each incoming connection. | ||
21 | The forked daemons handle | ||
diff --git a/debian/patches/gnome-ssh-askpass2-icon.patch b/debian/patches/gnome-ssh-askpass2-icon.patch new file mode 100644 index 000000000..96bbf3a09 --- /dev/null +++ b/debian/patches/gnome-ssh-askpass2-icon.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Description: Give the ssh-askpass-gnome window a default icon | ||
2 | Author: Vincent Untz <vuntz@ubuntu.com> | ||
3 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/27152 | ||
4 | Last-Update: 2010-02-28 | ||
5 | |||
6 | Index: b/contrib/gnome-ssh-askpass2.c | ||
7 | =================================================================== | ||
8 | --- a/contrib/gnome-ssh-askpass2.c | ||
9 | +++ b/contrib/gnome-ssh-askpass2.c | ||
10 | @@ -209,6 +209,8 @@ | ||
11 | |||
12 | gtk_init(&argc, &argv); | ||
13 | |||
14 | + gtk_window_set_default_icon_from_file ("/usr/share/pixmaps/ssh-askpass-gnome.png", NULL); | ||
15 | + | ||
16 | if (argc > 1) { | ||
17 | message = g_strjoinv(" ", argv + 1); | ||
18 | } else { | ||
diff --git a/debian/patches/gssapi.patch b/debian/patches/gssapi.patch new file mode 100644 index 000000000..85c6722f0 --- /dev/null +++ b/debian/patches/gssapi.patch | |||
@@ -0,0 +1,3088 @@ | |||
1 | Description: GSSAPI key exchange support | ||
2 | This patch has been rejected upstream: "None of the OpenSSH developers are | ||
3 | in favour of adding this, and this situation has not changed for several | ||
4 | years. This is not a slight on Simon's patch, which is of fine quality, | ||
5 | but just that a) we don't trust GSSAPI implementations that much and b) we | ||
6 | don't like adding new KEX since they are pre-auth attack surface. This one | ||
7 | is particularly scary, since it requires hooks out to typically root-owned | ||
8 | system resources." | ||
9 | . | ||
10 | However, quite a lot of people rely on this in Debian, and it's better to | ||
11 | have it merged into the main openssh package rather than having separate | ||
12 | -krb5 packages (as we used to have). It seems to have a generally good | ||
13 | security history. | ||
14 | Author: Simon Wilkinson <simon@sxw.org.uk> | ||
15 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242 | ||
16 | Last-Updated: 2013-09-14 | ||
17 | |||
18 | Index: b/ChangeLog.gssapi | ||
19 | =================================================================== | ||
20 | --- /dev/null | ||
21 | +++ b/ChangeLog.gssapi | ||
22 | @@ -0,0 +1,113 @@ | ||
23 | +20110101 | ||
24 | + - Finally update for OpenSSH 5.6p1 | ||
25 | + - Add GSSAPIServerIdentity option from Jim Basney | ||
26 | + | ||
27 | +20100308 | ||
28 | + - [ Makefile.in, key.c, key.h ] | ||
29 | + Updates for OpenSSH 5.4p1 | ||
30 | + - [ servconf.c ] | ||
31 | + Include GSSAPI options in the sshd -T configuration dump, and flag | ||
32 | + some older configuration options as being unsupported. Thanks to Colin | ||
33 | + Watson. | ||
34 | + - | ||
35 | + | ||
36 | +20100124 | ||
37 | + - [ sshconnect2.c ] | ||
38 | + Adapt to deal with additional element in Authmethod structure. Thanks to | ||
39 | + Colin Watson | ||
40 | + | ||
41 | +20090615 | ||
42 | + - [ gss-genr.c gss-serv.c kexgssc.c kexgsss.c monitor.c sshconnect2.c | ||
43 | + sshd.c ] | ||
44 | + Fix issues identified by Greg Hudson following a code review | ||
45 | + Check return value of gss_indicate_mechs | ||
46 | + Protect GSSAPI calls in monitor, so they can only be used if enabled | ||
47 | + Check return values of bignum functions in key exchange | ||
48 | + Use BN_clear_free to clear other side's DH value | ||
49 | + Make ssh_gssapi_id_kex more robust | ||
50 | + Only configure kex table pointers if GSSAPI is enabled | ||
51 | + Don't leak mechanism list, or gss mechanism list | ||
52 | + Cast data.length before printing | ||
53 | + If serverkey isn't provided, use an empty string, rather than NULL | ||
54 | + | ||
55 | +20090201 | ||
56 | + - [ gss-genr.c gss-serv.c kex.h kexgssc.c readconf.c readconf.h ssh-gss.h | ||
57 | + ssh_config.5 sshconnet2.c ] | ||
58 | + Add support for the GSSAPIClientIdentity option, which allows the user | ||
59 | + to specify which GSSAPI identity to use to contact a given server | ||
60 | + | ||
61 | +20080404 | ||
62 | + - [ gss-serv.c ] | ||
63 | + Add code to actually implement GSSAPIStrictAcceptCheck, which had somehow | ||
64 | + been omitted from a previous version of this patch. Reported by Borislav | ||
65 | + Stoichkov | ||
66 | + | ||
67 | +20070317 | ||
68 | + - [ gss-serv-krb5.c ] | ||
69 | + Remove C99ism, where new_ccname was being declared in the middle of a | ||
70 | + function | ||
71 | + | ||
72 | +20061220 | ||
73 | + - [ servconf.c ] | ||
74 | + Make default for GSSAPIStrictAcceptorCheck be Yes, to match previous, and | ||
75 | + documented, behaviour. Reported by Dan Watson. | ||
76 | + | ||
77 | +20060910 | ||
78 | + - [ gss-genr.c kexgssc.c kexgsss.c kex.h monitor.c sshconnect2.c sshd.c | ||
79 | + ssh-gss.h ] | ||
80 | + add support for gss-group14-sha1 key exchange mechanisms | ||
81 | + - [ gss-serv.c servconf.c servconf.h sshd_config sshd_config.5 ] | ||
82 | + Add GSSAPIStrictAcceptorCheck option to allow the disabling of | ||
83 | + acceptor principal checking on multi-homed machines. | ||
84 | + <Bugzilla #928> | ||
85 | + - [ sshd_config ssh_config ] | ||
86 | + Add settings for GSSAPIKeyExchange and GSSAPITrustDNS to the sample | ||
87 | + configuration files | ||
88 | + - [ kexgss.c kegsss.c sshconnect2.c sshd.c ] | ||
89 | + Code cleanup. Replace strlen/xmalloc/snprintf sequences with xasprintf() | ||
90 | + Limit length of error messages displayed by client | ||
91 | + | ||
92 | +20060909 | ||
93 | + - [ gss-genr.c gss-serv.c ] | ||
94 | + move ssh_gssapi_acquire_cred() and ssh_gssapi_server_ctx to be server | ||
95 | + only, where they belong | ||
96 | + <Bugzilla #1225> | ||
97 | + | ||
98 | +20060829 | ||
99 | + - [ gss-serv-krb5.c ] | ||
100 | + Fix CCAPI credentials cache name when creating KRB5CCNAME environment | ||
101 | + variable | ||
102 | + | ||
103 | +20060828 | ||
104 | + - [ gss-genr.c ] | ||
105 | + Avoid Heimdal context freeing problem | ||
106 | + <Fixed upstream 20060829> | ||
107 | + | ||
108 | +20060818 | ||
109 | + - [ gss-genr.c ssh-gss.h sshconnect2.c ] | ||
110 | + Make sure that SPENGO is disabled | ||
111 | + <Bugzilla #1218 - Fixed upstream 20060818> | ||
112 | + | ||
113 | +20060421 | ||
114 | + - [ gssgenr.c, sshconnect2.c ] | ||
115 | + a few type changes (signed versus unsigned, int versus size_t) to | ||
116 | + fix compiler errors/warnings | ||
117 | + (from jbasney AT ncsa.uiuc.edu) | ||
118 | + - [ kexgssc.c, sshconnect2.c ] | ||
119 | + fix uninitialized variable warnings | ||
120 | + (from jbasney AT ncsa.uiuc.edu) | ||
121 | + - [ gssgenr.c ] | ||
122 | + pass oid to gss_display_status (helpful when using GSSAPI mechglue) | ||
123 | + (from jbasney AT ncsa.uiuc.edu) | ||
124 | + <Bugzilla #1220 > | ||
125 | + - [ gss-serv-krb5.c ] | ||
126 | + #ifdef HAVE_GSSAPI_KRB5 should be #ifdef HAVE_GSSAPI_KRB5_H | ||
127 | + (from jbasney AT ncsa.uiuc.edu) | ||
128 | + <Fixed upstream 20060304> | ||
129 | + - [ readconf.c, readconf.h, ssh_config.5, sshconnect2.c | ||
130 | + add client-side GssapiKeyExchange option | ||
131 | + (from jbasney AT ncsa.uiuc.edu) | ||
132 | + - [ sshconnect2.c ] | ||
133 | + add support for GssapiTrustDns option for gssapi-with-mic | ||
134 | + (from jbasney AT ncsa.uiuc.edu) | ||
135 | + <gssapi-with-mic support is Bugzilla #1008> | ||
136 | Index: b/Makefile.in | ||
137 | =================================================================== | ||
138 | --- a/Makefile.in | ||
139 | +++ b/Makefile.in | ||
140 | @@ -72,6 +72,7 @@ | ||
141 | atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ | ||
142 | monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ | ||
143 | kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ | ||
144 | + kexgssc.o \ | ||
145 | msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ | ||
146 | jpake.o schnorr.o ssh-pkcs11.o krl.o | ||
147 | |||
148 | @@ -88,7 +89,7 @@ | ||
149 | auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ | ||
150 | monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ | ||
151 | auth-krb5.o \ | ||
152 | - auth2-gss.o gss-serv.o gss-serv-krb5.o \ | ||
153 | + auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o\ | ||
154 | loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ | ||
155 | sftp-server.o sftp-common.o \ | ||
156 | roaming_common.o roaming_serv.o \ | ||
157 | Index: b/auth-krb5.c | ||
158 | =================================================================== | ||
159 | --- a/auth-krb5.c | ||
160 | +++ b/auth-krb5.c | ||
161 | @@ -181,8 +181,13 @@ | ||
162 | |||
163 | len = strlen(authctxt->krb5_ticket_file) + 6; | ||
164 | authctxt->krb5_ccname = xmalloc(len); | ||
165 | +#ifdef USE_CCAPI | ||
166 | + snprintf(authctxt->krb5_ccname, len, "API:%s", | ||
167 | + authctxt->krb5_ticket_file); | ||
168 | +#else | ||
169 | snprintf(authctxt->krb5_ccname, len, "FILE:%s", | ||
170 | authctxt->krb5_ticket_file); | ||
171 | +#endif | ||
172 | |||
173 | #ifdef USE_PAM | ||
174 | if (options.use_pam) | ||
175 | @@ -239,15 +244,22 @@ | ||
176 | #ifndef HEIMDAL | ||
177 | krb5_error_code | ||
178 | ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { | ||
179 | - int tmpfd, ret, oerrno; | ||
180 | + int ret, oerrno; | ||
181 | char ccname[40]; | ||
182 | mode_t old_umask; | ||
183 | +#ifdef USE_CCAPI | ||
184 | + char cctemplate[] = "API:krb5cc_%d"; | ||
185 | +#else | ||
186 | + char cctemplate[] = "FILE:/tmp/krb5cc_%d_XXXXXXXXXX"; | ||
187 | + int tmpfd; | ||
188 | +#endif | ||
189 | |||
190 | ret = snprintf(ccname, sizeof(ccname), | ||
191 | - "FILE:/tmp/krb5cc_%d_XXXXXXXXXX", geteuid()); | ||
192 | + cctemplate, geteuid()); | ||
193 | if (ret < 0 || (size_t)ret >= sizeof(ccname)) | ||
194 | return ENOMEM; | ||
195 | |||
196 | +#ifndef USE_CCAPI | ||
197 | old_umask = umask(0177); | ||
198 | tmpfd = mkstemp(ccname + strlen("FILE:")); | ||
199 | oerrno = errno; | ||
200 | @@ -264,6 +276,7 @@ | ||
201 | return oerrno; | ||
202 | } | ||
203 | close(tmpfd); | ||
204 | +#endif | ||
205 | |||
206 | return (krb5_cc_resolve(ctx, ccname, ccache)); | ||
207 | } | ||
208 | Index: b/auth2-gss.c | ||
209 | =================================================================== | ||
210 | --- a/auth2-gss.c | ||
211 | +++ b/auth2-gss.c | ||
212 | @@ -1,7 +1,7 @@ | ||
213 | /* $OpenBSD: auth2-gss.c,v 1.20 2013/05/17 00:13:13 djm Exp $ */ | ||
214 | |||
215 | /* | ||
216 | - * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | ||
217 | + * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. | ||
218 | * | ||
219 | * Redistribution and use in source and binary forms, with or without | ||
220 | * modification, are permitted provided that the following conditions | ||
221 | @@ -52,6 +52,40 @@ | ||
222 | static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt); | ||
223 | static void input_gssapi_errtok(int, u_int32_t, void *); | ||
224 | |||
225 | +/* | ||
226 | + * The 'gssapi_keyex' userauth mechanism. | ||
227 | + */ | ||
228 | +static int | ||
229 | +userauth_gsskeyex(Authctxt *authctxt) | ||
230 | +{ | ||
231 | + int authenticated = 0; | ||
232 | + Buffer b; | ||
233 | + gss_buffer_desc mic, gssbuf; | ||
234 | + u_int len; | ||
235 | + | ||
236 | + mic.value = packet_get_string(&len); | ||
237 | + mic.length = len; | ||
238 | + | ||
239 | + packet_check_eom(); | ||
240 | + | ||
241 | + ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service, | ||
242 | + "gssapi-keyex"); | ||
243 | + | ||
244 | + gssbuf.value = buffer_ptr(&b); | ||
245 | + gssbuf.length = buffer_len(&b); | ||
246 | + | ||
247 | + /* gss_kex_context is NULL with privsep, so we can't check it here */ | ||
248 | + if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gss_kex_context, | ||
249 | + &gssbuf, &mic)))) | ||
250 | + authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user, | ||
251 | + authctxt->pw)); | ||
252 | + | ||
253 | + buffer_free(&b); | ||
254 | + free(mic.value); | ||
255 | + | ||
256 | + return (authenticated); | ||
257 | +} | ||
258 | + | ||
259 | /* | ||
260 | * We only support those mechanisms that we know about (ie ones that we know | ||
261 | * how to check local user kuserok and the like) | ||
262 | @@ -240,7 +274,8 @@ | ||
263 | |||
264 | packet_check_eom(); | ||
265 | |||
266 | - authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user)); | ||
267 | + authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user, | ||
268 | + authctxt->pw)); | ||
269 | |||
270 | authctxt->postponed = 0; | ||
271 | dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); | ||
272 | @@ -275,7 +310,8 @@ | ||
273 | gssbuf.length = buffer_len(&b); | ||
274 | |||
275 | if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gssctxt, &gssbuf, &mic)))) | ||
276 | - authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user)); | ||
277 | + authenticated = | ||
278 | + PRIVSEP(ssh_gssapi_userok(authctxt->user, authctxt->pw)); | ||
279 | else | ||
280 | logit("GSSAPI MIC check failed"); | ||
281 | |||
282 | @@ -290,6 +326,12 @@ | ||
283 | userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); | ||
284 | } | ||
285 | |||
286 | +Authmethod method_gsskeyex = { | ||
287 | + "gssapi-keyex", | ||
288 | + userauth_gsskeyex, | ||
289 | + &options.gss_authentication | ||
290 | +}; | ||
291 | + | ||
292 | Authmethod method_gssapi = { | ||
293 | "gssapi-with-mic", | ||
294 | userauth_gssapi, | ||
295 | Index: b/auth2.c | ||
296 | =================================================================== | ||
297 | --- a/auth2.c | ||
298 | +++ b/auth2.c | ||
299 | @@ -69,6 +69,7 @@ | ||
300 | extern Authmethod method_kbdint; | ||
301 | extern Authmethod method_hostbased; | ||
302 | #ifdef GSSAPI | ||
303 | +extern Authmethod method_gsskeyex; | ||
304 | extern Authmethod method_gssapi; | ||
305 | #endif | ||
306 | #ifdef JPAKE | ||
307 | @@ -79,6 +80,7 @@ | ||
308 | &method_none, | ||
309 | &method_pubkey, | ||
310 | #ifdef GSSAPI | ||
311 | + &method_gsskeyex, | ||
312 | &method_gssapi, | ||
313 | #endif | ||
314 | #ifdef JPAKE | ||
315 | Index: b/clientloop.c | ||
316 | =================================================================== | ||
317 | --- a/clientloop.c | ||
318 | +++ b/clientloop.c | ||
319 | @@ -111,6 +111,10 @@ | ||
320 | #include "msg.h" | ||
321 | #include "roaming.h" | ||
322 | |||
323 | +#ifdef GSSAPI | ||
324 | +#include "ssh-gss.h" | ||
325 | +#endif | ||
326 | + | ||
327 | /* import options */ | ||
328 | extern Options options; | ||
329 | |||
330 | @@ -1608,6 +1612,15 @@ | ||
331 | /* Do channel operations unless rekeying in progress. */ | ||
332 | if (!rekeying) { | ||
333 | channel_after_select(readset, writeset); | ||
334 | + | ||
335 | +#ifdef GSSAPI | ||
336 | + if (options.gss_renewal_rekey && | ||
337 | + ssh_gssapi_credentials_updated(GSS_C_NO_CONTEXT)) { | ||
338 | + debug("credentials updated - forcing rekey"); | ||
339 | + need_rekeying = 1; | ||
340 | + } | ||
341 | +#endif | ||
342 | + | ||
343 | if (need_rekeying || packet_need_rekeying()) { | ||
344 | debug("need rekeying"); | ||
345 | xxx_kex->done = 0; | ||
346 | Index: b/config.h.in | ||
347 | =================================================================== | ||
348 | --- a/config.h.in | ||
349 | +++ b/config.h.in | ||
350 | @@ -1546,6 +1546,9 @@ | ||
351 | /* Use btmp to log bad logins */ | ||
352 | #undef USE_BTMP | ||
353 | |||
354 | +/* platform uses an in-memory credentials cache */ | ||
355 | +#undef USE_CCAPI | ||
356 | + | ||
357 | /* Use libedit for sftp */ | ||
358 | #undef USE_LIBEDIT | ||
359 | |||
360 | @@ -1561,6 +1564,9 @@ | ||
361 | /* Use PIPES instead of a socketpair() */ | ||
362 | #undef USE_PIPES | ||
363 | |||
364 | +/* platform has the Security Authorization Session API */ | ||
365 | +#undef USE_SECURITY_SESSION_API | ||
366 | + | ||
367 | /* Define if you have Solaris process contracts */ | ||
368 | #undef USE_SOLARIS_PROCESS_CONTRACTS | ||
369 | |||
370 | Index: b/configure | ||
371 | =================================================================== | ||
372 | --- a/configure | ||
373 | +++ b/configure | ||
374 | @@ -6780,6 +6780,63 @@ | ||
375 | |||
376 | $as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h | ||
377 | |||
378 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have the Security Authorization Session API" >&5 | ||
379 | +$as_echo_n "checking if we have the Security Authorization Session API... " >&6; } | ||
380 | + cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
381 | +/* end confdefs.h. */ | ||
382 | +#include <Security/AuthSession.h> | ||
383 | +int | ||
384 | +main () | ||
385 | +{ | ||
386 | +SessionCreate(0, 0); | ||
387 | + ; | ||
388 | + return 0; | ||
389 | +} | ||
390 | +_ACEOF | ||
391 | +if ac_fn_c_try_compile "$LINENO"; then : | ||
392 | + ac_cv_use_security_session_api="yes" | ||
393 | + | ||
394 | +$as_echo "#define USE_SECURITY_SESSION_API 1" >>confdefs.h | ||
395 | + | ||
396 | + LIBS="$LIBS -framework Security" | ||
397 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
398 | +$as_echo "yes" >&6; } | ||
399 | +else | ||
400 | + ac_cv_use_security_session_api="no" | ||
401 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
402 | +$as_echo "no" >&6; } | ||
403 | +fi | ||
404 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||
405 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have an in-memory credentials cache" >&5 | ||
406 | +$as_echo_n "checking if we have an in-memory credentials cache... " >&6; } | ||
407 | + cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
408 | +/* end confdefs.h. */ | ||
409 | +#include <Kerberos/Kerberos.h> | ||
410 | +int | ||
411 | +main () | ||
412 | +{ | ||
413 | +cc_context_t c; | ||
414 | + (void) cc_initialize (&c, 0, NULL, NULL); | ||
415 | + ; | ||
416 | + return 0; | ||
417 | +} | ||
418 | +_ACEOF | ||
419 | +if ac_fn_c_try_compile "$LINENO"; then : | ||
420 | + | ||
421 | +$as_echo "#define USE_CCAPI 1" >>confdefs.h | ||
422 | + | ||
423 | + LIBS="$LIBS -framework Security" | ||
424 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
425 | +$as_echo "yes" >&6; } | ||
426 | + if test "x$ac_cv_use_security_session_api" = "xno"; then | ||
427 | + as_fn_error $? "*** Need a security framework to use the credentials cache API ***" "$LINENO" 5 | ||
428 | + fi | ||
429 | +else | ||
430 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
431 | +$as_echo "no" >&6; } | ||
432 | + | ||
433 | +fi | ||
434 | +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||
435 | |||
436 | ac_fn_c_check_decl "$LINENO" "AU_IPv4" "ac_cv_have_decl_AU_IPv4" "$ac_includes_default" | ||
437 | if test "x$ac_cv_have_decl_AU_IPv4" = xyes; then : | ||
438 | Index: b/configure.ac | ||
439 | =================================================================== | ||
440 | --- a/configure.ac | ||
441 | +++ b/configure.ac | ||
442 | @@ -548,6 +548,30 @@ | ||
443 | [Use tunnel device compatibility to OpenBSD]) | ||
444 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], | ||
445 | [Prepend the address family to IP tunnel traffic]) | ||
446 | + AC_MSG_CHECKING([if we have the Security Authorization Session API]) | ||
447 | + AC_TRY_COMPILE([#include <Security/AuthSession.h>], | ||
448 | + [SessionCreate(0, 0);], | ||
449 | + [ac_cv_use_security_session_api="yes" | ||
450 | + AC_DEFINE([USE_SECURITY_SESSION_API], [1], | ||
451 | + [platform has the Security Authorization Session API]) | ||
452 | + LIBS="$LIBS -framework Security" | ||
453 | + AC_MSG_RESULT([yes])], | ||
454 | + [ac_cv_use_security_session_api="no" | ||
455 | + AC_MSG_RESULT([no])]) | ||
456 | + AC_MSG_CHECKING([if we have an in-memory credentials cache]) | ||
457 | + AC_TRY_COMPILE( | ||
458 | + [#include <Kerberos/Kerberos.h>], | ||
459 | + [cc_context_t c; | ||
460 | + (void) cc_initialize (&c, 0, NULL, NULL);], | ||
461 | + [AC_DEFINE([USE_CCAPI], [1], | ||
462 | + [platform uses an in-memory credentials cache]) | ||
463 | + LIBS="$LIBS -framework Security" | ||
464 | + AC_MSG_RESULT([yes]) | ||
465 | + if test "x$ac_cv_use_security_session_api" = "xno"; then | ||
466 | + AC_MSG_ERROR([*** Need a security framework to use the credentials cache API ***]) | ||
467 | + fi], | ||
468 | + [AC_MSG_RESULT([no])] | ||
469 | + ) | ||
470 | m4_pattern_allow([AU_IPv]) | ||
471 | AC_CHECK_DECL([AU_IPv4], [], | ||
472 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) | ||
473 | Index: b/gss-genr.c | ||
474 | =================================================================== | ||
475 | --- a/gss-genr.c | ||
476 | +++ b/gss-genr.c | ||
477 | @@ -1,7 +1,7 @@ | ||
478 | /* $OpenBSD: gss-genr.c,v 1.21 2013/05/17 00:13:13 djm Exp $ */ | ||
479 | |||
480 | /* | ||
481 | - * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. | ||
482 | + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. | ||
483 | * | ||
484 | * Redistribution and use in source and binary forms, with or without | ||
485 | * modification, are permitted provided that the following conditions | ||
486 | @@ -39,12 +39,167 @@ | ||
487 | #include "buffer.h" | ||
488 | #include "log.h" | ||
489 | #include "ssh2.h" | ||
490 | +#include "cipher.h" | ||
491 | +#include "key.h" | ||
492 | +#include "kex.h" | ||
493 | +#include <openssl/evp.h> | ||
494 | |||
495 | #include "ssh-gss.h" | ||
496 | |||
497 | extern u_char *session_id2; | ||
498 | extern u_int session_id2_len; | ||
499 | |||
500 | +typedef struct { | ||
501 | + char *encoded; | ||
502 | + gss_OID oid; | ||
503 | +} ssh_gss_kex_mapping; | ||
504 | + | ||
505 | +/* | ||
506 | + * XXX - It would be nice to find a more elegant way of handling the | ||
507 | + * XXX passing of the key exchange context to the userauth routines | ||
508 | + */ | ||
509 | + | ||
510 | +Gssctxt *gss_kex_context = NULL; | ||
511 | + | ||
512 | +static ssh_gss_kex_mapping *gss_enc2oid = NULL; | ||
513 | + | ||
514 | +int | ||
515 | +ssh_gssapi_oid_table_ok() { | ||
516 | + return (gss_enc2oid != NULL); | ||
517 | +} | ||
518 | + | ||
519 | +/* | ||
520 | + * Return a list of the gss-group1-sha1 mechanisms supported by this program | ||
521 | + * | ||
522 | + * We test mechanisms to ensure that we can use them, to avoid starting | ||
523 | + * a key exchange with a bad mechanism | ||
524 | + */ | ||
525 | + | ||
526 | +char * | ||
527 | +ssh_gssapi_client_mechanisms(const char *host, const char *client) { | ||
528 | + gss_OID_set gss_supported; | ||
529 | + OM_uint32 min_status; | ||
530 | + | ||
531 | + if (GSS_ERROR(gss_indicate_mechs(&min_status, &gss_supported))) | ||
532 | + return NULL; | ||
533 | + | ||
534 | + return(ssh_gssapi_kex_mechs(gss_supported, ssh_gssapi_check_mechanism, | ||
535 | + host, client)); | ||
536 | +} | ||
537 | + | ||
538 | +char * | ||
539 | +ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check, | ||
540 | + const char *host, const char *client) { | ||
541 | + Buffer buf; | ||
542 | + size_t i; | ||
543 | + int oidpos, enclen; | ||
544 | + char *mechs, *encoded; | ||
545 | + u_char digest[EVP_MAX_MD_SIZE]; | ||
546 | + char deroid[2]; | ||
547 | + const EVP_MD *evp_md = EVP_md5(); | ||
548 | + EVP_MD_CTX md; | ||
549 | + | ||
550 | + if (gss_enc2oid != NULL) { | ||
551 | + for (i = 0; gss_enc2oid[i].encoded != NULL; i++) | ||
552 | + free(gss_enc2oid[i].encoded); | ||
553 | + free(gss_enc2oid); | ||
554 | + } | ||
555 | + | ||
556 | + gss_enc2oid = xmalloc(sizeof(ssh_gss_kex_mapping) * | ||
557 | + (gss_supported->count + 1)); | ||
558 | + | ||
559 | + buffer_init(&buf); | ||
560 | + | ||
561 | + oidpos = 0; | ||
562 | + for (i = 0; i < gss_supported->count; i++) { | ||
563 | + if (gss_supported->elements[i].length < 128 && | ||
564 | + (*check)(NULL, &(gss_supported->elements[i]), host, client)) { | ||
565 | + | ||
566 | + deroid[0] = SSH_GSS_OIDTYPE; | ||
567 | + deroid[1] = gss_supported->elements[i].length; | ||
568 | + | ||
569 | + EVP_DigestInit(&md, evp_md); | ||
570 | + EVP_DigestUpdate(&md, deroid, 2); | ||
571 | + EVP_DigestUpdate(&md, | ||
572 | + gss_supported->elements[i].elements, | ||
573 | + gss_supported->elements[i].length); | ||
574 | + EVP_DigestFinal(&md, digest, NULL); | ||
575 | + | ||
576 | + encoded = xmalloc(EVP_MD_size(evp_md) * 2); | ||
577 | + enclen = __b64_ntop(digest, EVP_MD_size(evp_md), | ||
578 | + encoded, EVP_MD_size(evp_md) * 2); | ||
579 | + | ||
580 | + if (oidpos != 0) | ||
581 | + buffer_put_char(&buf, ','); | ||
582 | + | ||
583 | + buffer_append(&buf, KEX_GSS_GEX_SHA1_ID, | ||
584 | + sizeof(KEX_GSS_GEX_SHA1_ID) - 1); | ||
585 | + buffer_append(&buf, encoded, enclen); | ||
586 | + buffer_put_char(&buf, ','); | ||
587 | + buffer_append(&buf, KEX_GSS_GRP1_SHA1_ID, | ||
588 | + sizeof(KEX_GSS_GRP1_SHA1_ID) - 1); | ||
589 | + buffer_append(&buf, encoded, enclen); | ||
590 | + buffer_put_char(&buf, ','); | ||
591 | + buffer_append(&buf, KEX_GSS_GRP14_SHA1_ID, | ||
592 | + sizeof(KEX_GSS_GRP14_SHA1_ID) - 1); | ||
593 | + buffer_append(&buf, encoded, enclen); | ||
594 | + | ||
595 | + gss_enc2oid[oidpos].oid = &(gss_supported->elements[i]); | ||
596 | + gss_enc2oid[oidpos].encoded = encoded; | ||
597 | + oidpos++; | ||
598 | + } | ||
599 | + } | ||
600 | + gss_enc2oid[oidpos].oid = NULL; | ||
601 | + gss_enc2oid[oidpos].encoded = NULL; | ||
602 | + | ||
603 | + buffer_put_char(&buf, '\0'); | ||
604 | + | ||
605 | + mechs = xmalloc(buffer_len(&buf)); | ||
606 | + buffer_get(&buf, mechs, buffer_len(&buf)); | ||
607 | + buffer_free(&buf); | ||
608 | + | ||
609 | + if (strlen(mechs) == 0) { | ||
610 | + free(mechs); | ||
611 | + mechs = NULL; | ||
612 | + } | ||
613 | + | ||
614 | + return (mechs); | ||
615 | +} | ||
616 | + | ||
617 | +gss_OID | ||
618 | +ssh_gssapi_id_kex(Gssctxt *ctx, char *name, int kex_type) { | ||
619 | + int i = 0; | ||
620 | + | ||
621 | + switch (kex_type) { | ||
622 | + case KEX_GSS_GRP1_SHA1: | ||
623 | + if (strlen(name) < sizeof(KEX_GSS_GRP1_SHA1_ID)) | ||
624 | + return GSS_C_NO_OID; | ||
625 | + name += sizeof(KEX_GSS_GRP1_SHA1_ID) - 1; | ||
626 | + break; | ||
627 | + case KEX_GSS_GRP14_SHA1: | ||
628 | + if (strlen(name) < sizeof(KEX_GSS_GRP14_SHA1_ID)) | ||
629 | + return GSS_C_NO_OID; | ||
630 | + name += sizeof(KEX_GSS_GRP14_SHA1_ID) - 1; | ||
631 | + break; | ||
632 | + case KEX_GSS_GEX_SHA1: | ||
633 | + if (strlen(name) < sizeof(KEX_GSS_GEX_SHA1_ID)) | ||
634 | + return GSS_C_NO_OID; | ||
635 | + name += sizeof(KEX_GSS_GEX_SHA1_ID) - 1; | ||
636 | + break; | ||
637 | + default: | ||
638 | + return GSS_C_NO_OID; | ||
639 | + } | ||
640 | + | ||
641 | + while (gss_enc2oid[i].encoded != NULL && | ||
642 | + strcmp(name, gss_enc2oid[i].encoded) != 0) | ||
643 | + i++; | ||
644 | + | ||
645 | + if (gss_enc2oid[i].oid != NULL && ctx != NULL) | ||
646 | + ssh_gssapi_set_oid(ctx, gss_enc2oid[i].oid); | ||
647 | + | ||
648 | + return gss_enc2oid[i].oid; | ||
649 | +} | ||
650 | + | ||
651 | /* Check that the OID in a data stream matches that in the context */ | ||
652 | int | ||
653 | ssh_gssapi_check_oid(Gssctxt *ctx, void *data, size_t len) | ||
654 | @@ -197,7 +352,7 @@ | ||
655 | } | ||
656 | |||
657 | ctx->major = gss_init_sec_context(&ctx->minor, | ||
658 | - GSS_C_NO_CREDENTIAL, &ctx->context, ctx->name, ctx->oid, | ||
659 | + ctx->client_creds, &ctx->context, ctx->name, ctx->oid, | ||
660 | GSS_C_MUTUAL_FLAG | GSS_C_INTEG_FLAG | deleg_flag, | ||
661 | 0, NULL, recv_tok, NULL, send_tok, flags, NULL); | ||
662 | |||
663 | @@ -227,8 +382,42 @@ | ||
664 | } | ||
665 | |||
666 | OM_uint32 | ||
667 | +ssh_gssapi_client_identity(Gssctxt *ctx, const char *name) | ||
668 | +{ | ||
669 | + gss_buffer_desc gssbuf; | ||
670 | + gss_name_t gssname; | ||
671 | + OM_uint32 status; | ||
672 | + gss_OID_set oidset; | ||
673 | + | ||
674 | + gssbuf.value = (void *) name; | ||
675 | + gssbuf.length = strlen(gssbuf.value); | ||
676 | + | ||
677 | + gss_create_empty_oid_set(&status, &oidset); | ||
678 | + gss_add_oid_set_member(&status, ctx->oid, &oidset); | ||
679 | + | ||
680 | + ctx->major = gss_import_name(&ctx->minor, &gssbuf, | ||
681 | + GSS_C_NT_USER_NAME, &gssname); | ||
682 | + | ||
683 | + if (!ctx->major) | ||
684 | + ctx->major = gss_acquire_cred(&ctx->minor, | ||
685 | + gssname, 0, oidset, GSS_C_INITIATE, | ||
686 | + &ctx->client_creds, NULL, NULL); | ||
687 | + | ||
688 | + gss_release_name(&status, &gssname); | ||
689 | + gss_release_oid_set(&status, &oidset); | ||
690 | + | ||
691 | + if (ctx->major) | ||
692 | + ssh_gssapi_error(ctx); | ||
693 | + | ||
694 | + return(ctx->major); | ||
695 | +} | ||
696 | + | ||
697 | +OM_uint32 | ||
698 | ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash) | ||
699 | { | ||
700 | + if (ctx == NULL) | ||
701 | + return -1; | ||
702 | + | ||
703 | if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context, | ||
704 | GSS_C_QOP_DEFAULT, buffer, hash))) | ||
705 | ssh_gssapi_error(ctx); | ||
706 | @@ -236,6 +425,19 @@ | ||
707 | return (ctx->major); | ||
708 | } | ||
709 | |||
710 | +/* Priviledged when used by server */ | ||
711 | +OM_uint32 | ||
712 | +ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) | ||
713 | +{ | ||
714 | + if (ctx == NULL) | ||
715 | + return -1; | ||
716 | + | ||
717 | + ctx->major = gss_verify_mic(&ctx->minor, ctx->context, | ||
718 | + gssbuf, gssmic, NULL); | ||
719 | + | ||
720 | + return (ctx->major); | ||
721 | +} | ||
722 | + | ||
723 | void | ||
724 | ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service, | ||
725 | const char *context) | ||
726 | @@ -249,11 +451,16 @@ | ||
727 | } | ||
728 | |||
729 | int | ||
730 | -ssh_gssapi_check_mechanism(Gssctxt **ctx, gss_OID oid, const char *host) | ||
731 | +ssh_gssapi_check_mechanism(Gssctxt **ctx, gss_OID oid, const char *host, | ||
732 | + const char *client) | ||
733 | { | ||
734 | gss_buffer_desc token = GSS_C_EMPTY_BUFFER; | ||
735 | OM_uint32 major, minor; | ||
736 | gss_OID_desc spnego_oid = {6, (void *)"\x2B\x06\x01\x05\x05\x02"}; | ||
737 | + Gssctxt *intctx = NULL; | ||
738 | + | ||
739 | + if (ctx == NULL) | ||
740 | + ctx = &intctx; | ||
741 | |||
742 | /* RFC 4462 says we MUST NOT do SPNEGO */ | ||
743 | if (oid->length == spnego_oid.length && | ||
744 | @@ -263,6 +470,10 @@ | ||
745 | ssh_gssapi_build_ctx(ctx); | ||
746 | ssh_gssapi_set_oid(*ctx, oid); | ||
747 | major = ssh_gssapi_import_name(*ctx, host); | ||
748 | + | ||
749 | + if (!GSS_ERROR(major) && client) | ||
750 | + major = ssh_gssapi_client_identity(*ctx, client); | ||
751 | + | ||
752 | if (!GSS_ERROR(major)) { | ||
753 | major = ssh_gssapi_init_ctx(*ctx, 0, GSS_C_NO_BUFFER, &token, | ||
754 | NULL); | ||
755 | @@ -272,10 +483,67 @@ | ||
756 | GSS_C_NO_BUFFER); | ||
757 | } | ||
758 | |||
759 | - if (GSS_ERROR(major)) | ||
760 | + if (GSS_ERROR(major) || intctx != NULL) | ||
761 | ssh_gssapi_delete_ctx(ctx); | ||
762 | |||
763 | return (!GSS_ERROR(major)); | ||
764 | } | ||
765 | |||
766 | +int | ||
767 | +ssh_gssapi_credentials_updated(Gssctxt *ctxt) { | ||
768 | + static gss_name_t saved_name = GSS_C_NO_NAME; | ||
769 | + static OM_uint32 saved_lifetime = 0; | ||
770 | + static gss_OID saved_mech = GSS_C_NO_OID; | ||
771 | + static gss_name_t name; | ||
772 | + static OM_uint32 last_call = 0; | ||
773 | + OM_uint32 lifetime, now, major, minor; | ||
774 | + int equal; | ||
775 | + gss_cred_usage_t usage = GSS_C_INITIATE; | ||
776 | + | ||
777 | + now = time(NULL); | ||
778 | + | ||
779 | + if (ctxt) { | ||
780 | + debug("Rekey has happened - updating saved versions"); | ||
781 | + | ||
782 | + if (saved_name != GSS_C_NO_NAME) | ||
783 | + gss_release_name(&minor, &saved_name); | ||
784 | + | ||
785 | + major = gss_inquire_cred(&minor, GSS_C_NO_CREDENTIAL, | ||
786 | + &saved_name, &saved_lifetime, NULL, NULL); | ||
787 | + | ||
788 | + if (!GSS_ERROR(major)) { | ||
789 | + saved_mech = ctxt->oid; | ||
790 | + saved_lifetime+= now; | ||
791 | + } else { | ||
792 | + /* Handle the error */ | ||
793 | + } | ||
794 | + return 0; | ||
795 | + } | ||
796 | + | ||
797 | + if (now - last_call < 10) | ||
798 | + return 0; | ||
799 | + | ||
800 | + last_call = now; | ||
801 | + | ||
802 | + if (saved_mech == GSS_C_NO_OID) | ||
803 | + return 0; | ||
804 | + | ||
805 | + major = gss_inquire_cred(&minor, GSS_C_NO_CREDENTIAL, | ||
806 | + &name, &lifetime, NULL, NULL); | ||
807 | + if (major == GSS_S_CREDENTIALS_EXPIRED) | ||
808 | + return 0; | ||
809 | + else if (GSS_ERROR(major)) | ||
810 | + return 0; | ||
811 | + | ||
812 | + major = gss_compare_name(&minor, saved_name, name, &equal); | ||
813 | + gss_release_name(&minor, &name); | ||
814 | + if (GSS_ERROR(major)) | ||
815 | + return 0; | ||
816 | + | ||
817 | + if (equal && (saved_lifetime < lifetime + now - 10)) | ||
818 | + return 1; | ||
819 | + | ||
820 | + return 0; | ||
821 | +} | ||
822 | + | ||
823 | #endif /* GSSAPI */ | ||
824 | Index: b/gss-serv-krb5.c | ||
825 | =================================================================== | ||
826 | --- a/gss-serv-krb5.c | ||
827 | +++ b/gss-serv-krb5.c | ||
828 | @@ -1,7 +1,7 @@ | ||
829 | /* $OpenBSD: gss-serv-krb5.c,v 1.8 2013/07/20 01:55:13 djm Exp $ */ | ||
830 | |||
831 | /* | ||
832 | - * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | ||
833 | + * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. | ||
834 | * | ||
835 | * Redistribution and use in source and binary forms, with or without | ||
836 | * modification, are permitted provided that the following conditions | ||
837 | @@ -122,6 +122,7 @@ | ||
838 | OM_uint32 maj_status, min_status; | ||
839 | int len; | ||
840 | const char *errmsg; | ||
841 | + const char *new_ccname; | ||
842 | |||
843 | if (client->creds == NULL) { | ||
844 | debug("No credentials stored"); | ||
845 | @@ -174,11 +175,16 @@ | ||
846 | return; | ||
847 | } | ||
848 | |||
849 | - client->store.filename = xstrdup(krb5_cc_get_name(krb_context, ccache)); | ||
850 | + new_ccname = krb5_cc_get_name(krb_context, ccache); | ||
851 | + | ||
852 | client->store.envvar = "KRB5CCNAME"; | ||
853 | - len = strlen(client->store.filename) + 6; | ||
854 | - client->store.envval = xmalloc(len); | ||
855 | - snprintf(client->store.envval, len, "FILE:%s", client->store.filename); | ||
856 | +#ifdef USE_CCAPI | ||
857 | + xasprintf(&client->store.envval, "API:%s", new_ccname); | ||
858 | + client->store.filename = NULL; | ||
859 | +#else | ||
860 | + xasprintf(&client->store.envval, "FILE:%s", new_ccname); | ||
861 | + client->store.filename = xstrdup(new_ccname); | ||
862 | +#endif | ||
863 | |||
864 | #ifdef USE_PAM | ||
865 | if (options.use_pam) | ||
866 | @@ -190,6 +196,71 @@ | ||
867 | return; | ||
868 | } | ||
869 | |||
870 | +int | ||
871 | +ssh_gssapi_krb5_updatecreds(ssh_gssapi_ccache *store, | ||
872 | + ssh_gssapi_client *client) | ||
873 | +{ | ||
874 | + krb5_ccache ccache = NULL; | ||
875 | + krb5_principal principal = NULL; | ||
876 | + char *name = NULL; | ||
877 | + krb5_error_code problem; | ||
878 | + OM_uint32 maj_status, min_status; | ||
879 | + | ||
880 | + if ((problem = krb5_cc_resolve(krb_context, store->envval, &ccache))) { | ||
881 | + logit("krb5_cc_resolve(): %.100s", | ||
882 | + krb5_get_err_text(krb_context, problem)); | ||
883 | + return 0; | ||
884 | + } | ||
885 | + | ||
886 | + /* Find out who the principal in this cache is */ | ||
887 | + if ((problem = krb5_cc_get_principal(krb_context, ccache, | ||
888 | + &principal))) { | ||
889 | + logit("krb5_cc_get_principal(): %.100s", | ||
890 | + krb5_get_err_text(krb_context, problem)); | ||
891 | + krb5_cc_close(krb_context, ccache); | ||
892 | + return 0; | ||
893 | + } | ||
894 | + | ||
895 | + if ((problem = krb5_unparse_name(krb_context, principal, &name))) { | ||
896 | + logit("krb5_unparse_name(): %.100s", | ||
897 | + krb5_get_err_text(krb_context, problem)); | ||
898 | + krb5_free_principal(krb_context, principal); | ||
899 | + krb5_cc_close(krb_context, ccache); | ||
900 | + return 0; | ||
901 | + } | ||
902 | + | ||
903 | + | ||
904 | + if (strcmp(name,client->exportedname.value)!=0) { | ||
905 | + debug("Name in local credentials cache differs. Not storing"); | ||
906 | + krb5_free_principal(krb_context, principal); | ||
907 | + krb5_cc_close(krb_context, ccache); | ||
908 | + krb5_free_unparsed_name(krb_context, name); | ||
909 | + return 0; | ||
910 | + } | ||
911 | + krb5_free_unparsed_name(krb_context, name); | ||
912 | + | ||
913 | + /* Name matches, so lets get on with it! */ | ||
914 | + | ||
915 | + if ((problem = krb5_cc_initialize(krb_context, ccache, principal))) { | ||
916 | + logit("krb5_cc_initialize(): %.100s", | ||
917 | + krb5_get_err_text(krb_context, problem)); | ||
918 | + krb5_free_principal(krb_context, principal); | ||
919 | + krb5_cc_close(krb_context, ccache); | ||
920 | + return 0; | ||
921 | + } | ||
922 | + | ||
923 | + krb5_free_principal(krb_context, principal); | ||
924 | + | ||
925 | + if ((maj_status = gss_krb5_copy_ccache(&min_status, client->creds, | ||
926 | + ccache))) { | ||
927 | + logit("gss_krb5_copy_ccache() failed. Sorry!"); | ||
928 | + krb5_cc_close(krb_context, ccache); | ||
929 | + return 0; | ||
930 | + } | ||
931 | + | ||
932 | + return 1; | ||
933 | +} | ||
934 | + | ||
935 | ssh_gssapi_mech gssapi_kerberos_mech = { | ||
936 | "toWM5Slw5Ew8Mqkay+al2g==", | ||
937 | "Kerberos", | ||
938 | @@ -197,7 +268,8 @@ | ||
939 | NULL, | ||
940 | &ssh_gssapi_krb5_userok, | ||
941 | NULL, | ||
942 | - &ssh_gssapi_krb5_storecreds | ||
943 | + &ssh_gssapi_krb5_storecreds, | ||
944 | + &ssh_gssapi_krb5_updatecreds | ||
945 | }; | ||
946 | |||
947 | #endif /* KRB5 */ | ||
948 | Index: b/gss-serv.c | ||
949 | =================================================================== | ||
950 | --- a/gss-serv.c | ||
951 | +++ b/gss-serv.c | ||
952 | @@ -1,7 +1,7 @@ | ||
953 | /* $OpenBSD: gss-serv.c,v 1.24 2013/07/20 01:55:13 djm Exp $ */ | ||
954 | |||
955 | /* | ||
956 | - * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | ||
957 | + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. | ||
958 | * | ||
959 | * Redistribution and use in source and binary forms, with or without | ||
960 | * modification, are permitted provided that the following conditions | ||
961 | @@ -45,15 +45,21 @@ | ||
962 | #include "channels.h" | ||
963 | #include "session.h" | ||
964 | #include "misc.h" | ||
965 | +#include "servconf.h" | ||
966 | +#include "uidswap.h" | ||
967 | |||
968 | #include "ssh-gss.h" | ||
969 | +#include "monitor_wrap.h" | ||
970 | + | ||
971 | +extern ServerOptions options; | ||
972 | |||
973 | static ssh_gssapi_client gssapi_client = | ||
974 | { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, | ||
975 | - GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL, NULL}}; | ||
976 | + GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, | ||
977 | + {NULL, NULL, NULL, NULL, NULL}, 0, 0}; | ||
978 | |||
979 | ssh_gssapi_mech gssapi_null_mech = | ||
980 | - { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL}; | ||
981 | + { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL, NULL}; | ||
982 | |||
983 | #ifdef KRB5 | ||
984 | extern ssh_gssapi_mech gssapi_kerberos_mech; | ||
985 | @@ -81,25 +87,32 @@ | ||
986 | char lname[MAXHOSTNAMELEN]; | ||
987 | gss_OID_set oidset; | ||
988 | |||
989 | - gss_create_empty_oid_set(&status, &oidset); | ||
990 | - gss_add_oid_set_member(&status, ctx->oid, &oidset); | ||
991 | + if (options.gss_strict_acceptor) { | ||
992 | + gss_create_empty_oid_set(&status, &oidset); | ||
993 | + gss_add_oid_set_member(&status, ctx->oid, &oidset); | ||
994 | + | ||
995 | + if (gethostname(lname, MAXHOSTNAMELEN)) { | ||
996 | + gss_release_oid_set(&status, &oidset); | ||
997 | + return (-1); | ||
998 | + } | ||
999 | |||
1000 | - if (gethostname(lname, MAXHOSTNAMELEN)) { | ||
1001 | - gss_release_oid_set(&status, &oidset); | ||
1002 | - return (-1); | ||
1003 | - } | ||
1004 | + if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) { | ||
1005 | + gss_release_oid_set(&status, &oidset); | ||
1006 | + return (ctx->major); | ||
1007 | + } | ||
1008 | + | ||
1009 | + if ((ctx->major = gss_acquire_cred(&ctx->minor, | ||
1010 | + ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, | ||
1011 | + NULL, NULL))) | ||
1012 | + ssh_gssapi_error(ctx); | ||
1013 | |||
1014 | - if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) { | ||
1015 | gss_release_oid_set(&status, &oidset); | ||
1016 | return (ctx->major); | ||
1017 | + } else { | ||
1018 | + ctx->name = GSS_C_NO_NAME; | ||
1019 | + ctx->creds = GSS_C_NO_CREDENTIAL; | ||
1020 | } | ||
1021 | - | ||
1022 | - if ((ctx->major = gss_acquire_cred(&ctx->minor, | ||
1023 | - ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL))) | ||
1024 | - ssh_gssapi_error(ctx); | ||
1025 | - | ||
1026 | - gss_release_oid_set(&status, &oidset); | ||
1027 | - return (ctx->major); | ||
1028 | + return GSS_S_COMPLETE; | ||
1029 | } | ||
1030 | |||
1031 | /* Privileged */ | ||
1032 | @@ -114,6 +127,29 @@ | ||
1033 | } | ||
1034 | |||
1035 | /* Unprivileged */ | ||
1036 | +char * | ||
1037 | +ssh_gssapi_server_mechanisms() { | ||
1038 | + gss_OID_set supported; | ||
1039 | + | ||
1040 | + ssh_gssapi_supported_oids(&supported); | ||
1041 | + return (ssh_gssapi_kex_mechs(supported, &ssh_gssapi_server_check_mech, | ||
1042 | + NULL, NULL)); | ||
1043 | +} | ||
1044 | + | ||
1045 | +/* Unprivileged */ | ||
1046 | +int | ||
1047 | +ssh_gssapi_server_check_mech(Gssctxt **dum, gss_OID oid, const char *data, | ||
1048 | + const char *dummy) { | ||
1049 | + Gssctxt *ctx = NULL; | ||
1050 | + int res; | ||
1051 | + | ||
1052 | + res = !GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctx, oid))); | ||
1053 | + ssh_gssapi_delete_ctx(&ctx); | ||
1054 | + | ||
1055 | + return (res); | ||
1056 | +} | ||
1057 | + | ||
1058 | +/* Unprivileged */ | ||
1059 | void | ||
1060 | ssh_gssapi_supported_oids(gss_OID_set *oidset) | ||
1061 | { | ||
1062 | @@ -123,7 +159,9 @@ | ||
1063 | gss_OID_set supported; | ||
1064 | |||
1065 | gss_create_empty_oid_set(&min_status, oidset); | ||
1066 | - gss_indicate_mechs(&min_status, &supported); | ||
1067 | + | ||
1068 | + if (GSS_ERROR(gss_indicate_mechs(&min_status, &supported))) | ||
1069 | + return; | ||
1070 | |||
1071 | while (supported_mechs[i]->name != NULL) { | ||
1072 | if (GSS_ERROR(gss_test_oid_set_member(&min_status, | ||
1073 | @@ -249,8 +287,48 @@ | ||
1074 | ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client) | ||
1075 | { | ||
1076 | int i = 0; | ||
1077 | + int equal = 0; | ||
1078 | + gss_name_t new_name = GSS_C_NO_NAME; | ||
1079 | + gss_buffer_desc ename = GSS_C_EMPTY_BUFFER; | ||
1080 | + | ||
1081 | + if (options.gss_store_rekey && client->used && ctx->client_creds) { | ||
1082 | + if (client->mech->oid.length != ctx->oid->length || | ||
1083 | + (memcmp(client->mech->oid.elements, | ||
1084 | + ctx->oid->elements, ctx->oid->length) !=0)) { | ||
1085 | + debug("Rekeyed credentials have different mechanism"); | ||
1086 | + return GSS_S_COMPLETE; | ||
1087 | + } | ||
1088 | + | ||
1089 | + if ((ctx->major = gss_inquire_cred_by_mech(&ctx->minor, | ||
1090 | + ctx->client_creds, ctx->oid, &new_name, | ||
1091 | + NULL, NULL, NULL))) { | ||
1092 | + ssh_gssapi_error(ctx); | ||
1093 | + return (ctx->major); | ||
1094 | + } | ||
1095 | + | ||
1096 | + ctx->major = gss_compare_name(&ctx->minor, client->name, | ||
1097 | + new_name, &equal); | ||
1098 | |||
1099 | - gss_buffer_desc ename; | ||
1100 | + if (GSS_ERROR(ctx->major)) { | ||
1101 | + ssh_gssapi_error(ctx); | ||
1102 | + return (ctx->major); | ||
1103 | + } | ||
1104 | + | ||
1105 | + if (!equal) { | ||
1106 | + debug("Rekeyed credentials have different name"); | ||
1107 | + return GSS_S_COMPLETE; | ||
1108 | + } | ||
1109 | + | ||
1110 | + debug("Marking rekeyed credentials for export"); | ||
1111 | + | ||
1112 | + gss_release_name(&ctx->minor, &client->name); | ||
1113 | + gss_release_cred(&ctx->minor, &client->creds); | ||
1114 | + client->name = new_name; | ||
1115 | + client->creds = ctx->client_creds; | ||
1116 | + ctx->client_creds = GSS_C_NO_CREDENTIAL; | ||
1117 | + client->updated = 1; | ||
1118 | + return GSS_S_COMPLETE; | ||
1119 | + } | ||
1120 | |||
1121 | client->mech = NULL; | ||
1122 | |||
1123 | @@ -265,6 +343,13 @@ | ||
1124 | if (client->mech == NULL) | ||
1125 | return GSS_S_FAILURE; | ||
1126 | |||
1127 | + if (ctx->client_creds && | ||
1128 | + (ctx->major = gss_inquire_cred_by_mech(&ctx->minor, | ||
1129 | + ctx->client_creds, ctx->oid, &client->name, NULL, NULL, NULL))) { | ||
1130 | + ssh_gssapi_error(ctx); | ||
1131 | + return (ctx->major); | ||
1132 | + } | ||
1133 | + | ||
1134 | if ((ctx->major = gss_display_name(&ctx->minor, ctx->client, | ||
1135 | &client->displayname, NULL))) { | ||
1136 | ssh_gssapi_error(ctx); | ||
1137 | @@ -282,6 +367,8 @@ | ||
1138 | return (ctx->major); | ||
1139 | } | ||
1140 | |||
1141 | + gss_release_buffer(&ctx->minor, &ename); | ||
1142 | + | ||
1143 | /* We can't copy this structure, so we just move the pointer to it */ | ||
1144 | client->creds = ctx->client_creds; | ||
1145 | ctx->client_creds = GSS_C_NO_CREDENTIAL; | ||
1146 | @@ -329,7 +416,7 @@ | ||
1147 | |||
1148 | /* Privileged */ | ||
1149 | int | ||
1150 | -ssh_gssapi_userok(char *user) | ||
1151 | +ssh_gssapi_userok(char *user, struct passwd *pw) | ||
1152 | { | ||
1153 | OM_uint32 lmin; | ||
1154 | |||
1155 | @@ -339,9 +426,11 @@ | ||
1156 | return 0; | ||
1157 | } | ||
1158 | if (gssapi_client.mech && gssapi_client.mech->userok) | ||
1159 | - if ((*gssapi_client.mech->userok)(&gssapi_client, user)) | ||
1160 | + if ((*gssapi_client.mech->userok)(&gssapi_client, user)) { | ||
1161 | + gssapi_client.used = 1; | ||
1162 | + gssapi_client.store.owner = pw; | ||
1163 | return 1; | ||
1164 | - else { | ||
1165 | + } else { | ||
1166 | /* Destroy delegated credentials if userok fails */ | ||
1167 | gss_release_buffer(&lmin, &gssapi_client.displayname); | ||
1168 | gss_release_buffer(&lmin, &gssapi_client.exportedname); | ||
1169 | @@ -354,14 +443,90 @@ | ||
1170 | return (0); | ||
1171 | } | ||
1172 | |||
1173 | -/* Privileged */ | ||
1174 | -OM_uint32 | ||
1175 | -ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) | ||
1176 | +/* These bits are only used for rekeying. The unpriviledged child is running | ||
1177 | + * as the user, the monitor is root. | ||
1178 | + * | ||
1179 | + * In the child, we want to : | ||
1180 | + * *) Ask the monitor to store our credentials into the store we specify | ||
1181 | + * *) If it succeeds, maybe do a PAM update | ||
1182 | + */ | ||
1183 | + | ||
1184 | +/* Stuff for PAM */ | ||
1185 | + | ||
1186 | +#ifdef USE_PAM | ||
1187 | +static int ssh_gssapi_simple_conv(int n, const struct pam_message **msg, | ||
1188 | + struct pam_response **resp, void *data) | ||
1189 | { | ||
1190 | - ctx->major = gss_verify_mic(&ctx->minor, ctx->context, | ||
1191 | - gssbuf, gssmic, NULL); | ||
1192 | + return (PAM_CONV_ERR); | ||
1193 | +} | ||
1194 | +#endif | ||
1195 | |||
1196 | - return (ctx->major); | ||
1197 | +void | ||
1198 | +ssh_gssapi_rekey_creds() { | ||
1199 | + int ok; | ||
1200 | + int ret; | ||
1201 | +#ifdef USE_PAM | ||
1202 | + pam_handle_t *pamh = NULL; | ||
1203 | + struct pam_conv pamconv = {ssh_gssapi_simple_conv, NULL}; | ||
1204 | + char *envstr; | ||
1205 | +#endif | ||
1206 | + | ||
1207 | + if (gssapi_client.store.filename == NULL && | ||
1208 | + gssapi_client.store.envval == NULL && | ||
1209 | + gssapi_client.store.envvar == NULL) | ||
1210 | + return; | ||
1211 | + | ||
1212 | + ok = PRIVSEP(ssh_gssapi_update_creds(&gssapi_client.store)); | ||
1213 | + | ||
1214 | + if (!ok) | ||
1215 | + return; | ||
1216 | + | ||
1217 | + debug("Rekeyed credentials stored successfully"); | ||
1218 | + | ||
1219 | + /* Actually managing to play with the ssh pam stack from here will | ||
1220 | + * be next to impossible. In any case, we may want different options | ||
1221 | + * for rekeying. So, use our own :) | ||
1222 | + */ | ||
1223 | +#ifdef USE_PAM | ||
1224 | + if (!use_privsep) { | ||
1225 | + debug("Not even going to try and do PAM with privsep disabled"); | ||
1226 | + return; | ||
1227 | + } | ||
1228 | + | ||
1229 | + ret = pam_start("sshd-rekey", gssapi_client.store.owner->pw_name, | ||
1230 | + &pamconv, &pamh); | ||
1231 | + if (ret) | ||
1232 | + return; | ||
1233 | + | ||
1234 | + xasprintf(&envstr, "%s=%s", gssapi_client.store.envvar, | ||
1235 | + gssapi_client.store.envval); | ||
1236 | + | ||
1237 | + ret = pam_putenv(pamh, envstr); | ||
1238 | + if (!ret) | ||
1239 | + pam_setcred(pamh, PAM_REINITIALIZE_CRED); | ||
1240 | + pam_end(pamh, PAM_SUCCESS); | ||
1241 | +#endif | ||
1242 | +} | ||
1243 | + | ||
1244 | +int | ||
1245 | +ssh_gssapi_update_creds(ssh_gssapi_ccache *store) { | ||
1246 | + int ok = 0; | ||
1247 | + | ||
1248 | + /* Check we've got credentials to store */ | ||
1249 | + if (!gssapi_client.updated) | ||
1250 | + return 0; | ||
1251 | + | ||
1252 | + gssapi_client.updated = 0; | ||
1253 | + | ||
1254 | + temporarily_use_uid(gssapi_client.store.owner); | ||
1255 | + if (gssapi_client.mech && gssapi_client.mech->updatecreds) | ||
1256 | + ok = (*gssapi_client.mech->updatecreds)(store, &gssapi_client); | ||
1257 | + else | ||
1258 | + debug("No update function for this mechanism"); | ||
1259 | + | ||
1260 | + restore_uid(); | ||
1261 | + | ||
1262 | + return ok; | ||
1263 | } | ||
1264 | |||
1265 | #endif | ||
1266 | Index: b/kex.c | ||
1267 | =================================================================== | ||
1268 | --- a/kex.c | ||
1269 | +++ b/kex.c | ||
1270 | @@ -50,6 +50,10 @@ | ||
1271 | #include "monitor.h" | ||
1272 | #include "roaming.h" | ||
1273 | |||
1274 | +#ifdef GSSAPI | ||
1275 | +#include "ssh-gss.h" | ||
1276 | +#endif | ||
1277 | + | ||
1278 | #if OPENSSL_VERSION_NUMBER >= 0x00907000L | ||
1279 | # if defined(HAVE_EVP_SHA256) | ||
1280 | # define evp_ssh_sha256 EVP_sha256 | ||
1281 | @@ -82,6 +86,14 @@ | ||
1282 | #endif | ||
1283 | { NULL, -1, -1, NULL}, | ||
1284 | }; | ||
1285 | +static const struct kexalg kexalg_prefixes[] = { | ||
1286 | +#ifdef GSSAPI | ||
1287 | + { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, EVP_sha1 }, | ||
1288 | + { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, EVP_sha1 }, | ||
1289 | + { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, EVP_sha1 }, | ||
1290 | +#endif | ||
1291 | + { NULL, -1, -1, NULL }, | ||
1292 | +}; | ||
1293 | |||
1294 | char * | ||
1295 | kex_alg_list(void) | ||
1296 | @@ -110,6 +122,10 @@ | ||
1297 | if (strcmp(k->name, name) == 0) | ||
1298 | return k; | ||
1299 | } | ||
1300 | + for (k = kexalg_prefixes; k->name != NULL; k++) { | ||
1301 | + if (strncmp(k->name, name, strlen(k->name)) == 0) | ||
1302 | + return k; | ||
1303 | + } | ||
1304 | return NULL; | ||
1305 | } | ||
1306 | |||
1307 | Index: b/kex.h | ||
1308 | =================================================================== | ||
1309 | --- a/kex.h | ||
1310 | +++ b/kex.h | ||
1311 | @@ -74,6 +74,9 @@ | ||
1312 | KEX_DH_GEX_SHA1, | ||
1313 | KEX_DH_GEX_SHA256, | ||
1314 | KEX_ECDH_SHA2, | ||
1315 | + KEX_GSS_GRP1_SHA1, | ||
1316 | + KEX_GSS_GRP14_SHA1, | ||
1317 | + KEX_GSS_GEX_SHA1, | ||
1318 | KEX_MAX | ||
1319 | }; | ||
1320 | |||
1321 | @@ -133,6 +136,12 @@ | ||
1322 | int flags; | ||
1323 | const EVP_MD *evp_md; | ||
1324 | int ec_nid; | ||
1325 | +#ifdef GSSAPI | ||
1326 | + int gss_deleg_creds; | ||
1327 | + int gss_trust_dns; | ||
1328 | + char *gss_host; | ||
1329 | + char *gss_client; | ||
1330 | +#endif | ||
1331 | char *client_version_string; | ||
1332 | char *server_version_string; | ||
1333 | int (*verify_host_key)(Key *); | ||
1334 | @@ -162,6 +171,11 @@ | ||
1335 | void kexecdh_client(Kex *); | ||
1336 | void kexecdh_server(Kex *); | ||
1337 | |||
1338 | +#ifdef GSSAPI | ||
1339 | +void kexgss_client(Kex *); | ||
1340 | +void kexgss_server(Kex *); | ||
1341 | +#endif | ||
1342 | + | ||
1343 | void | ||
1344 | kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, | ||
1345 | BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); | ||
1346 | Index: b/kexgssc.c | ||
1347 | =================================================================== | ||
1348 | --- /dev/null | ||
1349 | +++ b/kexgssc.c | ||
1350 | @@ -0,0 +1,333 @@ | ||
1351 | +/* | ||
1352 | + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. | ||
1353 | + * | ||
1354 | + * Redistribution and use in source and binary forms, with or without | ||
1355 | + * modification, are permitted provided that the following conditions | ||
1356 | + * are met: | ||
1357 | + * 1. Redistributions of source code must retain the above copyright | ||
1358 | + * notice, this list of conditions and the following disclaimer. | ||
1359 | + * 2. Redistributions in binary form must reproduce the above copyright | ||
1360 | + * notice, this list of conditions and the following disclaimer in the | ||
1361 | + * documentation and/or other materials provided with the distribution. | ||
1362 | + * | ||
1363 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR | ||
1364 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
1365 | + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
1366 | + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
1367 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
1368 | + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1369 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1370 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1371 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
1372 | + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1373 | + */ | ||
1374 | + | ||
1375 | +#include "includes.h" | ||
1376 | + | ||
1377 | +#ifdef GSSAPI | ||
1378 | + | ||
1379 | +#include "includes.h" | ||
1380 | + | ||
1381 | +#include <openssl/crypto.h> | ||
1382 | +#include <openssl/bn.h> | ||
1383 | + | ||
1384 | +#include <string.h> | ||
1385 | + | ||
1386 | +#include "xmalloc.h" | ||
1387 | +#include "buffer.h" | ||
1388 | +#include "ssh2.h" | ||
1389 | +#include "key.h" | ||
1390 | +#include "cipher.h" | ||
1391 | +#include "kex.h" | ||
1392 | +#include "log.h" | ||
1393 | +#include "packet.h" | ||
1394 | +#include "dh.h" | ||
1395 | + | ||
1396 | +#include "ssh-gss.h" | ||
1397 | + | ||
1398 | +void | ||
1399 | +kexgss_client(Kex *kex) { | ||
1400 | + gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER; | ||
1401 | + gss_buffer_desc recv_tok, gssbuf, msg_tok, *token_ptr; | ||
1402 | + Gssctxt *ctxt; | ||
1403 | + OM_uint32 maj_status, min_status, ret_flags; | ||
1404 | + u_int klen, kout, slen = 0, hashlen, strlen; | ||
1405 | + DH *dh; | ||
1406 | + BIGNUM *dh_server_pub = NULL; | ||
1407 | + BIGNUM *shared_secret = NULL; | ||
1408 | + BIGNUM *p = NULL; | ||
1409 | + BIGNUM *g = NULL; | ||
1410 | + u_char *kbuf, *hash; | ||
1411 | + u_char *serverhostkey = NULL; | ||
1412 | + u_char *empty = ""; | ||
1413 | + char *msg; | ||
1414 | + char *lang; | ||
1415 | + int type = 0; | ||
1416 | + int first = 1; | ||
1417 | + int nbits = 0, min = DH_GRP_MIN, max = DH_GRP_MAX; | ||
1418 | + | ||
1419 | + /* Initialise our GSSAPI world */ | ||
1420 | + ssh_gssapi_build_ctx(&ctxt); | ||
1421 | + if (ssh_gssapi_id_kex(ctxt, kex->name, kex->kex_type) | ||
1422 | + == GSS_C_NO_OID) | ||
1423 | + fatal("Couldn't identify host exchange"); | ||
1424 | + | ||
1425 | + if (ssh_gssapi_import_name(ctxt, kex->gss_host)) | ||
1426 | + fatal("Couldn't import hostname"); | ||
1427 | + | ||
1428 | + if (kex->gss_client && | ||
1429 | + ssh_gssapi_client_identity(ctxt, kex->gss_client)) | ||
1430 | + fatal("Couldn't acquire client credentials"); | ||
1431 | + | ||
1432 | + switch (kex->kex_type) { | ||
1433 | + case KEX_GSS_GRP1_SHA1: | ||
1434 | + dh = dh_new_group1(); | ||
1435 | + break; | ||
1436 | + case KEX_GSS_GRP14_SHA1: | ||
1437 | + dh = dh_new_group14(); | ||
1438 | + break; | ||
1439 | + case KEX_GSS_GEX_SHA1: | ||
1440 | + debug("Doing group exchange\n"); | ||
1441 | + nbits = dh_estimate(kex->we_need * 8); | ||
1442 | + packet_start(SSH2_MSG_KEXGSS_GROUPREQ); | ||
1443 | + packet_put_int(min); | ||
1444 | + packet_put_int(nbits); | ||
1445 | + packet_put_int(max); | ||
1446 | + | ||
1447 | + packet_send(); | ||
1448 | + | ||
1449 | + packet_read_expect(SSH2_MSG_KEXGSS_GROUP); | ||
1450 | + | ||
1451 | + if ((p = BN_new()) == NULL) | ||
1452 | + fatal("BN_new() failed"); | ||
1453 | + packet_get_bignum2(p); | ||
1454 | + if ((g = BN_new()) == NULL) | ||
1455 | + fatal("BN_new() failed"); | ||
1456 | + packet_get_bignum2(g); | ||
1457 | + packet_check_eom(); | ||
1458 | + | ||
1459 | + if (BN_num_bits(p) < min || BN_num_bits(p) > max) | ||
1460 | + fatal("GSSGRP_GEX group out of range: %d !< %d !< %d", | ||
1461 | + min, BN_num_bits(p), max); | ||
1462 | + | ||
1463 | + dh = dh_new_group(g, p); | ||
1464 | + break; | ||
1465 | + default: | ||
1466 | + fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); | ||
1467 | + } | ||
1468 | + | ||
1469 | + /* Step 1 - e is dh->pub_key */ | ||
1470 | + dh_gen_key(dh, kex->we_need * 8); | ||
1471 | + | ||
1472 | + /* This is f, we initialise it now to make life easier */ | ||
1473 | + dh_server_pub = BN_new(); | ||
1474 | + if (dh_server_pub == NULL) | ||
1475 | + fatal("dh_server_pub == NULL"); | ||
1476 | + | ||
1477 | + token_ptr = GSS_C_NO_BUFFER; | ||
1478 | + | ||
1479 | + do { | ||
1480 | + debug("Calling gss_init_sec_context"); | ||
1481 | + | ||
1482 | + maj_status = ssh_gssapi_init_ctx(ctxt, | ||
1483 | + kex->gss_deleg_creds, token_ptr, &send_tok, | ||
1484 | + &ret_flags); | ||
1485 | + | ||
1486 | + if (GSS_ERROR(maj_status)) { | ||
1487 | + if (send_tok.length != 0) { | ||
1488 | + packet_start(SSH2_MSG_KEXGSS_CONTINUE); | ||
1489 | + packet_put_string(send_tok.value, | ||
1490 | + send_tok.length); | ||
1491 | + } | ||
1492 | + fatal("gss_init_context failed"); | ||
1493 | + } | ||
1494 | + | ||
1495 | + /* If we've got an old receive buffer get rid of it */ | ||
1496 | + if (token_ptr != GSS_C_NO_BUFFER) | ||
1497 | + free(recv_tok.value); | ||
1498 | + | ||
1499 | + if (maj_status == GSS_S_COMPLETE) { | ||
1500 | + /* If mutual state flag is not true, kex fails */ | ||
1501 | + if (!(ret_flags & GSS_C_MUTUAL_FLAG)) | ||
1502 | + fatal("Mutual authentication failed"); | ||
1503 | + | ||
1504 | + /* If integ avail flag is not true kex fails */ | ||
1505 | + if (!(ret_flags & GSS_C_INTEG_FLAG)) | ||
1506 | + fatal("Integrity check failed"); | ||
1507 | + } | ||
1508 | + | ||
1509 | + /* | ||
1510 | + * If we have data to send, then the last message that we | ||
1511 | + * received cannot have been a 'complete'. | ||
1512 | + */ | ||
1513 | + if (send_tok.length != 0) { | ||
1514 | + if (first) { | ||
1515 | + packet_start(SSH2_MSG_KEXGSS_INIT); | ||
1516 | + packet_put_string(send_tok.value, | ||
1517 | + send_tok.length); | ||
1518 | + packet_put_bignum2(dh->pub_key); | ||
1519 | + first = 0; | ||
1520 | + } else { | ||
1521 | + packet_start(SSH2_MSG_KEXGSS_CONTINUE); | ||
1522 | + packet_put_string(send_tok.value, | ||
1523 | + send_tok.length); | ||
1524 | + } | ||
1525 | + packet_send(); | ||
1526 | + gss_release_buffer(&min_status, &send_tok); | ||
1527 | + | ||
1528 | + /* If we've sent them data, they should reply */ | ||
1529 | + do { | ||
1530 | + type = packet_read(); | ||
1531 | + if (type == SSH2_MSG_KEXGSS_HOSTKEY) { | ||
1532 | + debug("Received KEXGSS_HOSTKEY"); | ||
1533 | + if (serverhostkey) | ||
1534 | + fatal("Server host key received more than once"); | ||
1535 | + serverhostkey = | ||
1536 | + packet_get_string(&slen); | ||
1537 | + } | ||
1538 | + } while (type == SSH2_MSG_KEXGSS_HOSTKEY); | ||
1539 | + | ||
1540 | + switch (type) { | ||
1541 | + case SSH2_MSG_KEXGSS_CONTINUE: | ||
1542 | + debug("Received GSSAPI_CONTINUE"); | ||
1543 | + if (maj_status == GSS_S_COMPLETE) | ||
1544 | + fatal("GSSAPI Continue received from server when complete"); | ||
1545 | + recv_tok.value = packet_get_string(&strlen); | ||
1546 | + recv_tok.length = strlen; | ||
1547 | + break; | ||
1548 | + case SSH2_MSG_KEXGSS_COMPLETE: | ||
1549 | + debug("Received GSSAPI_COMPLETE"); | ||
1550 | + packet_get_bignum2(dh_server_pub); | ||
1551 | + msg_tok.value = packet_get_string(&strlen); | ||
1552 | + msg_tok.length = strlen; | ||
1553 | + | ||
1554 | + /* Is there a token included? */ | ||
1555 | + if (packet_get_char()) { | ||
1556 | + recv_tok.value= | ||
1557 | + packet_get_string(&strlen); | ||
1558 | + recv_tok.length = strlen; | ||
1559 | + /* If we're already complete - protocol error */ | ||
1560 | + if (maj_status == GSS_S_COMPLETE) | ||
1561 | + packet_disconnect("Protocol error: received token when complete"); | ||
1562 | + } else { | ||
1563 | + /* No token included */ | ||
1564 | + if (maj_status != GSS_S_COMPLETE) | ||
1565 | + packet_disconnect("Protocol error: did not receive final token"); | ||
1566 | + } | ||
1567 | + break; | ||
1568 | + case SSH2_MSG_KEXGSS_ERROR: | ||
1569 | + debug("Received Error"); | ||
1570 | + maj_status = packet_get_int(); | ||
1571 | + min_status = packet_get_int(); | ||
1572 | + msg = packet_get_string(NULL); | ||
1573 | + lang = packet_get_string(NULL); | ||
1574 | + fatal("GSSAPI Error: \n%.400s",msg); | ||
1575 | + default: | ||
1576 | + packet_disconnect("Protocol error: didn't expect packet type %d", | ||
1577 | + type); | ||
1578 | + } | ||
1579 | + token_ptr = &recv_tok; | ||
1580 | + } else { | ||
1581 | + /* No data, and not complete */ | ||
1582 | + if (maj_status != GSS_S_COMPLETE) | ||
1583 | + fatal("Not complete, and no token output"); | ||
1584 | + } | ||
1585 | + } while (maj_status & GSS_S_CONTINUE_NEEDED); | ||
1586 | + | ||
1587 | + /* | ||
1588 | + * We _must_ have received a COMPLETE message in reply from the | ||
1589 | + * server, which will have set dh_server_pub and msg_tok | ||
1590 | + */ | ||
1591 | + | ||
1592 | + if (type != SSH2_MSG_KEXGSS_COMPLETE) | ||
1593 | + fatal("Didn't receive a SSH2_MSG_KEXGSS_COMPLETE when I expected it"); | ||
1594 | + | ||
1595 | + /* Check f in range [1, p-1] */ | ||
1596 | + if (!dh_pub_is_valid(dh, dh_server_pub)) | ||
1597 | + packet_disconnect("bad server public DH value"); | ||
1598 | + | ||
1599 | + /* compute K=f^x mod p */ | ||
1600 | + klen = DH_size(dh); | ||
1601 | + kbuf = xmalloc(klen); | ||
1602 | + kout = DH_compute_key(kbuf, dh_server_pub, dh); | ||
1603 | + if (kout < 0) | ||
1604 | + fatal("DH_compute_key: failed"); | ||
1605 | + | ||
1606 | + shared_secret = BN_new(); | ||
1607 | + if (shared_secret == NULL) | ||
1608 | + fatal("kexgss_client: BN_new failed"); | ||
1609 | + | ||
1610 | + if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) | ||
1611 | + fatal("kexdh_client: BN_bin2bn failed"); | ||
1612 | + | ||
1613 | + memset(kbuf, 0, klen); | ||
1614 | + free(kbuf); | ||
1615 | + | ||
1616 | + switch (kex->kex_type) { | ||
1617 | + case KEX_GSS_GRP1_SHA1: | ||
1618 | + case KEX_GSS_GRP14_SHA1: | ||
1619 | + kex_dh_hash( kex->client_version_string, | ||
1620 | + kex->server_version_string, | ||
1621 | + buffer_ptr(&kex->my), buffer_len(&kex->my), | ||
1622 | + buffer_ptr(&kex->peer), buffer_len(&kex->peer), | ||
1623 | + (serverhostkey ? serverhostkey : empty), slen, | ||
1624 | + dh->pub_key, /* e */ | ||
1625 | + dh_server_pub, /* f */ | ||
1626 | + shared_secret, /* K */ | ||
1627 | + &hash, &hashlen | ||
1628 | + ); | ||
1629 | + break; | ||
1630 | + case KEX_GSS_GEX_SHA1: | ||
1631 | + kexgex_hash( | ||
1632 | + kex->evp_md, | ||
1633 | + kex->client_version_string, | ||
1634 | + kex->server_version_string, | ||
1635 | + buffer_ptr(&kex->my), buffer_len(&kex->my), | ||
1636 | + buffer_ptr(&kex->peer), buffer_len(&kex->peer), | ||
1637 | + (serverhostkey ? serverhostkey : empty), slen, | ||
1638 | + min, nbits, max, | ||
1639 | + dh->p, dh->g, | ||
1640 | + dh->pub_key, | ||
1641 | + dh_server_pub, | ||
1642 | + shared_secret, | ||
1643 | + &hash, &hashlen | ||
1644 | + ); | ||
1645 | + break; | ||
1646 | + default: | ||
1647 | + fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); | ||
1648 | + } | ||
1649 | + | ||
1650 | + gssbuf.value = hash; | ||
1651 | + gssbuf.length = hashlen; | ||
1652 | + | ||
1653 | + /* Verify that the hash matches the MIC we just got. */ | ||
1654 | + if (GSS_ERROR(ssh_gssapi_checkmic(ctxt, &gssbuf, &msg_tok))) | ||
1655 | + packet_disconnect("Hash's MIC didn't verify"); | ||
1656 | + | ||
1657 | + free(msg_tok.value); | ||
1658 | + | ||
1659 | + DH_free(dh); | ||
1660 | + free(serverhostkey); | ||
1661 | + BN_clear_free(dh_server_pub); | ||
1662 | + | ||
1663 | + /* save session id */ | ||
1664 | + if (kex->session_id == NULL) { | ||
1665 | + kex->session_id_len = hashlen; | ||
1666 | + kex->session_id = xmalloc(kex->session_id_len); | ||
1667 | + memcpy(kex->session_id, hash, kex->session_id_len); | ||
1668 | + } | ||
1669 | + | ||
1670 | + if (kex->gss_deleg_creds) | ||
1671 | + ssh_gssapi_credentials_updated(ctxt); | ||
1672 | + | ||
1673 | + if (gss_kex_context == NULL) | ||
1674 | + gss_kex_context = ctxt; | ||
1675 | + else | ||
1676 | + ssh_gssapi_delete_ctx(&ctxt); | ||
1677 | + | ||
1678 | + kex_derive_keys(kex, hash, hashlen, shared_secret); | ||
1679 | + BN_clear_free(shared_secret); | ||
1680 | + kex_finish(kex); | ||
1681 | +} | ||
1682 | + | ||
1683 | +#endif /* GSSAPI */ | ||
1684 | Index: b/kexgsss.c | ||
1685 | =================================================================== | ||
1686 | --- /dev/null | ||
1687 | +++ b/kexgsss.c | ||
1688 | @@ -0,0 +1,289 @@ | ||
1689 | +/* | ||
1690 | + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. | ||
1691 | + * | ||
1692 | + * Redistribution and use in source and binary forms, with or without | ||
1693 | + * modification, are permitted provided that the following conditions | ||
1694 | + * are met: | ||
1695 | + * 1. Redistributions of source code must retain the above copyright | ||
1696 | + * notice, this list of conditions and the following disclaimer. | ||
1697 | + * 2. Redistributions in binary form must reproduce the above copyright | ||
1698 | + * notice, this list of conditions and the following disclaimer in the | ||
1699 | + * documentation and/or other materials provided with the distribution. | ||
1700 | + * | ||
1701 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR | ||
1702 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
1703 | + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
1704 | + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
1705 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
1706 | + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1707 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1708 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1709 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
1710 | + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1711 | + */ | ||
1712 | + | ||
1713 | +#include "includes.h" | ||
1714 | + | ||
1715 | +#ifdef GSSAPI | ||
1716 | + | ||
1717 | +#include <string.h> | ||
1718 | + | ||
1719 | +#include <openssl/crypto.h> | ||
1720 | +#include <openssl/bn.h> | ||
1721 | + | ||
1722 | +#include "xmalloc.h" | ||
1723 | +#include "buffer.h" | ||
1724 | +#include "ssh2.h" | ||
1725 | +#include "key.h" | ||
1726 | +#include "cipher.h" | ||
1727 | +#include "kex.h" | ||
1728 | +#include "log.h" | ||
1729 | +#include "packet.h" | ||
1730 | +#include "dh.h" | ||
1731 | +#include "ssh-gss.h" | ||
1732 | +#include "monitor_wrap.h" | ||
1733 | +#include "servconf.h" | ||
1734 | + | ||
1735 | +extern ServerOptions options; | ||
1736 | + | ||
1737 | +void | ||
1738 | +kexgss_server(Kex *kex) | ||
1739 | +{ | ||
1740 | + OM_uint32 maj_status, min_status; | ||
1741 | + | ||
1742 | + /* | ||
1743 | + * Some GSSAPI implementations use the input value of ret_flags (an | ||
1744 | + * output variable) as a means of triggering mechanism specific | ||
1745 | + * features. Initializing it to zero avoids inadvertently | ||
1746 | + * activating this non-standard behaviour. | ||
1747 | + */ | ||
1748 | + | ||
1749 | + OM_uint32 ret_flags = 0; | ||
1750 | + gss_buffer_desc gssbuf, recv_tok, msg_tok; | ||
1751 | + gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER; | ||
1752 | + Gssctxt *ctxt = NULL; | ||
1753 | + u_int slen, klen, kout, hashlen; | ||
1754 | + u_char *kbuf, *hash; | ||
1755 | + DH *dh; | ||
1756 | + int min = -1, max = -1, nbits = -1; | ||
1757 | + BIGNUM *shared_secret = NULL; | ||
1758 | + BIGNUM *dh_client_pub = NULL; | ||
1759 | + int type = 0; | ||
1760 | + gss_OID oid; | ||
1761 | + char *mechs; | ||
1762 | + | ||
1763 | + /* Initialise GSSAPI */ | ||
1764 | + | ||
1765 | + /* If we're rekeying, privsep means that some of the private structures | ||
1766 | + * in the GSSAPI code are no longer available. This kludges them back | ||
1767 | + * into life | ||
1768 | + */ | ||
1769 | + if (!ssh_gssapi_oid_table_ok()) { | ||
1770 | + mechs = ssh_gssapi_server_mechanisms(); | ||
1771 | + free(mechs); | ||
1772 | + } | ||
1773 | + | ||
1774 | + debug2("%s: Identifying %s", __func__, kex->name); | ||
1775 | + oid = ssh_gssapi_id_kex(NULL, kex->name, kex->kex_type); | ||
1776 | + if (oid == GSS_C_NO_OID) | ||
1777 | + fatal("Unknown gssapi mechanism"); | ||
1778 | + | ||
1779 | + debug2("%s: Acquiring credentials", __func__); | ||
1780 | + | ||
1781 | + if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, oid)))) | ||
1782 | + fatal("Unable to acquire credentials for the server"); | ||
1783 | + | ||
1784 | + switch (kex->kex_type) { | ||
1785 | + case KEX_GSS_GRP1_SHA1: | ||
1786 | + dh = dh_new_group1(); | ||
1787 | + break; | ||
1788 | + case KEX_GSS_GRP14_SHA1: | ||
1789 | + dh = dh_new_group14(); | ||
1790 | + break; | ||
1791 | + case KEX_GSS_GEX_SHA1: | ||
1792 | + debug("Doing group exchange"); | ||
1793 | + packet_read_expect(SSH2_MSG_KEXGSS_GROUPREQ); | ||
1794 | + min = packet_get_int(); | ||
1795 | + nbits = packet_get_int(); | ||
1796 | + max = packet_get_int(); | ||
1797 | + min = MAX(DH_GRP_MIN, min); | ||
1798 | + max = MIN(DH_GRP_MAX, max); | ||
1799 | + packet_check_eom(); | ||
1800 | + if (max < min || nbits < min || max < nbits) | ||
1801 | + fatal("GSS_GEX, bad parameters: %d !< %d !< %d", | ||
1802 | + min, nbits, max); | ||
1803 | + dh = PRIVSEP(choose_dh(min, nbits, max)); | ||
1804 | + if (dh == NULL) | ||
1805 | + packet_disconnect("Protocol error: no matching group found"); | ||
1806 | + | ||
1807 | + packet_start(SSH2_MSG_KEXGSS_GROUP); | ||
1808 | + packet_put_bignum2(dh->p); | ||
1809 | + packet_put_bignum2(dh->g); | ||
1810 | + packet_send(); | ||
1811 | + | ||
1812 | + packet_write_wait(); | ||
1813 | + break; | ||
1814 | + default: | ||
1815 | + fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); | ||
1816 | + } | ||
1817 | + | ||
1818 | + dh_gen_key(dh, kex->we_need * 8); | ||
1819 | + | ||
1820 | + do { | ||
1821 | + debug("Wait SSH2_MSG_GSSAPI_INIT"); | ||
1822 | + type = packet_read(); | ||
1823 | + switch(type) { | ||
1824 | + case SSH2_MSG_KEXGSS_INIT: | ||
1825 | + if (dh_client_pub != NULL) | ||
1826 | + fatal("Received KEXGSS_INIT after initialising"); | ||
1827 | + recv_tok.value = packet_get_string(&slen); | ||
1828 | + recv_tok.length = slen; | ||
1829 | + | ||
1830 | + if ((dh_client_pub = BN_new()) == NULL) | ||
1831 | + fatal("dh_client_pub == NULL"); | ||
1832 | + | ||
1833 | + packet_get_bignum2(dh_client_pub); | ||
1834 | + | ||
1835 | + /* Send SSH_MSG_KEXGSS_HOSTKEY here, if we want */ | ||
1836 | + break; | ||
1837 | + case SSH2_MSG_KEXGSS_CONTINUE: | ||
1838 | + recv_tok.value = packet_get_string(&slen); | ||
1839 | + recv_tok.length = slen; | ||
1840 | + break; | ||
1841 | + default: | ||
1842 | + packet_disconnect( | ||
1843 | + "Protocol error: didn't expect packet type %d", | ||
1844 | + type); | ||
1845 | + } | ||
1846 | + | ||
1847 | + maj_status = PRIVSEP(ssh_gssapi_accept_ctx(ctxt, &recv_tok, | ||
1848 | + &send_tok, &ret_flags)); | ||
1849 | + | ||
1850 | + free(recv_tok.value); | ||
1851 | + | ||
1852 | + if (maj_status != GSS_S_COMPLETE && send_tok.length == 0) | ||
1853 | + fatal("Zero length token output when incomplete"); | ||
1854 | + | ||
1855 | + if (dh_client_pub == NULL) | ||
1856 | + fatal("No client public key"); | ||
1857 | + | ||
1858 | + if (maj_status & GSS_S_CONTINUE_NEEDED) { | ||
1859 | + debug("Sending GSSAPI_CONTINUE"); | ||
1860 | + packet_start(SSH2_MSG_KEXGSS_CONTINUE); | ||
1861 | + packet_put_string(send_tok.value, send_tok.length); | ||
1862 | + packet_send(); | ||
1863 | + gss_release_buffer(&min_status, &send_tok); | ||
1864 | + } | ||
1865 | + } while (maj_status & GSS_S_CONTINUE_NEEDED); | ||
1866 | + | ||
1867 | + if (GSS_ERROR(maj_status)) { | ||
1868 | + if (send_tok.length > 0) { | ||
1869 | + packet_start(SSH2_MSG_KEXGSS_CONTINUE); | ||
1870 | + packet_put_string(send_tok.value, send_tok.length); | ||
1871 | + packet_send(); | ||
1872 | + } | ||
1873 | + fatal("accept_ctx died"); | ||
1874 | + } | ||
1875 | + | ||
1876 | + if (!(ret_flags & GSS_C_MUTUAL_FLAG)) | ||
1877 | + fatal("Mutual Authentication flag wasn't set"); | ||
1878 | + | ||
1879 | + if (!(ret_flags & GSS_C_INTEG_FLAG)) | ||
1880 | + fatal("Integrity flag wasn't set"); | ||
1881 | + | ||
1882 | + if (!dh_pub_is_valid(dh, dh_client_pub)) | ||
1883 | + packet_disconnect("bad client public DH value"); | ||
1884 | + | ||
1885 | + klen = DH_size(dh); | ||
1886 | + kbuf = xmalloc(klen); | ||
1887 | + kout = DH_compute_key(kbuf, dh_client_pub, dh); | ||
1888 | + if (kout < 0) | ||
1889 | + fatal("DH_compute_key: failed"); | ||
1890 | + | ||
1891 | + shared_secret = BN_new(); | ||
1892 | + if (shared_secret == NULL) | ||
1893 | + fatal("kexgss_server: BN_new failed"); | ||
1894 | + | ||
1895 | + if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) | ||
1896 | + fatal("kexgss_server: BN_bin2bn failed"); | ||
1897 | + | ||
1898 | + memset(kbuf, 0, klen); | ||
1899 | + free(kbuf); | ||
1900 | + | ||
1901 | + switch (kex->kex_type) { | ||
1902 | + case KEX_GSS_GRP1_SHA1: | ||
1903 | + case KEX_GSS_GRP14_SHA1: | ||
1904 | + kex_dh_hash( | ||
1905 | + kex->client_version_string, kex->server_version_string, | ||
1906 | + buffer_ptr(&kex->peer), buffer_len(&kex->peer), | ||
1907 | + buffer_ptr(&kex->my), buffer_len(&kex->my), | ||
1908 | + NULL, 0, /* Change this if we start sending host keys */ | ||
1909 | + dh_client_pub, dh->pub_key, shared_secret, | ||
1910 | + &hash, &hashlen | ||
1911 | + ); | ||
1912 | + break; | ||
1913 | + case KEX_GSS_GEX_SHA1: | ||
1914 | + kexgex_hash( | ||
1915 | + kex->evp_md, | ||
1916 | + kex->client_version_string, kex->server_version_string, | ||
1917 | + buffer_ptr(&kex->peer), buffer_len(&kex->peer), | ||
1918 | + buffer_ptr(&kex->my), buffer_len(&kex->my), | ||
1919 | + NULL, 0, | ||
1920 | + min, nbits, max, | ||
1921 | + dh->p, dh->g, | ||
1922 | + dh_client_pub, | ||
1923 | + dh->pub_key, | ||
1924 | + shared_secret, | ||
1925 | + &hash, &hashlen | ||
1926 | + ); | ||
1927 | + break; | ||
1928 | + default: | ||
1929 | + fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); | ||
1930 | + } | ||
1931 | + | ||
1932 | + BN_clear_free(dh_client_pub); | ||
1933 | + | ||
1934 | + if (kex->session_id == NULL) { | ||
1935 | + kex->session_id_len = hashlen; | ||
1936 | + kex->session_id = xmalloc(kex->session_id_len); | ||
1937 | + memcpy(kex->session_id, hash, kex->session_id_len); | ||
1938 | + } | ||
1939 | + | ||
1940 | + gssbuf.value = hash; | ||
1941 | + gssbuf.length = hashlen; | ||
1942 | + | ||
1943 | + if (GSS_ERROR(PRIVSEP(ssh_gssapi_sign(ctxt,&gssbuf,&msg_tok)))) | ||
1944 | + fatal("Couldn't get MIC"); | ||
1945 | + | ||
1946 | + packet_start(SSH2_MSG_KEXGSS_COMPLETE); | ||
1947 | + packet_put_bignum2(dh->pub_key); | ||
1948 | + packet_put_string(msg_tok.value,msg_tok.length); | ||
1949 | + | ||
1950 | + if (send_tok.length != 0) { | ||
1951 | + packet_put_char(1); /* true */ | ||
1952 | + packet_put_string(send_tok.value, send_tok.length); | ||
1953 | + } else { | ||
1954 | + packet_put_char(0); /* false */ | ||
1955 | + } | ||
1956 | + packet_send(); | ||
1957 | + | ||
1958 | + gss_release_buffer(&min_status, &send_tok); | ||
1959 | + gss_release_buffer(&min_status, &msg_tok); | ||
1960 | + | ||
1961 | + if (gss_kex_context == NULL) | ||
1962 | + gss_kex_context = ctxt; | ||
1963 | + else | ||
1964 | + ssh_gssapi_delete_ctx(&ctxt); | ||
1965 | + | ||
1966 | + DH_free(dh); | ||
1967 | + | ||
1968 | + kex_derive_keys(kex, hash, hashlen, shared_secret); | ||
1969 | + BN_clear_free(shared_secret); | ||
1970 | + kex_finish(kex); | ||
1971 | + | ||
1972 | + /* If this was a rekey, then save out any delegated credentials we | ||
1973 | + * just exchanged. */ | ||
1974 | + if (options.gss_store_rekey) | ||
1975 | + ssh_gssapi_rekey_creds(); | ||
1976 | +} | ||
1977 | +#endif /* GSSAPI */ | ||
1978 | Index: b/key.c | ||
1979 | =================================================================== | ||
1980 | --- a/key.c | ||
1981 | +++ b/key.c | ||
1982 | @@ -933,6 +933,7 @@ | ||
1983 | KEY_RSA_CERT_V00, 0, 1 }, | ||
1984 | { "ssh-dss-cert-v00@openssh.com", "DSA-CERT-V00", | ||
1985 | KEY_DSA_CERT_V00, 0, 1 }, | ||
1986 | + { "null", "null", KEY_NULL, 0, 0 }, | ||
1987 | { NULL, NULL, -1, -1, 0 } | ||
1988 | }; | ||
1989 | |||
1990 | Index: b/key.h | ||
1991 | =================================================================== | ||
1992 | --- a/key.h | ||
1993 | +++ b/key.h | ||
1994 | @@ -44,6 +44,7 @@ | ||
1995 | KEY_ECDSA_CERT, | ||
1996 | KEY_RSA_CERT_V00, | ||
1997 | KEY_DSA_CERT_V00, | ||
1998 | + KEY_NULL, | ||
1999 | KEY_UNSPEC | ||
2000 | }; | ||
2001 | enum fp_type { | ||
2002 | Index: b/monitor.c | ||
2003 | =================================================================== | ||
2004 | --- a/monitor.c | ||
2005 | +++ b/monitor.c | ||
2006 | @@ -181,6 +181,8 @@ | ||
2007 | int mm_answer_gss_accept_ctx(int, Buffer *); | ||
2008 | int mm_answer_gss_userok(int, Buffer *); | ||
2009 | int mm_answer_gss_checkmic(int, Buffer *); | ||
2010 | +int mm_answer_gss_sign(int, Buffer *); | ||
2011 | +int mm_answer_gss_updatecreds(int, Buffer *); | ||
2012 | #endif | ||
2013 | |||
2014 | #ifdef SSH_AUDIT_EVENTS | ||
2015 | @@ -253,6 +255,7 @@ | ||
2016 | {MONITOR_REQ_GSSSTEP, MON_ISAUTH, mm_answer_gss_accept_ctx}, | ||
2017 | {MONITOR_REQ_GSSUSEROK, MON_AUTH, mm_answer_gss_userok}, | ||
2018 | {MONITOR_REQ_GSSCHECKMIC, MON_ISAUTH, mm_answer_gss_checkmic}, | ||
2019 | + {MONITOR_REQ_GSSSIGN, MON_ONCE, mm_answer_gss_sign}, | ||
2020 | #endif | ||
2021 | #ifdef JPAKE | ||
2022 | {MONITOR_REQ_JPAKE_GET_PWDATA, MON_ONCE, mm_answer_jpake_get_pwdata}, | ||
2023 | @@ -265,6 +268,12 @@ | ||
2024 | }; | ||
2025 | |||
2026 | struct mon_table mon_dispatch_postauth20[] = { | ||
2027 | +#ifdef GSSAPI | ||
2028 | + {MONITOR_REQ_GSSSETUP, 0, mm_answer_gss_setup_ctx}, | ||
2029 | + {MONITOR_REQ_GSSSTEP, 0, mm_answer_gss_accept_ctx}, | ||
2030 | + {MONITOR_REQ_GSSSIGN, 0, mm_answer_gss_sign}, | ||
2031 | + {MONITOR_REQ_GSSUPCREDS, 0, mm_answer_gss_updatecreds}, | ||
2032 | +#endif | ||
2033 | {MONITOR_REQ_MODULI, 0, mm_answer_moduli}, | ||
2034 | {MONITOR_REQ_SIGN, 0, mm_answer_sign}, | ||
2035 | {MONITOR_REQ_PTY, 0, mm_answer_pty}, | ||
2036 | @@ -373,6 +382,10 @@ | ||
2037 | /* Permit requests for moduli and signatures */ | ||
2038 | monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); | ||
2039 | monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); | ||
2040 | +#ifdef GSSAPI | ||
2041 | + /* and for the GSSAPI key exchange */ | ||
2042 | + monitor_permit(mon_dispatch, MONITOR_REQ_GSSSETUP, 1); | ||
2043 | +#endif | ||
2044 | } else { | ||
2045 | mon_dispatch = mon_dispatch_proto15; | ||
2046 | |||
2047 | @@ -487,6 +500,10 @@ | ||
2048 | monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); | ||
2049 | monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); | ||
2050 | monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); | ||
2051 | +#ifdef GSSAPI | ||
2052 | + /* and for the GSSAPI key exchange */ | ||
2053 | + monitor_permit(mon_dispatch, MONITOR_REQ_GSSSETUP, 1); | ||
2054 | +#endif | ||
2055 | } else { | ||
2056 | mon_dispatch = mon_dispatch_postauth15; | ||
2057 | monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); | ||
2058 | @@ -1855,6 +1872,13 @@ | ||
2059 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; | ||
2060 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; | ||
2061 | kex->kex[KEX_ECDH_SHA2] = kexecdh_server; | ||
2062 | +#ifdef GSSAPI | ||
2063 | + if (options.gss_keyex) { | ||
2064 | + kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; | ||
2065 | + kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_server; | ||
2066 | + kex->kex[KEX_GSS_GEX_SHA1] = kexgss_server; | ||
2067 | + } | ||
2068 | +#endif | ||
2069 | kex->server = 1; | ||
2070 | kex->hostkey_type = buffer_get_int(m); | ||
2071 | kex->kex_type = buffer_get_int(m); | ||
2072 | @@ -2062,6 +2086,9 @@ | ||
2073 | OM_uint32 major; | ||
2074 | u_int len; | ||
2075 | |||
2076 | + if (!options.gss_authentication && !options.gss_keyex) | ||
2077 | + fatal("In GSSAPI monitor when GSSAPI is disabled"); | ||
2078 | + | ||
2079 | goid.elements = buffer_get_string(m, &len); | ||
2080 | goid.length = len; | ||
2081 | |||
2082 | @@ -2089,6 +2116,9 @@ | ||
2083 | OM_uint32 flags = 0; /* GSI needs this */ | ||
2084 | u_int len; | ||
2085 | |||
2086 | + if (!options.gss_authentication && !options.gss_keyex) | ||
2087 | + fatal("In GSSAPI monitor when GSSAPI is disabled"); | ||
2088 | + | ||
2089 | in.value = buffer_get_string(m, &len); | ||
2090 | in.length = len; | ||
2091 | major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags); | ||
2092 | @@ -2106,6 +2136,7 @@ | ||
2093 | monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0); | ||
2094 | monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1); | ||
2095 | monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1); | ||
2096 | + monitor_permit(mon_dispatch, MONITOR_REQ_GSSSIGN, 1); | ||
2097 | } | ||
2098 | return (0); | ||
2099 | } | ||
2100 | @@ -2117,6 +2148,9 @@ | ||
2101 | OM_uint32 ret; | ||
2102 | u_int len; | ||
2103 | |||
2104 | + if (!options.gss_authentication && !options.gss_keyex) | ||
2105 | + fatal("In GSSAPI monitor when GSSAPI is disabled"); | ||
2106 | + | ||
2107 | gssbuf.value = buffer_get_string(m, &len); | ||
2108 | gssbuf.length = len; | ||
2109 | mic.value = buffer_get_string(m, &len); | ||
2110 | @@ -2143,7 +2177,11 @@ | ||
2111 | { | ||
2112 | int authenticated; | ||
2113 | |||
2114 | - authenticated = authctxt->valid && ssh_gssapi_userok(authctxt->user); | ||
2115 | + if (!options.gss_authentication && !options.gss_keyex) | ||
2116 | + fatal("In GSSAPI monitor when GSSAPI is disabled"); | ||
2117 | + | ||
2118 | + authenticated = authctxt->valid && | ||
2119 | + ssh_gssapi_userok(authctxt->user, authctxt->pw); | ||
2120 | |||
2121 | buffer_clear(m); | ||
2122 | buffer_put_int(m, authenticated); | ||
2123 | @@ -2156,6 +2194,74 @@ | ||
2124 | /* Monitor loop will terminate if authenticated */ | ||
2125 | return (authenticated); | ||
2126 | } | ||
2127 | + | ||
2128 | +int | ||
2129 | +mm_answer_gss_sign(int socket, Buffer *m) | ||
2130 | +{ | ||
2131 | + gss_buffer_desc data; | ||
2132 | + gss_buffer_desc hash = GSS_C_EMPTY_BUFFER; | ||
2133 | + OM_uint32 major, minor; | ||
2134 | + u_int len; | ||
2135 | + | ||
2136 | + if (!options.gss_authentication && !options.gss_keyex) | ||
2137 | + fatal("In GSSAPI monitor when GSSAPI is disabled"); | ||
2138 | + | ||
2139 | + data.value = buffer_get_string(m, &len); | ||
2140 | + data.length = len; | ||
2141 | + if (data.length != 20) | ||
2142 | + fatal("%s: data length incorrect: %d", __func__, | ||
2143 | + (int) data.length); | ||
2144 | + | ||
2145 | + /* Save the session ID on the first time around */ | ||
2146 | + if (session_id2_len == 0) { | ||
2147 | + session_id2_len = data.length; | ||
2148 | + session_id2 = xmalloc(session_id2_len); | ||
2149 | + memcpy(session_id2, data.value, session_id2_len); | ||
2150 | + } | ||
2151 | + major = ssh_gssapi_sign(gsscontext, &data, &hash); | ||
2152 | + | ||
2153 | + free(data.value); | ||
2154 | + | ||
2155 | + buffer_clear(m); | ||
2156 | + buffer_put_int(m, major); | ||
2157 | + buffer_put_string(m, hash.value, hash.length); | ||
2158 | + | ||
2159 | + mm_request_send(socket, MONITOR_ANS_GSSSIGN, m); | ||
2160 | + | ||
2161 | + gss_release_buffer(&minor, &hash); | ||
2162 | + | ||
2163 | + /* Turn on getpwnam permissions */ | ||
2164 | + monitor_permit(mon_dispatch, MONITOR_REQ_PWNAM, 1); | ||
2165 | + | ||
2166 | + /* And credential updating, for when rekeying */ | ||
2167 | + monitor_permit(mon_dispatch, MONITOR_REQ_GSSUPCREDS, 1); | ||
2168 | + | ||
2169 | + return (0); | ||
2170 | +} | ||
2171 | + | ||
2172 | +int | ||
2173 | +mm_answer_gss_updatecreds(int socket, Buffer *m) { | ||
2174 | + ssh_gssapi_ccache store; | ||
2175 | + int ok; | ||
2176 | + | ||
2177 | + store.filename = buffer_get_string(m, NULL); | ||
2178 | + store.envvar = buffer_get_string(m, NULL); | ||
2179 | + store.envval = buffer_get_string(m, NULL); | ||
2180 | + | ||
2181 | + ok = ssh_gssapi_update_creds(&store); | ||
2182 | + | ||
2183 | + free(store.filename); | ||
2184 | + free(store.envvar); | ||
2185 | + free(store.envval); | ||
2186 | + | ||
2187 | + buffer_clear(m); | ||
2188 | + buffer_put_int(m, ok); | ||
2189 | + | ||
2190 | + mm_request_send(socket, MONITOR_ANS_GSSUPCREDS, m); | ||
2191 | + | ||
2192 | + return(0); | ||
2193 | +} | ||
2194 | + | ||
2195 | #endif /* GSSAPI */ | ||
2196 | |||
2197 | #ifdef JPAKE | ||
2198 | Index: b/monitor.h | ||
2199 | =================================================================== | ||
2200 | --- a/monitor.h | ||
2201 | +++ b/monitor.h | ||
2202 | @@ -70,6 +70,9 @@ | ||
2203 | MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, | ||
2204 | MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, | ||
2205 | |||
2206 | + MONITOR_REQ_GSSSIGN = 150, MONITOR_ANS_GSSSIGN = 151, | ||
2207 | + MONITOR_REQ_GSSUPCREDS = 152, MONITOR_ANS_GSSUPCREDS = 153, | ||
2208 | + | ||
2209 | }; | ||
2210 | |||
2211 | struct mm_master; | ||
2212 | Index: b/monitor_wrap.c | ||
2213 | =================================================================== | ||
2214 | --- a/monitor_wrap.c | ||
2215 | +++ b/monitor_wrap.c | ||
2216 | @@ -1273,7 +1273,7 @@ | ||
2217 | } | ||
2218 | |||
2219 | int | ||
2220 | -mm_ssh_gssapi_userok(char *user) | ||
2221 | +mm_ssh_gssapi_userok(char *user, struct passwd *pw) | ||
2222 | { | ||
2223 | Buffer m; | ||
2224 | int authenticated = 0; | ||
2225 | @@ -1290,6 +1290,51 @@ | ||
2226 | debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); | ||
2227 | return (authenticated); | ||
2228 | } | ||
2229 | + | ||
2230 | +OM_uint32 | ||
2231 | +mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash) | ||
2232 | +{ | ||
2233 | + Buffer m; | ||
2234 | + OM_uint32 major; | ||
2235 | + u_int len; | ||
2236 | + | ||
2237 | + buffer_init(&m); | ||
2238 | + buffer_put_string(&m, data->value, data->length); | ||
2239 | + | ||
2240 | + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m); | ||
2241 | + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m); | ||
2242 | + | ||
2243 | + major = buffer_get_int(&m); | ||
2244 | + hash->value = buffer_get_string(&m, &len); | ||
2245 | + hash->length = len; | ||
2246 | + | ||
2247 | + buffer_free(&m); | ||
2248 | + | ||
2249 | + return(major); | ||
2250 | +} | ||
2251 | + | ||
2252 | +int | ||
2253 | +mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store) | ||
2254 | +{ | ||
2255 | + Buffer m; | ||
2256 | + int ok; | ||
2257 | + | ||
2258 | + buffer_init(&m); | ||
2259 | + | ||
2260 | + buffer_put_cstring(&m, store->filename ? store->filename : ""); | ||
2261 | + buffer_put_cstring(&m, store->envvar ? store->envvar : ""); | ||
2262 | + buffer_put_cstring(&m, store->envval ? store->envval : ""); | ||
2263 | + | ||
2264 | + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUPCREDS, &m); | ||
2265 | + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUPCREDS, &m); | ||
2266 | + | ||
2267 | + ok = buffer_get_int(&m); | ||
2268 | + | ||
2269 | + buffer_free(&m); | ||
2270 | + | ||
2271 | + return (ok); | ||
2272 | +} | ||
2273 | + | ||
2274 | #endif /* GSSAPI */ | ||
2275 | |||
2276 | #ifdef JPAKE | ||
2277 | Index: b/monitor_wrap.h | ||
2278 | =================================================================== | ||
2279 | --- a/monitor_wrap.h | ||
2280 | +++ b/monitor_wrap.h | ||
2281 | @@ -58,8 +58,10 @@ | ||
2282 | OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID); | ||
2283 | OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *, | ||
2284 | gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *); | ||
2285 | -int mm_ssh_gssapi_userok(char *user); | ||
2286 | +int mm_ssh_gssapi_userok(char *user, struct passwd *); | ||
2287 | OM_uint32 mm_ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); | ||
2288 | +OM_uint32 mm_ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); | ||
2289 | +int mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *); | ||
2290 | #endif | ||
2291 | |||
2292 | #ifdef USE_PAM | ||
2293 | Index: b/readconf.c | ||
2294 | =================================================================== | ||
2295 | --- a/readconf.c | ||
2296 | +++ b/readconf.c | ||
2297 | @@ -132,6 +132,8 @@ | ||
2298 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, | ||
2299 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, | ||
2300 | oAddressFamily, oGssAuthentication, oGssDelegateCreds, | ||
2301 | + oGssTrustDns, oGssKeyEx, oGssClientIdentity, oGssRenewalRekey, | ||
2302 | + oGssServerIdentity, | ||
2303 | oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, | ||
2304 | oSendEnv, oControlPath, oControlMaster, oControlPersist, | ||
2305 | oHashKnownHosts, | ||
2306 | @@ -172,10 +174,19 @@ | ||
2307 | { "afstokenpassing", oUnsupported }, | ||
2308 | #if defined(GSSAPI) | ||
2309 | { "gssapiauthentication", oGssAuthentication }, | ||
2310 | + { "gssapikeyexchange", oGssKeyEx }, | ||
2311 | { "gssapidelegatecredentials", oGssDelegateCreds }, | ||
2312 | + { "gssapitrustdns", oGssTrustDns }, | ||
2313 | + { "gssapiclientidentity", oGssClientIdentity }, | ||
2314 | + { "gssapiserveridentity", oGssServerIdentity }, | ||
2315 | + { "gssapirenewalforcesrekey", oGssRenewalRekey }, | ||
2316 | #else | ||
2317 | { "gssapiauthentication", oUnsupported }, | ||
2318 | + { "gssapikeyexchange", oUnsupported }, | ||
2319 | { "gssapidelegatecredentials", oUnsupported }, | ||
2320 | + { "gssapitrustdns", oUnsupported }, | ||
2321 | + { "gssapiclientidentity", oUnsupported }, | ||
2322 | + { "gssapirenewalforcesrekey", oUnsupported }, | ||
2323 | #endif | ||
2324 | { "fallbacktorsh", oDeprecated }, | ||
2325 | { "usersh", oDeprecated }, | ||
2326 | @@ -516,10 +527,30 @@ | ||
2327 | intptr = &options->gss_authentication; | ||
2328 | goto parse_flag; | ||
2329 | |||
2330 | + case oGssKeyEx: | ||
2331 | + intptr = &options->gss_keyex; | ||
2332 | + goto parse_flag; | ||
2333 | + | ||
2334 | case oGssDelegateCreds: | ||
2335 | intptr = &options->gss_deleg_creds; | ||
2336 | goto parse_flag; | ||
2337 | |||
2338 | + case oGssTrustDns: | ||
2339 | + intptr = &options->gss_trust_dns; | ||
2340 | + goto parse_flag; | ||
2341 | + | ||
2342 | + case oGssClientIdentity: | ||
2343 | + charptr = &options->gss_client_identity; | ||
2344 | + goto parse_string; | ||
2345 | + | ||
2346 | + case oGssServerIdentity: | ||
2347 | + charptr = &options->gss_server_identity; | ||
2348 | + goto parse_string; | ||
2349 | + | ||
2350 | + case oGssRenewalRekey: | ||
2351 | + intptr = &options->gss_renewal_rekey; | ||
2352 | + goto parse_flag; | ||
2353 | + | ||
2354 | case oBatchMode: | ||
2355 | intptr = &options->batch_mode; | ||
2356 | goto parse_flag; | ||
2357 | @@ -1168,7 +1199,12 @@ | ||
2358 | options->pubkey_authentication = -1; | ||
2359 | options->challenge_response_authentication = -1; | ||
2360 | options->gss_authentication = -1; | ||
2361 | + options->gss_keyex = -1; | ||
2362 | options->gss_deleg_creds = -1; | ||
2363 | + options->gss_trust_dns = -1; | ||
2364 | + options->gss_renewal_rekey = -1; | ||
2365 | + options->gss_client_identity = NULL; | ||
2366 | + options->gss_server_identity = NULL; | ||
2367 | options->password_authentication = -1; | ||
2368 | options->kbd_interactive_authentication = -1; | ||
2369 | options->kbd_interactive_devices = NULL; | ||
2370 | @@ -1268,8 +1304,14 @@ | ||
2371 | options->challenge_response_authentication = 1; | ||
2372 | if (options->gss_authentication == -1) | ||
2373 | options->gss_authentication = 0; | ||
2374 | + if (options->gss_keyex == -1) | ||
2375 | + options->gss_keyex = 0; | ||
2376 | if (options->gss_deleg_creds == -1) | ||
2377 | options->gss_deleg_creds = 0; | ||
2378 | + if (options->gss_trust_dns == -1) | ||
2379 | + options->gss_trust_dns = 0; | ||
2380 | + if (options->gss_renewal_rekey == -1) | ||
2381 | + options->gss_renewal_rekey = 0; | ||
2382 | if (options->password_authentication == -1) | ||
2383 | options->password_authentication = 1; | ||
2384 | if (options->kbd_interactive_authentication == -1) | ||
2385 | Index: b/readconf.h | ||
2386 | =================================================================== | ||
2387 | --- a/readconf.h | ||
2388 | +++ b/readconf.h | ||
2389 | @@ -48,7 +48,12 @@ | ||
2390 | int challenge_response_authentication; | ||
2391 | /* Try S/Key or TIS, authentication. */ | ||
2392 | int gss_authentication; /* Try GSS authentication */ | ||
2393 | + int gss_keyex; /* Try GSS key exchange */ | ||
2394 | int gss_deleg_creds; /* Delegate GSS credentials */ | ||
2395 | + int gss_trust_dns; /* Trust DNS for GSS canonicalization */ | ||
2396 | + int gss_renewal_rekey; /* Credential renewal forces rekey */ | ||
2397 | + char *gss_client_identity; /* Principal to initiate GSSAPI with */ | ||
2398 | + char *gss_server_identity; /* GSSAPI target principal */ | ||
2399 | int password_authentication; /* Try password | ||
2400 | * authentication. */ | ||
2401 | int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ | ||
2402 | Index: b/servconf.c | ||
2403 | =================================================================== | ||
2404 | --- a/servconf.c | ||
2405 | +++ b/servconf.c | ||
2406 | @@ -107,7 +107,10 @@ | ||
2407 | options->kerberos_ticket_cleanup = -1; | ||
2408 | options->kerberos_get_afs_token = -1; | ||
2409 | options->gss_authentication=-1; | ||
2410 | + options->gss_keyex = -1; | ||
2411 | options->gss_cleanup_creds = -1; | ||
2412 | + options->gss_strict_acceptor = -1; | ||
2413 | + options->gss_store_rekey = -1; | ||
2414 | options->password_authentication = -1; | ||
2415 | options->kbd_interactive_authentication = -1; | ||
2416 | options->challenge_response_authentication = -1; | ||
2417 | @@ -240,8 +243,14 @@ | ||
2418 | options->kerberos_get_afs_token = 0; | ||
2419 | if (options->gss_authentication == -1) | ||
2420 | options->gss_authentication = 0; | ||
2421 | + if (options->gss_keyex == -1) | ||
2422 | + options->gss_keyex = 0; | ||
2423 | if (options->gss_cleanup_creds == -1) | ||
2424 | options->gss_cleanup_creds = 1; | ||
2425 | + if (options->gss_strict_acceptor == -1) | ||
2426 | + options->gss_strict_acceptor = 1; | ||
2427 | + if (options->gss_store_rekey == -1) | ||
2428 | + options->gss_store_rekey = 0; | ||
2429 | if (options->password_authentication == -1) | ||
2430 | options->password_authentication = 1; | ||
2431 | if (options->kbd_interactive_authentication == -1) | ||
2432 | @@ -338,7 +347,9 @@ | ||
2433 | sBanner, sUseDNS, sHostbasedAuthentication, | ||
2434 | sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, | ||
2435 | sClientAliveCountMax, sAuthorizedKeysFile, | ||
2436 | - sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, | ||
2437 | + sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor, | ||
2438 | + sGssKeyEx, sGssStoreRekey, | ||
2439 | + sAcceptEnv, sPermitTunnel, | ||
2440 | sMatch, sPermitOpen, sForceCommand, sChrootDirectory, | ||
2441 | sUsePrivilegeSeparation, sAllowAgentForwarding, | ||
2442 | sZeroKnowledgePasswordAuthentication, sHostCertificate, | ||
2443 | @@ -405,10 +416,20 @@ | ||
2444 | #ifdef GSSAPI | ||
2445 | { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, | ||
2446 | { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, | ||
2447 | + { "gssapicleanupcreds", sGssCleanupCreds, SSHCFG_GLOBAL }, | ||
2448 | + { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL }, | ||
2449 | + { "gssapikeyexchange", sGssKeyEx, SSHCFG_GLOBAL }, | ||
2450 | + { "gssapistorecredentialsonrekey", sGssStoreRekey, SSHCFG_GLOBAL }, | ||
2451 | #else | ||
2452 | { "gssapiauthentication", sUnsupported, SSHCFG_ALL }, | ||
2453 | { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL }, | ||
2454 | + { "gssapicleanupcreds", sUnsupported, SSHCFG_GLOBAL }, | ||
2455 | + { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL }, | ||
2456 | + { "gssapikeyexchange", sUnsupported, SSHCFG_GLOBAL }, | ||
2457 | + { "gssapistorecredentialsonrekey", sUnsupported, SSHCFG_GLOBAL }, | ||
2458 | #endif | ||
2459 | + { "gssusesessionccache", sUnsupported, SSHCFG_GLOBAL }, | ||
2460 | + { "gssapiusesessioncredcache", sUnsupported, SSHCFG_GLOBAL }, | ||
2461 | { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, | ||
2462 | { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, | ||
2463 | { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, | ||
2464 | @@ -1073,10 +1094,22 @@ | ||
2465 | intptr = &options->gss_authentication; | ||
2466 | goto parse_flag; | ||
2467 | |||
2468 | + case sGssKeyEx: | ||
2469 | + intptr = &options->gss_keyex; | ||
2470 | + goto parse_flag; | ||
2471 | + | ||
2472 | case sGssCleanupCreds: | ||
2473 | intptr = &options->gss_cleanup_creds; | ||
2474 | goto parse_flag; | ||
2475 | |||
2476 | + case sGssStrictAcceptor: | ||
2477 | + intptr = &options->gss_strict_acceptor; | ||
2478 | + goto parse_flag; | ||
2479 | + | ||
2480 | + case sGssStoreRekey: | ||
2481 | + intptr = &options->gss_store_rekey; | ||
2482 | + goto parse_flag; | ||
2483 | + | ||
2484 | case sPasswordAuthentication: | ||
2485 | intptr = &options->password_authentication; | ||
2486 | goto parse_flag; | ||
2487 | @@ -1983,7 +2016,10 @@ | ||
2488 | #endif | ||
2489 | #ifdef GSSAPI | ||
2490 | dump_cfg_fmtint(sGssAuthentication, o->gss_authentication); | ||
2491 | + dump_cfg_fmtint(sGssKeyEx, o->gss_keyex); | ||
2492 | dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds); | ||
2493 | + dump_cfg_fmtint(sGssStrictAcceptor, o->gss_strict_acceptor); | ||
2494 | + dump_cfg_fmtint(sGssStoreRekey, o->gss_store_rekey); | ||
2495 | #endif | ||
2496 | #ifdef JPAKE | ||
2497 | dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication, | ||
2498 | Index: b/servconf.h | ||
2499 | =================================================================== | ||
2500 | --- a/servconf.h | ||
2501 | +++ b/servconf.h | ||
2502 | @@ -111,7 +111,10 @@ | ||
2503 | int kerberos_get_afs_token; /* If true, try to get AFS token if | ||
2504 | * authenticated with Kerberos. */ | ||
2505 | int gss_authentication; /* If true, permit GSSAPI authentication */ | ||
2506 | + int gss_keyex; /* If true, permit GSSAPI key exchange */ | ||
2507 | int gss_cleanup_creds; /* If true, destroy cred cache on logout */ | ||
2508 | + int gss_strict_acceptor; /* If true, restrict the GSSAPI acceptor name */ | ||
2509 | + int gss_store_rekey; | ||
2510 | int password_authentication; /* If true, permit password | ||
2511 | * authentication. */ | ||
2512 | int kbd_interactive_authentication; /* If true, permit */ | ||
2513 | Index: b/ssh-gss.h | ||
2514 | =================================================================== | ||
2515 | --- a/ssh-gss.h | ||
2516 | +++ b/ssh-gss.h | ||
2517 | @@ -1,6 +1,6 @@ | ||
2518 | /* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ | ||
2519 | /* | ||
2520 | - * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | ||
2521 | + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. | ||
2522 | * | ||
2523 | * Redistribution and use in source and binary forms, with or without | ||
2524 | * modification, are permitted provided that the following conditions | ||
2525 | @@ -61,10 +61,22 @@ | ||
2526 | |||
2527 | #define SSH_GSS_OIDTYPE 0x06 | ||
2528 | |||
2529 | +#define SSH2_MSG_KEXGSS_INIT 30 | ||
2530 | +#define SSH2_MSG_KEXGSS_CONTINUE 31 | ||
2531 | +#define SSH2_MSG_KEXGSS_COMPLETE 32 | ||
2532 | +#define SSH2_MSG_KEXGSS_HOSTKEY 33 | ||
2533 | +#define SSH2_MSG_KEXGSS_ERROR 34 | ||
2534 | +#define SSH2_MSG_KEXGSS_GROUPREQ 40 | ||
2535 | +#define SSH2_MSG_KEXGSS_GROUP 41 | ||
2536 | +#define KEX_GSS_GRP1_SHA1_ID "gss-group1-sha1-" | ||
2537 | +#define KEX_GSS_GRP14_SHA1_ID "gss-group14-sha1-" | ||
2538 | +#define KEX_GSS_GEX_SHA1_ID "gss-gex-sha1-" | ||
2539 | + | ||
2540 | typedef struct { | ||
2541 | char *filename; | ||
2542 | char *envvar; | ||
2543 | char *envval; | ||
2544 | + struct passwd *owner; | ||
2545 | void *data; | ||
2546 | } ssh_gssapi_ccache; | ||
2547 | |||
2548 | @@ -72,8 +84,11 @@ | ||
2549 | gss_buffer_desc displayname; | ||
2550 | gss_buffer_desc exportedname; | ||
2551 | gss_cred_id_t creds; | ||
2552 | + gss_name_t name; | ||
2553 | struct ssh_gssapi_mech_struct *mech; | ||
2554 | ssh_gssapi_ccache store; | ||
2555 | + int used; | ||
2556 | + int updated; | ||
2557 | } ssh_gssapi_client; | ||
2558 | |||
2559 | typedef struct ssh_gssapi_mech_struct { | ||
2560 | @@ -84,6 +99,7 @@ | ||
2561 | int (*userok) (ssh_gssapi_client *, char *); | ||
2562 | int (*localname) (ssh_gssapi_client *, char **); | ||
2563 | void (*storecreds) (ssh_gssapi_client *); | ||
2564 | + int (*updatecreds) (ssh_gssapi_ccache *, ssh_gssapi_client *); | ||
2565 | } ssh_gssapi_mech; | ||
2566 | |||
2567 | typedef struct { | ||
2568 | @@ -94,10 +110,11 @@ | ||
2569 | gss_OID oid; /* client */ | ||
2570 | gss_cred_id_t creds; /* server */ | ||
2571 | gss_name_t client; /* server */ | ||
2572 | - gss_cred_id_t client_creds; /* server */ | ||
2573 | + gss_cred_id_t client_creds; /* both */ | ||
2574 | } Gssctxt; | ||
2575 | |||
2576 | extern ssh_gssapi_mech *supported_mechs[]; | ||
2577 | +extern Gssctxt *gss_kex_context; | ||
2578 | |||
2579 | int ssh_gssapi_check_oid(Gssctxt *, void *, size_t); | ||
2580 | void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t); | ||
2581 | @@ -117,16 +134,30 @@ | ||
2582 | void ssh_gssapi_delete_ctx(Gssctxt **); | ||
2583 | OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); | ||
2584 | void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *); | ||
2585 | -int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *); | ||
2586 | +int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *, const char *); | ||
2587 | +OM_uint32 ssh_gssapi_client_identity(Gssctxt *, const char *); | ||
2588 | +int ssh_gssapi_credentials_updated(Gssctxt *); | ||
2589 | |||
2590 | /* In the server */ | ||
2591 | +typedef int ssh_gssapi_check_fn(Gssctxt **, gss_OID, const char *, | ||
2592 | + const char *); | ||
2593 | +char *ssh_gssapi_client_mechanisms(const char *, const char *); | ||
2594 | +char *ssh_gssapi_kex_mechs(gss_OID_set, ssh_gssapi_check_fn *, const char *, | ||
2595 | + const char *); | ||
2596 | +gss_OID ssh_gssapi_id_kex(Gssctxt *, char *, int); | ||
2597 | +int ssh_gssapi_server_check_mech(Gssctxt **,gss_OID, const char *, | ||
2598 | + const char *); | ||
2599 | OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID); | ||
2600 | -int ssh_gssapi_userok(char *name); | ||
2601 | +int ssh_gssapi_userok(char *name, struct passwd *); | ||
2602 | OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); | ||
2603 | void ssh_gssapi_do_child(char ***, u_int *); | ||
2604 | void ssh_gssapi_cleanup_creds(void); | ||
2605 | void ssh_gssapi_storecreds(void); | ||
2606 | |||
2607 | +char *ssh_gssapi_server_mechanisms(void); | ||
2608 | +int ssh_gssapi_oid_table_ok(); | ||
2609 | + | ||
2610 | +int ssh_gssapi_update_creds(ssh_gssapi_ccache *store); | ||
2611 | #endif /* GSSAPI */ | ||
2612 | |||
2613 | #endif /* _SSH_GSS_H */ | ||
2614 | Index: b/ssh_config | ||
2615 | =================================================================== | ||
2616 | --- a/ssh_config | ||
2617 | +++ b/ssh_config | ||
2618 | @@ -26,6 +26,8 @@ | ||
2619 | # HostbasedAuthentication no | ||
2620 | # GSSAPIAuthentication no | ||
2621 | # GSSAPIDelegateCredentials no | ||
2622 | +# GSSAPIKeyExchange no | ||
2623 | +# GSSAPITrustDNS no | ||
2624 | # BatchMode no | ||
2625 | # CheckHostIP yes | ||
2626 | # AddressFamily any | ||
2627 | Index: b/ssh_config.5 | ||
2628 | =================================================================== | ||
2629 | --- a/ssh_config.5 | ||
2630 | +++ b/ssh_config.5 | ||
2631 | @@ -529,11 +529,43 @@ | ||
2632 | The default is | ||
2633 | .Dq no . | ||
2634 | Note that this option applies to protocol version 2 only. | ||
2635 | +.It Cm GSSAPIKeyExchange | ||
2636 | +Specifies whether key exchange based on GSSAPI may be used. When using | ||
2637 | +GSSAPI key exchange the server need not have a host key. | ||
2638 | +The default is | ||
2639 | +.Dq no . | ||
2640 | +Note that this option applies to protocol version 2 only. | ||
2641 | +.It Cm GSSAPIClientIdentity | ||
2642 | +If set, specifies the GSSAPI client identity that ssh should use when | ||
2643 | +connecting to the server. The default is unset, which means that the default | ||
2644 | +identity will be used. | ||
2645 | +.It Cm GSSAPIServerIdentity | ||
2646 | +If set, specifies the GSSAPI server identity that ssh should expect when | ||
2647 | +connecting to the server. The default is unset, which means that the | ||
2648 | +expected GSSAPI server identity will be determined from the target | ||
2649 | +hostname. | ||
2650 | .It Cm GSSAPIDelegateCredentials | ||
2651 | Forward (delegate) credentials to the server. | ||
2652 | The default is | ||
2653 | .Dq no . | ||
2654 | -Note that this option applies to protocol version 2 only. | ||
2655 | +Note that this option applies to protocol version 2 connections using GSSAPI. | ||
2656 | +.It Cm GSSAPIRenewalForcesRekey | ||
2657 | +If set to | ||
2658 | +.Dq yes | ||
2659 | +then renewal of the client's GSSAPI credentials will force the rekeying of the | ||
2660 | +ssh connection. With a compatible server, this can delegate the renewed | ||
2661 | +credentials to a session on the server. | ||
2662 | +The default is | ||
2663 | +.Dq no . | ||
2664 | +.It Cm GSSAPITrustDns | ||
2665 | +Set to | ||
2666 | +.Dq yes to indicate that the DNS is trusted to securely canonicalize | ||
2667 | +the name of the host being connected to. If | ||
2668 | +.Dq no, the hostname entered on the | ||
2669 | +command line will be passed untouched to the GSSAPI library. | ||
2670 | +The default is | ||
2671 | +.Dq no . | ||
2672 | +This option only applies to protocol version 2 connections using GSSAPI. | ||
2673 | .It Cm HashKnownHosts | ||
2674 | Indicates that | ||
2675 | .Xr ssh 1 | ||
2676 | Index: b/sshconnect2.c | ||
2677 | =================================================================== | ||
2678 | --- a/sshconnect2.c | ||
2679 | +++ b/sshconnect2.c | ||
2680 | @@ -160,9 +160,34 @@ | ||
2681 | { | ||
2682 | Kex *kex; | ||
2683 | |||
2684 | +#ifdef GSSAPI | ||
2685 | + char *orig = NULL, *gss = NULL; | ||
2686 | + char *gss_host = NULL; | ||
2687 | +#endif | ||
2688 | + | ||
2689 | xxx_host = host; | ||
2690 | xxx_hostaddr = hostaddr; | ||
2691 | |||
2692 | +#ifdef GSSAPI | ||
2693 | + if (options.gss_keyex) { | ||
2694 | + /* Add the GSSAPI mechanisms currently supported on this | ||
2695 | + * client to the key exchange algorithm proposal */ | ||
2696 | + orig = myproposal[PROPOSAL_KEX_ALGS]; | ||
2697 | + | ||
2698 | + if (options.gss_trust_dns) | ||
2699 | + gss_host = (char *)get_canonical_hostname(1); | ||
2700 | + else | ||
2701 | + gss_host = host; | ||
2702 | + | ||
2703 | + gss = ssh_gssapi_client_mechanisms(gss_host, options.gss_client_identity); | ||
2704 | + if (gss) { | ||
2705 | + debug("Offering GSSAPI proposal: %s", gss); | ||
2706 | + xasprintf(&myproposal[PROPOSAL_KEX_ALGS], | ||
2707 | + "%s,%s", gss, orig); | ||
2708 | + } | ||
2709 | + } | ||
2710 | +#endif | ||
2711 | + | ||
2712 | if (options.ciphers == (char *)-1) { | ||
2713 | logit("No valid ciphers for protocol version 2 given, using defaults."); | ||
2714 | options.ciphers = NULL; | ||
2715 | @@ -197,6 +222,17 @@ | ||
2716 | if (options.kex_algorithms != NULL) | ||
2717 | myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; | ||
2718 | |||
2719 | +#ifdef GSSAPI | ||
2720 | + /* If we've got GSSAPI algorithms, then we also support the | ||
2721 | + * 'null' hostkey, as a last resort */ | ||
2722 | + if (options.gss_keyex && gss) { | ||
2723 | + orig = myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]; | ||
2724 | + xasprintf(&myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS], | ||
2725 | + "%s,null", orig); | ||
2726 | + free(gss); | ||
2727 | + } | ||
2728 | +#endif | ||
2729 | + | ||
2730 | if (options.rekey_limit || options.rekey_interval) | ||
2731 | packet_set_rekey_limits((u_int32_t)options.rekey_limit, | ||
2732 | (time_t)options.rekey_interval); | ||
2733 | @@ -208,10 +244,30 @@ | ||
2734 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; | ||
2735 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; | ||
2736 | kex->kex[KEX_ECDH_SHA2] = kexecdh_client; | ||
2737 | +#ifdef GSSAPI | ||
2738 | + if (options.gss_keyex) { | ||
2739 | + kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; | ||
2740 | + kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_client; | ||
2741 | + kex->kex[KEX_GSS_GEX_SHA1] = kexgss_client; | ||
2742 | + } | ||
2743 | +#endif | ||
2744 | kex->client_version_string=client_version_string; | ||
2745 | kex->server_version_string=server_version_string; | ||
2746 | kex->verify_host_key=&verify_host_key_callback; | ||
2747 | |||
2748 | +#ifdef GSSAPI | ||
2749 | + if (options.gss_keyex) { | ||
2750 | + kex->gss_deleg_creds = options.gss_deleg_creds; | ||
2751 | + kex->gss_trust_dns = options.gss_trust_dns; | ||
2752 | + kex->gss_client = options.gss_client_identity; | ||
2753 | + if (options.gss_server_identity) { | ||
2754 | + kex->gss_host = options.gss_server_identity; | ||
2755 | + } else { | ||
2756 | + kex->gss_host = gss_host; | ||
2757 | + } | ||
2758 | + } | ||
2759 | +#endif | ||
2760 | + | ||
2761 | xxx_kex = kex; | ||
2762 | |||
2763 | dispatch_run(DISPATCH_BLOCK, &kex->done, kex); | ||
2764 | @@ -307,6 +363,7 @@ | ||
2765 | void input_gssapi_hash(int type, u_int32_t, void *); | ||
2766 | void input_gssapi_error(int, u_int32_t, void *); | ||
2767 | void input_gssapi_errtok(int, u_int32_t, void *); | ||
2768 | +int userauth_gsskeyex(Authctxt *authctxt); | ||
2769 | #endif | ||
2770 | |||
2771 | void userauth(Authctxt *, char *); | ||
2772 | @@ -322,6 +379,11 @@ | ||
2773 | |||
2774 | Authmethod authmethods[] = { | ||
2775 | #ifdef GSSAPI | ||
2776 | + {"gssapi-keyex", | ||
2777 | + userauth_gsskeyex, | ||
2778 | + NULL, | ||
2779 | + &options.gss_authentication, | ||
2780 | + NULL}, | ||
2781 | {"gssapi-with-mic", | ||
2782 | userauth_gssapi, | ||
2783 | NULL, | ||
2784 | @@ -625,19 +687,31 @@ | ||
2785 | static u_int mech = 0; | ||
2786 | OM_uint32 min; | ||
2787 | int ok = 0; | ||
2788 | + const char *gss_host; | ||
2789 | + | ||
2790 | + if (options.gss_server_identity) | ||
2791 | + gss_host = options.gss_server_identity; | ||
2792 | + else if (options.gss_trust_dns) | ||
2793 | + gss_host = get_canonical_hostname(1); | ||
2794 | + else | ||
2795 | + gss_host = authctxt->host; | ||
2796 | |||
2797 | /* Try one GSSAPI method at a time, rather than sending them all at | ||
2798 | * once. */ | ||
2799 | |||
2800 | if (gss_supported == NULL) | ||
2801 | - gss_indicate_mechs(&min, &gss_supported); | ||
2802 | + if (GSS_ERROR(gss_indicate_mechs(&min, &gss_supported))) { | ||
2803 | + gss_supported = NULL; | ||
2804 | + return 0; | ||
2805 | + } | ||
2806 | |||
2807 | /* Check to see if the mechanism is usable before we offer it */ | ||
2808 | while (mech < gss_supported->count && !ok) { | ||
2809 | /* My DER encoding requires length<128 */ | ||
2810 | if (gss_supported->elements[mech].length < 128 && | ||
2811 | ssh_gssapi_check_mechanism(&gssctxt, | ||
2812 | - &gss_supported->elements[mech], authctxt->host)) { | ||
2813 | + &gss_supported->elements[mech], gss_host, | ||
2814 | + options.gss_client_identity)) { | ||
2815 | ok = 1; /* Mechanism works */ | ||
2816 | } else { | ||
2817 | mech++; | ||
2818 | @@ -734,8 +808,8 @@ | ||
2819 | { | ||
2820 | Authctxt *authctxt = ctxt; | ||
2821 | Gssctxt *gssctxt; | ||
2822 | - int oidlen; | ||
2823 | - char *oidv; | ||
2824 | + u_int oidlen; | ||
2825 | + u_char *oidv; | ||
2826 | |||
2827 | if (authctxt == NULL) | ||
2828 | fatal("input_gssapi_response: no authentication context"); | ||
2829 | @@ -844,6 +918,48 @@ | ||
2830 | free(msg); | ||
2831 | free(lang); | ||
2832 | } | ||
2833 | + | ||
2834 | +int | ||
2835 | +userauth_gsskeyex(Authctxt *authctxt) | ||
2836 | +{ | ||
2837 | + Buffer b; | ||
2838 | + gss_buffer_desc gssbuf; | ||
2839 | + gss_buffer_desc mic = GSS_C_EMPTY_BUFFER; | ||
2840 | + OM_uint32 ms; | ||
2841 | + | ||
2842 | + static int attempt = 0; | ||
2843 | + if (attempt++ >= 1) | ||
2844 | + return (0); | ||
2845 | + | ||
2846 | + if (gss_kex_context == NULL) { | ||
2847 | + debug("No valid Key exchange context"); | ||
2848 | + return (0); | ||
2849 | + } | ||
2850 | + | ||
2851 | + ssh_gssapi_buildmic(&b, authctxt->server_user, authctxt->service, | ||
2852 | + "gssapi-keyex"); | ||
2853 | + | ||
2854 | + gssbuf.value = buffer_ptr(&b); | ||
2855 | + gssbuf.length = buffer_len(&b); | ||
2856 | + | ||
2857 | + if (GSS_ERROR(ssh_gssapi_sign(gss_kex_context, &gssbuf, &mic))) { | ||
2858 | + buffer_free(&b); | ||
2859 | + return (0); | ||
2860 | + } | ||
2861 | + | ||
2862 | + packet_start(SSH2_MSG_USERAUTH_REQUEST); | ||
2863 | + packet_put_cstring(authctxt->server_user); | ||
2864 | + packet_put_cstring(authctxt->service); | ||
2865 | + packet_put_cstring(authctxt->method->name); | ||
2866 | + packet_put_string(mic.value, mic.length); | ||
2867 | + packet_send(); | ||
2868 | + | ||
2869 | + buffer_free(&b); | ||
2870 | + gss_release_buffer(&ms, &mic); | ||
2871 | + | ||
2872 | + return (1); | ||
2873 | +} | ||
2874 | + | ||
2875 | #endif /* GSSAPI */ | ||
2876 | |||
2877 | int | ||
2878 | Index: b/sshd.c | ||
2879 | =================================================================== | ||
2880 | --- a/sshd.c | ||
2881 | +++ b/sshd.c | ||
2882 | @@ -122,6 +122,10 @@ | ||
2883 | #include "ssh-sandbox.h" | ||
2884 | #include "version.h" | ||
2885 | |||
2886 | +#ifdef USE_SECURITY_SESSION_API | ||
2887 | +#include <Security/AuthSession.h> | ||
2888 | +#endif | ||
2889 | + | ||
2890 | #ifdef LIBWRAP | ||
2891 | #include <tcpd.h> | ||
2892 | #include <syslog.h> | ||
2893 | @@ -1703,10 +1707,13 @@ | ||
2894 | logit("Disabling protocol version 1. Could not load host key"); | ||
2895 | options.protocol &= ~SSH_PROTO_1; | ||
2896 | } | ||
2897 | +#ifndef GSSAPI | ||
2898 | + /* The GSSAPI key exchange can run without a host key */ | ||
2899 | if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) { | ||
2900 | logit("Disabling protocol version 2. Could not load host key"); | ||
2901 | options.protocol &= ~SSH_PROTO_2; | ||
2902 | } | ||
2903 | +#endif | ||
2904 | if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { | ||
2905 | logit("sshd: no hostkeys available -- exiting."); | ||
2906 | exit(1); | ||
2907 | @@ -2035,6 +2042,60 @@ | ||
2908 | /* Log the connection. */ | ||
2909 | verbose("Connection from %.500s port %d", remote_ip, remote_port); | ||
2910 | |||
2911 | +#ifdef USE_SECURITY_SESSION_API | ||
2912 | + /* | ||
2913 | + * Create a new security session for use by the new user login if | ||
2914 | + * the current session is the root session or we are not launched | ||
2915 | + * by inetd (eg: debugging mode or server mode). We do not | ||
2916 | + * necessarily need to create a session if we are launched from | ||
2917 | + * inetd because Panther xinetd will create a session for us. | ||
2918 | + * | ||
2919 | + * The only case where this logic will fail is if there is an | ||
2920 | + * inetd running in a non-root session which is not creating | ||
2921 | + * new sessions for us. Then all the users will end up in the | ||
2922 | + * same session (bad). | ||
2923 | + * | ||
2924 | + * When the client exits, the session will be destroyed for us | ||
2925 | + * automatically. | ||
2926 | + * | ||
2927 | + * We must create the session before any credentials are stored | ||
2928 | + * (including AFS pags, which happens a few lines below). | ||
2929 | + */ | ||
2930 | + { | ||
2931 | + OSStatus err = 0; | ||
2932 | + SecuritySessionId sid = 0; | ||
2933 | + SessionAttributeBits sattrs = 0; | ||
2934 | + | ||
2935 | + err = SessionGetInfo(callerSecuritySession, &sid, &sattrs); | ||
2936 | + if (err) | ||
2937 | + error("SessionGetInfo() failed with error %.8X", | ||
2938 | + (unsigned) err); | ||
2939 | + else | ||
2940 | + debug("Current Session ID is %.8X / Session Attributes are %.8X", | ||
2941 | + (unsigned) sid, (unsigned) sattrs); | ||
2942 | + | ||
2943 | + if (inetd_flag && !(sattrs & sessionIsRoot)) | ||
2944 | + debug("Running in inetd mode in a non-root session... " | ||
2945 | + "assuming inetd created the session for us."); | ||
2946 | + else { | ||
2947 | + debug("Creating new security session..."); | ||
2948 | + err = SessionCreate(0, sessionHasTTY | sessionIsRemote); | ||
2949 | + if (err) | ||
2950 | + error("SessionCreate() failed with error %.8X", | ||
2951 | + (unsigned) err); | ||
2952 | + | ||
2953 | + err = SessionGetInfo(callerSecuritySession, &sid, | ||
2954 | + &sattrs); | ||
2955 | + if (err) | ||
2956 | + error("SessionGetInfo() failed with error %.8X", | ||
2957 | + (unsigned) err); | ||
2958 | + else | ||
2959 | + debug("New Session ID is %.8X / Session Attributes are %.8X", | ||
2960 | + (unsigned) sid, (unsigned) sattrs); | ||
2961 | + } | ||
2962 | + } | ||
2963 | +#endif | ||
2964 | + | ||
2965 | /* | ||
2966 | * We don't want to listen forever unless the other side | ||
2967 | * successfully authenticates itself. So we set up an alarm which is | ||
2968 | @@ -2439,6 +2500,48 @@ | ||
2969 | |||
2970 | myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types(); | ||
2971 | |||
2972 | +#ifdef GSSAPI | ||
2973 | + { | ||
2974 | + char *orig; | ||
2975 | + char *gss = NULL; | ||
2976 | + char *newstr = NULL; | ||
2977 | + orig = myproposal[PROPOSAL_KEX_ALGS]; | ||
2978 | + | ||
2979 | + /* | ||
2980 | + * If we don't have a host key, then there's no point advertising | ||
2981 | + * the other key exchange algorithms | ||
2982 | + */ | ||
2983 | + | ||
2984 | + if (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]) == 0) | ||
2985 | + orig = NULL; | ||
2986 | + | ||
2987 | + if (options.gss_keyex) | ||
2988 | + gss = ssh_gssapi_server_mechanisms(); | ||
2989 | + else | ||
2990 | + gss = NULL; | ||
2991 | + | ||
2992 | + if (gss && orig) | ||
2993 | + xasprintf(&newstr, "%s,%s", gss, orig); | ||
2994 | + else if (gss) | ||
2995 | + newstr = gss; | ||
2996 | + else if (orig) | ||
2997 | + newstr = orig; | ||
2998 | + | ||
2999 | + /* | ||
3000 | + * If we've got GSSAPI mechanisms, then we've got the 'null' host | ||
3001 | + * key alg, but we can't tell people about it unless its the only | ||
3002 | + * host key algorithm we support | ||
3003 | + */ | ||
3004 | + if (gss && (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS])) == 0) | ||
3005 | + myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = "null"; | ||
3006 | + | ||
3007 | + if (newstr) | ||
3008 | + myproposal[PROPOSAL_KEX_ALGS] = newstr; | ||
3009 | + else | ||
3010 | + fatal("No supported key exchange algorithms"); | ||
3011 | + } | ||
3012 | +#endif | ||
3013 | + | ||
3014 | /* start key exchange */ | ||
3015 | kex = kex_setup(myproposal); | ||
3016 | kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; | ||
3017 | @@ -2446,6 +2549,13 @@ | ||
3018 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; | ||
3019 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; | ||
3020 | kex->kex[KEX_ECDH_SHA2] = kexecdh_server; | ||
3021 | +#ifdef GSSAPI | ||
3022 | + if (options.gss_keyex) { | ||
3023 | + kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; | ||
3024 | + kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_server; | ||
3025 | + kex->kex[KEX_GSS_GEX_SHA1] = kexgss_server; | ||
3026 | + } | ||
3027 | +#endif | ||
3028 | kex->server = 1; | ||
3029 | kex->client_version_string=client_version_string; | ||
3030 | kex->server_version_string=server_version_string; | ||
3031 | Index: b/sshd_config | ||
3032 | =================================================================== | ||
3033 | --- a/sshd_config | ||
3034 | +++ b/sshd_config | ||
3035 | @@ -83,6 +83,8 @@ | ||
3036 | # GSSAPI options | ||
3037 | #GSSAPIAuthentication no | ||
3038 | #GSSAPICleanupCredentials yes | ||
3039 | +#GSSAPIStrictAcceptorCheck yes | ||
3040 | +#GSSAPIKeyExchange no | ||
3041 | |||
3042 | # Set this to 'yes' to enable PAM authentication, account processing, | ||
3043 | # and session processing. If this is enabled, PAM authentication will | ||
3044 | Index: b/sshd_config.5 | ||
3045 | =================================================================== | ||
3046 | --- a/sshd_config.5 | ||
3047 | +++ b/sshd_config.5 | ||
3048 | @@ -484,12 +484,40 @@ | ||
3049 | The default is | ||
3050 | .Dq no . | ||
3051 | Note that this option applies to protocol version 2 only. | ||
3052 | +.It Cm GSSAPIKeyExchange | ||
3053 | +Specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange | ||
3054 | +doesn't rely on ssh keys to verify host identity. | ||
3055 | +The default is | ||
3056 | +.Dq no . | ||
3057 | +Note that this option applies to protocol version 2 only. | ||
3058 | .It Cm GSSAPICleanupCredentials | ||
3059 | Specifies whether to automatically destroy the user's credentials cache | ||
3060 | on logout. | ||
3061 | The default is | ||
3062 | .Dq yes . | ||
3063 | Note that this option applies to protocol version 2 only. | ||
3064 | +.It Cm GSSAPIStrictAcceptorCheck | ||
3065 | +Determines whether to be strict about the identity of the GSSAPI acceptor | ||
3066 | +a client authenticates against. If | ||
3067 | +.Dq yes | ||
3068 | +then the client must authenticate against the | ||
3069 | +.Pa host | ||
3070 | +service on the current hostname. If | ||
3071 | +.Dq no | ||
3072 | +then the client may authenticate against any service key stored in the | ||
3073 | +machine's default store. This facility is provided to assist with operation | ||
3074 | +on multi homed machines. | ||
3075 | +The default is | ||
3076 | +.Dq yes . | ||
3077 | +Note that this option applies only to protocol version 2 GSSAPI connections, | ||
3078 | +and setting it to | ||
3079 | +.Dq no | ||
3080 | +may only work with recent Kerberos GSSAPI libraries. | ||
3081 | +.It Cm GSSAPIStoreCredentialsOnRekey | ||
3082 | +Controls whether the user's GSSAPI credentials should be updated following a | ||
3083 | +successful connection rekeying. This option can be used to accepted renewed | ||
3084 | +or updated credentials from a compatible client. The default is | ||
3085 | +.Dq no . | ||
3086 | .It Cm HostbasedAuthentication | ||
3087 | Specifies whether rhosts or /etc/hosts.equiv authentication together | ||
3088 | with successful public key client host authentication is allowed | ||
diff --git a/debian/patches/helpful-wait-terminate.patch b/debian/patches/helpful-wait-terminate.patch new file mode 100644 index 000000000..298e8e216 --- /dev/null +++ b/debian/patches/helpful-wait-terminate.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Description: Mention ~& when waiting for forwarded connections to terminate | ||
2 | Author: Matthew Vernon <matthew@debian.org> | ||
3 | Bug-Debian: http://bugs.debian.org/50308 | ||
4 | Last-Update: 2010-02-27 | ||
5 | |||
6 | Index: b/serverloop.c | ||
7 | =================================================================== | ||
8 | --- a/serverloop.c | ||
9 | +++ b/serverloop.c | ||
10 | @@ -686,7 +686,7 @@ | ||
11 | if (!channel_still_open()) | ||
12 | break; | ||
13 | if (!waiting_termination) { | ||
14 | - const char *s = "Waiting for forwarded connections to terminate...\r\n"; | ||
15 | + const char *s = "Waiting for forwarded connections to terminate... (press ~& to background)\r\n"; | ||
16 | char *cp; | ||
17 | waiting_termination = 1; | ||
18 | buffer_append(&stderr_buffer, s, strlen(s)); | ||
diff --git a/debian/patches/keepalive-extensions.patch b/debian/patches/keepalive-extensions.patch new file mode 100644 index 000000000..a851a91bf --- /dev/null +++ b/debian/patches/keepalive-extensions.patch | |||
@@ -0,0 +1,124 @@ | |||
1 | Description: Various keepalive extensions | ||
2 | Add compatibility aliases for ProtocolKeepAlives and SetupTimeOut, | ||
3 | supported in previous versions of Debian's OpenSSH package but since | ||
4 | superseded by ServerAliveInterval. (We're probably stuck with this bit for | ||
5 | compatibility.) | ||
6 | . | ||
7 | In batch mode, default ServerAliveInterval to five minutes. | ||
8 | . | ||
9 | Adjust documentation to match and to give some more advice on use of | ||
10 | keepalives. | ||
11 | Author: Richard Kettlewell <rjk@greenend.org.uk> | ||
12 | Author: Ian Jackson <ian@chiark.greenend.org.uk> | ||
13 | Author: Matthew Vernon <matthew@debian.org> | ||
14 | Author: Colin Watson <cjwatson@debian.org> | ||
15 | Last-Update: 2013-09-14 | ||
16 | |||
17 | Index: b/readconf.c | ||
18 | =================================================================== | ||
19 | --- a/readconf.c | ||
20 | +++ b/readconf.c | ||
21 | @@ -141,6 +141,7 @@ | ||
22 | oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, | ||
23 | oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, | ||
24 | oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, | ||
25 | + oProtocolKeepAlives, oSetupTimeOut, | ||
26 | oIgnoredUnknownOption, oDeprecated, oUnsupported | ||
27 | } OpCodes; | ||
28 | |||
29 | @@ -263,6 +264,8 @@ | ||
30 | { "ipqos", oIPQoS }, | ||
31 | { "requesttty", oRequestTTY }, | ||
32 | { "ignoreunknown", oIgnoreUnknown }, | ||
33 | + { "protocolkeepalives", oProtocolKeepAlives }, | ||
34 | + { "setuptimeout", oSetupTimeOut }, | ||
35 | |||
36 | { NULL, oBadOption } | ||
37 | }; | ||
38 | @@ -939,6 +942,8 @@ | ||
39 | goto parse_flag; | ||
40 | |||
41 | case oServerAliveInterval: | ||
42 | + case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
43 | + case oSetupTimeOut: /* Debian-specific compatibility alias */ | ||
44 | intptr = &options->server_alive_interval; | ||
45 | goto parse_time; | ||
46 | |||
47 | @@ -1404,8 +1409,13 @@ | ||
48 | options->rekey_interval = 0; | ||
49 | if (options->verify_host_key_dns == -1) | ||
50 | options->verify_host_key_dns = 0; | ||
51 | - if (options->server_alive_interval == -1) | ||
52 | - options->server_alive_interval = 0; | ||
53 | + if (options->server_alive_interval == -1) { | ||
54 | + /* in batch mode, default is 5mins */ | ||
55 | + if (options->batch_mode == 1) | ||
56 | + options->server_alive_interval = 300; | ||
57 | + else | ||
58 | + options->server_alive_interval = 0; | ||
59 | + } | ||
60 | if (options->server_alive_count_max == -1) | ||
61 | options->server_alive_count_max = 3; | ||
62 | if (options->control_master == -1) | ||
63 | Index: b/ssh_config.5 | ||
64 | =================================================================== | ||
65 | --- a/ssh_config.5 | ||
66 | +++ b/ssh_config.5 | ||
67 | @@ -136,8 +136,12 @@ | ||
68 | If set to | ||
69 | .Dq yes , | ||
70 | passphrase/password querying will be disabled. | ||
71 | +In addition, the | ||
72 | +.Cm ServerAliveInterval | ||
73 | +option will be set to 300 seconds by default. | ||
74 | This option is useful in scripts and other batch jobs where no user | ||
75 | -is present to supply the password. | ||
76 | +is present to supply the password, | ||
77 | +and where it is desirable to detect a broken network swiftly. | ||
78 | The argument must be | ||
79 | .Dq yes | ||
80 | or | ||
81 | @@ -1141,8 +1145,15 @@ | ||
82 | will send a message through the encrypted | ||
83 | channel to request a response from the server. | ||
84 | The default | ||
85 | -is 0, indicating that these messages will not be sent to the server. | ||
86 | +is 0, indicating that these messages will not be sent to the server, | ||
87 | +or 300 if the | ||
88 | +.Cm BatchMode | ||
89 | +option is set. | ||
90 | This option applies to protocol version 2 only. | ||
91 | +.Cm ProtocolKeepAlives | ||
92 | +and | ||
93 | +.Cm SetupTimeOut | ||
94 | +are Debian-specific compatibility aliases for this option. | ||
95 | .It Cm StrictHostKeyChecking | ||
96 | If this flag is set to | ||
97 | .Dq yes , | ||
98 | @@ -1181,6 +1192,12 @@ | ||
99 | other side. | ||
100 | If they are sent, death of the connection or crash of one | ||
101 | of the machines will be properly noticed. | ||
102 | +This option only uses TCP keepalives (as opposed to using ssh level | ||
103 | +keepalives), so takes a long time to notice when the connection dies. | ||
104 | +As such, you probably want | ||
105 | +the | ||
106 | +.Cm ServerAliveInterval | ||
107 | +option as well. | ||
108 | However, this means that | ||
109 | connections will die if the route is down temporarily, and some people | ||
110 | find it annoying. | ||
111 | Index: b/sshd_config.5 | ||
112 | =================================================================== | ||
113 | --- a/sshd_config.5 | ||
114 | +++ b/sshd_config.5 | ||
115 | @@ -1161,6 +1161,9 @@ | ||
116 | .Pp | ||
117 | To disable TCP keepalive messages, the value should be set to | ||
118 | .Dq no . | ||
119 | +.Pp | ||
120 | +This option was formerly called | ||
121 | +.Cm KeepAlive . | ||
122 | .It Cm TrustedUserCAKeys | ||
123 | Specifies a file containing public keys of certificate authorities that are | ||
124 | trusted to sign user certificates for authentication. | ||
diff --git a/debian/patches/lintian-symlink-pickiness.patch b/debian/patches/lintian-symlink-pickiness.patch new file mode 100644 index 000000000..19ae33b22 --- /dev/null +++ b/debian/patches/lintian-symlink-pickiness.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Description: Fix picky lintian errors about slogin symlinks | ||
2 | Apparently this breaks some SVR4 packaging systems, so upstream can't win | ||
3 | either way and opted to keep the status quo. We need this patch anyway. | ||
4 | Author: Colin Watson <cjwatson@debian.org> | ||
5 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1728 | ||
6 | Last-Update: 2013-09-14 | ||
7 | |||
8 | Index: b/Makefile.in | ||
9 | =================================================================== | ||
10 | --- a/Makefile.in | ||
11 | +++ b/Makefile.in | ||
12 | @@ -296,9 +296,9 @@ | ||
13 | $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 | ||
14 | $(INSTALL) -m 644 ssh-vulnkey.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-vulnkey.1 | ||
15 | -rm -f $(DESTDIR)$(bindir)/slogin | ||
16 | - ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin | ||
17 | + ln -s ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin | ||
18 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | ||
19 | - ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | ||
20 | + ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | ||
21 | |||
22 | install-sysconf: | ||
23 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ | ||
diff --git a/debian/patches/mention-ssh-keygen-on-keychange.patch b/debian/patches/mention-ssh-keygen-on-keychange.patch new file mode 100644 index 000000000..55c277031 --- /dev/null +++ b/debian/patches/mention-ssh-keygen-on-keychange.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Description: Mention ssh-keygen in ssh fingerprint changed warning | ||
2 | Author: Scott Moser <smoser@ubuntu.com> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1843 | ||
4 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/686607 | ||
5 | Last-Update: 2013-09-14 | ||
6 | |||
7 | Index: b/sshconnect.c | ||
8 | =================================================================== | ||
9 | --- a/sshconnect.c | ||
10 | +++ b/sshconnect.c | ||
11 | @@ -981,9 +981,12 @@ | ||
12 | error("%s. This could either mean that", key_msg); | ||
13 | error("DNS SPOOFING is happening or the IP address for the host"); | ||
14 | error("and its host key have changed at the same time."); | ||
15 | - if (ip_status != HOST_NEW) | ||
16 | + if (ip_status != HOST_NEW) { | ||
17 | error("Offending key for IP in %s:%lu", | ||
18 | ip_found->file, ip_found->line); | ||
19 | + error(" remove with: ssh-keygen -f \"%s\" -R %s", | ||
20 | + ip_found->file, ip); | ||
21 | + } | ||
22 | } | ||
23 | /* The host key has changed. */ | ||
24 | warn_changed_key(host_key); | ||
25 | @@ -991,6 +994,8 @@ | ||
26 | user_hostfiles[0]); | ||
27 | error("Offending %s key in %s:%lu", key_type(host_found->key), | ||
28 | host_found->file, host_found->line); | ||
29 | + error(" remove with: ssh-keygen -f \"%s\" -R %s", | ||
30 | + host_found->file, host); | ||
31 | |||
32 | /* | ||
33 | * If strict host key checking is in use, the user will have | ||
diff --git a/debian/patches/openbsd-docs.patch b/debian/patches/openbsd-docs.patch new file mode 100644 index 000000000..d4eeee6e8 --- /dev/null +++ b/debian/patches/openbsd-docs.patch | |||
@@ -0,0 +1,135 @@ | |||
1 | Description: Adjust various OpenBSD-specific references in manual pages | ||
2 | No single bug reference for this patch, but history includes: | ||
3 | http://bugs.debian.org/154434 (login.conf(5)) | ||
4 | http://bugs.debian.org/513417 (/etc/rc) | ||
5 | http://bugs.debian.org/530692 (ssl(8)) | ||
6 | https://bugs.launchpad.net/bugs/456660 (ssl(8)) | ||
7 | Author: Colin Watson <cjwatson@debian.org> | ||
8 | Forwarded: not-needed | ||
9 | Last-Update: 2013-09-14 | ||
10 | |||
11 | Index: b/moduli.5 | ||
12 | =================================================================== | ||
13 | --- a/moduli.5 | ||
14 | +++ b/moduli.5 | ||
15 | @@ -21,7 +21,7 @@ | ||
16 | .Nd Diffie-Hellman moduli | ||
17 | .Sh DESCRIPTION | ||
18 | The | ||
19 | -.Pa /etc/moduli | ||
20 | +.Pa /etc/ssh/moduli | ||
21 | file contains prime numbers and generators for use by | ||
22 | .Xr sshd 8 | ||
23 | in the Diffie-Hellman Group Exchange key exchange method. | ||
24 | @@ -110,7 +110,7 @@ | ||
25 | Diffie-Hellman output to sufficiently key the selected symmetric cipher. | ||
26 | .Xr sshd 8 | ||
27 | then randomly selects a modulus from | ||
28 | -.Fa /etc/moduli | ||
29 | +.Fa /etc/ssh/moduli | ||
30 | that best meets the size requirement. | ||
31 | .Sh SEE ALSO | ||
32 | .Xr ssh-keygen 1 , | ||
33 | Index: b/ssh-keygen.1 | ||
34 | =================================================================== | ||
35 | --- a/ssh-keygen.1 | ||
36 | +++ b/ssh-keygen.1 | ||
37 | @@ -171,9 +171,7 @@ | ||
38 | .Pa ~/.ssh/id_dsa | ||
39 | or | ||
40 | .Pa ~/.ssh/id_rsa . | ||
41 | -Additionally, the system administrator may use this to generate host keys, | ||
42 | -as seen in | ||
43 | -.Pa /etc/rc . | ||
44 | +Additionally, the system administrator may use this to generate host keys. | ||
45 | .Pp | ||
46 | Normally this program generates the key and asks for a file in which | ||
47 | to store the private key. | ||
48 | @@ -219,9 +217,7 @@ | ||
49 | For each of the key types (rsa1, rsa, dsa and ecdsa) for which host keys | ||
50 | do not exist, generate the host keys with the default key file path, | ||
51 | an empty passphrase, default bits for the key type, and default comment. | ||
52 | -This is used by | ||
53 | -.Pa /etc/rc | ||
54 | -to generate new host keys. | ||
55 | +This is used by system administration scripts to generate new host keys. | ||
56 | .It Fl a Ar trials | ||
57 | Specifies the number of primality tests to perform when screening DH-GEX | ||
58 | candidates using the | ||
59 | @@ -605,7 +601,7 @@ | ||
60 | Valid generator values are 2, 3, and 5. | ||
61 | .Pp | ||
62 | Screened DH groups may be installed in | ||
63 | -.Pa /etc/moduli . | ||
64 | +.Pa /etc/ssh/moduli . | ||
65 | It is important that this file contains moduli of a range of bit lengths and | ||
66 | that both ends of a connection share common moduli. | ||
67 | .Sh CERTIFICATES | ||
68 | @@ -800,7 +796,7 @@ | ||
69 | where the user wishes to log in using public key authentication. | ||
70 | There is no need to keep the contents of this file secret. | ||
71 | .Pp | ||
72 | -.It Pa /etc/moduli | ||
73 | +.It Pa /etc/ssh/moduli | ||
74 | Contains Diffie-Hellman groups used for DH-GEX. | ||
75 | The file format is described in | ||
76 | .Xr moduli 5 . | ||
77 | Index: b/ssh.1 | ||
78 | =================================================================== | ||
79 | --- a/ssh.1 | ||
80 | +++ b/ssh.1 | ||
81 | @@ -756,6 +756,10 @@ | ||
82 | but protocol 2 may use any. | ||
83 | The HISTORY section of | ||
84 | .Xr ssl 8 | ||
85 | +(on non-OpenBSD systems, see | ||
86 | +.nh | ||
87 | +http://www.openbsd.org/cgi\-bin/man.cgi?query=ssl&sektion=8#HISTORY) | ||
88 | +.hy | ||
89 | contains a brief discussion of the DSA and RSA algorithms. | ||
90 | .Pp | ||
91 | The file | ||
92 | Index: b/sshd.8 | ||
93 | =================================================================== | ||
94 | --- a/sshd.8 | ||
95 | +++ b/sshd.8 | ||
96 | @@ -70,7 +70,7 @@ | ||
97 | .Nm | ||
98 | listens for connections from clients. | ||
99 | It is normally started at boot from | ||
100 | -.Pa /etc/rc . | ||
101 | +.Pa /etc/init.d/ssh . | ||
102 | It forks a new | ||
103 | daemon for each incoming connection. | ||
104 | The forked daemons handle | ||
105 | @@ -859,7 +859,7 @@ | ||
106 | .Xr ssh 1 ) . | ||
107 | It should only be writable by root. | ||
108 | .Pp | ||
109 | -.It Pa /etc/moduli | ||
110 | +.It Pa /etc/ssh/moduli | ||
111 | Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange". | ||
112 | The file format is described in | ||
113 | .Xr moduli 5 . | ||
114 | @@ -957,7 +957,6 @@ | ||
115 | .Xr ssh-vulnkey 1 , | ||
116 | .Xr chroot 2 , | ||
117 | .Xr hosts_access 5 , | ||
118 | -.Xr login.conf 5 , | ||
119 | .Xr moduli 5 , | ||
120 | .Xr sshd_config 5 , | ||
121 | .Xr inetd 8 , | ||
122 | Index: b/sshd_config.5 | ||
123 | =================================================================== | ||
124 | --- a/sshd_config.5 | ||
125 | +++ b/sshd_config.5 | ||
126 | @@ -283,8 +283,7 @@ | ||
127 | By default, no banner is displayed. | ||
128 | .It Cm ChallengeResponseAuthentication | ||
129 | Specifies whether challenge-response authentication is allowed (e.g. via | ||
130 | -PAM or though authentication styles supported in | ||
131 | -.Xr login.conf 5 ) | ||
132 | +PAM). | ||
133 | The default is | ||
134 | .Dq yes . | ||
135 | .It Cm ChrootDirectory | ||
diff --git a/debian/patches/package-versioning.patch b/debian/patches/package-versioning.patch new file mode 100644 index 000000000..2be45ebf8 --- /dev/null +++ b/debian/patches/package-versioning.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | Description: Include the Debian version in our identification | ||
2 | This makes it easier to audit networks for versions patched against | ||
3 | security vulnerabilities. It has little detrimental effect, as attackers | ||
4 | will generally just try attacks rather than bothering to scan for | ||
5 | vulnerable-looking version strings. (However, see debian-banner.patch.) | ||
6 | Author: Matthew Vernon <matthew@debian.org> | ||
7 | Forwarded: not-needed | ||
8 | Last-Update: 2013-09-14 | ||
9 | |||
10 | Index: b/sshconnect.c | ||
11 | =================================================================== | ||
12 | --- a/sshconnect.c | ||
13 | +++ b/sshconnect.c | ||
14 | @@ -442,10 +442,10 @@ | ||
15 | /* Send our own protocol version identification. */ | ||
16 | if (compat20) { | ||
17 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n", | ||
18 | - PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION); | ||
19 | + PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE); | ||
20 | } else { | ||
21 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n", | ||
22 | - PROTOCOL_MAJOR_1, minor1, SSH_VERSION); | ||
23 | + PROTOCOL_MAJOR_1, minor1, SSH_RELEASE); | ||
24 | } | ||
25 | if (roaming_atomicio(vwrite, connection_out, client_version_string, | ||
26 | strlen(client_version_string)) != strlen(client_version_string)) | ||
27 | Index: b/sshd.c | ||
28 | =================================================================== | ||
29 | --- a/sshd.c | ||
30 | +++ b/sshd.c | ||
31 | @@ -440,7 +440,7 @@ | ||
32 | } | ||
33 | |||
34 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", | ||
35 | - major, minor, SSH_VERSION, | ||
36 | + major, minor, SSH_RELEASE, | ||
37 | *options.version_addendum == '\0' ? "" : " ", | ||
38 | options.version_addendum, newline); | ||
39 | |||
40 | Index: b/version.h | ||
41 | =================================================================== | ||
42 | --- a/version.h | ||
43 | +++ b/version.h | ||
44 | @@ -3,4 +3,9 @@ | ||
45 | #define SSH_VERSION "OpenSSH_6.3" | ||
46 | |||
47 | #define SSH_PORTABLE "p1" | ||
48 | -#define SSH_RELEASE SSH_VERSION SSH_PORTABLE | ||
49 | +#define SSH_RELEASE_MINIMUM SSH_VERSION SSH_PORTABLE | ||
50 | +#ifdef SSH_EXTRAVERSION | ||
51 | +#define SSH_RELEASE SSH_RELEASE_MINIMUM " " SSH_EXTRAVERSION | ||
52 | +#else | ||
53 | +#define SSH_RELEASE SSH_RELEASE_MINIMUM | ||
54 | +#endif | ||
diff --git a/debian/patches/quieter-signals.patch b/debian/patches/quieter-signals.patch new file mode 100644 index 000000000..32f4cfc67 --- /dev/null +++ b/debian/patches/quieter-signals.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Description: Reduce severity of "Killed by signal %d" | ||
2 | This produces irritating messages when using ProxyCommand or other programs | ||
3 | that use ssh under the covers (e.g. Subversion). These messages are more | ||
4 | normally printed by the calling program, such as the shell. | ||
5 | . | ||
6 | According to the upstream bug, the right way to avoid this is to use the -q | ||
7 | option, so we may drop this patch after further investigation into whether | ||
8 | any software in Debian is still relying on it. | ||
9 | Author: Peter Samuelson <peter@p12n.org> | ||
10 | Author: Colin Watson <cjwatson@debian.org> | ||
11 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1118 | ||
12 | Bug-Debian: http://bugs.debian.org/313371 | ||
13 | Last-Update: 2013-09-14 | ||
14 | |||
15 | Index: b/clientloop.c | ||
16 | =================================================================== | ||
17 | --- a/clientloop.c | ||
18 | +++ b/clientloop.c | ||
19 | @@ -1717,8 +1717,10 @@ | ||
20 | exit_status = 0; | ||
21 | } | ||
22 | |||
23 | - if (received_signal) | ||
24 | - fatal("Killed by signal %d.", (int) received_signal); | ||
25 | + if (received_signal) { | ||
26 | + debug("Killed by signal %d.", (int) received_signal); | ||
27 | + cleanup_exit((int) received_signal + 128); | ||
28 | + } | ||
29 | |||
30 | /* | ||
31 | * In interactive mode (with pseudo tty) display a message indicating | ||
diff --git a/debian/patches/scp-quoting.patch b/debian/patches/scp-quoting.patch new file mode 100644 index 000000000..239c1b599 --- /dev/null +++ b/debian/patches/scp-quoting.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Description: Adjust scp quoting in verbose mode | ||
2 | Tweak scp's reporting of filenames in verbose mode to be a bit less | ||
3 | confusing with spaces. | ||
4 | . | ||
5 | This should be revised to mimic real shell quoting. | ||
6 | Author: Nicolas Valcárcel <nvalcarcel@ubuntu.com> | ||
7 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/89945 | ||
8 | Last-Update: 2010-02-27 | ||
9 | |||
10 | Index: b/scp.c | ||
11 | =================================================================== | ||
12 | --- a/scp.c | ||
13 | +++ b/scp.c | ||
14 | @@ -189,8 +189,16 @@ | ||
15 | |||
16 | if (verbose_mode) { | ||
17 | fprintf(stderr, "Executing:"); | ||
18 | - for (i = 0; i < a->num; i++) | ||
19 | - fprintf(stderr, " %s", a->list[i]); | ||
20 | + for (i = 0; i < a->num; i++) { | ||
21 | + if (i == 0) | ||
22 | + fprintf(stderr, " %s", a->list[i]); | ||
23 | + else | ||
24 | + /* | ||
25 | + * TODO: misbehaves if a->list[i] contains a | ||
26 | + * single quote | ||
27 | + */ | ||
28 | + fprintf(stderr, " '%s'", a->list[i]); | ||
29 | + } | ||
30 | fprintf(stderr, "\n"); | ||
31 | } | ||
32 | if ((pid = fork()) == -1) | ||
diff --git a/debian/patches/selinux-role.patch b/debian/patches/selinux-role.patch new file mode 100644 index 000000000..f3376c20a --- /dev/null +++ b/debian/patches/selinux-role.patch | |||
@@ -0,0 +1,479 @@ | |||
1 | Description: Handle SELinux authorisation roles | ||
2 | Rejected upstream due to discomfort with magic usernames; a better approach | ||
3 | will need an SSH protocol change. In the meantime, this came from Debian's | ||
4 | SELinux maintainer, so we'll keep it until we have something better. | ||
5 | Author: Manoj Srivastava <srivasta@debian.org> | ||
6 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1641 | ||
7 | Bug-Debian: http://bugs.debian.org/394795 | ||
8 | Last-Update: 2013-09-14 | ||
9 | |||
10 | Index: b/auth.h | ||
11 | =================================================================== | ||
12 | --- a/auth.h | ||
13 | +++ b/auth.h | ||
14 | @@ -59,6 +59,7 @@ | ||
15 | char *service; | ||
16 | struct passwd *pw; /* set if 'valid' */ | ||
17 | char *style; | ||
18 | + char *role; | ||
19 | void *kbdintctxt; | ||
20 | char *info; /* Extra info for next auth_log */ | ||
21 | void *jpake_ctx; | ||
22 | Index: b/auth1.c | ||
23 | =================================================================== | ||
24 | --- a/auth1.c | ||
25 | +++ b/auth1.c | ||
26 | @@ -380,7 +380,7 @@ | ||
27 | do_authentication(Authctxt *authctxt) | ||
28 | { | ||
29 | u_int ulen; | ||
30 | - char *user, *style = NULL; | ||
31 | + char *user, *style = NULL, *role = NULL; | ||
32 | |||
33 | /* Get the name of the user that we wish to log in as. */ | ||
34 | packet_read_expect(SSH_CMSG_USER); | ||
35 | @@ -389,11 +389,17 @@ | ||
36 | user = packet_get_cstring(&ulen); | ||
37 | packet_check_eom(); | ||
38 | |||
39 | + if ((role = strchr(user, '/')) != NULL) | ||
40 | + *role++ = '\0'; | ||
41 | + | ||
42 | if ((style = strchr(user, ':')) != NULL) | ||
43 | *style++ = '\0'; | ||
44 | + else if (role && (style = strchr(role, ':')) != NULL) | ||
45 | + *style++ = '\0'; | ||
46 | |||
47 | authctxt->user = user; | ||
48 | authctxt->style = style; | ||
49 | + authctxt->role = role; | ||
50 | |||
51 | /* Verify that the user is a valid user. */ | ||
52 | if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) | ||
53 | Index: b/auth2.c | ||
54 | =================================================================== | ||
55 | --- a/auth2.c | ||
56 | +++ b/auth2.c | ||
57 | @@ -222,7 +222,7 @@ | ||
58 | { | ||
59 | Authctxt *authctxt = ctxt; | ||
60 | Authmethod *m = NULL; | ||
61 | - char *user, *service, *method, *style = NULL; | ||
62 | + char *user, *service, *method, *style = NULL, *role = NULL; | ||
63 | int authenticated = 0; | ||
64 | |||
65 | if (authctxt == NULL) | ||
66 | @@ -234,8 +234,13 @@ | ||
67 | debug("userauth-request for user %s service %s method %s", user, service, method); | ||
68 | debug("attempt %d failures %d", authctxt->attempt, authctxt->failures); | ||
69 | |||
70 | + if ((role = strchr(user, '/')) != NULL) | ||
71 | + *role++ = 0; | ||
72 | + | ||
73 | if ((style = strchr(user, ':')) != NULL) | ||
74 | *style++ = 0; | ||
75 | + else if (role && (style = strchr(role, ':')) != NULL) | ||
76 | + *style++ = '\0'; | ||
77 | |||
78 | if (authctxt->attempt++ == 0) { | ||
79 | /* setup auth context */ | ||
80 | @@ -259,8 +264,9 @@ | ||
81 | use_privsep ? " [net]" : ""); | ||
82 | authctxt->service = xstrdup(service); | ||
83 | authctxt->style = style ? xstrdup(style) : NULL; | ||
84 | + authctxt->role = role ? xstrdup(role) : NULL; | ||
85 | if (use_privsep) | ||
86 | - mm_inform_authserv(service, style); | ||
87 | + mm_inform_authserv(service, style, role); | ||
88 | userauth_banner(); | ||
89 | if (auth2_setup_methods_lists(authctxt) != 0) | ||
90 | packet_disconnect("no authentication methods enabled"); | ||
91 | Index: b/monitor.c | ||
92 | =================================================================== | ||
93 | --- a/monitor.c | ||
94 | +++ b/monitor.c | ||
95 | @@ -146,6 +146,7 @@ | ||
96 | int mm_answer_pwnamallow(int, Buffer *); | ||
97 | int mm_answer_auth2_read_banner(int, Buffer *); | ||
98 | int mm_answer_authserv(int, Buffer *); | ||
99 | +int mm_answer_authrole(int, Buffer *); | ||
100 | int mm_answer_authpassword(int, Buffer *); | ||
101 | int mm_answer_bsdauthquery(int, Buffer *); | ||
102 | int mm_answer_bsdauthrespond(int, Buffer *); | ||
103 | @@ -227,6 +228,7 @@ | ||
104 | {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, | ||
105 | {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, | ||
106 | {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, | ||
107 | + {MONITOR_REQ_AUTHROLE, MON_ONCE, mm_answer_authrole}, | ||
108 | {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, | ||
109 | {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, | ||
110 | #ifdef USE_PAM | ||
111 | @@ -844,6 +846,7 @@ | ||
112 | else { | ||
113 | /* Allow service/style information on the auth context */ | ||
114 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); | ||
115 | + monitor_permit(mon_dispatch, MONITOR_REQ_AUTHROLE, 1); | ||
116 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); | ||
117 | } | ||
118 | #ifdef USE_PAM | ||
119 | @@ -874,14 +877,37 @@ | ||
120 | |||
121 | authctxt->service = buffer_get_string(m, NULL); | ||
122 | authctxt->style = buffer_get_string(m, NULL); | ||
123 | - debug3("%s: service=%s, style=%s", | ||
124 | - __func__, authctxt->service, authctxt->style); | ||
125 | + authctxt->role = buffer_get_string(m, NULL); | ||
126 | + debug3("%s: service=%s, style=%s, role=%s", | ||
127 | + __func__, authctxt->service, authctxt->style, authctxt->role); | ||
128 | |||
129 | if (strlen(authctxt->style) == 0) { | ||
130 | free(authctxt->style); | ||
131 | authctxt->style = NULL; | ||
132 | } | ||
133 | |||
134 | + if (strlen(authctxt->role) == 0) { | ||
135 | + free(authctxt->role); | ||
136 | + authctxt->role = NULL; | ||
137 | + } | ||
138 | + | ||
139 | + return (0); | ||
140 | +} | ||
141 | + | ||
142 | +int | ||
143 | +mm_answer_authrole(int sock, Buffer *m) | ||
144 | +{ | ||
145 | + monitor_permit_authentications(1); | ||
146 | + | ||
147 | + authctxt->role = buffer_get_string(m, NULL); | ||
148 | + debug3("%s: role=%s", | ||
149 | + __func__, authctxt->role); | ||
150 | + | ||
151 | + if (strlen(authctxt->role) == 0) { | ||
152 | + free(authctxt->role); | ||
153 | + authctxt->role = NULL; | ||
154 | + } | ||
155 | + | ||
156 | return (0); | ||
157 | } | ||
158 | |||
159 | @@ -1486,7 +1512,7 @@ | ||
160 | res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); | ||
161 | if (res == 0) | ||
162 | goto error; | ||
163 | - pty_setowner(authctxt->pw, s->tty); | ||
164 | + pty_setowner(authctxt->pw, s->tty, authctxt->role); | ||
165 | |||
166 | buffer_put_int(m, 1); | ||
167 | buffer_put_cstring(m, s->tty); | ||
168 | Index: b/monitor.h | ||
169 | =================================================================== | ||
170 | --- a/monitor.h | ||
171 | +++ b/monitor.h | ||
172 | @@ -73,6 +73,8 @@ | ||
173 | MONITOR_REQ_GSSSIGN = 150, MONITOR_ANS_GSSSIGN = 151, | ||
174 | MONITOR_REQ_GSSUPCREDS = 152, MONITOR_ANS_GSSUPCREDS = 153, | ||
175 | |||
176 | + MONITOR_REQ_AUTHROLE = 154, | ||
177 | + | ||
178 | }; | ||
179 | |||
180 | struct mm_master; | ||
181 | Index: b/monitor_wrap.c | ||
182 | =================================================================== | ||
183 | --- a/monitor_wrap.c | ||
184 | +++ b/monitor_wrap.c | ||
185 | @@ -320,10 +320,10 @@ | ||
186 | return (banner); | ||
187 | } | ||
188 | |||
189 | -/* Inform the privileged process about service and style */ | ||
190 | +/* Inform the privileged process about service, style, and role */ | ||
191 | |||
192 | void | ||
193 | -mm_inform_authserv(char *service, char *style) | ||
194 | +mm_inform_authserv(char *service, char *style, char *role) | ||
195 | { | ||
196 | Buffer m; | ||
197 | |||
198 | @@ -332,11 +332,29 @@ | ||
199 | buffer_init(&m); | ||
200 | buffer_put_cstring(&m, service); | ||
201 | buffer_put_cstring(&m, style ? style : ""); | ||
202 | + buffer_put_cstring(&m, role ? role : ""); | ||
203 | |||
204 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); | ||
205 | |||
206 | buffer_free(&m); | ||
207 | } | ||
208 | + | ||
209 | +/* Inform the privileged process about role */ | ||
210 | + | ||
211 | +void | ||
212 | +mm_inform_authrole(char *role) | ||
213 | +{ | ||
214 | + Buffer m; | ||
215 | + | ||
216 | + debug3("%s entering", __func__); | ||
217 | + | ||
218 | + buffer_init(&m); | ||
219 | + buffer_put_cstring(&m, role ? role : ""); | ||
220 | + | ||
221 | + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m); | ||
222 | + | ||
223 | + buffer_free(&m); | ||
224 | +} | ||
225 | |||
226 | /* Do the password authentication */ | ||
227 | int | ||
228 | Index: b/monitor_wrap.h | ||
229 | =================================================================== | ||
230 | --- a/monitor_wrap.h | ||
231 | +++ b/monitor_wrap.h | ||
232 | @@ -41,7 +41,8 @@ | ||
233 | int mm_is_monitor(void); | ||
234 | DH *mm_choose_dh(int, int, int); | ||
235 | int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); | ||
236 | -void mm_inform_authserv(char *, char *); | ||
237 | +void mm_inform_authserv(char *, char *, char *); | ||
238 | +void mm_inform_authrole(char *); | ||
239 | struct passwd *mm_getpwnamallow(const char *); | ||
240 | char *mm_auth2_read_banner(void); | ||
241 | int mm_auth_password(struct Authctxt *, char *); | ||
242 | Index: b/openbsd-compat/port-linux.c | ||
243 | =================================================================== | ||
244 | --- a/openbsd-compat/port-linux.c | ||
245 | +++ b/openbsd-compat/port-linux.c | ||
246 | @@ -29,6 +29,12 @@ | ||
247 | #include <string.h> | ||
248 | #include <stdio.h> | ||
249 | |||
250 | +#ifdef WITH_SELINUX | ||
251 | +#include "key.h" | ||
252 | +#include "hostfile.h" | ||
253 | +#include "auth.h" | ||
254 | +#endif | ||
255 | + | ||
256 | #include "log.h" | ||
257 | #include "xmalloc.h" | ||
258 | #include "port-linux.h" | ||
259 | @@ -58,7 +64,7 @@ | ||
260 | |||
261 | /* Return the default security context for the given username */ | ||
262 | static security_context_t | ||
263 | -ssh_selinux_getctxbyname(char *pwname) | ||
264 | +ssh_selinux_getctxbyname(char *pwname, const char *role) | ||
265 | { | ||
266 | security_context_t sc = NULL; | ||
267 | char *sename = NULL, *lvl = NULL; | ||
268 | @@ -73,9 +79,16 @@ | ||
269 | #endif | ||
270 | |||
271 | #ifdef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL | ||
272 | - r = get_default_context_with_level(sename, lvl, NULL, &sc); | ||
273 | + if (role != NULL && role[0]) | ||
274 | + r = get_default_context_with_rolelevel(sename, role, lvl, NULL, | ||
275 | + &sc); | ||
276 | + else | ||
277 | + r = get_default_context_with_level(sename, lvl, NULL, &sc); | ||
278 | #else | ||
279 | - r = get_default_context(sename, NULL, &sc); | ||
280 | + if (role != NULL && role[0]) | ||
281 | + r = get_default_context_with_role(sename, role, NULL, &sc); | ||
282 | + else | ||
283 | + r = get_default_context(sename, NULL, &sc); | ||
284 | #endif | ||
285 | |||
286 | if (r != 0) { | ||
287 | @@ -105,7 +118,7 @@ | ||
288 | |||
289 | /* Set the execution context to the default for the specified user */ | ||
290 | void | ||
291 | -ssh_selinux_setup_exec_context(char *pwname) | ||
292 | +ssh_selinux_setup_exec_context(char *pwname, const char *role) | ||
293 | { | ||
294 | security_context_t user_ctx = NULL; | ||
295 | |||
296 | @@ -114,7 +127,7 @@ | ||
297 | |||
298 | debug3("%s: setting execution context", __func__); | ||
299 | |||
300 | - user_ctx = ssh_selinux_getctxbyname(pwname); | ||
301 | + user_ctx = ssh_selinux_getctxbyname(pwname, role); | ||
302 | if (setexeccon(user_ctx) != 0) { | ||
303 | switch (security_getenforce()) { | ||
304 | case -1: | ||
305 | @@ -136,7 +149,7 @@ | ||
306 | |||
307 | /* Set the TTY context for the specified user */ | ||
308 | void | ||
309 | -ssh_selinux_setup_pty(char *pwname, const char *tty) | ||
310 | +ssh_selinux_setup_pty(char *pwname, const char *tty, const char *role) | ||
311 | { | ||
312 | security_context_t new_tty_ctx = NULL; | ||
313 | security_context_t user_ctx = NULL; | ||
314 | @@ -147,7 +160,7 @@ | ||
315 | |||
316 | debug3("%s: setting TTY context on %s", __func__, tty); | ||
317 | |||
318 | - user_ctx = ssh_selinux_getctxbyname(pwname); | ||
319 | + user_ctx = ssh_selinux_getctxbyname(pwname, role); | ||
320 | |||
321 | /* XXX: should these calls fatal() upon failure in enforcing mode? */ | ||
322 | |||
323 | Index: b/openbsd-compat/port-linux.h | ||
324 | =================================================================== | ||
325 | --- a/openbsd-compat/port-linux.h | ||
326 | +++ b/openbsd-compat/port-linux.h | ||
327 | @@ -21,8 +21,8 @@ | ||
328 | |||
329 | #ifdef WITH_SELINUX | ||
330 | int ssh_selinux_enabled(void); | ||
331 | -void ssh_selinux_setup_pty(char *, const char *); | ||
332 | -void ssh_selinux_setup_exec_context(char *); | ||
333 | +void ssh_selinux_setup_pty(char *, const char *, const char *); | ||
334 | +void ssh_selinux_setup_exec_context(char *, const char *); | ||
335 | void ssh_selinux_change_context(const char *); | ||
336 | void ssh_selinux_setfscreatecon(const char *); | ||
337 | #endif | ||
338 | Index: b/platform.c | ||
339 | =================================================================== | ||
340 | --- a/platform.c | ||
341 | +++ b/platform.c | ||
342 | @@ -134,7 +134,7 @@ | ||
343 | * called if sshd is running as root. | ||
344 | */ | ||
345 | void | ||
346 | -platform_setusercontext_post_groups(struct passwd *pw) | ||
347 | +platform_setusercontext_post_groups(struct passwd *pw, const char *role) | ||
348 | { | ||
349 | #if !defined(HAVE_LOGIN_CAP) && defined(USE_PAM) | ||
350 | /* | ||
351 | @@ -181,7 +181,7 @@ | ||
352 | } | ||
353 | #endif /* HAVE_SETPCRED */ | ||
354 | #ifdef WITH_SELINUX | ||
355 | - ssh_selinux_setup_exec_context(pw->pw_name); | ||
356 | + ssh_selinux_setup_exec_context(pw->pw_name, role); | ||
357 | #endif | ||
358 | } | ||
359 | |||
360 | Index: b/platform.h | ||
361 | =================================================================== | ||
362 | --- a/platform.h | ||
363 | +++ b/platform.h | ||
364 | @@ -26,7 +26,7 @@ | ||
365 | void platform_post_fork_child(void); | ||
366 | int platform_privileged_uidswap(void); | ||
367 | void platform_setusercontext(struct passwd *); | ||
368 | -void platform_setusercontext_post_groups(struct passwd *); | ||
369 | +void platform_setusercontext_post_groups(struct passwd *, const char *); | ||
370 | char *platform_get_krb5_client(const char *); | ||
371 | char *platform_krb5_get_principal_name(const char *); | ||
372 | int platform_sys_dir_uid(uid_t); | ||
373 | Index: b/session.c | ||
374 | =================================================================== | ||
375 | --- a/session.c | ||
376 | +++ b/session.c | ||
377 | @@ -1474,7 +1474,7 @@ | ||
378 | |||
379 | /* Set login name, uid, gid, and groups. */ | ||
380 | void | ||
381 | -do_setusercontext(struct passwd *pw) | ||
382 | +do_setusercontext(struct passwd *pw, const char *role) | ||
383 | { | ||
384 | char *chroot_path, *tmp; | ||
385 | |||
386 | @@ -1502,7 +1502,7 @@ | ||
387 | endgrent(); | ||
388 | #endif | ||
389 | |||
390 | - platform_setusercontext_post_groups(pw); | ||
391 | + platform_setusercontext_post_groups(pw, role); | ||
392 | |||
393 | if (options.chroot_directory != NULL && | ||
394 | strcasecmp(options.chroot_directory, "none") != 0) { | ||
395 | @@ -1646,7 +1646,7 @@ | ||
396 | |||
397 | /* Force a password change */ | ||
398 | if (s->authctxt->force_pwchange) { | ||
399 | - do_setusercontext(pw); | ||
400 | + do_setusercontext(pw, s->authctxt->role); | ||
401 | child_close_fds(); | ||
402 | do_pwchange(s); | ||
403 | exit(1); | ||
404 | @@ -1673,7 +1673,7 @@ | ||
405 | /* When PAM is enabled we rely on it to do the nologin check */ | ||
406 | if (!options.use_pam) | ||
407 | do_nologin(pw); | ||
408 | - do_setusercontext(pw); | ||
409 | + do_setusercontext(pw, s->authctxt->role); | ||
410 | /* | ||
411 | * PAM session modules in do_setusercontext may have | ||
412 | * generated messages, so if this in an interactive | ||
413 | @@ -2084,7 +2084,7 @@ | ||
414 | tty_parse_modes(s->ttyfd, &n_bytes); | ||
415 | |||
416 | if (!use_privsep) | ||
417 | - pty_setowner(s->pw, s->tty); | ||
418 | + pty_setowner(s->pw, s->tty, s->authctxt->role); | ||
419 | |||
420 | /* Set window size from the packet. */ | ||
421 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); | ||
422 | Index: b/session.h | ||
423 | =================================================================== | ||
424 | --- a/session.h | ||
425 | +++ b/session.h | ||
426 | @@ -76,7 +76,7 @@ | ||
427 | Session *session_new(void); | ||
428 | Session *session_by_tty(char *); | ||
429 | void session_close(Session *); | ||
430 | -void do_setusercontext(struct passwd *); | ||
431 | +void do_setusercontext(struct passwd *, const char *); | ||
432 | void child_set_env(char ***envp, u_int *envsizep, const char *name, | ||
433 | const char *value); | ||
434 | |||
435 | Index: b/sshd.c | ||
436 | =================================================================== | ||
437 | --- a/sshd.c | ||
438 | +++ b/sshd.c | ||
439 | @@ -753,7 +753,7 @@ | ||
440 | RAND_seed(rnd, sizeof(rnd)); | ||
441 | |||
442 | /* Drop privileges */ | ||
443 | - do_setusercontext(authctxt->pw); | ||
444 | + do_setusercontext(authctxt->pw, authctxt->role); | ||
445 | |||
446 | skip: | ||
447 | /* It is safe now to apply the key state */ | ||
448 | Index: b/sshpty.c | ||
449 | =================================================================== | ||
450 | --- a/sshpty.c | ||
451 | +++ b/sshpty.c | ||
452 | @@ -200,7 +200,7 @@ | ||
453 | } | ||
454 | |||
455 | void | ||
456 | -pty_setowner(struct passwd *pw, const char *tty) | ||
457 | +pty_setowner(struct passwd *pw, const char *tty, const char *role) | ||
458 | { | ||
459 | struct group *grp; | ||
460 | gid_t gid; | ||
461 | @@ -227,7 +227,7 @@ | ||
462 | strerror(errno)); | ||
463 | |||
464 | #ifdef WITH_SELINUX | ||
465 | - ssh_selinux_setup_pty(pw->pw_name, tty); | ||
466 | + ssh_selinux_setup_pty(pw->pw_name, tty, role); | ||
467 | #endif | ||
468 | |||
469 | if (st.st_uid != pw->pw_uid || st.st_gid != gid) { | ||
470 | Index: b/sshpty.h | ||
471 | =================================================================== | ||
472 | --- a/sshpty.h | ||
473 | +++ b/sshpty.h | ||
474 | @@ -24,4 +24,4 @@ | ||
475 | void pty_release(const char *); | ||
476 | void pty_make_controlling_tty(int *, const char *); | ||
477 | void pty_change_window_size(int, u_int, u_int, u_int, u_int); | ||
478 | -void pty_setowner(struct passwd *, const char *); | ||
479 | +void pty_setowner(struct passwd *, const char *, const char *); | ||
diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..f5c2ebb52 --- /dev/null +++ b/debian/patches/series | |||
@@ -0,0 +1,48 @@ | |||
1 | # GSSAPI | ||
2 | gssapi.patch | ||
3 | |||
4 | # SELinux | ||
5 | selinux-role.patch | ||
6 | |||
7 | # Key blacklisting | ||
8 | ssh-vulnkey.patch | ||
9 | |||
10 | # Keepalive handling | ||
11 | ssh1-keepalive.patch | ||
12 | keepalive-extensions.patch | ||
13 | |||
14 | # Message adjustments | ||
15 | syslog-level-silent.patch | ||
16 | quieter-signals.patch | ||
17 | helpful-wait-terminate.patch | ||
18 | |||
19 | # ConsoleKit | ||
20 | consolekit.patch | ||
21 | |||
22 | # Miscellaneous bug fixes | ||
23 | user-group-modes.patch | ||
24 | scp-quoting.patch | ||
25 | shell-path.patch | ||
26 | dnssec-sshfp.patch | ||
27 | auth-log-verbosity.patch | ||
28 | mention-ssh-keygen-on-keychange.patch | ||
29 | |||
30 | # Versioning | ||
31 | package-versioning.patch | ||
32 | debian-banner.patch | ||
33 | |||
34 | # File system layout | ||
35 | authorized-keys-man-symlink.patch | ||
36 | lintian-symlink-pickiness.patch | ||
37 | |||
38 | # Documentation | ||
39 | openbsd-docs.patch | ||
40 | ssh-argv0.patch | ||
41 | doc-hash-tab-completion.patch | ||
42 | doc-upstart.patch | ||
43 | ssh-agent-setgid.patch | ||
44 | |||
45 | # Debian-specific configuration | ||
46 | gnome-ssh-askpass2-icon.patch | ||
47 | sigstop.patch | ||
48 | debian-config.patch | ||
diff --git a/debian/patches/shell-path.patch b/debian/patches/shell-path.patch new file mode 100644 index 000000000..a1c6efc8d --- /dev/null +++ b/debian/patches/shell-path.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Description: Look for $SHELL on the path for ProxyCommand/LocalCommand | ||
2 | There's some debate on the upstream bug about whether POSIX requires this. | ||
3 | I (Colin Watson) agree with Vincent and think it does. | ||
4 | Author: Colin Watson <cjwatson@debian.org> | ||
5 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1494 | ||
6 | Bug-Debian: http://bugs.debian.org/492728 | ||
7 | Last-Update: 2013-09-14 | ||
8 | |||
9 | Index: b/sshconnect.c | ||
10 | =================================================================== | ||
11 | --- a/sshconnect.c | ||
12 | +++ b/sshconnect.c | ||
13 | @@ -151,7 +151,7 @@ | ||
14 | /* Execute the proxy command. Note that we gave up any | ||
15 | extra privileges above. */ | ||
16 | signal(SIGPIPE, SIG_DFL); | ||
17 | - execv(argv[0], argv); | ||
18 | + execvp(argv[0], argv); | ||
19 | perror(argv[0]); | ||
20 | exit(1); | ||
21 | } | ||
22 | @@ -1298,7 +1298,7 @@ | ||
23 | if (pid == 0) { | ||
24 | signal(SIGPIPE, SIG_DFL); | ||
25 | debug3("Executing %s -c \"%s\"", shell, args); | ||
26 | - execl(shell, shell, "-c", args, (char *)NULL); | ||
27 | + execlp(shell, shell, "-c", args, (char *)NULL); | ||
28 | error("Couldn't execute %s -c \"%s\": %s", | ||
29 | shell, args, strerror(errno)); | ||
30 | _exit(1); | ||
diff --git a/debian/patches/sigstop.patch b/debian/patches/sigstop.patch new file mode 100644 index 000000000..3311a797c --- /dev/null +++ b/debian/patches/sigstop.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Description: Support synchronisation with service supervisor using SIGSTOP | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Forwarded: no | ||
4 | Last-Update: 2013-09-14 | ||
5 | |||
6 | Index: b/sshd.c | ||
7 | =================================================================== | ||
8 | --- a/sshd.c | ||
9 | +++ b/sshd.c | ||
10 | @@ -1914,6 +1914,10 @@ | ||
11 | } | ||
12 | } | ||
13 | |||
14 | + if (getenv("SSH_SIGSTOP")) | ||
15 | + /* Tell service supervisor that we are ready. */ | ||
16 | + kill(getpid(), SIGSTOP); | ||
17 | + | ||
18 | /* Accept a connection and return in a forked child */ | ||
19 | server_accept_loop(&sock_in, &sock_out, | ||
20 | &newsock, config_s); | ||
diff --git a/debian/patches/ssh-agent-setgid.patch b/debian/patches/ssh-agent-setgid.patch new file mode 100644 index 000000000..7e909a165 --- /dev/null +++ b/debian/patches/ssh-agent-setgid.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Description: Document consequences of ssh-agent being setgid in ssh-agent(1) | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Bug-Debian: http://bugs.debian.org/711623 | ||
4 | Forwarded: no | ||
5 | Last-Update: 2013-06-08 | ||
6 | |||
7 | Index: b/ssh-agent.1 | ||
8 | =================================================================== | ||
9 | --- a/ssh-agent.1 | ||
10 | +++ b/ssh-agent.1 | ||
11 | @@ -182,6 +182,21 @@ | ||
12 | .Pp | ||
13 | The agent exits automatically when the command given on the command | ||
14 | line terminates. | ||
15 | +.Pp | ||
16 | +In Debian, | ||
17 | +.Nm | ||
18 | +is installed with the set-group-id bit set, to prevent | ||
19 | +.Xr ptrace 2 | ||
20 | +attacks retrieving private key material. | ||
21 | +This has the side-effect of causing the run-time linker to remove certain | ||
22 | +environment variables which might have security implications for set-id | ||
23 | +programs, including | ||
24 | +.Ev LD_PRELOAD , | ||
25 | +.Ev LD_LIBRARY_PATH , | ||
26 | +and | ||
27 | +.Ev TMPDIR . | ||
28 | +If you need to set any of these environment variables, you will need to do | ||
29 | +so in the program executed by ssh-agent. | ||
30 | .Sh FILES | ||
31 | .Bl -tag -width Ds | ||
32 | .It Pa ~/.ssh/identity | ||
diff --git a/debian/patches/ssh-argv0.patch b/debian/patches/ssh-argv0.patch new file mode 100644 index 000000000..28d144221 --- /dev/null +++ b/debian/patches/ssh-argv0.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Description: ssh(1): Refer to ssh-argv0(1) | ||
2 | Old versions of OpenSSH (up to 2.5 or thereabouts) allowed creating | ||
3 | symlinks to ssh with the name of the host you want to connect to. Debian | ||
4 | ships an ssh-argv0 script restoring this feature; this patch refers to its | ||
5 | manual page from ssh(1). | ||
6 | Bug-Debian: http://bugs.debian.org/111341 | ||
7 | Forwarded: not-needed | ||
8 | Last-Update: 2013-09-14 | ||
9 | |||
10 | Index: b/ssh.1 | ||
11 | =================================================================== | ||
12 | --- a/ssh.1 | ||
13 | +++ b/ssh.1 | ||
14 | @@ -1451,6 +1451,7 @@ | ||
15 | .Xr sftp 1 , | ||
16 | .Xr ssh-add 1 , | ||
17 | .Xr ssh-agent 1 , | ||
18 | +.Xr ssh-argv0 1 , | ||
19 | .Xr ssh-keygen 1 , | ||
20 | .Xr ssh-keyscan 1 , | ||
21 | .Xr ssh-vulnkey 1 , | ||
diff --git a/debian/patches/ssh-vulnkey.patch b/debian/patches/ssh-vulnkey.patch new file mode 100644 index 000000000..a56911290 --- /dev/null +++ b/debian/patches/ssh-vulnkey.patch | |||
@@ -0,0 +1,1382 @@ | |||
1 | Description: Reject vulnerable keys to mitigate Debian OpenSSL flaw | ||
2 | In 2008, Debian (and derived distributions such as Ubuntu) shipped an | ||
3 | OpenSSL package with a flawed random number generator, causing OpenSSH to | ||
4 | generate only a very limited set of keys which were subject to private half | ||
5 | precomputation. To mitigate this, this patch checks key authentications | ||
6 | against a blacklist of known-vulnerable keys, and adds a new ssh-vulnkey | ||
7 | program which can be used to explicitly check keys against that blacklist. | ||
8 | See CVE-2008-0166. | ||
9 | Author: Colin Watson <cjwatson@ubuntu.com> | ||
10 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1469 | ||
11 | Last-Update: 2013-09-14 | ||
12 | |||
13 | Index: b/Makefile.in | ||
14 | =================================================================== | ||
15 | --- a/Makefile.in | ||
16 | +++ b/Makefile.in | ||
17 | @@ -26,6 +26,7 @@ | ||
18 | SFTP_SERVER=$(libexecdir)/sftp-server | ||
19 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign | ||
20 | SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper | ||
21 | +SSH_DATADIR=$(datadir)/ssh | ||
22 | PRIVSEP_PATH=@PRIVSEP_PATH@ | ||
23 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ | ||
24 | STRIP_OPT=@STRIP_OPT@ | ||
25 | @@ -37,7 +38,8 @@ | ||
26 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ | ||
27 | -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \ | ||
28 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ | ||
29 | - -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" | ||
30 | + -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ | ||
31 | + -D_PATH_SSH_DATADIR=\"$(SSH_DATADIR)\" | ||
32 | |||
33 | CC=@CC@ | ||
34 | LD=@LD@ | ||
35 | @@ -61,7 +63,7 @@ | ||
36 | EXEEXT=@EXEEXT@ | ||
37 | MANFMT=@MANFMT@ | ||
38 | |||
39 | -TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) | ||
40 | +TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) ssh-vulnkey$(EXEEXT) | ||
41 | |||
42 | LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \ | ||
43 | canohost.o channels.o cipher.o cipher-aes.o \ | ||
44 | @@ -96,8 +98,8 @@ | ||
45 | sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ | ||
46 | sandbox-seccomp-filter.o | ||
47 | |||
48 | -MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out | ||
49 | -MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 | ||
50 | +MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out ssh-vulnkey.1.out sshd_config.5.out ssh_config.5.out | ||
51 | +MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 ssh-vulnkey.1 sshd_config.5 ssh_config.5 | ||
52 | MANTYPE = @MANTYPE@ | ||
53 | |||
54 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out | ||
55 | @@ -176,6 +178,9 @@ | ||
56 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o | ||
57 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) | ||
58 | |||
59 | +ssh-vulnkey$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-vulnkey.o | ||
60 | + $(LD) -o $@ ssh-vulnkey.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | ||
61 | + | ||
62 | # test driver for the loginrec code - not built by default | ||
63 | logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o | ||
64 | $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) | ||
65 | @@ -272,6 +277,7 @@ | ||
66 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) | ||
67 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) | ||
68 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | ||
69 | + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-vulnkey$(EXEEXT) $(DESTDIR)$(bindir)/ssh-vulnkey$(EXEEXT) | ||
70 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | ||
71 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | ||
72 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | ||
73 | @@ -286,6 +292,7 @@ | ||
74 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | ||
75 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | ||
76 | $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 | ||
77 | + $(INSTALL) -m 644 ssh-vulnkey.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-vulnkey.1 | ||
78 | -rm -f $(DESTDIR)$(bindir)/slogin | ||
79 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin | ||
80 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | ||
81 | @@ -367,6 +374,7 @@ | ||
82 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) | ||
83 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) | ||
84 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) | ||
85 | + -rm -f $(DESTDIR)$(bindir)/ssh-vulnkey$(EXEEXT) | ||
86 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) | ||
87 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) | ||
88 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | ||
89 | @@ -379,6 +387,7 @@ | ||
90 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | ||
91 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | ||
92 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | ||
93 | + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-vulnkey.1 | ||
94 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | ||
95 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | ||
96 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | ||
97 | Index: b/auth-rh-rsa.c | ||
98 | =================================================================== | ||
99 | --- a/auth-rh-rsa.c | ||
100 | +++ b/auth-rh-rsa.c | ||
101 | @@ -44,7 +44,7 @@ | ||
102 | { | ||
103 | HostStatus host_status; | ||
104 | |||
105 | - if (auth_key_is_revoked(client_host_key)) | ||
106 | + if (auth_key_is_revoked(client_host_key, 0)) | ||
107 | return 0; | ||
108 | |||
109 | /* Check if we would accept it using rhosts authentication. */ | ||
110 | Index: b/auth-rsa.c | ||
111 | =================================================================== | ||
112 | --- a/auth-rsa.c | ||
113 | +++ b/auth-rsa.c | ||
114 | @@ -237,7 +237,7 @@ | ||
115 | free(fp); | ||
116 | |||
117 | /* Never accept a revoked key */ | ||
118 | - if (auth_key_is_revoked(key)) | ||
119 | + if (auth_key_is_revoked(key, 0)) | ||
120 | break; | ||
121 | |||
122 | /* We have found the desired key. */ | ||
123 | Index: b/auth.c | ||
124 | =================================================================== | ||
125 | --- a/auth.c | ||
126 | +++ b/auth.c | ||
127 | @@ -59,6 +59,7 @@ | ||
128 | #include "servconf.h" | ||
129 | #include "key.h" | ||
130 | #include "hostfile.h" | ||
131 | +#include "authfile.h" | ||
132 | #include "auth.h" | ||
133 | #include "auth-options.h" | ||
134 | #include "canohost.h" | ||
135 | @@ -657,10 +658,34 @@ | ||
136 | |||
137 | /* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ | ||
138 | int | ||
139 | -auth_key_is_revoked(Key *key) | ||
140 | +auth_key_is_revoked(Key *key, int hostkey) | ||
141 | { | ||
142 | char *key_fp; | ||
143 | |||
144 | + if (blacklisted_key(key, &key_fp) == 1) { | ||
145 | + if (options.permit_blacklisted_keys) { | ||
146 | + if (hostkey) | ||
147 | + error("Host key %s blacklisted (see " | ||
148 | + "ssh-vulnkey(1)); continuing anyway", | ||
149 | + key_fp); | ||
150 | + else | ||
151 | + logit("Public key %s from %s blacklisted (see " | ||
152 | + "ssh-vulnkey(1)); continuing anyway", | ||
153 | + key_fp, get_remote_ipaddr()); | ||
154 | + free(key_fp); | ||
155 | + } else { | ||
156 | + if (hostkey) | ||
157 | + error("Host key %s blacklisted (see " | ||
158 | + "ssh-vulnkey(1))", key_fp); | ||
159 | + else | ||
160 | + logit("Public key %s from %s blacklisted (see " | ||
161 | + "ssh-vulnkey(1))", | ||
162 | + key_fp, get_remote_ipaddr()); | ||
163 | + free(key_fp); | ||
164 | + return 1; | ||
165 | + } | ||
166 | + } | ||
167 | + | ||
168 | if (options.revoked_keys_file == NULL) | ||
169 | return 0; | ||
170 | switch (ssh_krl_file_contains_key(options.revoked_keys_file, key)) { | ||
171 | Index: b/auth.h | ||
172 | =================================================================== | ||
173 | --- a/auth.h | ||
174 | +++ b/auth.h | ||
175 | @@ -191,7 +191,7 @@ | ||
176 | |||
177 | FILE *auth_openkeyfile(const char *, struct passwd *, int); | ||
178 | FILE *auth_openprincipals(const char *, struct passwd *, int); | ||
179 | -int auth_key_is_revoked(Key *); | ||
180 | +int auth_key_is_revoked(Key *, int); | ||
181 | |||
182 | HostStatus | ||
183 | check_key_in_hostfiles(struct passwd *, Key *, const char *, | ||
184 | Index: b/auth2-hostbased.c | ||
185 | =================================================================== | ||
186 | --- a/auth2-hostbased.c | ||
187 | +++ b/auth2-hostbased.c | ||
188 | @@ -150,7 +150,7 @@ | ||
189 | int len; | ||
190 | char *fp; | ||
191 | |||
192 | - if (auth_key_is_revoked(key)) | ||
193 | + if (auth_key_is_revoked(key, 0)) | ||
194 | return 0; | ||
195 | |||
196 | resolvedname = get_canonical_hostname(options.use_dns); | ||
197 | Index: b/auth2-pubkey.c | ||
198 | =================================================================== | ||
199 | --- a/auth2-pubkey.c | ||
200 | +++ b/auth2-pubkey.c | ||
201 | @@ -647,9 +647,10 @@ | ||
202 | u_int success, i; | ||
203 | char *file; | ||
204 | |||
205 | - if (auth_key_is_revoked(key)) | ||
206 | + if (auth_key_is_revoked(key, 0)) | ||
207 | return 0; | ||
208 | - if (key_is_cert(key) && auth_key_is_revoked(key->cert->signature_key)) | ||
209 | + if (key_is_cert(key) && | ||
210 | + auth_key_is_revoked(key->cert->signature_key, 0)) | ||
211 | return 0; | ||
212 | |||
213 | success = user_cert_trusted_ca(pw, key); | ||
214 | Index: b/authfile.c | ||
215 | =================================================================== | ||
216 | --- a/authfile.c | ||
217 | +++ b/authfile.c | ||
218 | @@ -68,6 +68,7 @@ | ||
219 | #include "rsa.h" | ||
220 | #include "misc.h" | ||
221 | #include "atomicio.h" | ||
222 | +#include "pathnames.h" | ||
223 | |||
224 | #define MAX_KEY_FILE_SIZE (1024 * 1024) | ||
225 | |||
226 | @@ -944,3 +945,139 @@ | ||
227 | return ret; | ||
228 | } | ||
229 | |||
230 | +/* Scan a blacklist of known-vulnerable keys in blacklist_file. */ | ||
231 | +static int | ||
232 | +blacklisted_key_in_file(Key *key, const char *blacklist_file, char **fp) | ||
233 | +{ | ||
234 | + int fd = -1; | ||
235 | + char *dgst_hex = NULL; | ||
236 | + char *dgst_packed = NULL, *p; | ||
237 | + int i; | ||
238 | + size_t line_len; | ||
239 | + struct stat st; | ||
240 | + char buf[256]; | ||
241 | + off_t start, lower, upper; | ||
242 | + int ret = 0; | ||
243 | + | ||
244 | + debug("Checking blacklist file %s", blacklist_file); | ||
245 | + fd = open(blacklist_file, O_RDONLY); | ||
246 | + if (fd < 0) { | ||
247 | + ret = -1; | ||
248 | + goto out; | ||
249 | + } | ||
250 | + | ||
251 | + dgst_hex = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); | ||
252 | + /* Remove all colons */ | ||
253 | + dgst_packed = xcalloc(1, strlen(dgst_hex) + 1); | ||
254 | + for (i = 0, p = dgst_packed; dgst_hex[i]; i++) | ||
255 | + if (dgst_hex[i] != ':') | ||
256 | + *p++ = dgst_hex[i]; | ||
257 | + /* Only compare least-significant 80 bits (to keep the blacklist | ||
258 | + * size down) | ||
259 | + */ | ||
260 | + line_len = strlen(dgst_packed + 12); | ||
261 | + if (line_len > 32) | ||
262 | + goto out; | ||
263 | + | ||
264 | + /* Skip leading comments */ | ||
265 | + start = 0; | ||
266 | + for (;;) { | ||
267 | + ssize_t r; | ||
268 | + char *newline; | ||
269 | + | ||
270 | + r = atomicio(read, fd, buf, sizeof(buf)); | ||
271 | + if (r <= 0) | ||
272 | + goto out; | ||
273 | + if (buf[0] != '#') | ||
274 | + break; | ||
275 | + | ||
276 | + newline = memchr(buf, '\n', sizeof(buf)); | ||
277 | + if (!newline) | ||
278 | + goto out; | ||
279 | + start += newline + 1 - buf; | ||
280 | + if (lseek(fd, start, SEEK_SET) < 0) | ||
281 | + goto out; | ||
282 | + } | ||
283 | + | ||
284 | + /* Initialise binary search record numbers */ | ||
285 | + if (fstat(fd, &st) < 0) | ||
286 | + goto out; | ||
287 | + lower = 0; | ||
288 | + upper = (st.st_size - start) / (line_len + 1); | ||
289 | + | ||
290 | + while (lower != upper) { | ||
291 | + off_t cur; | ||
292 | + int cmp; | ||
293 | + | ||
294 | + cur = lower + (upper - lower) / 2; | ||
295 | + | ||
296 | + /* Read this line and compare to digest; this is | ||
297 | + * overflow-safe since cur < max(off_t) / (line_len + 1) */ | ||
298 | + if (lseek(fd, start + cur * (line_len + 1), SEEK_SET) < 0) | ||
299 | + break; | ||
300 | + if (atomicio(read, fd, buf, line_len) != line_len) | ||
301 | + break; | ||
302 | + cmp = memcmp(buf, dgst_packed + 12, line_len); | ||
303 | + if (cmp < 0) { | ||
304 | + if (cur == lower) | ||
305 | + break; | ||
306 | + lower = cur; | ||
307 | + } else if (cmp > 0) { | ||
308 | + if (cur == upper) | ||
309 | + break; | ||
310 | + upper = cur; | ||
311 | + } else { | ||
312 | + debug("Found %s in blacklist", dgst_hex); | ||
313 | + ret = 1; | ||
314 | + break; | ||
315 | + } | ||
316 | + } | ||
317 | + | ||
318 | +out: | ||
319 | + free(dgst_packed); | ||
320 | + if (ret != 1 && dgst_hex) { | ||
321 | + free(dgst_hex); | ||
322 | + dgst_hex = NULL; | ||
323 | + } | ||
324 | + if (fp) | ||
325 | + *fp = dgst_hex; | ||
326 | + if (fd >= 0) | ||
327 | + close(fd); | ||
328 | + return ret; | ||
329 | +} | ||
330 | + | ||
331 | +/* | ||
332 | + * Scan blacklists of known-vulnerable keys. If a vulnerable key is found, | ||
333 | + * its fingerprint is returned in *fp, unless fp is NULL. | ||
334 | + */ | ||
335 | +int | ||
336 | +blacklisted_key(Key *key, char **fp) | ||
337 | +{ | ||
338 | + Key *public; | ||
339 | + char *blacklist_file; | ||
340 | + int ret, ret2; | ||
341 | + | ||
342 | + public = key_demote(key); | ||
343 | + if (public->type == KEY_RSA1) | ||
344 | + public->type = KEY_RSA; | ||
345 | + | ||
346 | + xasprintf(&blacklist_file, "%s.%s-%u", | ||
347 | + _PATH_BLACKLIST, key_type(public), key_size(public)); | ||
348 | + ret = blacklisted_key_in_file(public, blacklist_file, fp); | ||
349 | + free(blacklist_file); | ||
350 | + if (ret > 0) { | ||
351 | + key_free(public); | ||
352 | + return ret; | ||
353 | + } | ||
354 | + | ||
355 | + xasprintf(&blacklist_file, "%s.%s-%u", | ||
356 | + _PATH_BLACKLIST_CONFIG, key_type(public), key_size(public)); | ||
357 | + ret2 = blacklisted_key_in_file(public, blacklist_file, fp); | ||
358 | + free(blacklist_file); | ||
359 | + if (ret2 > ret) | ||
360 | + ret = ret2; | ||
361 | + | ||
362 | + key_free(public); | ||
363 | + return ret; | ||
364 | +} | ||
365 | + | ||
366 | Index: b/authfile.h | ||
367 | =================================================================== | ||
368 | --- a/authfile.h | ||
369 | +++ b/authfile.h | ||
370 | @@ -28,4 +28,6 @@ | ||
371 | int key_perm_ok(int, const char *); | ||
372 | int key_in_file(Key *, const char *, int); | ||
373 | |||
374 | +int blacklisted_key(Key *key, char **fp); | ||
375 | + | ||
376 | #endif | ||
377 | Index: b/pathnames.h | ||
378 | =================================================================== | ||
379 | --- a/pathnames.h | ||
380 | +++ b/pathnames.h | ||
381 | @@ -18,6 +18,10 @@ | ||
382 | #define SSHDIR ETCDIR "/ssh" | ||
383 | #endif | ||
384 | |||
385 | +#ifndef _PATH_SSH_DATADIR | ||
386 | +#define _PATH_SSH_DATADIR "/usr/share/ssh" | ||
387 | +#endif | ||
388 | + | ||
389 | #ifndef _PATH_SSH_PIDDIR | ||
390 | #define _PATH_SSH_PIDDIR "/var/run" | ||
391 | #endif | ||
392 | @@ -44,6 +48,9 @@ | ||
393 | /* Backwards compatibility */ | ||
394 | #define _PATH_DH_PRIMES SSHDIR "/primes" | ||
395 | |||
396 | +#define _PATH_BLACKLIST _PATH_SSH_DATADIR "/blacklist" | ||
397 | +#define _PATH_BLACKLIST_CONFIG SSHDIR "/blacklist" | ||
398 | + | ||
399 | #ifndef _PATH_SSH_PROGRAM | ||
400 | #define _PATH_SSH_PROGRAM "/usr/bin/ssh" | ||
401 | #endif | ||
402 | Index: b/readconf.c | ||
403 | =================================================================== | ||
404 | --- a/readconf.c | ||
405 | +++ b/readconf.c | ||
406 | @@ -128,6 +128,7 @@ | ||
407 | oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, | ||
408 | oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, | ||
409 | oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, | ||
410 | + oUseBlacklistedKeys, | ||
411 | oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, | ||
412 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, | ||
413 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, | ||
414 | @@ -161,6 +162,7 @@ | ||
415 | { "passwordauthentication", oPasswordAuthentication }, | ||
416 | { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, | ||
417 | { "kbdinteractivedevices", oKbdInteractiveDevices }, | ||
418 | + { "useblacklistedkeys", oUseBlacklistedKeys }, | ||
419 | { "rsaauthentication", oRSAAuthentication }, | ||
420 | { "pubkeyauthentication", oPubkeyAuthentication }, | ||
421 | { "dsaauthentication", oPubkeyAuthentication }, /* alias */ | ||
422 | @@ -523,6 +525,10 @@ | ||
423 | intptr = &options->challenge_response_authentication; | ||
424 | goto parse_flag; | ||
425 | |||
426 | + case oUseBlacklistedKeys: | ||
427 | + intptr = &options->use_blacklisted_keys; | ||
428 | + goto parse_flag; | ||
429 | + | ||
430 | case oGssAuthentication: | ||
431 | intptr = &options->gss_authentication; | ||
432 | goto parse_flag; | ||
433 | @@ -1210,6 +1216,7 @@ | ||
434 | options->kbd_interactive_devices = NULL; | ||
435 | options->rhosts_rsa_authentication = -1; | ||
436 | options->hostbased_authentication = -1; | ||
437 | + options->use_blacklisted_keys = -1; | ||
438 | options->batch_mode = -1; | ||
439 | options->check_host_ip = -1; | ||
440 | options->strict_host_key_checking = -1; | ||
441 | @@ -1320,6 +1327,8 @@ | ||
442 | options->rhosts_rsa_authentication = 0; | ||
443 | if (options->hostbased_authentication == -1) | ||
444 | options->hostbased_authentication = 0; | ||
445 | + if (options->use_blacklisted_keys == -1) | ||
446 | + options->use_blacklisted_keys = 0; | ||
447 | if (options->batch_mode == -1) | ||
448 | options->batch_mode = 0; | ||
449 | if (options->check_host_ip == -1) | ||
450 | Index: b/readconf.h | ||
451 | =================================================================== | ||
452 | --- a/readconf.h | ||
453 | +++ b/readconf.h | ||
454 | @@ -59,6 +59,7 @@ | ||
455 | int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ | ||
456 | char *kbd_interactive_devices; /* Keyboard-interactive auth devices. */ | ||
457 | int zero_knowledge_password_authentication; /* Try jpake */ | ||
458 | + int use_blacklisted_keys; /* If true, send */ | ||
459 | int batch_mode; /* Batch mode: do not ask for passwords. */ | ||
460 | int check_host_ip; /* Also keep track of keys for IP address */ | ||
461 | int strict_host_key_checking; /* Strict host key checking. */ | ||
462 | Index: b/servconf.c | ||
463 | =================================================================== | ||
464 | --- a/servconf.c | ||
465 | +++ b/servconf.c | ||
466 | @@ -114,6 +114,7 @@ | ||
467 | options->password_authentication = -1; | ||
468 | options->kbd_interactive_authentication = -1; | ||
469 | options->challenge_response_authentication = -1; | ||
470 | + options->permit_blacklisted_keys = -1; | ||
471 | options->permit_empty_passwd = -1; | ||
472 | options->permit_user_env = -1; | ||
473 | options->use_login = -1; | ||
474 | @@ -257,6 +258,8 @@ | ||
475 | options->kbd_interactive_authentication = 0; | ||
476 | if (options->challenge_response_authentication == -1) | ||
477 | options->challenge_response_authentication = 1; | ||
478 | + if (options->permit_blacklisted_keys == -1) | ||
479 | + options->permit_blacklisted_keys = 0; | ||
480 | if (options->permit_empty_passwd == -1) | ||
481 | options->permit_empty_passwd = 0; | ||
482 | if (options->permit_user_env == -1) | ||
483 | @@ -338,7 +341,7 @@ | ||
484 | sListenAddress, sAddressFamily, | ||
485 | sPrintMotd, sPrintLastLog, sIgnoreRhosts, | ||
486 | sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, | ||
487 | - sStrictModes, sEmptyPasswd, sTCPKeepAlive, | ||
488 | + sStrictModes, sPermitBlacklistedKeys, sEmptyPasswd, sTCPKeepAlive, | ||
489 | sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, | ||
490 | sRekeyLimit, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, | ||
491 | sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, | ||
492 | @@ -451,6 +454,7 @@ | ||
493 | { "x11uselocalhost", sX11UseLocalhost, SSHCFG_ALL }, | ||
494 | { "xauthlocation", sXAuthLocation, SSHCFG_GLOBAL }, | ||
495 | { "strictmodes", sStrictModes, SSHCFG_GLOBAL }, | ||
496 | + { "permitblacklistedkeys", sPermitBlacklistedKeys, SSHCFG_GLOBAL }, | ||
497 | { "permitemptypasswords", sEmptyPasswd, SSHCFG_ALL }, | ||
498 | { "permituserenvironment", sPermitUserEnvironment, SSHCFG_GLOBAL }, | ||
499 | { "uselogin", sUseLogin, SSHCFG_GLOBAL }, | ||
500 | @@ -1158,6 +1162,10 @@ | ||
501 | intptr = &options->tcp_keep_alive; | ||
502 | goto parse_flag; | ||
503 | |||
504 | + case sPermitBlacklistedKeys: | ||
505 | + intptr = &options->permit_blacklisted_keys; | ||
506 | + goto parse_flag; | ||
507 | + | ||
508 | case sEmptyPasswd: | ||
509 | intptr = &options->permit_empty_passwd; | ||
510 | goto parse_flag; | ||
511 | @@ -2036,6 +2044,7 @@ | ||
512 | dump_cfg_fmtint(sX11UseLocalhost, o->x11_use_localhost); | ||
513 | dump_cfg_fmtint(sStrictModes, o->strict_modes); | ||
514 | dump_cfg_fmtint(sTCPKeepAlive, o->tcp_keep_alive); | ||
515 | + dump_cfg_fmtint(sPermitBlacklistedKeys, o->permit_blacklisted_keys); | ||
516 | dump_cfg_fmtint(sEmptyPasswd, o->permit_empty_passwd); | ||
517 | dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); | ||
518 | dump_cfg_fmtint(sUseLogin, o->use_login); | ||
519 | Index: b/servconf.h | ||
520 | =================================================================== | ||
521 | --- a/servconf.h | ||
522 | +++ b/servconf.h | ||
523 | @@ -121,6 +121,7 @@ | ||
524 | int challenge_response_authentication; | ||
525 | int zero_knowledge_password_authentication; | ||
526 | /* If true, permit jpake auth */ | ||
527 | + int permit_blacklisted_keys; /* If true, permit */ | ||
528 | int permit_empty_passwd; /* If false, do not permit empty | ||
529 | * passwords. */ | ||
530 | int permit_user_env; /* If true, read ~/.ssh/environment */ | ||
531 | Index: b/ssh-add.1 | ||
532 | =================================================================== | ||
533 | --- a/ssh-add.1 | ||
534 | +++ b/ssh-add.1 | ||
535 | @@ -81,6 +81,10 @@ | ||
536 | .Nm | ||
537 | to work. | ||
538 | .Pp | ||
539 | +Any keys recorded in the blacklist of known-compromised keys (see | ||
540 | +.Xr ssh-vulnkey 1 ) | ||
541 | +will be refused. | ||
542 | +.Pp | ||
543 | The options are as follows: | ||
544 | .Bl -tag -width Ds | ||
545 | .It Fl c | ||
546 | @@ -186,6 +190,7 @@ | ||
547 | .Xr ssh 1 , | ||
548 | .Xr ssh-agent 1 , | ||
549 | .Xr ssh-keygen 1 , | ||
550 | +.Xr ssh-vulnkey 1 , | ||
551 | .Xr sshd 8 | ||
552 | .Sh AUTHORS | ||
553 | OpenSSH is a derivative of the original and free | ||
554 | Index: b/ssh-add.c | ||
555 | =================================================================== | ||
556 | --- a/ssh-add.c | ||
557 | +++ b/ssh-add.c | ||
558 | @@ -167,7 +167,7 @@ | ||
559 | add_file(AuthenticationConnection *ac, const char *filename, int key_only) | ||
560 | { | ||
561 | Key *private, *cert; | ||
562 | - char *comment = NULL; | ||
563 | + char *comment = NULL, *fp; | ||
564 | char msg[1024], *certpath = NULL; | ||
565 | int fd, perms_ok, ret = -1; | ||
566 | Buffer keyblob; | ||
567 | @@ -243,6 +243,14 @@ | ||
568 | } else { | ||
569 | fprintf(stderr, "Could not add identity: %s\n", filename); | ||
570 | } | ||
571 | + if (blacklisted_key(private, &fp) == 1) { | ||
572 | + fprintf(stderr, "Public key %s blacklisted (see " | ||
573 | + "ssh-vulnkey(1)); refusing to add it\n", fp); | ||
574 | + free(fp); | ||
575 | + key_free(private); | ||
576 | + free(comment); | ||
577 | + return -1; | ||
578 | + } | ||
579 | |||
580 | /* Skip trying to load the cert if requested */ | ||
581 | if (key_only) | ||
582 | Index: b/ssh-keygen.1 | ||
583 | =================================================================== | ||
584 | --- a/ssh-keygen.1 | ||
585 | +++ b/ssh-keygen.1 | ||
586 | @@ -809,6 +809,7 @@ | ||
587 | .Xr ssh 1 , | ||
588 | .Xr ssh-add 1 , | ||
589 | .Xr ssh-agent 1 , | ||
590 | +.Xr ssh-vulnkey 1 , | ||
591 | .Xr moduli 5 , | ||
592 | .Xr sshd 8 | ||
593 | .Rs | ||
594 | Index: b/ssh-vulnkey.1 | ||
595 | =================================================================== | ||
596 | --- /dev/null | ||
597 | +++ b/ssh-vulnkey.1 | ||
598 | @@ -0,0 +1,242 @@ | ||
599 | +.\" Copyright (c) 2008 Canonical Ltd. All rights reserved. | ||
600 | +.\" | ||
601 | +.\" Redistribution and use in source and binary forms, with or without | ||
602 | +.\" modification, are permitted provided that the following conditions | ||
603 | +.\" are met: | ||
604 | +.\" 1. Redistributions of source code must retain the above copyright | ||
605 | +.\" notice, this list of conditions and the following disclaimer. | ||
606 | +.\" 2. Redistributions in binary form must reproduce the above copyright | ||
607 | +.\" notice, this list of conditions and the following disclaimer in the | ||
608 | +.\" documentation and/or other materials provided with the distribution. | ||
609 | +.\" | ||
610 | +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
611 | +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
612 | +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
613 | +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
614 | +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
615 | +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
616 | +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
617 | +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
618 | +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
619 | +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
620 | +.\" | ||
621 | +.Dd $Mdocdate: May 12 2008 $ | ||
622 | +.Dt SSH-VULNKEY 1 | ||
623 | +.Os | ||
624 | +.Sh NAME | ||
625 | +.Nm ssh-vulnkey | ||
626 | +.Nd check blacklist of compromised keys | ||
627 | +.Sh SYNOPSIS | ||
628 | +.Nm | ||
629 | +.Op Fl q | Fl v | ||
630 | +.Ar file ... | ||
631 | +.Nm | ||
632 | +.Fl a | ||
633 | +.Sh DESCRIPTION | ||
634 | +.Nm | ||
635 | +checks a key against a blacklist of compromised keys. | ||
636 | +.Pp | ||
637 | +A substantial number of keys are known to have been generated using a broken | ||
638 | +version of OpenSSL distributed by Debian which failed to seed its random | ||
639 | +number generator correctly. | ||
640 | +Keys generated using these OpenSSL versions should be assumed to be | ||
641 | +compromised. | ||
642 | +This tool may be useful in checking for such keys. | ||
643 | +.Pp | ||
644 | +Keys that are compromised cannot be repaired; replacements must be generated | ||
645 | +using | ||
646 | +.Xr ssh-keygen 1 . | ||
647 | +Make sure to update | ||
648 | +.Pa authorized_keys | ||
649 | +files on all systems where compromised keys were permitted to authenticate. | ||
650 | +.Pp | ||
651 | +The argument list will be interpreted as a list of paths to public key files | ||
652 | +or | ||
653 | +.Pa authorized_keys | ||
654 | +files. | ||
655 | +If no suitable file is found at a given path, | ||
656 | +.Nm | ||
657 | +will append | ||
658 | +.Pa .pub | ||
659 | +and retry, in case it was given a private key file. | ||
660 | +If no files are given as arguments, | ||
661 | +.Nm | ||
662 | +will check | ||
663 | +.Pa ~/.ssh/id_rsa , | ||
664 | +.Pa ~/.ssh/id_dsa , | ||
665 | +.Pa ~/.ssh/identity , | ||
666 | +.Pa ~/.ssh/authorized_keys | ||
667 | +and | ||
668 | +.Pa ~/.ssh/authorized_keys2 , | ||
669 | +as well as the system's host keys if readable. | ||
670 | +.Pp | ||
671 | +If | ||
672 | +.Dq - | ||
673 | +is given as an argument, | ||
674 | +.Nm | ||
675 | +will read from standard input. | ||
676 | +This can be used to process output from | ||
677 | +.Xr ssh-keyscan 1 , | ||
678 | +for example: | ||
679 | +.Pp | ||
680 | +.Dl $ ssh-keyscan -t rsa remote.example.org | ssh-vulnkey - | ||
681 | +.Pp | ||
682 | +Unless the | ||
683 | +.Cm PermitBlacklistedKeys | ||
684 | +option is used, | ||
685 | +.Xr sshd 8 | ||
686 | +will reject attempts to authenticate with keys in the compromised list. | ||
687 | +.Pp | ||
688 | +The output from | ||
689 | +.Nm | ||
690 | +looks like this: | ||
691 | +.Pp | ||
692 | +.Bd -literal -offset indent | ||
693 | +/etc/ssh/ssh_host_key:1: COMPROMISED: RSA1 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@host | ||
694 | +/home/user/.ssh/id_dsa:1: Not blacklisted: DSA 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx /home/user/.ssh/id_dsa.pub | ||
695 | +/home/user/.ssh/authorized_keys:3: Unknown (blacklist file not installed): RSA 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user@host | ||
696 | +.Ed | ||
697 | +.Pp | ||
698 | +Each line is of the following format (any lines beginning with | ||
699 | +.Dq # | ||
700 | +should be ignored by scripts): | ||
701 | +.Pp | ||
702 | +.Dl Ar filename : Ns Ar line : Ar status : Ar type Ar size Ar fingerprint Ar comment | ||
703 | +.Pp | ||
704 | +It is important to distinguish between the possible values of | ||
705 | +.Ar status : | ||
706 | +.Pp | ||
707 | +.Bl -tag -width Ds | ||
708 | +.It COMPROMISED | ||
709 | +These keys are listed in a blacklist file, normally because their | ||
710 | +corresponding private keys are well-known. | ||
711 | +Replacements must be generated using | ||
712 | +.Xr ssh-keygen 1 . | ||
713 | +.It Not blacklisted | ||
714 | +A blacklist file exists for this key type and size, but this key is not | ||
715 | +listed in it. | ||
716 | +Unless there is some particular reason to believe otherwise, this key | ||
717 | +may be used safely. | ||
718 | +(Note that DSA keys used with the broken version of OpenSSL distributed | ||
719 | +by Debian may be compromised in the event that anyone captured a network | ||
720 | +trace, even if they were generated with a secure version of OpenSSL.) | ||
721 | +.It Unknown (blacklist file not installed) | ||
722 | +No blacklist file exists for this key type and size. | ||
723 | +You should find a suitable published blacklist and install it before | ||
724 | +deciding whether this key is safe to use. | ||
725 | +.El | ||
726 | +.Pp | ||
727 | +The options are as follows: | ||
728 | +.Bl -tag -width Ds | ||
729 | +.It Fl a | ||
730 | +Check keys of all users on the system. | ||
731 | +You will typically need to run | ||
732 | +.Nm | ||
733 | +as root to use this option. | ||
734 | +For each user, | ||
735 | +.Nm | ||
736 | +will check | ||
737 | +.Pa ~/.ssh/id_rsa , | ||
738 | +.Pa ~/.ssh/id_dsa , | ||
739 | +.Pa ~/.ssh/identity , | ||
740 | +.Pa ~/.ssh/authorized_keys | ||
741 | +and | ||
742 | +.Pa ~/.ssh/authorized_keys2 . | ||
743 | +It will also check the system's host keys. | ||
744 | +.It Fl q | ||
745 | +Quiet mode. | ||
746 | +Normally, | ||
747 | +.Nm | ||
748 | +outputs the fingerprint of each key scanned, with a description of its | ||
749 | +status. | ||
750 | +This option suppresses that output. | ||
751 | +.It Fl v | ||
752 | +Verbose mode. | ||
753 | +Normally, | ||
754 | +.Nm | ||
755 | +does not output anything for keys that are not listed in their corresponding | ||
756 | +blacklist file (although it still produces output for keys for which there | ||
757 | +is no blacklist file, since their status is unknown). | ||
758 | +This option causes | ||
759 | +.Nm | ||
760 | +to produce output for all keys. | ||
761 | +.El | ||
762 | +.Sh EXIT STATUS | ||
763 | +.Nm | ||
764 | +will exit zero if any of the given keys were in the compromised list, | ||
765 | +otherwise non-zero. | ||
766 | +.Sh BLACKLIST FILE FORMAT | ||
767 | +The blacklist file may start with comments, on lines starting with | ||
768 | +.Dq # . | ||
769 | +After these initial comments, it must follow a strict format: | ||
770 | +.Pp | ||
771 | +.Bl -bullet -offset indent -compact | ||
772 | +.It | ||
773 | +All the lines must be exactly the same length (20 characters followed by a | ||
774 | +newline) and must be in sorted order. | ||
775 | +.It | ||
776 | +Each line must consist of the lower-case hexadecimal MD5 key fingerprint, | ||
777 | +without colons, and with the first 12 characters removed (that is, the least | ||
778 | +significant 80 bits of the fingerprint). | ||
779 | +.El | ||
780 | +.Pp | ||
781 | +The key fingerprint may be generated using | ||
782 | +.Xr ssh-keygen 1 : | ||
783 | +.Pp | ||
784 | +.Dl $ ssh-keygen -l -f /path/to/key | ||
785 | +.Pp | ||
786 | +This strict format is necessary to allow the blacklist file to be checked | ||
787 | +quickly, using a binary-search algorithm. | ||
788 | +.Sh FILES | ||
789 | +.Bl -tag -width Ds | ||
790 | +.It Pa ~/.ssh/id_rsa | ||
791 | +If present, contains the protocol version 2 RSA authentication identity of | ||
792 | +the user. | ||
793 | +.It Pa ~/.ssh/id_dsa | ||
794 | +If present, contains the protocol version 2 DSA authentication identity of | ||
795 | +the user. | ||
796 | +.It Pa ~/.ssh/identity | ||
797 | +If present, contains the protocol version 1 RSA authentication identity of | ||
798 | +the user. | ||
799 | +.It Pa ~/.ssh/authorized_keys | ||
800 | +If present, lists the public keys (RSA/DSA) that can be used for logging in | ||
801 | +as this user. | ||
802 | +.It Pa ~/.ssh/authorized_keys2 | ||
803 | +Obsolete name for | ||
804 | +.Pa ~/.ssh/authorized_keys . | ||
805 | +This file may still be present on some old systems, but should not be | ||
806 | +created if it is missing. | ||
807 | +.It Pa /etc/ssh/ssh_host_rsa_key | ||
808 | +If present, contains the protocol version 2 RSA identity of the system. | ||
809 | +.It Pa /etc/ssh/ssh_host_dsa_key | ||
810 | +If present, contains the protocol version 2 DSA identity of the system. | ||
811 | +.It Pa /etc/ssh/ssh_host_key | ||
812 | +If present, contains the protocol version 1 RSA identity of the system. | ||
813 | +.It Pa /usr/share/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH | ||
814 | +If present, lists the blacklisted keys of type | ||
815 | +.Ar TYPE | ||
816 | +.Pf ( Dq RSA | ||
817 | +or | ||
818 | +.Dq DSA ) | ||
819 | +and bit length | ||
820 | +.Ar LENGTH . | ||
821 | +The format of this file is described above. | ||
822 | +RSA1 keys are converted to RSA before being checked in the blacklist. | ||
823 | +Note that the fingerprints of RSA1 keys are computed differently, so you | ||
824 | +will not be able to find them in the blacklist by hand. | ||
825 | +.It Pa /etc/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH | ||
826 | +Same as | ||
827 | +.Pa /usr/share/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH , | ||
828 | +but may be edited by the system administrator to add new blacklist entries. | ||
829 | +.El | ||
830 | +.Sh SEE ALSO | ||
831 | +.Xr ssh-keygen 1 , | ||
832 | +.Xr sshd 8 | ||
833 | +.Sh AUTHORS | ||
834 | +.An -nosplit | ||
835 | +.An Colin Watson Aq cjwatson@ubuntu.com | ||
836 | +.Pp | ||
837 | +Florian Weimer suggested the option to check keys of all users, and the idea | ||
838 | +of processing | ||
839 | +.Xr ssh-keyscan 1 | ||
840 | +output. | ||
841 | Index: b/ssh-vulnkey.c | ||
842 | =================================================================== | ||
843 | --- /dev/null | ||
844 | +++ b/ssh-vulnkey.c | ||
845 | @@ -0,0 +1,386 @@ | ||
846 | +/* | ||
847 | + * Copyright (c) 2008 Canonical Ltd. All rights reserved. | ||
848 | + * | ||
849 | + * Redistribution and use in source and binary forms, with or without | ||
850 | + * modification, are permitted provided that the following conditions | ||
851 | + * are met: | ||
852 | + * 1. Redistributions of source code must retain the above copyright | ||
853 | + * notice, this list of conditions and the following disclaimer. | ||
854 | + * 2. Redistributions in binary form must reproduce the above copyright | ||
855 | + * notice, this list of conditions and the following disclaimer in the | ||
856 | + * documentation and/or other materials provided with the distribution. | ||
857 | + * | ||
858 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
859 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
860 | + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
861 | + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
862 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
863 | + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
864 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
865 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
866 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
867 | + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
868 | + */ | ||
869 | + | ||
870 | +#include "includes.h" | ||
871 | + | ||
872 | +#include <sys/types.h> | ||
873 | +#include <sys/stat.h> | ||
874 | + | ||
875 | +#include <errno.h> | ||
876 | +#include <string.h> | ||
877 | +#include <stdio.h> | ||
878 | +#include <fcntl.h> | ||
879 | +#include <unistd.h> | ||
880 | + | ||
881 | +#include <openssl/evp.h> | ||
882 | + | ||
883 | +#include "xmalloc.h" | ||
884 | +#include "ssh.h" | ||
885 | +#include "log.h" | ||
886 | +#include "key.h" | ||
887 | +#include "authfile.h" | ||
888 | +#include "pathnames.h" | ||
889 | +#include "uidswap.h" | ||
890 | +#include "misc.h" | ||
891 | + | ||
892 | +extern char *__progname; | ||
893 | + | ||
894 | +/* Default files to check */ | ||
895 | +static char *default_host_files[] = { | ||
896 | + _PATH_HOST_RSA_KEY_FILE, | ||
897 | + _PATH_HOST_DSA_KEY_FILE, | ||
898 | + _PATH_HOST_KEY_FILE, | ||
899 | + NULL | ||
900 | +}; | ||
901 | +static char *default_files[] = { | ||
902 | + _PATH_SSH_CLIENT_ID_RSA, | ||
903 | + _PATH_SSH_CLIENT_ID_DSA, | ||
904 | + _PATH_SSH_CLIENT_IDENTITY, | ||
905 | + _PATH_SSH_USER_PERMITTED_KEYS, | ||
906 | + _PATH_SSH_USER_PERMITTED_KEYS2, | ||
907 | + NULL | ||
908 | +}; | ||
909 | + | ||
910 | +static int verbosity = 0; | ||
911 | + | ||
912 | +static int some_keys = 0; | ||
913 | +static int some_unknown = 0; | ||
914 | +static int some_compromised = 0; | ||
915 | + | ||
916 | +static void | ||
917 | +usage(void) | ||
918 | +{ | ||
919 | + fprintf(stderr, "usage: %s [-aqv] [file ...]\n", __progname); | ||
920 | + fprintf(stderr, "Options:\n"); | ||
921 | + fprintf(stderr, " -a Check keys of all users.\n"); | ||
922 | + fprintf(stderr, " -q Quiet mode.\n"); | ||
923 | + fprintf(stderr, " -v Verbose mode.\n"); | ||
924 | + exit(1); | ||
925 | +} | ||
926 | + | ||
927 | +static void | ||
928 | +describe_key(const char *filename, u_long linenum, const char *msg, | ||
929 | + Key *key, const char *comment, int min_verbosity) | ||
930 | +{ | ||
931 | + char *fp; | ||
932 | + | ||
933 | + fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); | ||
934 | + if (verbosity >= min_verbosity) { | ||
935 | + if (strchr(filename, ':')) | ||
936 | + printf("\"%s\"", filename); | ||
937 | + else | ||
938 | + printf("%s", filename); | ||
939 | + printf(":%lu: %s: %s %u %s %s\n", linenum, msg, | ||
940 | + key_type(key), key_size(key), fp, comment); | ||
941 | + } | ||
942 | + free(fp); | ||
943 | +} | ||
944 | + | ||
945 | +static int | ||
946 | +do_key(const char *filename, u_long linenum, | ||
947 | + Key *key, const char *comment) | ||
948 | +{ | ||
949 | + Key *public; | ||
950 | + int blacklist_status; | ||
951 | + int ret = 1; | ||
952 | + | ||
953 | + some_keys = 1; | ||
954 | + | ||
955 | + public = key_demote(key); | ||
956 | + if (public->type == KEY_RSA1) | ||
957 | + public->type = KEY_RSA; | ||
958 | + | ||
959 | + blacklist_status = blacklisted_key(public, NULL); | ||
960 | + if (blacklist_status == -1) { | ||
961 | + describe_key(filename, linenum, | ||
962 | + "Unknown (blacklist file not installed)", key, comment, 0); | ||
963 | + some_unknown = 1; | ||
964 | + } else if (blacklist_status == 1) { | ||
965 | + describe_key(filename, linenum, | ||
966 | + "COMPROMISED", key, comment, 0); | ||
967 | + some_compromised = 1; | ||
968 | + ret = 0; | ||
969 | + } else | ||
970 | + describe_key(filename, linenum, | ||
971 | + "Not blacklisted", key, comment, 1); | ||
972 | + | ||
973 | + key_free(public); | ||
974 | + | ||
975 | + return ret; | ||
976 | +} | ||
977 | + | ||
978 | +static int | ||
979 | +do_filename(const char *filename, int quiet_open) | ||
980 | +{ | ||
981 | + FILE *f; | ||
982 | + char line[SSH_MAX_PUBKEY_BYTES]; | ||
983 | + char *cp; | ||
984 | + u_long linenum = 0; | ||
985 | + Key *key; | ||
986 | + char *comment = NULL; | ||
987 | + int found = 0, ret = 1; | ||
988 | + | ||
989 | + /* Copy much of key_load_public's logic here so that we can read | ||
990 | + * several keys from a single file (e.g. authorized_keys). | ||
991 | + */ | ||
992 | + | ||
993 | + if (strcmp(filename, "-") != 0) { | ||
994 | + int save_errno; | ||
995 | + f = fopen(filename, "r"); | ||
996 | + save_errno = errno; | ||
997 | + if (!f) { | ||
998 | + char pubfile[MAXPATHLEN]; | ||
999 | + if (strlcpy(pubfile, filename, sizeof pubfile) < | ||
1000 | + sizeof(pubfile) && | ||
1001 | + strlcat(pubfile, ".pub", sizeof pubfile) < | ||
1002 | + sizeof(pubfile)) | ||
1003 | + f = fopen(pubfile, "r"); | ||
1004 | + } | ||
1005 | + errno = save_errno; /* earlier errno is more useful */ | ||
1006 | + if (!f) { | ||
1007 | + if (!quiet_open) | ||
1008 | + perror(filename); | ||
1009 | + return -1; | ||
1010 | + } | ||
1011 | + if (verbosity > 0) | ||
1012 | + printf("# %s\n", filename); | ||
1013 | + } else | ||
1014 | + f = stdin; | ||
1015 | + while (read_keyfile_line(f, filename, line, sizeof(line), | ||
1016 | + &linenum) != -1) { | ||
1017 | + int i; | ||
1018 | + char *space; | ||
1019 | + int type; | ||
1020 | + char *end; | ||
1021 | + | ||
1022 | + /* Chop trailing newline. */ | ||
1023 | + i = strlen(line) - 1; | ||
1024 | + if (line[i] == '\n') | ||
1025 | + line[i] = '\0'; | ||
1026 | + | ||
1027 | + /* Skip leading whitespace, empty and comment lines. */ | ||
1028 | + for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | ||
1029 | + ; | ||
1030 | + if (!*cp || *cp == '\n' || *cp == '#') | ||
1031 | + continue; | ||
1032 | + | ||
1033 | + /* Cope with ssh-keyscan output and options in | ||
1034 | + * authorized_keys files. | ||
1035 | + */ | ||
1036 | + space = strchr(cp, ' '); | ||
1037 | + if (!space) | ||
1038 | + continue; | ||
1039 | + *space = '\0'; | ||
1040 | + type = key_type_from_name(cp); | ||
1041 | + *space = ' '; | ||
1042 | + /* Leading number (RSA1) or valid type (RSA/DSA) indicates | ||
1043 | + * that we have no host name or options to skip. | ||
1044 | + */ | ||
1045 | + if ((strtol(cp, &end, 10) == 0 || *end != ' ') && | ||
1046 | + type == KEY_UNSPEC) { | ||
1047 | + int quoted = 0; | ||
1048 | + | ||
1049 | + for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { | ||
1050 | + if (*cp == '\\' && cp[1] == '"') | ||
1051 | + cp++; /* Skip both */ | ||
1052 | + else if (*cp == '"') | ||
1053 | + quoted = !quoted; | ||
1054 | + } | ||
1055 | + /* Skip remaining whitespace. */ | ||
1056 | + for (; *cp == ' ' || *cp == '\t'; cp++) | ||
1057 | + ; | ||
1058 | + if (!*cp) | ||
1059 | + continue; | ||
1060 | + } | ||
1061 | + | ||
1062 | + /* Read and process the key itself. */ | ||
1063 | + key = key_new(KEY_RSA1); | ||
1064 | + if (key_read(key, &cp) == 1) { | ||
1065 | + while (*cp == ' ' || *cp == '\t') | ||
1066 | + cp++; | ||
1067 | + if (!do_key(filename, linenum, | ||
1068 | + key, *cp ? cp : filename)) | ||
1069 | + ret = 0; | ||
1070 | + found = 1; | ||
1071 | + } else { | ||
1072 | + key_free(key); | ||
1073 | + key = key_new(KEY_UNSPEC); | ||
1074 | + if (key_read(key, &cp) == 1) { | ||
1075 | + while (*cp == ' ' || *cp == '\t') | ||
1076 | + cp++; | ||
1077 | + if (!do_key(filename, linenum, | ||
1078 | + key, *cp ? cp : filename)) | ||
1079 | + ret = 0; | ||
1080 | + found = 1; | ||
1081 | + } | ||
1082 | + } | ||
1083 | + key_free(key); | ||
1084 | + } | ||
1085 | + if (f != stdin) | ||
1086 | + fclose(f); | ||
1087 | + | ||
1088 | + if (!found && filename) { | ||
1089 | + key = key_load_public(filename, &comment); | ||
1090 | + if (key) { | ||
1091 | + if (!do_key(filename, 1, key, comment)) | ||
1092 | + ret = 0; | ||
1093 | + found = 1; | ||
1094 | + } | ||
1095 | + free(comment); | ||
1096 | + } | ||
1097 | + | ||
1098 | + return ret; | ||
1099 | +} | ||
1100 | + | ||
1101 | +static int | ||
1102 | +do_host(int quiet_open) | ||
1103 | +{ | ||
1104 | + int i; | ||
1105 | + struct stat st; | ||
1106 | + int ret = 1; | ||
1107 | + | ||
1108 | + for (i = 0; default_host_files[i]; i++) { | ||
1109 | + if (stat(default_host_files[i], &st) < 0 && errno == ENOENT) | ||
1110 | + continue; | ||
1111 | + if (!do_filename(default_host_files[i], quiet_open)) | ||
1112 | + ret = 0; | ||
1113 | + } | ||
1114 | + | ||
1115 | + return ret; | ||
1116 | +} | ||
1117 | + | ||
1118 | +static int | ||
1119 | +do_user(const char *dir) | ||
1120 | +{ | ||
1121 | + int i; | ||
1122 | + char *file; | ||
1123 | + struct stat st; | ||
1124 | + int ret = 1; | ||
1125 | + | ||
1126 | + for (i = 0; default_files[i]; i++) { | ||
1127 | + xasprintf(&file, "%s/%s", dir, default_files[i]); | ||
1128 | + if (stat(file, &st) < 0 && errno == ENOENT) { | ||
1129 | + free(file); | ||
1130 | + continue; | ||
1131 | + } | ||
1132 | + if (!do_filename(file, 0)) | ||
1133 | + ret = 0; | ||
1134 | + free(file); | ||
1135 | + } | ||
1136 | + | ||
1137 | + return ret; | ||
1138 | +} | ||
1139 | + | ||
1140 | +int | ||
1141 | +main(int argc, char **argv) | ||
1142 | +{ | ||
1143 | + int opt, all_users = 0; | ||
1144 | + int ret = 1; | ||
1145 | + extern int optind; | ||
1146 | + | ||
1147 | + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | ||
1148 | + sanitise_stdfd(); | ||
1149 | + | ||
1150 | + __progname = ssh_get_progname(argv[0]); | ||
1151 | + | ||
1152 | + SSLeay_add_all_algorithms(); | ||
1153 | + log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); | ||
1154 | + | ||
1155 | + /* We don't need the RNG ourselves, but symbol references here allow | ||
1156 | + * ld to link us properly. | ||
1157 | + */ | ||
1158 | + seed_rng(); | ||
1159 | + | ||
1160 | + while ((opt = getopt(argc, argv, "ahqv")) != -1) { | ||
1161 | + switch (opt) { | ||
1162 | + case 'a': | ||
1163 | + all_users = 1; | ||
1164 | + break; | ||
1165 | + case 'q': | ||
1166 | + verbosity--; | ||
1167 | + break; | ||
1168 | + case 'v': | ||
1169 | + verbosity++; | ||
1170 | + break; | ||
1171 | + case 'h': | ||
1172 | + default: | ||
1173 | + usage(); | ||
1174 | + } | ||
1175 | + } | ||
1176 | + | ||
1177 | + if (all_users) { | ||
1178 | + struct passwd *pw; | ||
1179 | + | ||
1180 | + if (!do_host(0)) | ||
1181 | + ret = 0; | ||
1182 | + | ||
1183 | + while ((pw = getpwent()) != NULL) { | ||
1184 | + if (pw->pw_dir) { | ||
1185 | + temporarily_use_uid(pw); | ||
1186 | + if (!do_user(pw->pw_dir)) | ||
1187 | + ret = 0; | ||
1188 | + restore_uid(); | ||
1189 | + } | ||
1190 | + } | ||
1191 | + } else if (optind == argc) { | ||
1192 | + struct passwd *pw; | ||
1193 | + | ||
1194 | + if (!do_host(1)) | ||
1195 | + ret = 0; | ||
1196 | + | ||
1197 | + if ((pw = getpwuid(geteuid())) == NULL) | ||
1198 | + fprintf(stderr, "No user found with uid %u\n", | ||
1199 | + (u_int)geteuid()); | ||
1200 | + else { | ||
1201 | + if (!do_user(pw->pw_dir)) | ||
1202 | + ret = 0; | ||
1203 | + } | ||
1204 | + } else { | ||
1205 | + while (optind < argc) | ||
1206 | + if (!do_filename(argv[optind++], 0)) | ||
1207 | + ret = 0; | ||
1208 | + } | ||
1209 | + | ||
1210 | + if (verbosity >= 0) { | ||
1211 | + if (some_unknown) { | ||
1212 | + printf("#\n"); | ||
1213 | + printf("# The status of some keys on your system is unknown.\n"); | ||
1214 | + printf("# You may need to install additional blacklist files.\n"); | ||
1215 | + } | ||
1216 | + if (some_compromised) { | ||
1217 | + printf("#\n"); | ||
1218 | + printf("# Some keys on your system have been compromised!\n"); | ||
1219 | + printf("# You must replace them using ssh-keygen(1).\n"); | ||
1220 | + } | ||
1221 | + if (some_unknown || some_compromised) { | ||
1222 | + printf("#\n"); | ||
1223 | + printf("# See the ssh-vulnkey(1) manual page for further advice.\n"); | ||
1224 | + } else if (some_keys && verbosity > 0) { | ||
1225 | + printf("#\n"); | ||
1226 | + printf("# No blacklisted keys!\n"); | ||
1227 | + } | ||
1228 | + } | ||
1229 | + | ||
1230 | + return ret; | ||
1231 | +} | ||
1232 | Index: b/ssh.1 | ||
1233 | =================================================================== | ||
1234 | --- a/ssh.1 | ||
1235 | +++ b/ssh.1 | ||
1236 | @@ -1447,6 +1447,7 @@ | ||
1237 | .Xr ssh-agent 1 , | ||
1238 | .Xr ssh-keygen 1 , | ||
1239 | .Xr ssh-keyscan 1 , | ||
1240 | +.Xr ssh-vulnkey 1 , | ||
1241 | .Xr tun 4 , | ||
1242 | .Xr hosts.equiv 5 , | ||
1243 | .Xr ssh_config 5 , | ||
1244 | Index: b/ssh.c | ||
1245 | =================================================================== | ||
1246 | --- a/ssh.c | ||
1247 | +++ b/ssh.c | ||
1248 | @@ -1525,7 +1525,7 @@ | ||
1249 | static void | ||
1250 | load_public_identity_files(void) | ||
1251 | { | ||
1252 | - char *filename, *cp, thishost[NI_MAXHOST]; | ||
1253 | + char *filename, *cp, thishost[NI_MAXHOST], *fp; | ||
1254 | char *pwdir = NULL, *pwname = NULL; | ||
1255 | int i = 0; | ||
1256 | Key *public; | ||
1257 | @@ -1583,6 +1583,22 @@ | ||
1258 | public = key_load_public(filename, NULL); | ||
1259 | debug("identity file %s type %d", filename, | ||
1260 | public ? public->type : -1); | ||
1261 | + if (public && blacklisted_key(public, &fp) == 1) { | ||
1262 | + if (options.use_blacklisted_keys) | ||
1263 | + logit("Public key %s blacklisted (see " | ||
1264 | + "ssh-vulnkey(1)); continuing anyway", fp); | ||
1265 | + else | ||
1266 | + logit("Public key %s blacklisted (see " | ||
1267 | + "ssh-vulnkey(1)); refusing to send it", | ||
1268 | + fp); | ||
1269 | + free(fp); | ||
1270 | + if (!options.use_blacklisted_keys) { | ||
1271 | + key_free(public); | ||
1272 | + free(filename); | ||
1273 | + filename = NULL; | ||
1274 | + public = NULL; | ||
1275 | + } | ||
1276 | + } | ||
1277 | free(options.identity_files[i]); | ||
1278 | identity_files[n_ids] = filename; | ||
1279 | identity_keys[n_ids] = public; | ||
1280 | Index: b/ssh_config.5 | ||
1281 | =================================================================== | ||
1282 | --- a/ssh_config.5 | ||
1283 | +++ b/ssh_config.5 | ||
1284 | @@ -1229,6 +1229,23 @@ | ||
1285 | .Dq any . | ||
1286 | The default is | ||
1287 | .Dq any:any . | ||
1288 | +.It Cm UseBlacklistedKeys | ||
1289 | +Specifies whether | ||
1290 | +.Xr ssh 1 | ||
1291 | +should use keys recorded in its blacklist of known-compromised keys (see | ||
1292 | +.Xr ssh-vulnkey 1 ) | ||
1293 | +for authentication. | ||
1294 | +If | ||
1295 | +.Dq yes , | ||
1296 | +then attempts to use compromised keys for authentication will be logged but | ||
1297 | +accepted. | ||
1298 | +It is strongly recommended that this be used only to install new authorized | ||
1299 | +keys on the remote system, and even then only with the utmost care. | ||
1300 | +If | ||
1301 | +.Dq no , | ||
1302 | +then attempts to use compromised keys for authentication will be prevented. | ||
1303 | +The default is | ||
1304 | +.Dq no . | ||
1305 | .It Cm UsePrivilegedPort | ||
1306 | Specifies whether to use a privileged port for outgoing connections. | ||
1307 | The argument must be | ||
1308 | Index: b/sshconnect2.c | ||
1309 | =================================================================== | ||
1310 | --- a/sshconnect2.c | ||
1311 | +++ b/sshconnect2.c | ||
1312 | @@ -1491,6 +1491,8 @@ | ||
1313 | |||
1314 | /* list of keys stored in the filesystem and PKCS#11 */ | ||
1315 | for (i = 0; i < options.num_identity_files; i++) { | ||
1316 | + if (options.identity_files[i] == NULL) | ||
1317 | + continue; | ||
1318 | key = options.identity_keys[i]; | ||
1319 | if (key && key->type == KEY_RSA1) | ||
1320 | continue; | ||
1321 | @@ -1608,7 +1610,7 @@ | ||
1322 | debug("Offering %s public key: %s", key_type(id->key), | ||
1323 | id->filename); | ||
1324 | sent = send_pubkey_test(authctxt, id); | ||
1325 | - } else if (id->key == NULL) { | ||
1326 | + } else if (id->key == NULL && id->filename) { | ||
1327 | debug("Trying private key: %s", id->filename); | ||
1328 | id->key = load_identity_file(id->filename, | ||
1329 | id->userprovided); | ||
1330 | Index: b/sshd.8 | ||
1331 | =================================================================== | ||
1332 | --- a/sshd.8 | ||
1333 | +++ b/sshd.8 | ||
1334 | @@ -954,6 +954,7 @@ | ||
1335 | .Xr ssh-agent 1 , | ||
1336 | .Xr ssh-keygen 1 , | ||
1337 | .Xr ssh-keyscan 1 , | ||
1338 | +.Xr ssh-vulnkey 1 , | ||
1339 | .Xr chroot 2 , | ||
1340 | .Xr hosts_access 5 , | ||
1341 | .Xr login.conf 5 , | ||
1342 | Index: b/sshd.c | ||
1343 | =================================================================== | ||
1344 | --- a/sshd.c | ||
1345 | +++ b/sshd.c | ||
1346 | @@ -1688,6 +1688,11 @@ | ||
1347 | sensitive_data.host_pubkeys[i] = NULL; | ||
1348 | continue; | ||
1349 | } | ||
1350 | + if (auth_key_is_revoked(key != NULL ? key : pubkey, 1)) { | ||
1351 | + sensitive_data.host_keys[i] = NULL; | ||
1352 | + sensitive_data.host_pubkeys[i] = NULL; | ||
1353 | + continue; | ||
1354 | + } | ||
1355 | |||
1356 | switch (keytype) { | ||
1357 | case KEY_RSA1: | ||
1358 | Index: b/sshd_config.5 | ||
1359 | =================================================================== | ||
1360 | --- a/sshd_config.5 | ||
1361 | +++ b/sshd_config.5 | ||
1362 | @@ -885,6 +885,20 @@ | ||
1363 | Specifies whether password authentication is allowed. | ||
1364 | The default is | ||
1365 | .Dq yes . | ||
1366 | +.It Cm PermitBlacklistedKeys | ||
1367 | +Specifies whether | ||
1368 | +.Xr sshd 8 | ||
1369 | +should allow keys recorded in its blacklist of known-compromised keys (see | ||
1370 | +.Xr ssh-vulnkey 1 ) . | ||
1371 | +If | ||
1372 | +.Dq yes , | ||
1373 | +then attempts to authenticate with compromised keys will be logged but | ||
1374 | +accepted. | ||
1375 | +If | ||
1376 | +.Dq no , | ||
1377 | +then attempts to authenticate with compromised keys will be rejected. | ||
1378 | +The default is | ||
1379 | +.Dq no . | ||
1380 | .It Cm PermitEmptyPasswords | ||
1381 | When password authentication is allowed, it specifies whether the | ||
1382 | server allows login to accounts with empty password strings. | ||
diff --git a/debian/patches/ssh1-keepalive.patch b/debian/patches/ssh1-keepalive.patch new file mode 100644 index 000000000..de61e1dd9 --- /dev/null +++ b/debian/patches/ssh1-keepalive.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | Description: Partial server keep-alive implementation for SSH1 | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1712 | ||
4 | Last-Update: 2013-09-14 | ||
5 | |||
6 | Index: b/clientloop.c | ||
7 | =================================================================== | ||
8 | --- a/clientloop.c | ||
9 | +++ b/clientloop.c | ||
10 | @@ -563,16 +563,21 @@ | ||
11 | static void | ||
12 | server_alive_check(void) | ||
13 | { | ||
14 | - if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | ||
15 | - logit("Timeout, server %s not responding.", host); | ||
16 | - cleanup_exit(255); | ||
17 | + if (compat20) { | ||
18 | + if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | ||
19 | + logit("Timeout, server %s not responding.", host); | ||
20 | + cleanup_exit(255); | ||
21 | + } | ||
22 | + packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
23 | + packet_put_cstring("keepalive@openssh.com"); | ||
24 | + packet_put_char(1); /* boolean: want reply */ | ||
25 | + packet_send(); | ||
26 | + /* Insert an empty placeholder to maintain ordering */ | ||
27 | + client_register_global_confirm(NULL, NULL); | ||
28 | + } else { | ||
29 | + packet_send_ignore(0); | ||
30 | + packet_send(); | ||
31 | } | ||
32 | - packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
33 | - packet_put_cstring("keepalive@openssh.com"); | ||
34 | - packet_put_char(1); /* boolean: want reply */ | ||
35 | - packet_send(); | ||
36 | - /* Insert an empty placeholder to maintain ordering */ | ||
37 | - client_register_global_confirm(NULL, NULL); | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | @@ -634,7 +639,7 @@ | ||
42 | */ | ||
43 | |||
44 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ | ||
45 | - if (options.server_alive_interval > 0 && compat20) { | ||
46 | + if (options.server_alive_interval > 0) { | ||
47 | timeout_secs = options.server_alive_interval; | ||
48 | server_alive_time = now + options.server_alive_interval; | ||
49 | } | ||
50 | Index: b/ssh_config.5 | ||
51 | =================================================================== | ||
52 | --- a/ssh_config.5 | ||
53 | +++ b/ssh_config.5 | ||
54 | @@ -1130,7 +1130,10 @@ | ||
55 | .Cm ServerAliveCountMax | ||
56 | is left at the default, if the server becomes unresponsive, | ||
57 | ssh will disconnect after approximately 45 seconds. | ||
58 | -This option applies to protocol version 2 only. | ||
59 | +This option applies to protocol version 2 only; in protocol version | ||
60 | +1 there is no mechanism to request a response from the server to the | ||
61 | +server alive messages, so disconnection is the responsibility of the TCP | ||
62 | +stack. | ||
63 | .It Cm ServerAliveInterval | ||
64 | Sets a timeout interval in seconds after which if no data has been received | ||
65 | from the server, | ||
diff --git a/debian/patches/syslog-level-silent.patch b/debian/patches/syslog-level-silent.patch new file mode 100644 index 000000000..f8be76c89 --- /dev/null +++ b/debian/patches/syslog-level-silent.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Description: "LogLevel SILENT" compatibility | ||
2 | "LogLevel SILENT" (-qq) was introduced in Debian openssh 1:3.0.1p1-1 to | ||
3 | match the behaviour of non-free SSH, in which -q does not suppress fatal | ||
4 | errors. However, this was unintentionally broken in 1:4.6p1-2 and nobody | ||
5 | complained, so we've dropped most of it. The parts that remain are basic | ||
6 | configuration file compatibility, and an adjustment to "Pseudo-terminal | ||
7 | will not be allocated ..." which should be split out into a separate patch. | ||
8 | Author: Jonathan David Amery <jdamery@ysolde.ucam.org> | ||
9 | Author: Matthew Vernon <matthew@debian.org> | ||
10 | Author: Colin Watson <cjwatson@debian.org> | ||
11 | Last-Update: 2013-09-14 | ||
12 | |||
13 | Index: b/log.c | ||
14 | =================================================================== | ||
15 | --- a/log.c | ||
16 | +++ b/log.c | ||
17 | @@ -94,6 +94,7 @@ | ||
18 | LogLevel val; | ||
19 | } log_levels[] = | ||
20 | { | ||
21 | + { "SILENT", SYSLOG_LEVEL_QUIET }, /* compatibility */ | ||
22 | { "QUIET", SYSLOG_LEVEL_QUIET }, | ||
23 | { "FATAL", SYSLOG_LEVEL_FATAL }, | ||
24 | { "ERROR", SYSLOG_LEVEL_ERROR }, | ||
25 | Index: b/ssh.c | ||
26 | =================================================================== | ||
27 | --- a/ssh.c | ||
28 | +++ b/ssh.c | ||
29 | @@ -740,7 +740,7 @@ | ||
30 | /* Do not allocate a tty if stdin is not a tty. */ | ||
31 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && | ||
32 | options.request_tty != REQUEST_TTY_FORCE) { | ||
33 | - if (tty_flag) | ||
34 | + if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) | ||
35 | logit("Pseudo-terminal will not be allocated because " | ||
36 | "stdin is not a terminal."); | ||
37 | tty_flag = 0; | ||
diff --git a/debian/patches/user-group-modes.patch b/debian/patches/user-group-modes.patch new file mode 100644 index 000000000..ac00edac6 --- /dev/null +++ b/debian/patches/user-group-modes.patch | |||
@@ -0,0 +1,250 @@ | |||
1 | Description: Allow harmless group-writability | ||
2 | Allow secure files (~/.ssh/config, ~/.ssh/authorized_keys, etc.) to be | ||
3 | group-writable, provided that the group in question contains only the | ||
4 | file's owner. Rejected upstream for IMO incorrect reasons (e.g. a | ||
5 | misunderstanding about the contents of gr->gr_mem). Given that | ||
6 | per-user groups and umask 002 are the default setup in Debian (for good | ||
7 | reasons - this makes operating in setgid directories with other groups | ||
8 | much easier), we need to permit this by default. | ||
9 | Author: Colin Watson <cjwatson@debian.org> | ||
10 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1060 | ||
11 | Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314347 | ||
12 | Last-Update: 2013-09-14 | ||
13 | |||
14 | Index: b/readconf.c | ||
15 | =================================================================== | ||
16 | --- a/readconf.c | ||
17 | +++ b/readconf.c | ||
18 | @@ -30,6 +30,8 @@ | ||
19 | #include <stdio.h> | ||
20 | #include <string.h> | ||
21 | #include <unistd.h> | ||
22 | +#include <pwd.h> | ||
23 | +#include <grp.h> | ||
24 | #ifdef HAVE_UTIL_H | ||
25 | #include <util.h> | ||
26 | #endif | ||
27 | @@ -1160,8 +1162,7 @@ | ||
28 | |||
29 | if (fstat(fileno(f), &sb) == -1) | ||
30 | fatal("fstat %s: %s", filename, strerror(errno)); | ||
31 | - if (((sb.st_uid != 0 && sb.st_uid != getuid()) || | ||
32 | - (sb.st_mode & 022) != 0)) | ||
33 | + if (!secure_permissions(&sb, getuid())) | ||
34 | fatal("Bad owner or permissions on %s", filename); | ||
35 | } | ||
36 | |||
37 | Index: b/ssh.1 | ||
38 | =================================================================== | ||
39 | --- a/ssh.1 | ||
40 | +++ b/ssh.1 | ||
41 | @@ -1338,6 +1338,8 @@ | ||
42 | .Xr ssh_config 5 . | ||
43 | Because of the potential for abuse, this file must have strict permissions: | ||
44 | read/write for the user, and not writable by others. | ||
45 | +It may be group-writable provided that the group in question contains only | ||
46 | +the user. | ||
47 | .Pp | ||
48 | .It Pa ~/.ssh/environment | ||
49 | Contains additional definitions for environment variables; see | ||
50 | Index: b/ssh_config.5 | ||
51 | =================================================================== | ||
52 | --- a/ssh_config.5 | ||
53 | +++ b/ssh_config.5 | ||
54 | @@ -1382,6 +1382,8 @@ | ||
55 | This file is used by the SSH client. | ||
56 | Because of the potential for abuse, this file must have strict permissions: | ||
57 | read/write for the user, and not accessible by others. | ||
58 | +It may be group-writable provided that the group in question contains only | ||
59 | +the user. | ||
60 | .It Pa /etc/ssh/ssh_config | ||
61 | Systemwide configuration file. | ||
62 | This file provides defaults for those | ||
63 | Index: b/auth.c | ||
64 | =================================================================== | ||
65 | --- a/auth.c | ||
66 | +++ b/auth.c | ||
67 | @@ -408,8 +408,7 @@ | ||
68 | user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); | ||
69 | if (options.strict_modes && | ||
70 | (stat(user_hostfile, &st) == 0) && | ||
71 | - ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | ||
72 | - (st.st_mode & 022) != 0)) { | ||
73 | + !secure_permissions(&st, pw->pw_uid)) { | ||
74 | logit("Authentication refused for %.100s: " | ||
75 | "bad owner or modes for %.200s", | ||
76 | pw->pw_name, user_hostfile); | ||
77 | @@ -471,8 +470,7 @@ | ||
78 | snprintf(err, errlen, "%s is not a regular file", buf); | ||
79 | return -1; | ||
80 | } | ||
81 | - if ((!platform_sys_dir_uid(stp->st_uid) && stp->st_uid != uid) || | ||
82 | - (stp->st_mode & 022) != 0) { | ||
83 | + if (!secure_permissions(stp, uid)) { | ||
84 | snprintf(err, errlen, "bad ownership or modes for file %s", | ||
85 | buf); | ||
86 | return -1; | ||
87 | @@ -487,8 +485,7 @@ | ||
88 | strlcpy(buf, cp, sizeof(buf)); | ||
89 | |||
90 | if (stat(buf, &st) < 0 || | ||
91 | - (!platform_sys_dir_uid(st.st_uid) && st.st_uid != uid) || | ||
92 | - (st.st_mode & 022) != 0) { | ||
93 | + !secure_permissions(&st, uid)) { | ||
94 | snprintf(err, errlen, | ||
95 | "bad ownership or modes for directory %s", buf); | ||
96 | return -1; | ||
97 | Index: b/misc.c | ||
98 | =================================================================== | ||
99 | --- a/misc.c | ||
100 | +++ b/misc.c | ||
101 | @@ -48,8 +48,9 @@ | ||
102 | #include <netdb.h> | ||
103 | #ifdef HAVE_PATHS_H | ||
104 | # include <paths.h> | ||
105 | -#include <pwd.h> | ||
106 | #endif | ||
107 | +#include <pwd.h> | ||
108 | +#include <grp.h> | ||
109 | #ifdef SSH_TUN_OPENBSD | ||
110 | #include <net/if.h> | ||
111 | #endif | ||
112 | @@ -58,6 +59,7 @@ | ||
113 | #include "misc.h" | ||
114 | #include "log.h" | ||
115 | #include "ssh.h" | ||
116 | +#include "platform.h" | ||
117 | |||
118 | /* remove newline at end of string */ | ||
119 | char * | ||
120 | @@ -642,6 +644,71 @@ | ||
121 | return -1; | ||
122 | } | ||
123 | |||
124 | +/* | ||
125 | + * return 1 if the specified uid is a uid that may own a system directory | ||
126 | + * otherwise 0. | ||
127 | + */ | ||
128 | +int | ||
129 | +platform_sys_dir_uid(uid_t uid) | ||
130 | +{ | ||
131 | + if (uid == 0) | ||
132 | + return 1; | ||
133 | +#ifdef PLATFORM_SYS_DIR_UID | ||
134 | + if (uid == PLATFORM_SYS_DIR_UID) | ||
135 | + return 1; | ||
136 | +#endif | ||
137 | + return 0; | ||
138 | +} | ||
139 | + | ||
140 | +int | ||
141 | +secure_permissions(struct stat *st, uid_t uid) | ||
142 | +{ | ||
143 | + if (!platform_sys_dir_uid(st->st_uid) && st->st_uid != uid) | ||
144 | + return 0; | ||
145 | + if ((st->st_mode & 002) != 0) | ||
146 | + return 0; | ||
147 | + if ((st->st_mode & 020) != 0) { | ||
148 | + /* If the file is group-writable, the group in question must | ||
149 | + * have exactly one member, namely the file's owner. | ||
150 | + * (Zero-member groups are typically used by setgid | ||
151 | + * binaries, and are unlikely to be suitable.) | ||
152 | + */ | ||
153 | + struct passwd *pw; | ||
154 | + struct group *gr; | ||
155 | + int members = 0; | ||
156 | + | ||
157 | + gr = getgrgid(st->st_gid); | ||
158 | + if (!gr) | ||
159 | + return 0; | ||
160 | + | ||
161 | + /* Check primary group memberships. */ | ||
162 | + while ((pw = getpwent()) != NULL) { | ||
163 | + if (pw->pw_gid == gr->gr_gid) { | ||
164 | + ++members; | ||
165 | + if (pw->pw_uid != uid) | ||
166 | + return 0; | ||
167 | + } | ||
168 | + } | ||
169 | + endpwent(); | ||
170 | + | ||
171 | + pw = getpwuid(st->st_uid); | ||
172 | + if (!pw) | ||
173 | + return 0; | ||
174 | + | ||
175 | + /* Check supplementary group memberships. */ | ||
176 | + if (gr->gr_mem[0]) { | ||
177 | + ++members; | ||
178 | + if (strcmp(pw->pw_name, gr->gr_mem[0]) || | ||
179 | + gr->gr_mem[1]) | ||
180 | + return 0; | ||
181 | + } | ||
182 | + | ||
183 | + if (!members) | ||
184 | + return 0; | ||
185 | + } | ||
186 | + return 1; | ||
187 | +} | ||
188 | + | ||
189 | int | ||
190 | tun_open(int tun, int mode) | ||
191 | { | ||
192 | Index: b/misc.h | ||
193 | =================================================================== | ||
194 | --- a/misc.h | ||
195 | +++ b/misc.h | ||
196 | @@ -104,4 +104,6 @@ | ||
197 | int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2))); | ||
198 | int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *); | ||
199 | |||
200 | +int secure_permissions(struct stat *st, uid_t uid); | ||
201 | + | ||
202 | #endif /* _MISC_H */ | ||
203 | Index: b/auth-rhosts.c | ||
204 | =================================================================== | ||
205 | --- a/auth-rhosts.c | ||
206 | +++ b/auth-rhosts.c | ||
207 | @@ -256,8 +256,7 @@ | ||
208 | return 0; | ||
209 | } | ||
210 | if (options.strict_modes && | ||
211 | - ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | ||
212 | - (st.st_mode & 022) != 0)) { | ||
213 | + !secure_permissions(&st, pw->pw_uid)) { | ||
214 | logit("Rhosts authentication refused for %.100s: " | ||
215 | "bad ownership or modes for home directory.", pw->pw_name); | ||
216 | auth_debug_add("Rhosts authentication refused for %.100s: " | ||
217 | @@ -283,8 +282,7 @@ | ||
218 | * allowing access to their account by anyone. | ||
219 | */ | ||
220 | if (options.strict_modes && | ||
221 | - ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | ||
222 | - (st.st_mode & 022) != 0)) { | ||
223 | + !secure_permissions(&st, pw->pw_uid)) { | ||
224 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", | ||
225 | pw->pw_name, buf); | ||
226 | auth_debug_add("Bad file modes for %.200s", buf); | ||
227 | Index: b/platform.c | ||
228 | =================================================================== | ||
229 | --- a/platform.c | ||
230 | +++ b/platform.c | ||
231 | @@ -194,19 +194,3 @@ | ||
232 | return NULL; | ||
233 | #endif | ||
234 | } | ||
235 | - | ||
236 | -/* | ||
237 | - * return 1 if the specified uid is a uid that may own a system directory | ||
238 | - * otherwise 0. | ||
239 | - */ | ||
240 | -int | ||
241 | -platform_sys_dir_uid(uid_t uid) | ||
242 | -{ | ||
243 | - if (uid == 0) | ||
244 | - return 1; | ||
245 | -#ifdef PLATFORM_SYS_DIR_UID | ||
246 | - if (uid == PLATFORM_SYS_DIR_UID) | ||
247 | - return 1; | ||
248 | -#endif | ||
249 | - return 0; | ||
250 | -} | ||
diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..d53bafa4c --- /dev/null +++ b/debian/rules | |||
@@ -0,0 +1,228 @@ | |||
1 | #!/usr/bin/make -f | ||
2 | |||
3 | # Uncomment this to turn on verbose mode. | ||
4 | # export DH_VERBOSE=1 | ||
5 | |||
6 | # This has to be exported to make some magic below work. | ||
7 | export DH_OPTIONS | ||
8 | |||
9 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) | ||
10 | RUN_TESTS := yes | ||
11 | else | ||
12 | RUN_TESTS := | ||
13 | endif | ||
14 | |||
15 | ifeq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | ||
16 | PARALLEL := | ||
17 | else | ||
18 | PARALLEL := \ | ||
19 | -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | ||
20 | endif | ||
21 | |||
22 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | ||
23 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | ||
24 | |||
25 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
26 | CC := gcc | ||
27 | PKG_CONFIG = pkg-config | ||
28 | else | ||
29 | CC := $(DEB_HOST_GNU_TYPE)-gcc | ||
30 | PKG_CONFIG = $(DEB_HOST_GNU_TYPE)-pkg-config | ||
31 | RUN_TESTS := | ||
32 | endif | ||
33 | |||
34 | DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) | ||
35 | |||
36 | # Take account of old dpkg-architecture output. | ||
37 | ifeq ($(DEB_HOST_ARCH_OS),) | ||
38 | DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)) | ||
39 | ifeq ($(DEB_HOST_ARCH_OS),gnu) | ||
40 | DEB_HOST_ARCH_OS := hurd | ||
41 | endif | ||
42 | endif | ||
43 | |||
44 | # Change the version string to reflect distribution | ||
45 | DISTRIBUTION := $(shell dpkg-vendor --query vendor) | ||
46 | SSH_EXTRAVERSION := $(DISTRIBUTION)-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') | ||
47 | |||
48 | DISTRIBUTOR := $(shell if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then echo Ubuntu; else echo Debian; fi) | ||
49 | ifeq ($(DISTRIBUTOR),Ubuntu) | ||
50 | DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games | ||
51 | else | ||
52 | DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games | ||
53 | endif | ||
54 | SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 | ||
55 | |||
56 | ifeq ($(DISTRIBUTOR),Ubuntu) | ||
57 | server_recommends := ssh-import-id | ||
58 | else | ||
59 | server_recommends := | ||
60 | endif | ||
61 | |||
62 | # Common path configuration. | ||
63 | confflags += --sysconfdir=/etc/ssh | ||
64 | |||
65 | # Common build options. | ||
66 | confflags += --disable-strip | ||
67 | confflags += --with-mantype=doc | ||
68 | confflags += --with-4in6 | ||
69 | confflags += --with-privsep-path=/var/run/sshd | ||
70 | |||
71 | # The Hurd needs libcrypt for res_query et al. | ||
72 | ifeq ($(DEB_HOST_ARCH_OS),hurd) | ||
73 | confflags += --with-libs=-lcrypt | ||
74 | endif | ||
75 | |||
76 | # Everything above here is common to the deb and udeb builds. | ||
77 | confflags_udeb := $(confflags) | ||
78 | |||
79 | # Options specific to the deb build. | ||
80 | confflags += --with-tcp-wrappers | ||
81 | confflags += --with-pam | ||
82 | confflags += --with-libedit | ||
83 | confflags += --with-kerberos5=/usr | ||
84 | confflags += --with-ssl-engine | ||
85 | ifeq ($(DEB_HOST_ARCH_OS),linux) | ||
86 | confflags += --with-selinux | ||
87 | endif | ||
88 | ifeq ($(DISTRIBUTOR),Ubuntu) | ||
89 | confflags += --with-consolekit | ||
90 | endif | ||
91 | |||
92 | # The deb build wants xauth; the udeb build doesn't. | ||
93 | confflags += --with-xauth=/usr/bin/xauth | ||
94 | confflags_udeb += --without-xauth | ||
95 | |||
96 | # Default paths. The udeb build has /usr/bin/X11 and /usr/games removed. | ||
97 | confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUSER_PATH) | ||
98 | confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
99 | |||
100 | # Compiler flags. | ||
101 | export DEB_BUILD_MAINT_OPTIONS := hardening=+all | ||
102 | default_cflags := $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS) | ||
103 | cflags := $(default_cflags) | ||
104 | cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT | ||
105 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | ||
106 | cflags_udeb := -Os | ||
107 | cflags_udeb += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | ||
108 | confflags += --with-cflags='$(cflags)' | ||
109 | confflags_udeb += --with-cflags='$(cflags_udeb)' | ||
110 | |||
111 | # Linker flags. | ||
112 | default_ldflags := $(shell dpkg-buildflags --get LDFLAGS) | ||
113 | confflags += --with-ldflags='$(strip -Wl,--as-needed $(default_ldflags))' | ||
114 | confflags_udeb += --with-ldflags='-Wl,--as-needed' | ||
115 | |||
116 | %: | ||
117 | dh $@ --with=autoreconf | ||
118 | |||
119 | autoreconf: | ||
120 | autoreconf -f -i | ||
121 | cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./ | ||
122 | |||
123 | override_dh_autoreconf: | ||
124 | dh_autoreconf debian/rules -- autoreconf | ||
125 | |||
126 | override_dh_auto_configure: | ||
127 | dh_auto_configure -Bbuild-deb -- $(confflags) | ||
128 | dh_auto_configure -Bbuild-udeb -- $(confflags_udeb) | ||
129 | |||
130 | override_dh_auto_build: | ||
131 | # Debian's /var/log/btmp has inappropriate permissions. | ||
132 | perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-deb/config.h | ||
133 | perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-udeb/config.h | ||
134 | |||
135 | # Avoid libnsl linkage. Ugh. | ||
136 | perl -pi -e 's/ +-lnsl//' build-udeb/config.status | ||
137 | cd build-udeb && ./config.status | ||
138 | |||
139 | $(MAKE) -C build-deb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' | ||
140 | $(MAKE) -C build-udeb $(PARALLEL) ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen | ||
141 | |||
142 | $(MAKE) -C contrib gnome-ssh-askpass2 CC='$(CC) $(default_cflags) -Wall -Wl,--as-needed $(default_ldflags)' PKG_CONFIG=$(PKG_CONFIG) | ||
143 | |||
144 | override_dh_auto_test: | ||
145 | ifeq ($(RUN_TESTS),yes) | ||
146 | $(MAKE) -C debian/tests | ||
147 | endif | ||
148 | |||
149 | override_dh_auto_clean: | ||
150 | rm -rf build-deb build-udeb | ||
151 | ifeq ($(RUN_TESTS),yes) | ||
152 | $(MAKE) -C debian/tests clean | ||
153 | endif | ||
154 | $(MAKE) -C contrib clean | ||
155 | (cat debian/copyright.head; iconv -f ISO-8859-1 -t UTF-8 LICENCE) \ | ||
156 | > debian/copyright | ||
157 | |||
158 | override_dh_auto_install: | ||
159 | $(MAKE) -C build-deb DESTDIR=`pwd`/debian/tmp install-nokeys | ||
160 | |||
161 | override_dh_install: | ||
162 | rm -f debian/tmp/etc/ssh/sshd_config | ||
163 | |||
164 | dh_install -Nopenssh-client-udeb -Nopenssh-server-udeb --fail-missing | ||
165 | dh_install -popenssh-client-udeb -popenssh-server-udeb \ | ||
166 | --sourcedir=build-udeb | ||
167 | |||
168 | install -o root -g root -m 755 contrib/gnome-ssh-askpass2 debian/ssh-askpass-gnome/usr/lib/openssh/gnome-ssh-askpass | ||
169 | |||
170 | install -o root -g root debian/openssh-server.if-up debian/openssh-server/etc/network/if-up.d/openssh-server | ||
171 | install -o root -g root -m 644 debian/openssh-server.ufw.profile debian/openssh-server/etc/ufw/applications.d/openssh-server | ||
172 | |||
173 | # Remove version control tags to avoid unnecessary conffile | ||
174 | # resolution steps for administrators. | ||
175 | sed -i '/\$$OpenBSD:/d' \ | ||
176 | debian/openssh-client/etc/ssh/moduli \ | ||
177 | debian/openssh-client/etc/ssh/ssh_config | ||
178 | |||
179 | # dh_apport would be neater, but at the time of writing it isn't in | ||
180 | # unstable yet. | ||
181 | install -p -m 644 debian/openssh-client.apport debian/openssh-client/usr/share/apport/package-hooks/openssh-client.py | ||
182 | install -p -m 644 debian/openssh-server.apport debian/openssh-server/usr/share/apport/package-hooks/openssh-server.py | ||
183 | |||
184 | # Upstart user job (only used under user sessions) | ||
185 | install -p -m 644 -D debian/ssh-agent.user-session.upstart debian/openssh-client/usr/share/upstart/sessions/ssh-agent.conf | ||
186 | |||
187 | override_dh_installdocs: | ||
188 | dh_installdocs -Nopenssh-server -Nssh | ||
189 | dh_installdocs -popenssh-server -pssh --link-doc=openssh-client | ||
190 | # Avoid breaking dh_installexamples later. | ||
191 | mkdir -p debian/openssh-server/usr/share/doc/openssh-client | ||
192 | |||
193 | override_dh_installinit: | ||
194 | dh_installinit -R --name ssh -- start 16 2 3 4 5 . | ||
195 | |||
196 | override_dh_installpam: | ||
197 | dh_installpam --name sshd | ||
198 | |||
199 | override_dh_fixperms: | ||
200 | dh_fixperms | ||
201 | chmod u+s debian/openssh-client/usr/lib/openssh/ssh-keysign | ||
202 | |||
203 | # Tighten libssl dependencies to match the check in entropy.c. | ||
204 | override_dh_shlibdeps: | ||
205 | dh_shlibdeps | ||
206 | debian/adjust-openssl-dependencies | ||
207 | |||
208 | override_dh_gencontrol: | ||
209 | dh_gencontrol -- -V'openssh-server:Recommends=$(server_recommends)' | ||
210 | |||
211 | override_dh_builddeb: | ||
212 | dh_builddeb -- -Zxz | ||
213 | |||
214 | debian/faq.html: | ||
215 | wget -O - http://www.openssh.org/faq.html | \ | ||
216 | sed 's,\(href="\)\(txt/\|[^":]*\.html\),\1http://www.openssh.org/\2,g' \ | ||
217 | > debian/faq.html | ||
218 | |||
219 | # You only need to run this immediately after checking out the package from | ||
220 | # revision control. | ||
221 | quilt-setup: | ||
222 | [ ! -d .pc ] | ||
223 | set -e; for patch in $$(quilt series | tac); do \ | ||
224 | patch -p1 -R --no-backup-if-mismatch <"debian/patches/$$patch"; \ | ||
225 | done | ||
226 | quilt push -a | ||
227 | |||
228 | .PHONY: quilt-setup | ||
diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/source/format | |||
@@ -0,0 +1 @@ | |||
3.0 (quilt) | |||
diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 000000000..df5790e2e --- /dev/null +++ b/debian/source/include-binaries | |||
@@ -0,0 +1 @@ | |||
debian/ssh-askpass-gnome.png | |||
diff --git a/debian/ssh-agent.user-session.upstart b/debian/ssh-agent.user-session.upstart new file mode 100644 index 000000000..8553e12f1 --- /dev/null +++ b/debian/ssh-agent.user-session.upstart | |||
@@ -0,0 +1,19 @@ | |||
1 | description "SSH Agent" | ||
2 | author "Stéphane Graber <stgraber@ubuntu.com>" | ||
3 | |||
4 | start on starting xsession-init | ||
5 | |||
6 | pre-start script | ||
7 | [ -e /etc/X11/Xsession.options ] || { stop; exit 0; } | ||
8 | grep -q "^use-ssh-agent$" /etc/X11/Xsession.options || { stop; exit 0; } | ||
9 | |||
10 | eval "$(ssh-agent)" >/dev/null | ||
11 | initctl set-env --global SSH_AUTH_SOCK=$SSH_AUTH_SOCK | ||
12 | initctl set-env --global SSH_AGENT_PID=$SSH_AGENT_PID | ||
13 | end script | ||
14 | |||
15 | post-stop script | ||
16 | kill $SSH_AGENT_PID 2>/dev/null || true | ||
17 | initctl unset-env --global SSH_AUTH_SOCK | ||
18 | initctl unset-env --global SSH_AGENT_PID | ||
19 | end script | ||
diff --git a/debian/ssh-argv0 b/debian/ssh-argv0 new file mode 100644 index 000000000..37506a4d7 --- /dev/null +++ b/debian/ssh-argv0 | |||
@@ -0,0 +1,31 @@ | |||
1 | #! /bin/sh | ||
2 | set -e | ||
3 | |||
4 | # Copyright (c) 2001 Jonathan Amery. | ||
5 | # | ||
6 | # Redistribution and use in source and binary forms, with or without | ||
7 | # modification, are permitted provided that the following conditions | ||
8 | # are met: | ||
9 | # 1. Redistributions of source code must retain the above copyright | ||
10 | # notice, this list of conditions and the following disclaimer. | ||
11 | # 2. Redistributions in binary form must reproduce the above copyright | ||
12 | # notice, this list of conditions and the following disclaimer in the | ||
13 | # documentation and/or other materials provided with the distribution. | ||
14 | # | ||
15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
16 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
17 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
19 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
20 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
21 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
22 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
24 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | |||
26 | if [ "${0##*/}" = "ssh-argv0" ] | ||
27 | then | ||
28 | echo 'ssh-argv0: This script should not be run like this, see ssh-argv0(1) for details' 1>&2 | ||
29 | exit 1 | ||
30 | fi | ||
31 | exec ssh "${0##*/}" "$@" | ||
diff --git a/debian/ssh-argv0.1 b/debian/ssh-argv0.1 new file mode 100644 index 000000000..a36a63d40 --- /dev/null +++ b/debian/ssh-argv0.1 | |||
@@ -0,0 +1,64 @@ | |||
1 | .Dd September 7, 2001 | ||
2 | .Dt SSH-ARGV0 1 | ||
3 | .Os Debian Project | ||
4 | .Sh NAME | ||
5 | .Nm ssh-argv0 | ||
6 | .Nd replaces the old ssh command-name as hostname handling | ||
7 | .Sh SYNOPSIS | ||
8 | .Ar hostname | user@hostname | ||
9 | .Op Fl l Ar login_name | ||
10 | .Op Ar command | ||
11 | .Pp | ||
12 | .Ar hostname | user@hostname | ||
13 | .Op Fl afgknqstvxACNTX1246 | ||
14 | .Op Fl b Ar bind_address | ||
15 | .Op Fl c Ar cipher_spec | ||
16 | .Op Fl e Ar escape_char | ||
17 | .Op Fl i Ar identity_file | ||
18 | .Op Fl l Ar login_name | ||
19 | .Op Fl m Ar mac_spec | ||
20 | .Op Fl o Ar option | ||
21 | .Op Fl p Ar port | ||
22 | .Op Fl F Ar configfile | ||
23 | .Oo Fl L Xo | ||
24 | .Sm off | ||
25 | .Ar port : | ||
26 | .Ar host : | ||
27 | .Ar hostport | ||
28 | .Sm on | ||
29 | .Xc | ||
30 | .Oc | ||
31 | .Oo Fl R Xo | ||
32 | .Sm off | ||
33 | .Ar port : | ||
34 | .Ar host : | ||
35 | .Ar hostport | ||
36 | .Sm on | ||
37 | .Xc | ||
38 | .Oc | ||
39 | .Op Fl D Ar port | ||
40 | .Op Ar command | ||
41 | .Sh DESCRIPTION | ||
42 | .Nm | ||
43 | replaces the old ssh command-name as hostname handling. | ||
44 | If you link to this script with a hostname then executing the link is | ||
45 | equivalent to having executed ssh with that hostname as an argument. | ||
46 | All other arguments are passed to ssh and will be processed normally. | ||
47 | .Sh OPTIONS | ||
48 | See | ||
49 | .Xr ssh 1 . | ||
50 | .Sh FILES | ||
51 | See | ||
52 | .Xr ssh 1 . | ||
53 | .Sh AUTHORS | ||
54 | OpenSSH is a derivative of the original and free | ||
55 | ssh 1.2.12 release by Tatu Ylonen. | ||
56 | Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, | ||
57 | Theo de Raadt and Dug Song | ||
58 | removed many bugs, re-added newer features and | ||
59 | created OpenSSH. | ||
60 | Markus Friedl contributed the support for SSH | ||
61 | protocol versions 1.5 and 2.0. | ||
62 | Jonathan Amery wrote this ssh-argv0 script and the associated documentation. | ||
63 | .Sh SEE ALSO | ||
64 | .Xr ssh 1 | ||
diff --git a/debian/ssh-askpass-gnome.copyright b/debian/ssh-askpass-gnome.copyright new file mode 100644 index 000000000..4a71dda00 --- /dev/null +++ b/debian/ssh-askpass-gnome.copyright | |||
@@ -0,0 +1,44 @@ | |||
1 | This package contains a Gnome based implementation of ssh-askpass | ||
2 | written by Damien Miller. | ||
3 | |||
4 | It is split out from the main package to isolate the dependency on the | ||
5 | Gnome and X11 libraries. | ||
6 | |||
7 | It was packaged for Debian by Philip Hands <phil@hands.com>. | ||
8 | |||
9 | Copyright: | ||
10 | |||
11 | /* | ||
12 | ** | ||
13 | ** GNOME ssh passphrase requestor | ||
14 | ** | ||
15 | ** Damien Miller <djm@ibs.com.au> | ||
16 | ** | ||
17 | ** Copyright 1999 Internet Business Solutions | ||
18 | ** | ||
19 | ** Permission is hereby granted, free of charge, to any person | ||
20 | ** obtaining a copy of this software and associated documentation | ||
21 | ** files (the "Software"), to deal in the Software without | ||
22 | ** restriction, including without limitation the rights to use, copy, | ||
23 | ** modify, merge, publish, distribute, sublicense, and/or sell copies | ||
24 | ** of the Software, and to permit persons to whom the Software is | ||
25 | ** furnished to do so, subject to the following conditions: | ||
26 | ** | ||
27 | ** The above copyright notice and this permission notice shall be | ||
28 | ** included in all copies or substantial portions of the Software. | ||
29 | ** | ||
30 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | ||
31 | ** KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
32 | ** WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE | ||
33 | ** AND NONINFRINGEMENT. IN NO EVENT SHALL DAMIEN MILLER OR INTERNET | ||
34 | ** BUSINESS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
35 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
36 | ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE | ||
37 | ** OR OTHER DEALINGS IN THE SOFTWARE. | ||
38 | ** | ||
39 | ** Except as contained in this notice, the name of Internet Business | ||
40 | ** Solutions shall not be used in advertising or otherwise to promote | ||
41 | ** the sale, use or other dealings in this Software without prior | ||
42 | ** written authorization from Internet Business Solutions. | ||
43 | ** | ||
44 | */ | ||
diff --git a/debian/ssh-askpass-gnome.desktop b/debian/ssh-askpass-gnome.desktop new file mode 100644 index 000000000..eba7a67d1 --- /dev/null +++ b/debian/ssh-askpass-gnome.desktop | |||
@@ -0,0 +1,12 @@ | |||
1 | [Desktop Entry] | ||
2 | Version=1.0 | ||
3 | Encoding=UTF-8 | ||
4 | Name=SSH AskPass | ||
5 | GenericName=ssh-add | ||
6 | Comment=Enter passphrase to authenticate to the ssh agent | ||
7 | Exec=/usr/bin/ssh-add | ||
8 | TryExec=ssh-add | ||
9 | Terminal=false | ||
10 | Type=Application | ||
11 | Icon=ssh-askpass-gnome | ||
12 | Categories=Network;Security; | ||
diff --git a/debian/ssh-askpass-gnome.dirs b/debian/ssh-askpass-gnome.dirs new file mode 100644 index 000000000..0ffa45024 --- /dev/null +++ b/debian/ssh-askpass-gnome.dirs | |||
@@ -0,0 +1,3 @@ | |||
1 | usr/lib/openssh | ||
2 | usr/share/man/man1 | ||
3 | usr/share/pixmaps | ||
diff --git a/debian/ssh-askpass-gnome.examples b/debian/ssh-askpass-gnome.examples new file mode 100644 index 000000000..66fd8c0e4 --- /dev/null +++ b/debian/ssh-askpass-gnome.examples | |||
@@ -0,0 +1 @@ | |||
debian/ssh-askpass-gnome.desktop | |||
diff --git a/debian/ssh-askpass-gnome.install b/debian/ssh-askpass-gnome.install new file mode 100644 index 000000000..8b6b5f045 --- /dev/null +++ b/debian/ssh-askpass-gnome.install | |||
@@ -0,0 +1 @@ | |||
debian/ssh-askpass-gnome.png usr/share/pixmaps | |||
diff --git a/debian/ssh-askpass-gnome.manpages b/debian/ssh-askpass-gnome.manpages new file mode 100644 index 000000000..7749f13bb --- /dev/null +++ b/debian/ssh-askpass-gnome.manpages | |||
@@ -0,0 +1 @@ | |||
debian/gnome-ssh-askpass.1 | |||
diff --git a/debian/ssh-askpass-gnome.png b/debian/ssh-askpass-gnome.png new file mode 100644 index 000000000..06f75764e --- /dev/null +++ b/debian/ssh-askpass-gnome.png | |||
Binary files differ | |||
diff --git a/debian/ssh-askpass-gnome.postinst b/debian/ssh-askpass-gnome.postinst new file mode 100644 index 000000000..8a454e520 --- /dev/null +++ b/debian/ssh-askpass-gnome.postinst | |||
@@ -0,0 +1,48 @@ | |||
1 | #! /bin/sh | ||
2 | # postinst script for ssh-askpass-gnome | ||
3 | # | ||
4 | # see: dh_installdeb(1) | ||
5 | |||
6 | set -e | ||
7 | |||
8 | # summary of how this script can be called: | ||
9 | # * <postinst> `configure' <most-recently-configured-version> | ||
10 | # * <old-postinst> `abort-upgrade' <new version> | ||
11 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> | ||
12 | # <new-version> | ||
13 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | ||
14 | # <failed-install-package> <version> `removing' | ||
15 | # <conflicting-package> <version> | ||
16 | # for details, see /usr/share/doc/packaging-manual/ | ||
17 | # | ||
18 | # quoting from the policy: | ||
19 | # Any necessary prompting should almost always be confined to the | ||
20 | # post-installation script, and should be protected with a conditional | ||
21 | # so that unnecessary prompting doesn't happen if a package's | ||
22 | # installation fails and the `postinst' is called with `abort-upgrade', | ||
23 | # `abort-remove' or `abort-deconfigure'. | ||
24 | |||
25 | case "$1" in | ||
26 | configure) | ||
27 | update-alternatives --quiet \ | ||
28 | --install /usr/bin/ssh-askpass ssh-askpass \ | ||
29 | /usr/lib/openssh/gnome-ssh-askpass 30 \ | ||
30 | --slave /usr/share/man/man1/ssh-askpass.1.gz \ | ||
31 | ssh-askpass.1.gz /usr/share/man/man1/gnome-ssh-askpass.1.gz | ||
32 | ;; | ||
33 | |||
34 | abort-upgrade|abort-remove|abort-deconfigure) | ||
35 | ;; | ||
36 | |||
37 | *) | ||
38 | echo "postinst called with unknown argument \`$1'" >&2 | ||
39 | exit 0 | ||
40 | ;; | ||
41 | esac | ||
42 | |||
43 | # dh_installdeb will replace this with shell code automatically | ||
44 | # generated by other debhelper scripts. | ||
45 | |||
46 | #DEBHELPER# | ||
47 | |||
48 | exit 0 | ||
diff --git a/debian/ssh-askpass-gnome.prerm b/debian/ssh-askpass-gnome.prerm new file mode 100644 index 000000000..0adcfc76b --- /dev/null +++ b/debian/ssh-askpass-gnome.prerm | |||
@@ -0,0 +1,39 @@ | |||
1 | #! /bin/sh | ||
2 | # prerm script for ssh-askpass-gnome | ||
3 | # | ||
4 | # see: dh_installdeb(1) | ||
5 | |||
6 | set -e | ||
7 | |||
8 | # summary of how this script can be called: | ||
9 | # * <prerm> `remove' | ||
10 | # * <old-prerm> `upgrade' <new-version> | ||
11 | # * <new-prerm> `failed-upgrade' <old-version> | ||
12 | # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> | ||
13 | # * <deconfigured's-prerm> `deconfigure' `in-favour' | ||
14 | # <package-being-installed> <version> `removing' | ||
15 | # <conflicting-package> <version> | ||
16 | # for details, see /usr/share/doc/packaging-manual/ | ||
17 | |||
18 | case "$1" in | ||
19 | remove|deconfigure) | ||
20 | update-alternatives --quiet --remove ssh-askpass /usr/lib/openssh/gnome-ssh-askpass | ||
21 | ;; | ||
22 | upgrade) | ||
23 | ;; | ||
24 | failed-upgrade) | ||
25 | ;; | ||
26 | *) | ||
27 | echo "prerm called with unknown argument \`$1'" >&2 | ||
28 | exit 0 | ||
29 | ;; | ||
30 | esac | ||
31 | |||
32 | # dh_installdeb will replace this with shell code automatically | ||
33 | # generated by other debhelper scripts. | ||
34 | |||
35 | #DEBHELPER# | ||
36 | |||
37 | exit 0 | ||
38 | |||
39 | |||
diff --git a/debian/ssh-krb5.NEWS b/debian/ssh-krb5.NEWS new file mode 100644 index 000000000..5a6433ab2 --- /dev/null +++ b/debian/ssh-krb5.NEWS | |||
@@ -0,0 +1,18 @@ | |||
1 | ssh-krb5 (1:4.3p2-7) unstable; urgency=low | ||
2 | |||
3 | The normal openssh-server and openssh-client packages in Debian now | ||
4 | include full GSSAPI support, including key exchange. This package is | ||
5 | now only a transitional package that depends on openssh-server and | ||
6 | openssh-client and configures openssh-server for GSSAPI authentication | ||
7 | if it wasn't already. | ||
8 | |||
9 | You can now simply install openssh-server and openssh-client directly | ||
10 | and remove this package. Just make sure that /etc/ssh/sshd_config | ||
11 | contains: | ||
12 | |||
13 | GSSAPIAuthentication yes | ||
14 | GSSAPIKeyExchange yes | ||
15 | |||
16 | if you want to support GSSAPI authentication to your ssh server. | ||
17 | |||
18 | -- Russ Allbery <rra@debian.org> Tue, 03 Oct 2006 22:27:27 -0700 | ||
diff --git a/debian/ssh-krb5.postinst b/debian/ssh-krb5.postinst new file mode 100644 index 000000000..f799accfe --- /dev/null +++ b/debian/ssh-krb5.postinst | |||
@@ -0,0 +1,61 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | action="$1" | ||
6 | oldversion="$2" | ||
7 | |||
8 | if [ "$action" = configure ] ; then | ||
9 | # Make sure that GSSAPI is enabled. If there is no uncommented GSSAPI | ||
10 | # configuration, uncomment any commented-out configuration if present | ||
11 | # (this will catch the case of a fresh install of openssh-server). | ||
12 | # Otherwise, add configuration turning on GSSAPIAuthentication and | ||
13 | # GSSAPIKeyExchange. | ||
14 | # | ||
15 | # If there is some configuration, we may be upgrading from ssh-krb5. It | ||
16 | # enabled GSSAPIKeyExchange without any configuration option. Therefore, | ||
17 | # if it isn't explicitly set, always enable it for compatible behavior | ||
18 | # with ssh-krb5. | ||
19 | if dpkg --compare-versions "$oldversion" ge 1:4.3p2-9; then | ||
20 | : | ||
21 | else | ||
22 | changed= | ||
23 | if grep -qi '^[ ]*GSSAPI' /etc/ssh/sshd_config ; then | ||
24 | if grep -qi '^[ ]*GSSAPIKeyExchange' /etc/ssh/sshd_config ; then | ||
25 | : | ||
26 | else | ||
27 | changed=true | ||
28 | cat >> /etc/ssh/sshd_config <<EOF | ||
29 | |||
30 | # GSSAPI key exchange (added by ssh-krb5 transitional package) | ||
31 | GSSAPIKeyExchange yes | ||
32 | EOF | ||
33 | fi | ||
34 | else | ||
35 | changed=true | ||
36 | if grep -qi '^#GSSAPI' /etc/ssh/sshd_config ; then | ||
37 | perl -pe 's/^\#(GSSAPI(Authentication|KeyExchange))\b.*/$1 yes/i' \ | ||
38 | < /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new | ||
39 | chown --reference /etc/ssh/sshd_config \ | ||
40 | /etc/ssh/sshd_config.dpkg-new | ||
41 | chmod --reference /etc/ssh/sshd_config \ | ||
42 | /etc/ssh/sshd_config.dpkg-new | ||
43 | mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config | ||
44 | else | ||
45 | cat >> /etc/ssh/sshd_config <<EOF | ||
46 | |||
47 | # GSSAPI authentication (added by ssh-krb5 transitional package) | ||
48 | GSSAPIAuthentication yes | ||
49 | GSSAPIKeyExchange yes | ||
50 | EOF | ||
51 | fi | ||
52 | fi | ||
53 | if [ -n "$changed" ]; then | ||
54 | invoke-rc.d ssh restart | ||
55 | fi | ||
56 | fi | ||
57 | fi | ||
58 | |||
59 | #DEBHELPER# | ||
60 | |||
61 | exit 0 | ||
diff --git a/debian/ssh.dirs b/debian/ssh.dirs new file mode 100644 index 000000000..1da8fba83 --- /dev/null +++ b/debian/ssh.dirs | |||
@@ -0,0 +1 @@ | |||
usr/share/lintian/overrides | |||
diff --git a/debian/ssh.lintian-overrides b/debian/ssh.lintian-overrides new file mode 100644 index 000000000..b9bf7ea08 --- /dev/null +++ b/debian/ssh.lintian-overrides | |||
@@ -0,0 +1 @@ | |||
ssh: package-contains-empty-directory usr/share/doc/openssh-client/ | |||
diff --git a/debian/tests/Makefile b/debian/tests/Makefile new file mode 100644 index 000000000..666ed8227 --- /dev/null +++ b/debian/tests/Makefile | |||
@@ -0,0 +1,12 @@ | |||
1 | test: getpid.so | ||
2 | chmod +x keygen-test | ||
3 | ./keygen-test | ||
4 | |||
5 | getpid.o: getpid.c | ||
6 | gcc -fPIC -c $< -o $@ | ||
7 | |||
8 | getpid.so: getpid.o | ||
9 | gcc -shared -o $@ $< | ||
10 | |||
11 | clean: | ||
12 | rm -f getpid.o getpid.so key1 key1.pub key2 key2.pub | ||
diff --git a/debian/tests/getpid.c b/debian/tests/getpid.c new file mode 100644 index 000000000..c9e35b87e --- /dev/null +++ b/debian/tests/getpid.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Compile: | ||
3 | |||
4 | gcc -fPIC -c getpid.c -o getpid.o | ||
5 | gcc -shared -o getpid.so getpid.o | ||
6 | |||
7 | * Use: | ||
8 | |||
9 | FORCE_PID=1234 LD_PRELOAD=./getpid.so bash | ||
10 | |||
11 | # | ||
12 | # Copyright (C) 2001-2008 Kees Cook | ||
13 | # kees@outflux.net, http://outflux.net/ | ||
14 | # | ||
15 | # This program is free software; you can redistribute it and/or | ||
16 | # modify it under the terms of the GNU General Public License | ||
17 | # as published by the Free Software Foundation; either version 2 | ||
18 | # of the License, or (at your option) any later version. | ||
19 | # | ||
20 | # This program is distributed in the hope that it will be useful, | ||
21 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | # GNU General Public License for more details. | ||
24 | # | ||
25 | # You should have received a copy of the GNU General Public License | ||
26 | # along with this program; if not, write to the Free Software | ||
27 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
28 | # http://www.gnu.org/copyleft/gpl.html | ||
29 | |||
30 | */ | ||
31 | |||
32 | #include <sys/types.h> | ||
33 | #include <unistd.h> | ||
34 | #include <stdlib.h> | ||
35 | |||
36 | pid_t getpid(void) | ||
37 | { | ||
38 | return atoi(getenv("FORCE_PID")); | ||
39 | } | ||
diff --git a/debian/tests/keygen-test b/debian/tests/keygen-test new file mode 100755 index 000000000..02b7c761a --- /dev/null +++ b/debian/tests/keygen-test | |||
@@ -0,0 +1,12 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | rm -f key1 key1.pub key2 key2.pub | ||
4 | LD_PRELOAD="$(pwd)/getpid.so" FORCE_PID=1234 \ | ||
5 | ../../build-deb/ssh-keygen -N '' -f key1 >/dev/null | ||
6 | LD_PRELOAD="$(pwd)/getpid.so" FORCE_PID=1234 \ | ||
7 | ../../build-deb/ssh-keygen -N '' -f key2 >/dev/null | ||
8 | if cmp -s key1 key2; then | ||
9 | echo "Generated two identical keys!" >&2 | ||
10 | exit 1 | ||
11 | fi | ||
12 | exit 0 | ||
diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000..6ffdc3708 --- /dev/null +++ b/debian/watch | |||
@@ -0,0 +1,3 @@ | |||
1 | version=2 | ||
2 | ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-(.*)\.tar\.gz \ | ||
3 | debian uupdate | ||
@@ -196,6 +196,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address, | |||
196 | { | 196 | { |
197 | u_int counter; | 197 | u_int counter; |
198 | int result; | 198 | int result; |
199 | unsigned int rrset_flags = 0; | ||
199 | struct rrsetinfo *fingerprints = NULL; | 200 | struct rrsetinfo *fingerprints = NULL; |
200 | 201 | ||
201 | u_int8_t hostkey_algorithm; | 202 | u_int8_t hostkey_algorithm; |
@@ -219,8 +220,19 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address, | |||
219 | return -1; | 220 | return -1; |
220 | } | 221 | } |
221 | 222 | ||
223 | /* | ||
224 | * Original getrrsetbyname function, found on OpenBSD for example, | ||
225 | * doesn't accept any flag and prerequisite for obtaining AD bit in | ||
226 | * DNS response is set by "options edns0" in resolv.conf. | ||
227 | * | ||
228 | * Our version is more clever and use RRSET_FORCE_EDNS0 flag. | ||
229 | */ | ||
230 | #ifndef HAVE_GETRRSETBYNAME | ||
231 | rrset_flags |= RRSET_FORCE_EDNS0; | ||
232 | #endif | ||
222 | result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, | 233 | result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, |
223 | DNS_RDATATYPE_SSHFP, 0, &fingerprints); | 234 | DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints); |
235 | |||
224 | if (result) { | 236 | if (result) { |
225 | verbose("DNS lookup error: %s", dns_result_totext(result)); | 237 | verbose("DNS lookup error: %s", dns_result_totext(result)); |
226 | return -1; | 238 | return -1; |
@@ -94,6 +94,7 @@ static struct { | |||
94 | LogLevel val; | 94 | LogLevel val; |
95 | } log_levels[] = | 95 | } log_levels[] = |
96 | { | 96 | { |
97 | { "SILENT", SYSLOG_LEVEL_QUIET }, /* compatibility */ | ||
97 | { "QUIET", SYSLOG_LEVEL_QUIET }, | 98 | { "QUIET", SYSLOG_LEVEL_QUIET }, |
98 | { "FATAL", SYSLOG_LEVEL_FATAL }, | 99 | { "FATAL", SYSLOG_LEVEL_FATAL }, |
99 | { "ERROR", SYSLOG_LEVEL_ERROR }, | 100 | { "ERROR", SYSLOG_LEVEL_ERROR }, |
@@ -48,8 +48,9 @@ | |||
48 | #include <netdb.h> | 48 | #include <netdb.h> |
49 | #ifdef HAVE_PATHS_H | 49 | #ifdef HAVE_PATHS_H |
50 | # include <paths.h> | 50 | # include <paths.h> |
51 | #include <pwd.h> | ||
52 | #endif | 51 | #endif |
52 | #include <pwd.h> | ||
53 | #include <grp.h> | ||
53 | #ifdef SSH_TUN_OPENBSD | 54 | #ifdef SSH_TUN_OPENBSD |
54 | #include <net/if.h> | 55 | #include <net/if.h> |
55 | #endif | 56 | #endif |
@@ -58,6 +59,7 @@ | |||
58 | #include "misc.h" | 59 | #include "misc.h" |
59 | #include "log.h" | 60 | #include "log.h" |
60 | #include "ssh.h" | 61 | #include "ssh.h" |
62 | #include "platform.h" | ||
61 | 63 | ||
62 | /* remove newline at end of string */ | 64 | /* remove newline at end of string */ |
63 | char * | 65 | char * |
@@ -642,6 +644,71 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz, | |||
642 | return -1; | 644 | return -1; |
643 | } | 645 | } |
644 | 646 | ||
647 | /* | ||
648 | * return 1 if the specified uid is a uid that may own a system directory | ||
649 | * otherwise 0. | ||
650 | */ | ||
651 | int | ||
652 | platform_sys_dir_uid(uid_t uid) | ||
653 | { | ||
654 | if (uid == 0) | ||
655 | return 1; | ||
656 | #ifdef PLATFORM_SYS_DIR_UID | ||
657 | if (uid == PLATFORM_SYS_DIR_UID) | ||
658 | return 1; | ||
659 | #endif | ||
660 | return 0; | ||
661 | } | ||
662 | |||
663 | int | ||
664 | secure_permissions(struct stat *st, uid_t uid) | ||
665 | { | ||
666 | if (!platform_sys_dir_uid(st->st_uid) && st->st_uid != uid) | ||
667 | return 0; | ||
668 | if ((st->st_mode & 002) != 0) | ||
669 | return 0; | ||
670 | if ((st->st_mode & 020) != 0) { | ||
671 | /* If the file is group-writable, the group in question must | ||
672 | * have exactly one member, namely the file's owner. | ||
673 | * (Zero-member groups are typically used by setgid | ||
674 | * binaries, and are unlikely to be suitable.) | ||
675 | */ | ||
676 | struct passwd *pw; | ||
677 | struct group *gr; | ||
678 | int members = 0; | ||
679 | |||
680 | gr = getgrgid(st->st_gid); | ||
681 | if (!gr) | ||
682 | return 0; | ||
683 | |||
684 | /* Check primary group memberships. */ | ||
685 | while ((pw = getpwent()) != NULL) { | ||
686 | if (pw->pw_gid == gr->gr_gid) { | ||
687 | ++members; | ||
688 | if (pw->pw_uid != uid) | ||
689 | return 0; | ||
690 | } | ||
691 | } | ||
692 | endpwent(); | ||
693 | |||
694 | pw = getpwuid(st->st_uid); | ||
695 | if (!pw) | ||
696 | return 0; | ||
697 | |||
698 | /* Check supplementary group memberships. */ | ||
699 | if (gr->gr_mem[0]) { | ||
700 | ++members; | ||
701 | if (strcmp(pw->pw_name, gr->gr_mem[0]) || | ||
702 | gr->gr_mem[1]) | ||
703 | return 0; | ||
704 | } | ||
705 | |||
706 | if (!members) | ||
707 | return 0; | ||
708 | } | ||
709 | return 1; | ||
710 | } | ||
711 | |||
645 | int | 712 | int |
646 | tun_open(int tun, int mode) | 713 | tun_open(int tun, int mode) |
647 | { | 714 | { |
@@ -104,4 +104,6 @@ char *read_passphrase(const char *, int); | |||
104 | int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2))); | 104 | int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2))); |
105 | int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *); | 105 | int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *); |
106 | 106 | ||
107 | int secure_permissions(struct stat *st, uid_t uid); | ||
108 | |||
107 | #endif /* _MISC_H */ | 109 | #endif /* _MISC_H */ |
@@ -21,7 +21,7 @@ | |||
21 | .Nd Diffie-Hellman moduli | 21 | .Nd Diffie-Hellman moduli |
22 | .Sh DESCRIPTION | 22 | .Sh DESCRIPTION |
23 | The | 23 | The |
24 | .Pa /etc/moduli | 24 | .Pa /etc/ssh/moduli |
25 | file contains prime numbers and generators for use by | 25 | file contains prime numbers and generators for use by |
26 | .Xr sshd 8 | 26 | .Xr sshd 8 |
27 | in the Diffie-Hellman Group Exchange key exchange method. | 27 | in the Diffie-Hellman Group Exchange key exchange method. |
@@ -110,7 +110,7 @@ first estimates the size of the modulus required to produce enough | |||
110 | Diffie-Hellman output to sufficiently key the selected symmetric cipher. | 110 | Diffie-Hellman output to sufficiently key the selected symmetric cipher. |
111 | .Xr sshd 8 | 111 | .Xr sshd 8 |
112 | then randomly selects a modulus from | 112 | then randomly selects a modulus from |
113 | .Fa /etc/moduli | 113 | .Fa /etc/ssh/moduli |
114 | that best meets the size requirement. | 114 | that best meets the size requirement. |
115 | .Sh SEE ALSO | 115 | .Sh SEE ALSO |
116 | .Xr ssh-keygen 1 , | 116 | .Xr ssh-keygen 1 , |
@@ -98,6 +98,9 @@ | |||
98 | #include "jpake.h" | 98 | #include "jpake.h" |
99 | #include "roaming.h" | 99 | #include "roaming.h" |
100 | #include "authfd.h" | 100 | #include "authfd.h" |
101 | #ifdef USE_CONSOLEKIT | ||
102 | #include "consolekit.h" | ||
103 | #endif | ||
101 | 104 | ||
102 | #ifdef GSSAPI | 105 | #ifdef GSSAPI |
103 | static Gssctxt *gsscontext = NULL; | 106 | static Gssctxt *gsscontext = NULL; |
@@ -146,6 +149,7 @@ int mm_answer_sign(int, Buffer *); | |||
146 | int mm_answer_pwnamallow(int, Buffer *); | 149 | int mm_answer_pwnamallow(int, Buffer *); |
147 | int mm_answer_auth2_read_banner(int, Buffer *); | 150 | int mm_answer_auth2_read_banner(int, Buffer *); |
148 | int mm_answer_authserv(int, Buffer *); | 151 | int mm_answer_authserv(int, Buffer *); |
152 | int mm_answer_authrole(int, Buffer *); | ||
149 | int mm_answer_authpassword(int, Buffer *); | 153 | int mm_answer_authpassword(int, Buffer *); |
150 | int mm_answer_bsdauthquery(int, Buffer *); | 154 | int mm_answer_bsdauthquery(int, Buffer *); |
151 | int mm_answer_bsdauthrespond(int, Buffer *); | 155 | int mm_answer_bsdauthrespond(int, Buffer *); |
@@ -192,6 +196,10 @@ int mm_answer_audit_command(int, Buffer *); | |||
192 | 196 | ||
193 | static int monitor_read_log(struct monitor *); | 197 | static int monitor_read_log(struct monitor *); |
194 | 198 | ||
199 | #ifdef USE_CONSOLEKIT | ||
200 | int mm_answer_consolekit_register(int, Buffer *); | ||
201 | #endif | ||
202 | |||
195 | static Authctxt *authctxt; | 203 | static Authctxt *authctxt; |
196 | static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ | 204 | static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ |
197 | 205 | ||
@@ -227,6 +235,7 @@ struct mon_table mon_dispatch_proto20[] = { | |||
227 | {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, | 235 | {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
228 | {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, | 236 | {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, |
229 | {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, | 237 | {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
238 | {MONITOR_REQ_AUTHROLE, MON_ONCE, mm_answer_authrole}, | ||
230 | {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, | 239 | {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
231 | {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, | 240 | {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
232 | #ifdef USE_PAM | 241 | #ifdef USE_PAM |
@@ -283,6 +292,9 @@ struct mon_table mon_dispatch_postauth20[] = { | |||
283 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, | 292 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, |
284 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, | 293 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, |
285 | #endif | 294 | #endif |
295 | #ifdef USE_CONSOLEKIT | ||
296 | {MONITOR_REQ_CONSOLEKIT_REGISTER, 0, mm_answer_consolekit_register}, | ||
297 | #endif | ||
286 | {0, 0, NULL} | 298 | {0, 0, NULL} |
287 | }; | 299 | }; |
288 | 300 | ||
@@ -325,6 +337,9 @@ struct mon_table mon_dispatch_postauth15[] = { | |||
325 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, | 337 | {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, |
326 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, | 338 | {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, |
327 | #endif | 339 | #endif |
340 | #ifdef USE_CONSOLEKIT | ||
341 | {MONITOR_REQ_CONSOLEKIT_REGISTER, 0, mm_answer_consolekit_register}, | ||
342 | #endif | ||
328 | {0, 0, NULL} | 343 | {0, 0, NULL} |
329 | }; | 344 | }; |
330 | 345 | ||
@@ -512,6 +527,9 @@ monitor_child_postauth(struct monitor *pmonitor) | |||
512 | monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); | 527 | monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); |
513 | monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); | 528 | monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); |
514 | } | 529 | } |
530 | #ifdef USE_CONSOLEKIT | ||
531 | monitor_permit(mon_dispatch, MONITOR_REQ_CONSOLEKIT_REGISTER, 1); | ||
532 | #endif | ||
515 | 533 | ||
516 | for (;;) | 534 | for (;;) |
517 | monitor_read(pmonitor, mon_dispatch, NULL); | 535 | monitor_read(pmonitor, mon_dispatch, NULL); |
@@ -844,6 +862,7 @@ mm_answer_pwnamallow(int sock, Buffer *m) | |||
844 | else { | 862 | else { |
845 | /* Allow service/style information on the auth context */ | 863 | /* Allow service/style information on the auth context */ |
846 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); | 864 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); |
865 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHROLE, 1); | ||
847 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); | 866 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); |
848 | } | 867 | } |
849 | #ifdef USE_PAM | 868 | #ifdef USE_PAM |
@@ -874,14 +893,37 @@ mm_answer_authserv(int sock, Buffer *m) | |||
874 | 893 | ||
875 | authctxt->service = buffer_get_string(m, NULL); | 894 | authctxt->service = buffer_get_string(m, NULL); |
876 | authctxt->style = buffer_get_string(m, NULL); | 895 | authctxt->style = buffer_get_string(m, NULL); |
877 | debug3("%s: service=%s, style=%s", | 896 | authctxt->role = buffer_get_string(m, NULL); |
878 | __func__, authctxt->service, authctxt->style); | 897 | debug3("%s: service=%s, style=%s, role=%s", |
898 | __func__, authctxt->service, authctxt->style, authctxt->role); | ||
879 | 899 | ||
880 | if (strlen(authctxt->style) == 0) { | 900 | if (strlen(authctxt->style) == 0) { |
881 | free(authctxt->style); | 901 | free(authctxt->style); |
882 | authctxt->style = NULL; | 902 | authctxt->style = NULL; |
883 | } | 903 | } |
884 | 904 | ||
905 | if (strlen(authctxt->role) == 0) { | ||
906 | free(authctxt->role); | ||
907 | authctxt->role = NULL; | ||
908 | } | ||
909 | |||
910 | return (0); | ||
911 | } | ||
912 | |||
913 | int | ||
914 | mm_answer_authrole(int sock, Buffer *m) | ||
915 | { | ||
916 | monitor_permit_authentications(1); | ||
917 | |||
918 | authctxt->role = buffer_get_string(m, NULL); | ||
919 | debug3("%s: role=%s", | ||
920 | __func__, authctxt->role); | ||
921 | |||
922 | if (strlen(authctxt->role) == 0) { | ||
923 | free(authctxt->role); | ||
924 | authctxt->role = NULL; | ||
925 | } | ||
926 | |||
885 | return (0); | 927 | return (0); |
886 | } | 928 | } |
887 | 929 | ||
@@ -1486,7 +1528,7 @@ mm_answer_pty(int sock, Buffer *m) | |||
1486 | res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); | 1528 | res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); |
1487 | if (res == 0) | 1529 | if (res == 0) |
1488 | goto error; | 1530 | goto error; |
1489 | pty_setowner(authctxt->pw, s->tty); | 1531 | pty_setowner(authctxt->pw, s->tty, authctxt->role); |
1490 | 1532 | ||
1491 | buffer_put_int(m, 1); | 1533 | buffer_put_int(m, 1); |
1492 | buffer_put_cstring(m, s->tty); | 1534 | buffer_put_cstring(m, s->tty); |
@@ -2466,3 +2508,30 @@ mm_answer_jpake_check_confirm(int sock, Buffer *m) | |||
2466 | } | 2508 | } |
2467 | 2509 | ||
2468 | #endif /* JPAKE */ | 2510 | #endif /* JPAKE */ |
2511 | |||
2512 | #ifdef USE_CONSOLEKIT | ||
2513 | int | ||
2514 | mm_answer_consolekit_register(int sock, Buffer *m) | ||
2515 | { | ||
2516 | Session *s; | ||
2517 | char *tty, *display; | ||
2518 | char *cookie = NULL; | ||
2519 | |||
2520 | debug3("%s entering", __func__); | ||
2521 | |||
2522 | tty = buffer_get_string(m, NULL); | ||
2523 | display = buffer_get_string(m, NULL); | ||
2524 | s = session_by_tty(tty); | ||
2525 | if (s != NULL) | ||
2526 | cookie = consolekit_register(s, display); | ||
2527 | buffer_clear(m); | ||
2528 | buffer_put_cstring(m, cookie != NULL ? cookie : ""); | ||
2529 | mm_request_send(sock, MONITOR_ANS_CONSOLEKIT_REGISTER, m); | ||
2530 | |||
2531 | free(cookie); | ||
2532 | free(display); | ||
2533 | free(tty); | ||
2534 | |||
2535 | return (0); | ||
2536 | } | ||
2537 | #endif /* USE_CONSOLEKIT */ | ||
@@ -73,6 +73,10 @@ enum monitor_reqtype { | |||
73 | MONITOR_REQ_GSSSIGN = 150, MONITOR_ANS_GSSSIGN = 151, | 73 | MONITOR_REQ_GSSSIGN = 150, MONITOR_ANS_GSSSIGN = 151, |
74 | MONITOR_REQ_GSSUPCREDS = 152, MONITOR_ANS_GSSUPCREDS = 153, | 74 | MONITOR_REQ_GSSUPCREDS = 152, MONITOR_ANS_GSSUPCREDS = 153, |
75 | 75 | ||
76 | MONITOR_REQ_AUTHROLE = 154, | ||
77 | |||
78 | MONITOR_REQ_CONSOLEKIT_REGISTER = 156, MONITOR_ANS_CONSOLEKIT_REGISTER = 157, | ||
79 | |||
76 | }; | 80 | }; |
77 | 81 | ||
78 | struct mm_master; | 82 | struct mm_master; |
diff --git a/monitor_wrap.c b/monitor_wrap.c index 433b234d2..9662a4c63 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -320,10 +320,10 @@ mm_auth2_read_banner(void) | |||
320 | return (banner); | 320 | return (banner); |
321 | } | 321 | } |
322 | 322 | ||
323 | /* Inform the privileged process about service and style */ | 323 | /* Inform the privileged process about service, style, and role */ |
324 | 324 | ||
325 | void | 325 | void |
326 | mm_inform_authserv(char *service, char *style) | 326 | mm_inform_authserv(char *service, char *style, char *role) |
327 | { | 327 | { |
328 | Buffer m; | 328 | Buffer m; |
329 | 329 | ||
@@ -332,12 +332,30 @@ mm_inform_authserv(char *service, char *style) | |||
332 | buffer_init(&m); | 332 | buffer_init(&m); |
333 | buffer_put_cstring(&m, service); | 333 | buffer_put_cstring(&m, service); |
334 | buffer_put_cstring(&m, style ? style : ""); | 334 | buffer_put_cstring(&m, style ? style : ""); |
335 | buffer_put_cstring(&m, role ? role : ""); | ||
335 | 336 | ||
336 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); | 337 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); |
337 | 338 | ||
338 | buffer_free(&m); | 339 | buffer_free(&m); |
339 | } | 340 | } |
340 | 341 | ||
342 | /* Inform the privileged process about role */ | ||
343 | |||
344 | void | ||
345 | mm_inform_authrole(char *role) | ||
346 | { | ||
347 | Buffer m; | ||
348 | |||
349 | debug3("%s entering", __func__); | ||
350 | |||
351 | buffer_init(&m); | ||
352 | buffer_put_cstring(&m, role ? role : ""); | ||
353 | |||
354 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m); | ||
355 | |||
356 | buffer_free(&m); | ||
357 | } | ||
358 | |||
341 | /* Do the password authentication */ | 359 | /* Do the password authentication */ |
342 | int | 360 | int |
343 | mm_auth_password(Authctxt *authctxt, char *password) | 361 | mm_auth_password(Authctxt *authctxt, char *password) |
@@ -1498,3 +1516,34 @@ mm_jpake_check_confirm(const BIGNUM *k, | |||
1498 | return success; | 1516 | return success; |
1499 | } | 1517 | } |
1500 | #endif /* JPAKE */ | 1518 | #endif /* JPAKE */ |
1519 | |||
1520 | #ifdef USE_CONSOLEKIT | ||
1521 | char * | ||
1522 | mm_consolekit_register(Session *s, const char *display) | ||
1523 | { | ||
1524 | Buffer m; | ||
1525 | char *cookie; | ||
1526 | |||
1527 | debug3("%s entering", __func__); | ||
1528 | |||
1529 | if (s->ttyfd == -1) | ||
1530 | return NULL; | ||
1531 | buffer_init(&m); | ||
1532 | buffer_put_cstring(&m, s->tty); | ||
1533 | buffer_put_cstring(&m, display != NULL ? display : ""); | ||
1534 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_CONSOLEKIT_REGISTER, &m); | ||
1535 | buffer_clear(&m); | ||
1536 | |||
1537 | mm_request_receive_expect(pmonitor->m_recvfd, | ||
1538 | MONITOR_ANS_CONSOLEKIT_REGISTER, &m); | ||
1539 | cookie = buffer_get_string(&m, NULL); | ||
1540 | buffer_free(&m); | ||
1541 | |||
1542 | /* treat empty cookie as missing cookie */ | ||
1543 | if (strlen(cookie) == 0) { | ||
1544 | free(cookie); | ||
1545 | cookie = NULL; | ||
1546 | } | ||
1547 | return (cookie); | ||
1548 | } | ||
1549 | #endif /* USE_CONSOLEKIT */ | ||
diff --git a/monitor_wrap.h b/monitor_wrap.h index ec9b9b1c3..360fb9f57 100644 --- a/monitor_wrap.h +++ b/monitor_wrap.h | |||
@@ -41,7 +41,8 @@ void mm_log_handler(LogLevel, const char *, void *); | |||
41 | int mm_is_monitor(void); | 41 | int mm_is_monitor(void); |
42 | DH *mm_choose_dh(int, int, int); | 42 | DH *mm_choose_dh(int, int, int); |
43 | int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); | 43 | int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); |
44 | void mm_inform_authserv(char *, char *); | 44 | void mm_inform_authserv(char *, char *, char *); |
45 | void mm_inform_authrole(char *); | ||
45 | struct passwd *mm_getpwnamallow(const char *); | 46 | struct passwd *mm_getpwnamallow(const char *); |
46 | char *mm_auth2_read_banner(void); | 47 | char *mm_auth2_read_banner(void); |
47 | int mm_auth_password(struct Authctxt *, char *); | 48 | int mm_auth_password(struct Authctxt *, char *); |
@@ -130,4 +131,8 @@ void *mm_zalloc(struct mm_master *, u_int, u_int); | |||
130 | void mm_zfree(struct mm_master *, void *); | 131 | void mm_zfree(struct mm_master *, void *); |
131 | void mm_init_compression(struct mm_master *); | 132 | void mm_init_compression(struct mm_master *); |
132 | 133 | ||
134 | #ifdef USE_CONSOLEKIT | ||
135 | char *mm_consolekit_register(struct Session *, const char *); | ||
136 | #endif /* USE_CONSOLEKIT */ | ||
137 | |||
133 | #endif /* _MM_WRAP_H_ */ | 138 | #endif /* _MM_WRAP_H_ */ |
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index dc6fe0533..e061a290a 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c | |||
@@ -209,8 +209,8 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, | |||
209 | goto fail; | 209 | goto fail; |
210 | } | 210 | } |
211 | 211 | ||
212 | /* don't allow flags yet, unimplemented */ | 212 | /* Allow RRSET_FORCE_EDNS0 flag only. */ |
213 | if (flags) { | 213 | if ((flags & !RRSET_FORCE_EDNS0) != 0) { |
214 | result = ERRSET_INVAL; | 214 | result = ERRSET_INVAL; |
215 | goto fail; | 215 | goto fail; |
216 | } | 216 | } |
@@ -226,9 +226,9 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, | |||
226 | #endif /* DEBUG */ | 226 | #endif /* DEBUG */ |
227 | 227 | ||
228 | #ifdef RES_USE_DNSSEC | 228 | #ifdef RES_USE_DNSSEC |
229 | /* turn on DNSSEC if EDNS0 is configured */ | 229 | /* turn on DNSSEC if required */ |
230 | if (_resp->options & RES_USE_EDNS0) | 230 | if (flags & RRSET_FORCE_EDNS0) |
231 | _resp->options |= RES_USE_DNSSEC; | 231 | _resp->options |= (RES_USE_EDNS0|RES_USE_DNSSEC); |
232 | #endif /* RES_USE_DNSEC */ | 232 | #endif /* RES_USE_DNSEC */ |
233 | 233 | ||
234 | /* make query */ | 234 | /* make query */ |
diff --git a/openbsd-compat/getrrsetbyname.h b/openbsd-compat/getrrsetbyname.h index 1283f5506..dbbc85a2a 100644 --- a/openbsd-compat/getrrsetbyname.h +++ b/openbsd-compat/getrrsetbyname.h | |||
@@ -72,6 +72,9 @@ | |||
72 | #ifndef RRSET_VALIDATED | 72 | #ifndef RRSET_VALIDATED |
73 | # define RRSET_VALIDATED 1 | 73 | # define RRSET_VALIDATED 1 |
74 | #endif | 74 | #endif |
75 | #ifndef RRSET_FORCE_EDNS0 | ||
76 | # define RRSET_FORCE_EDNS0 0x0001 | ||
77 | #endif | ||
75 | 78 | ||
76 | /* | 79 | /* |
77 | * Return codes for getrrsetbyname() | 80 | * Return codes for getrrsetbyname() |
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index 4637a7a3e..de6ad3fd7 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c | |||
@@ -29,6 +29,12 @@ | |||
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <stdio.h> | 30 | #include <stdio.h> |
31 | 31 | ||
32 | #ifdef WITH_SELINUX | ||
33 | #include "key.h" | ||
34 | #include "hostfile.h" | ||
35 | #include "auth.h" | ||
36 | #endif | ||
37 | |||
32 | #include "log.h" | 38 | #include "log.h" |
33 | #include "xmalloc.h" | 39 | #include "xmalloc.h" |
34 | #include "port-linux.h" | 40 | #include "port-linux.h" |
@@ -58,7 +64,7 @@ ssh_selinux_enabled(void) | |||
58 | 64 | ||
59 | /* Return the default security context for the given username */ | 65 | /* Return the default security context for the given username */ |
60 | static security_context_t | 66 | static security_context_t |
61 | ssh_selinux_getctxbyname(char *pwname) | 67 | ssh_selinux_getctxbyname(char *pwname, const char *role) |
62 | { | 68 | { |
63 | security_context_t sc = NULL; | 69 | security_context_t sc = NULL; |
64 | char *sename = NULL, *lvl = NULL; | 70 | char *sename = NULL, *lvl = NULL; |
@@ -73,9 +79,16 @@ ssh_selinux_getctxbyname(char *pwname) | |||
73 | #endif | 79 | #endif |
74 | 80 | ||
75 | #ifdef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL | 81 | #ifdef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL |
76 | r = get_default_context_with_level(sename, lvl, NULL, &sc); | 82 | if (role != NULL && role[0]) |
83 | r = get_default_context_with_rolelevel(sename, role, lvl, NULL, | ||
84 | &sc); | ||
85 | else | ||
86 | r = get_default_context_with_level(sename, lvl, NULL, &sc); | ||
77 | #else | 87 | #else |
78 | r = get_default_context(sename, NULL, &sc); | 88 | if (role != NULL && role[0]) |
89 | r = get_default_context_with_role(sename, role, NULL, &sc); | ||
90 | else | ||
91 | r = get_default_context(sename, NULL, &sc); | ||
79 | #endif | 92 | #endif |
80 | 93 | ||
81 | if (r != 0) { | 94 | if (r != 0) { |
@@ -105,7 +118,7 @@ ssh_selinux_getctxbyname(char *pwname) | |||
105 | 118 | ||
106 | /* Set the execution context to the default for the specified user */ | 119 | /* Set the execution context to the default for the specified user */ |
107 | void | 120 | void |
108 | ssh_selinux_setup_exec_context(char *pwname) | 121 | ssh_selinux_setup_exec_context(char *pwname, const char *role) |
109 | { | 122 | { |
110 | security_context_t user_ctx = NULL; | 123 | security_context_t user_ctx = NULL; |
111 | 124 | ||
@@ -114,7 +127,7 @@ ssh_selinux_setup_exec_context(char *pwname) | |||
114 | 127 | ||
115 | debug3("%s: setting execution context", __func__); | 128 | debug3("%s: setting execution context", __func__); |
116 | 129 | ||
117 | user_ctx = ssh_selinux_getctxbyname(pwname); | 130 | user_ctx = ssh_selinux_getctxbyname(pwname, role); |
118 | if (setexeccon(user_ctx) != 0) { | 131 | if (setexeccon(user_ctx) != 0) { |
119 | switch (security_getenforce()) { | 132 | switch (security_getenforce()) { |
120 | case -1: | 133 | case -1: |
@@ -136,7 +149,7 @@ ssh_selinux_setup_exec_context(char *pwname) | |||
136 | 149 | ||
137 | /* Set the TTY context for the specified user */ | 150 | /* Set the TTY context for the specified user */ |
138 | void | 151 | void |
139 | ssh_selinux_setup_pty(char *pwname, const char *tty) | 152 | ssh_selinux_setup_pty(char *pwname, const char *tty, const char *role) |
140 | { | 153 | { |
141 | security_context_t new_tty_ctx = NULL; | 154 | security_context_t new_tty_ctx = NULL; |
142 | security_context_t user_ctx = NULL; | 155 | security_context_t user_ctx = NULL; |
@@ -147,7 +160,7 @@ ssh_selinux_setup_pty(char *pwname, const char *tty) | |||
147 | 160 | ||
148 | debug3("%s: setting TTY context on %s", __func__, tty); | 161 | debug3("%s: setting TTY context on %s", __func__, tty); |
149 | 162 | ||
150 | user_ctx = ssh_selinux_getctxbyname(pwname); | 163 | user_ctx = ssh_selinux_getctxbyname(pwname, role); |
151 | 164 | ||
152 | /* XXX: should these calls fatal() upon failure in enforcing mode? */ | 165 | /* XXX: should these calls fatal() upon failure in enforcing mode? */ |
153 | 166 | ||
diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h index e3d1004aa..80ce13ad9 100644 --- a/openbsd-compat/port-linux.h +++ b/openbsd-compat/port-linux.h | |||
@@ -21,8 +21,8 @@ | |||
21 | 21 | ||
22 | #ifdef WITH_SELINUX | 22 | #ifdef WITH_SELINUX |
23 | int ssh_selinux_enabled(void); | 23 | int ssh_selinux_enabled(void); |
24 | void ssh_selinux_setup_pty(char *, const char *); | 24 | void ssh_selinux_setup_pty(char *, const char *, const char *); |
25 | void ssh_selinux_setup_exec_context(char *); | 25 | void ssh_selinux_setup_exec_context(char *, const char *); |
26 | void ssh_selinux_change_context(const char *); | 26 | void ssh_selinux_change_context(const char *); |
27 | void ssh_selinux_setfscreatecon(const char *); | 27 | void ssh_selinux_setfscreatecon(const char *); |
28 | #endif | 28 | #endif |
diff --git a/pathnames.h b/pathnames.h index 5027fbaed..47f7867d5 100644 --- a/pathnames.h +++ b/pathnames.h | |||
@@ -18,6 +18,10 @@ | |||
18 | #define SSHDIR ETCDIR "/ssh" | 18 | #define SSHDIR ETCDIR "/ssh" |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #ifndef _PATH_SSH_DATADIR | ||
22 | #define _PATH_SSH_DATADIR "/usr/share/ssh" | ||
23 | #endif | ||
24 | |||
21 | #ifndef _PATH_SSH_PIDDIR | 25 | #ifndef _PATH_SSH_PIDDIR |
22 | #define _PATH_SSH_PIDDIR "/var/run" | 26 | #define _PATH_SSH_PIDDIR "/var/run" |
23 | #endif | 27 | #endif |
@@ -44,6 +48,9 @@ | |||
44 | /* Backwards compatibility */ | 48 | /* Backwards compatibility */ |
45 | #define _PATH_DH_PRIMES SSHDIR "/primes" | 49 | #define _PATH_DH_PRIMES SSHDIR "/primes" |
46 | 50 | ||
51 | #define _PATH_BLACKLIST _PATH_SSH_DATADIR "/blacklist" | ||
52 | #define _PATH_BLACKLIST_CONFIG SSHDIR "/blacklist" | ||
53 | |||
47 | #ifndef _PATH_SSH_PROGRAM | 54 | #ifndef _PATH_SSH_PROGRAM |
48 | #define _PATH_SSH_PROGRAM "/usr/bin/ssh" | 55 | #define _PATH_SSH_PROGRAM "/usr/bin/ssh" |
49 | #endif | 56 | #endif |
diff --git a/platform.c b/platform.c index 3262b2478..0b3bee147 100644 --- a/platform.c +++ b/platform.c | |||
@@ -134,7 +134,7 @@ platform_setusercontext(struct passwd *pw) | |||
134 | * called if sshd is running as root. | 134 | * called if sshd is running as root. |
135 | */ | 135 | */ |
136 | void | 136 | void |
137 | platform_setusercontext_post_groups(struct passwd *pw) | 137 | platform_setusercontext_post_groups(struct passwd *pw, const char *role) |
138 | { | 138 | { |
139 | #if !defined(HAVE_LOGIN_CAP) && defined(USE_PAM) | 139 | #if !defined(HAVE_LOGIN_CAP) && defined(USE_PAM) |
140 | /* | 140 | /* |
@@ -181,7 +181,7 @@ platform_setusercontext_post_groups(struct passwd *pw) | |||
181 | } | 181 | } |
182 | #endif /* HAVE_SETPCRED */ | 182 | #endif /* HAVE_SETPCRED */ |
183 | #ifdef WITH_SELINUX | 183 | #ifdef WITH_SELINUX |
184 | ssh_selinux_setup_exec_context(pw->pw_name); | 184 | ssh_selinux_setup_exec_context(pw->pw_name, role); |
185 | #endif | 185 | #endif |
186 | } | 186 | } |
187 | 187 | ||
@@ -194,19 +194,3 @@ platform_krb5_get_principal_name(const char *pw_name) | |||
194 | return NULL; | 194 | return NULL; |
195 | #endif | 195 | #endif |
196 | } | 196 | } |
197 | |||
198 | /* | ||
199 | * return 1 if the specified uid is a uid that may own a system directory | ||
200 | * otherwise 0. | ||
201 | */ | ||
202 | int | ||
203 | platform_sys_dir_uid(uid_t uid) | ||
204 | { | ||
205 | if (uid == 0) | ||
206 | return 1; | ||
207 | #ifdef PLATFORM_SYS_DIR_UID | ||
208 | if (uid == PLATFORM_SYS_DIR_UID) | ||
209 | return 1; | ||
210 | #endif | ||
211 | return 0; | ||
212 | } | ||
diff --git a/platform.h b/platform.h index 19f6bfdd3..3188a3d7c 100644 --- a/platform.h +++ b/platform.h | |||
@@ -26,7 +26,7 @@ void platform_post_fork_parent(pid_t child_pid); | |||
26 | void platform_post_fork_child(void); | 26 | void platform_post_fork_child(void); |
27 | int platform_privileged_uidswap(void); | 27 | int platform_privileged_uidswap(void); |
28 | void platform_setusercontext(struct passwd *); | 28 | void platform_setusercontext(struct passwd *); |
29 | void platform_setusercontext_post_groups(struct passwd *); | 29 | void platform_setusercontext_post_groups(struct passwd *, const char *); |
30 | char *platform_get_krb5_client(const char *); | 30 | char *platform_get_krb5_client(const char *); |
31 | char *platform_krb5_get_principal_name(const char *); | 31 | char *platform_krb5_get_principal_name(const char *); |
32 | int platform_sys_dir_uid(uid_t); | 32 | int platform_sys_dir_uid(uid_t); |
diff --git a/readconf.c b/readconf.c index 2695fd6c0..2778176c6 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <stdio.h> | 30 | #include <stdio.h> |
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include <pwd.h> | ||
34 | #include <grp.h> | ||
33 | #ifdef HAVE_UTIL_H | 35 | #ifdef HAVE_UTIL_H |
34 | #include <util.h> | 36 | #include <util.h> |
35 | #endif | 37 | #endif |
@@ -128,6 +130,7 @@ typedef enum { | |||
128 | oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, | 130 | oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, |
129 | oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, | 131 | oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, |
130 | oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, | 132 | oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, |
133 | oUseBlacklistedKeys, | ||
131 | oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, | 134 | oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, |
132 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, | 135 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, |
133 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, | 136 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, |
@@ -140,6 +143,7 @@ typedef enum { | |||
140 | oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, | 143 | oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, |
141 | oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, | 144 | oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, |
142 | oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, | 145 | oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, |
146 | oProtocolKeepAlives, oSetupTimeOut, | ||
143 | oIgnoredUnknownOption, oDeprecated, oUnsupported | 147 | oIgnoredUnknownOption, oDeprecated, oUnsupported |
144 | } OpCodes; | 148 | } OpCodes; |
145 | 149 | ||
@@ -161,6 +165,7 @@ static struct { | |||
161 | { "passwordauthentication", oPasswordAuthentication }, | 165 | { "passwordauthentication", oPasswordAuthentication }, |
162 | { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, | 166 | { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, |
163 | { "kbdinteractivedevices", oKbdInteractiveDevices }, | 167 | { "kbdinteractivedevices", oKbdInteractiveDevices }, |
168 | { "useblacklistedkeys", oUseBlacklistedKeys }, | ||
164 | { "rsaauthentication", oRSAAuthentication }, | 169 | { "rsaauthentication", oRSAAuthentication }, |
165 | { "pubkeyauthentication", oPubkeyAuthentication }, | 170 | { "pubkeyauthentication", oPubkeyAuthentication }, |
166 | { "dsaauthentication", oPubkeyAuthentication }, /* alias */ | 171 | { "dsaauthentication", oPubkeyAuthentication }, /* alias */ |
@@ -261,6 +266,8 @@ static struct { | |||
261 | { "ipqos", oIPQoS }, | 266 | { "ipqos", oIPQoS }, |
262 | { "requesttty", oRequestTTY }, | 267 | { "requesttty", oRequestTTY }, |
263 | { "ignoreunknown", oIgnoreUnknown }, | 268 | { "ignoreunknown", oIgnoreUnknown }, |
269 | { "protocolkeepalives", oProtocolKeepAlives }, | ||
270 | { "setuptimeout", oSetupTimeOut }, | ||
264 | 271 | ||
265 | { NULL, oBadOption } | 272 | { NULL, oBadOption } |
266 | }; | 273 | }; |
@@ -523,6 +530,10 @@ parse_flag: | |||
523 | intptr = &options->challenge_response_authentication; | 530 | intptr = &options->challenge_response_authentication; |
524 | goto parse_flag; | 531 | goto parse_flag; |
525 | 532 | ||
533 | case oUseBlacklistedKeys: | ||
534 | intptr = &options->use_blacklisted_keys; | ||
535 | goto parse_flag; | ||
536 | |||
526 | case oGssAuthentication: | 537 | case oGssAuthentication: |
527 | intptr = &options->gss_authentication; | 538 | intptr = &options->gss_authentication; |
528 | goto parse_flag; | 539 | goto parse_flag; |
@@ -933,6 +944,8 @@ parse_int: | |||
933 | goto parse_flag; | 944 | goto parse_flag; |
934 | 945 | ||
935 | case oServerAliveInterval: | 946 | case oServerAliveInterval: |
947 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
948 | case oSetupTimeOut: /* Debian-specific compatibility alias */ | ||
936 | intptr = &options->server_alive_interval; | 949 | intptr = &options->server_alive_interval; |
937 | goto parse_time; | 950 | goto parse_time; |
938 | 951 | ||
@@ -1149,8 +1162,7 @@ read_config_file(const char *filename, const char *host, Options *options, | |||
1149 | 1162 | ||
1150 | if (fstat(fileno(f), &sb) == -1) | 1163 | if (fstat(fileno(f), &sb) == -1) |
1151 | fatal("fstat %s: %s", filename, strerror(errno)); | 1164 | fatal("fstat %s: %s", filename, strerror(errno)); |
1152 | if (((sb.st_uid != 0 && sb.st_uid != getuid()) || | 1165 | if (!secure_permissions(&sb, getuid())) |
1153 | (sb.st_mode & 022) != 0)) | ||
1154 | fatal("Bad owner or permissions on %s", filename); | 1166 | fatal("Bad owner or permissions on %s", filename); |
1155 | } | 1167 | } |
1156 | 1168 | ||
@@ -1210,6 +1222,7 @@ initialize_options(Options * options) | |||
1210 | options->kbd_interactive_devices = NULL; | 1222 | options->kbd_interactive_devices = NULL; |
1211 | options->rhosts_rsa_authentication = -1; | 1223 | options->rhosts_rsa_authentication = -1; |
1212 | options->hostbased_authentication = -1; | 1224 | options->hostbased_authentication = -1; |
1225 | options->use_blacklisted_keys = -1; | ||
1213 | options->batch_mode = -1; | 1226 | options->batch_mode = -1; |
1214 | options->check_host_ip = -1; | 1227 | options->check_host_ip = -1; |
1215 | options->strict_host_key_checking = -1; | 1228 | options->strict_host_key_checking = -1; |
@@ -1285,7 +1298,7 @@ fill_default_options(Options * options) | |||
1285 | if (options->forward_x11 == -1) | 1298 | if (options->forward_x11 == -1) |
1286 | options->forward_x11 = 0; | 1299 | options->forward_x11 = 0; |
1287 | if (options->forward_x11_trusted == -1) | 1300 | if (options->forward_x11_trusted == -1) |
1288 | options->forward_x11_trusted = 0; | 1301 | options->forward_x11_trusted = 1; |
1289 | if (options->forward_x11_timeout == -1) | 1302 | if (options->forward_x11_timeout == -1) |
1290 | options->forward_x11_timeout = 1200; | 1303 | options->forward_x11_timeout = 1200; |
1291 | if (options->exit_on_forward_failure == -1) | 1304 | if (options->exit_on_forward_failure == -1) |
@@ -1320,6 +1333,8 @@ fill_default_options(Options * options) | |||
1320 | options->rhosts_rsa_authentication = 0; | 1333 | options->rhosts_rsa_authentication = 0; |
1321 | if (options->hostbased_authentication == -1) | 1334 | if (options->hostbased_authentication == -1) |
1322 | options->hostbased_authentication = 0; | 1335 | options->hostbased_authentication = 0; |
1336 | if (options->use_blacklisted_keys == -1) | ||
1337 | options->use_blacklisted_keys = 0; | ||
1323 | if (options->batch_mode == -1) | 1338 | if (options->batch_mode == -1) |
1324 | options->batch_mode = 0; | 1339 | options->batch_mode = 0; |
1325 | if (options->check_host_ip == -1) | 1340 | if (options->check_host_ip == -1) |
@@ -1395,8 +1410,13 @@ fill_default_options(Options * options) | |||
1395 | options->rekey_interval = 0; | 1410 | options->rekey_interval = 0; |
1396 | if (options->verify_host_key_dns == -1) | 1411 | if (options->verify_host_key_dns == -1) |
1397 | options->verify_host_key_dns = 0; | 1412 | options->verify_host_key_dns = 0; |
1398 | if (options->server_alive_interval == -1) | 1413 | if (options->server_alive_interval == -1) { |
1399 | options->server_alive_interval = 0; | 1414 | /* in batch mode, default is 5mins */ |
1415 | if (options->batch_mode == 1) | ||
1416 | options->server_alive_interval = 300; | ||
1417 | else | ||
1418 | options->server_alive_interval = 0; | ||
1419 | } | ||
1400 | if (options->server_alive_count_max == -1) | 1420 | if (options->server_alive_count_max == -1) |
1401 | options->server_alive_count_max = 3; | 1421 | options->server_alive_count_max = 3; |
1402 | if (options->control_master == -1) | 1422 | if (options->control_master == -1) |
diff --git a/readconf.h b/readconf.h index 675b35dfe..a508151f7 100644 --- a/readconf.h +++ b/readconf.h | |||
@@ -59,6 +59,7 @@ typedef struct { | |||
59 | int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ | 59 | int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ |
60 | char *kbd_interactive_devices; /* Keyboard-interactive auth devices. */ | 60 | char *kbd_interactive_devices; /* Keyboard-interactive auth devices. */ |
61 | int zero_knowledge_password_authentication; /* Try jpake */ | 61 | int zero_knowledge_password_authentication; /* Try jpake */ |
62 | int use_blacklisted_keys; /* If true, send */ | ||
62 | int batch_mode; /* Batch mode: do not ask for passwords. */ | 63 | int batch_mode; /* Batch mode: do not ask for passwords. */ |
63 | int check_host_ip; /* Also keep track of keys for IP address */ | 64 | int check_host_ip; /* Also keep track of keys for IP address */ |
64 | int strict_host_key_checking; /* Strict host key checking. */ | 65 | int strict_host_key_checking; /* Strict host key checking. */ |
@@ -189,8 +189,16 @@ do_local_cmd(arglist *a) | |||
189 | 189 | ||
190 | if (verbose_mode) { | 190 | if (verbose_mode) { |
191 | fprintf(stderr, "Executing:"); | 191 | fprintf(stderr, "Executing:"); |
192 | for (i = 0; i < a->num; i++) | 192 | for (i = 0; i < a->num; i++) { |
193 | fprintf(stderr, " %s", a->list[i]); | 193 | if (i == 0) |
194 | fprintf(stderr, " %s", a->list[i]); | ||
195 | else | ||
196 | /* | ||
197 | * TODO: misbehaves if a->list[i] contains a | ||
198 | * single quote | ||
199 | */ | ||
200 | fprintf(stderr, " '%s'", a->list[i]); | ||
201 | } | ||
194 | fprintf(stderr, "\n"); | 202 | fprintf(stderr, "\n"); |
195 | } | 203 | } |
196 | if ((pid = fork()) == -1) | 204 | if ((pid = fork()) == -1) |
diff --git a/servconf.c b/servconf.c index c938ae399..a2928ff57 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -114,6 +114,7 @@ initialize_server_options(ServerOptions *options) | |||
114 | options->password_authentication = -1; | 114 | options->password_authentication = -1; |
115 | options->kbd_interactive_authentication = -1; | 115 | options->kbd_interactive_authentication = -1; |
116 | options->challenge_response_authentication = -1; | 116 | options->challenge_response_authentication = -1; |
117 | options->permit_blacklisted_keys = -1; | ||
117 | options->permit_empty_passwd = -1; | 118 | options->permit_empty_passwd = -1; |
118 | options->permit_user_env = -1; | 119 | options->permit_user_env = -1; |
119 | options->use_login = -1; | 120 | options->use_login = -1; |
@@ -156,6 +157,7 @@ initialize_server_options(ServerOptions *options) | |||
156 | options->ip_qos_interactive = -1; | 157 | options->ip_qos_interactive = -1; |
157 | options->ip_qos_bulk = -1; | 158 | options->ip_qos_bulk = -1; |
158 | options->version_addendum = NULL; | 159 | options->version_addendum = NULL; |
160 | options->debian_banner = -1; | ||
159 | } | 161 | } |
160 | 162 | ||
161 | void | 163 | void |
@@ -257,6 +259,8 @@ fill_default_server_options(ServerOptions *options) | |||
257 | options->kbd_interactive_authentication = 0; | 259 | options->kbd_interactive_authentication = 0; |
258 | if (options->challenge_response_authentication == -1) | 260 | if (options->challenge_response_authentication == -1) |
259 | options->challenge_response_authentication = 1; | 261 | options->challenge_response_authentication = 1; |
262 | if (options->permit_blacklisted_keys == -1) | ||
263 | options->permit_blacklisted_keys = 0; | ||
260 | if (options->permit_empty_passwd == -1) | 264 | if (options->permit_empty_passwd == -1) |
261 | options->permit_empty_passwd = 0; | 265 | options->permit_empty_passwd = 0; |
262 | if (options->permit_user_env == -1) | 266 | if (options->permit_user_env == -1) |
@@ -307,6 +311,8 @@ fill_default_server_options(ServerOptions *options) | |||
307 | options->ip_qos_bulk = IPTOS_THROUGHPUT; | 311 | options->ip_qos_bulk = IPTOS_THROUGHPUT; |
308 | if (options->version_addendum == NULL) | 312 | if (options->version_addendum == NULL) |
309 | options->version_addendum = xstrdup(""); | 313 | options->version_addendum = xstrdup(""); |
314 | if (options->debian_banner == -1) | ||
315 | options->debian_banner = 1; | ||
310 | /* Turn privilege separation on by default */ | 316 | /* Turn privilege separation on by default */ |
311 | if (use_privsep == -1) | 317 | if (use_privsep == -1) |
312 | use_privsep = PRIVSEP_NOSANDBOX; | 318 | use_privsep = PRIVSEP_NOSANDBOX; |
@@ -338,7 +344,7 @@ typedef enum { | |||
338 | sListenAddress, sAddressFamily, | 344 | sListenAddress, sAddressFamily, |
339 | sPrintMotd, sPrintLastLog, sIgnoreRhosts, | 345 | sPrintMotd, sPrintLastLog, sIgnoreRhosts, |
340 | sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, | 346 | sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, |
341 | sStrictModes, sEmptyPasswd, sTCPKeepAlive, | 347 | sStrictModes, sPermitBlacklistedKeys, sEmptyPasswd, sTCPKeepAlive, |
342 | sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, | 348 | sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, |
343 | sRekeyLimit, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, | 349 | sRekeyLimit, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, |
344 | sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, | 350 | sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, |
@@ -357,6 +363,7 @@ typedef enum { | |||
357 | sKexAlgorithms, sIPQoS, sVersionAddendum, | 363 | sKexAlgorithms, sIPQoS, sVersionAddendum, |
358 | sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, | 364 | sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, |
359 | sAuthenticationMethods, sHostKeyAgent, | 365 | sAuthenticationMethods, sHostKeyAgent, |
366 | sDebianBanner, | ||
360 | sDeprecated, sUnsupported | 367 | sDeprecated, sUnsupported |
361 | } ServerOpCodes; | 368 | } ServerOpCodes; |
362 | 369 | ||
@@ -451,6 +458,7 @@ static struct { | |||
451 | { "x11uselocalhost", sX11UseLocalhost, SSHCFG_ALL }, | 458 | { "x11uselocalhost", sX11UseLocalhost, SSHCFG_ALL }, |
452 | { "xauthlocation", sXAuthLocation, SSHCFG_GLOBAL }, | 459 | { "xauthlocation", sXAuthLocation, SSHCFG_GLOBAL }, |
453 | { "strictmodes", sStrictModes, SSHCFG_GLOBAL }, | 460 | { "strictmodes", sStrictModes, SSHCFG_GLOBAL }, |
461 | { "permitblacklistedkeys", sPermitBlacklistedKeys, SSHCFG_GLOBAL }, | ||
454 | { "permitemptypasswords", sEmptyPasswd, SSHCFG_ALL }, | 462 | { "permitemptypasswords", sEmptyPasswd, SSHCFG_ALL }, |
455 | { "permituserenvironment", sPermitUserEnvironment, SSHCFG_GLOBAL }, | 463 | { "permituserenvironment", sPermitUserEnvironment, SSHCFG_GLOBAL }, |
456 | { "uselogin", sUseLogin, SSHCFG_GLOBAL }, | 464 | { "uselogin", sUseLogin, SSHCFG_GLOBAL }, |
@@ -497,6 +505,7 @@ static struct { | |||
497 | { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, | 505 | { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, |
498 | { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, | 506 | { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, |
499 | { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL }, | 507 | { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL }, |
508 | { "debianbanner", sDebianBanner, SSHCFG_GLOBAL }, | ||
500 | { NULL, sBadOption, 0 } | 509 | { NULL, sBadOption, 0 } |
501 | }; | 510 | }; |
502 | 511 | ||
@@ -1158,6 +1167,10 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1158 | intptr = &options->tcp_keep_alive; | 1167 | intptr = &options->tcp_keep_alive; |
1159 | goto parse_flag; | 1168 | goto parse_flag; |
1160 | 1169 | ||
1170 | case sPermitBlacklistedKeys: | ||
1171 | intptr = &options->permit_blacklisted_keys; | ||
1172 | goto parse_flag; | ||
1173 | |||
1161 | case sEmptyPasswd: | 1174 | case sEmptyPasswd: |
1162 | intptr = &options->permit_empty_passwd; | 1175 | intptr = &options->permit_empty_passwd; |
1163 | goto parse_flag; | 1176 | goto parse_flag; |
@@ -1640,6 +1653,10 @@ process_server_config_line(ServerOptions *options, char *line, | |||
1640 | } | 1653 | } |
1641 | return 0; | 1654 | return 0; |
1642 | 1655 | ||
1656 | case sDebianBanner: | ||
1657 | intptr = &options->debian_banner; | ||
1658 | goto parse_int; | ||
1659 | |||
1643 | case sDeprecated: | 1660 | case sDeprecated: |
1644 | logit("%s line %d: Deprecated option %s", | 1661 | logit("%s line %d: Deprecated option %s", |
1645 | filename, linenum, arg); | 1662 | filename, linenum, arg); |
@@ -2036,6 +2053,7 @@ dump_config(ServerOptions *o) | |||
2036 | dump_cfg_fmtint(sX11UseLocalhost, o->x11_use_localhost); | 2053 | dump_cfg_fmtint(sX11UseLocalhost, o->x11_use_localhost); |
2037 | dump_cfg_fmtint(sStrictModes, o->strict_modes); | 2054 | dump_cfg_fmtint(sStrictModes, o->strict_modes); |
2038 | dump_cfg_fmtint(sTCPKeepAlive, o->tcp_keep_alive); | 2055 | dump_cfg_fmtint(sTCPKeepAlive, o->tcp_keep_alive); |
2056 | dump_cfg_fmtint(sPermitBlacklistedKeys, o->permit_blacklisted_keys); | ||
2039 | dump_cfg_fmtint(sEmptyPasswd, o->permit_empty_passwd); | 2057 | dump_cfg_fmtint(sEmptyPasswd, o->permit_empty_passwd); |
2040 | dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); | 2058 | dump_cfg_fmtint(sPermitUserEnvironment, o->permit_user_env); |
2041 | dump_cfg_fmtint(sUseLogin, o->use_login); | 2059 | dump_cfg_fmtint(sUseLogin, o->use_login); |
diff --git a/servconf.h b/servconf.h index ab6e34669..fd72ce2a3 100644 --- a/servconf.h +++ b/servconf.h | |||
@@ -121,6 +121,7 @@ typedef struct { | |||
121 | int challenge_response_authentication; | 121 | int challenge_response_authentication; |
122 | int zero_knowledge_password_authentication; | 122 | int zero_knowledge_password_authentication; |
123 | /* If true, permit jpake auth */ | 123 | /* If true, permit jpake auth */ |
124 | int permit_blacklisted_keys; /* If true, permit */ | ||
124 | int permit_empty_passwd; /* If false, do not permit empty | 125 | int permit_empty_passwd; /* If false, do not permit empty |
125 | * passwords. */ | 126 | * passwords. */ |
126 | int permit_user_env; /* If true, read ~/.ssh/environment */ | 127 | int permit_user_env; /* If true, read ~/.ssh/environment */ |
@@ -187,6 +188,8 @@ typedef struct { | |||
187 | 188 | ||
188 | u_int num_auth_methods; | 189 | u_int num_auth_methods; |
189 | char *auth_methods[MAX_AUTH_METHODS]; | 190 | char *auth_methods[MAX_AUTH_METHODS]; |
191 | |||
192 | int debian_banner; | ||
190 | } ServerOptions; | 193 | } ServerOptions; |
191 | 194 | ||
192 | /* Information about the incoming connection as used by Match */ | 195 | /* Information about the incoming connection as used by Match */ |
diff --git a/serverloop.c b/serverloop.c index ccbad617d..5f22df3df 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -686,7 +686,7 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) | |||
686 | if (!channel_still_open()) | 686 | if (!channel_still_open()) |
687 | break; | 687 | break; |
688 | if (!waiting_termination) { | 688 | if (!waiting_termination) { |
689 | const char *s = "Waiting for forwarded connections to terminate...\r\n"; | 689 | const char *s = "Waiting for forwarded connections to terminate... (press ~& to background)\r\n"; |
690 | char *cp; | 690 | char *cp; |
691 | waiting_termination = 1; | 691 | waiting_termination = 1; |
692 | buffer_append(&stderr_buffer, s, strlen(s)); | 692 | buffer_append(&stderr_buffer, s, strlen(s)); |
@@ -92,6 +92,7 @@ | |||
92 | #include "kex.h" | 92 | #include "kex.h" |
93 | #include "monitor_wrap.h" | 93 | #include "monitor_wrap.h" |
94 | #include "sftp.h" | 94 | #include "sftp.h" |
95 | #include "consolekit.h" | ||
95 | 96 | ||
96 | #if defined(KRB5) && defined(USE_AFS) | 97 | #if defined(KRB5) && defined(USE_AFS) |
97 | #include <kafs.h> | 98 | #include <kafs.h> |
@@ -1132,6 +1133,9 @@ do_setup_env(Session *s, const char *shell) | |||
1132 | #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) | 1133 | #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) |
1133 | char *path = NULL; | 1134 | char *path = NULL; |
1134 | #endif | 1135 | #endif |
1136 | #ifdef USE_CONSOLEKIT | ||
1137 | const char *ckcookie = NULL; | ||
1138 | #endif /* USE_CONSOLEKIT */ | ||
1135 | 1139 | ||
1136 | /* Initialize the environment. */ | 1140 | /* Initialize the environment. */ |
1137 | envsize = 100; | 1141 | envsize = 100; |
@@ -1276,6 +1280,11 @@ do_setup_env(Session *s, const char *shell) | |||
1276 | child_set_env(&env, &envsize, "KRB5CCNAME", | 1280 | child_set_env(&env, &envsize, "KRB5CCNAME", |
1277 | s->authctxt->krb5_ccname); | 1281 | s->authctxt->krb5_ccname); |
1278 | #endif | 1282 | #endif |
1283 | #ifdef USE_CONSOLEKIT | ||
1284 | ckcookie = PRIVSEP(consolekit_register(s, s->display)); | ||
1285 | if (ckcookie) | ||
1286 | child_set_env(&env, &envsize, "XDG_SESSION_COOKIE", ckcookie); | ||
1287 | #endif /* USE_CONSOLEKIT */ | ||
1279 | #ifdef USE_PAM | 1288 | #ifdef USE_PAM |
1280 | /* | 1289 | /* |
1281 | * Pull in any environment variables that may have | 1290 | * Pull in any environment variables that may have |
@@ -1474,7 +1483,7 @@ safely_chroot(const char *path, uid_t uid) | |||
1474 | 1483 | ||
1475 | /* Set login name, uid, gid, and groups. */ | 1484 | /* Set login name, uid, gid, and groups. */ |
1476 | void | 1485 | void |
1477 | do_setusercontext(struct passwd *pw) | 1486 | do_setusercontext(struct passwd *pw, const char *role) |
1478 | { | 1487 | { |
1479 | char *chroot_path, *tmp; | 1488 | char *chroot_path, *tmp; |
1480 | 1489 | ||
@@ -1502,7 +1511,7 @@ do_setusercontext(struct passwd *pw) | |||
1502 | endgrent(); | 1511 | endgrent(); |
1503 | #endif | 1512 | #endif |
1504 | 1513 | ||
1505 | platform_setusercontext_post_groups(pw); | 1514 | platform_setusercontext_post_groups(pw, role); |
1506 | 1515 | ||
1507 | if (options.chroot_directory != NULL && | 1516 | if (options.chroot_directory != NULL && |
1508 | strcasecmp(options.chroot_directory, "none") != 0) { | 1517 | strcasecmp(options.chroot_directory, "none") != 0) { |
@@ -1646,7 +1655,7 @@ do_child(Session *s, const char *command) | |||
1646 | 1655 | ||
1647 | /* Force a password change */ | 1656 | /* Force a password change */ |
1648 | if (s->authctxt->force_pwchange) { | 1657 | if (s->authctxt->force_pwchange) { |
1649 | do_setusercontext(pw); | 1658 | do_setusercontext(pw, s->authctxt->role); |
1650 | child_close_fds(); | 1659 | child_close_fds(); |
1651 | do_pwchange(s); | 1660 | do_pwchange(s); |
1652 | exit(1); | 1661 | exit(1); |
@@ -1673,7 +1682,7 @@ do_child(Session *s, const char *command) | |||
1673 | /* When PAM is enabled we rely on it to do the nologin check */ | 1682 | /* When PAM is enabled we rely on it to do the nologin check */ |
1674 | if (!options.use_pam) | 1683 | if (!options.use_pam) |
1675 | do_nologin(pw); | 1684 | do_nologin(pw); |
1676 | do_setusercontext(pw); | 1685 | do_setusercontext(pw, s->authctxt->role); |
1677 | /* | 1686 | /* |
1678 | * PAM session modules in do_setusercontext may have | 1687 | * PAM session modules in do_setusercontext may have |
1679 | * generated messages, so if this in an interactive | 1688 | * generated messages, so if this in an interactive |
@@ -2084,7 +2093,7 @@ session_pty_req(Session *s) | |||
2084 | tty_parse_modes(s->ttyfd, &n_bytes); | 2093 | tty_parse_modes(s->ttyfd, &n_bytes); |
2085 | 2094 | ||
2086 | if (!use_privsep) | 2095 | if (!use_privsep) |
2087 | pty_setowner(s->pw, s->tty); | 2096 | pty_setowner(s->pw, s->tty, s->authctxt->role); |
2088 | 2097 | ||
2089 | /* Set window size from the packet. */ | 2098 | /* Set window size from the packet. */ |
2090 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); | 2099 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
@@ -2320,6 +2329,10 @@ session_pty_cleanup2(Session *s) | |||
2320 | 2329 | ||
2321 | debug("session_pty_cleanup: session %d release %s", s->self, s->tty); | 2330 | debug("session_pty_cleanup: session %d release %s", s->self, s->tty); |
2322 | 2331 | ||
2332 | #ifdef USE_CONSOLEKIT | ||
2333 | consolekit_unregister(s); | ||
2334 | #endif /* USE_CONSOLEKIT */ | ||
2335 | |||
2323 | /* Record that the user has logged out. */ | 2336 | /* Record that the user has logged out. */ |
2324 | if (s->pid != 0) | 2337 | if (s->pid != 0) |
2325 | record_logout(s->pid, s->tty, s->pw->pw_name); | 2338 | record_logout(s->pid, s->tty, s->pw->pw_name); |
@@ -26,6 +26,8 @@ | |||
26 | #ifndef SESSION_H | 26 | #ifndef SESSION_H |
27 | #define SESSION_H | 27 | #define SESSION_H |
28 | 28 | ||
29 | struct _CkConnector; | ||
30 | |||
29 | #define TTYSZ 64 | 31 | #define TTYSZ 64 |
30 | typedef struct Session Session; | 32 | typedef struct Session Session; |
31 | struct Session { | 33 | struct Session { |
@@ -60,6 +62,10 @@ struct Session { | |||
60 | char *name; | 62 | char *name; |
61 | char *val; | 63 | char *val; |
62 | } *env; | 64 | } *env; |
65 | |||
66 | #ifdef USE_CONSOLEKIT | ||
67 | struct _CkConnector *ckc; | ||
68 | #endif /* USE_CONSOLEKIT */ | ||
63 | }; | 69 | }; |
64 | 70 | ||
65 | void do_authenticated(Authctxt *); | 71 | void do_authenticated(Authctxt *); |
@@ -76,7 +82,7 @@ void session_pty_cleanup2(Session *); | |||
76 | Session *session_new(void); | 82 | Session *session_new(void); |
77 | Session *session_by_tty(char *); | 83 | Session *session_by_tty(char *); |
78 | void session_close(Session *); | 84 | void session_close(Session *); |
79 | void do_setusercontext(struct passwd *); | 85 | void do_setusercontext(struct passwd *, const char *); |
80 | void child_set_env(char ***envp, u_int *envsizep, const char *name, | 86 | void child_set_env(char ***envp, u_int *envsizep, const char *name, |
81 | const char *value); | 87 | const char *value); |
82 | 88 | ||
@@ -81,6 +81,10 @@ environment variable must contain the name of its socket for | |||
81 | .Nm | 81 | .Nm |
82 | to work. | 82 | to work. |
83 | .Pp | 83 | .Pp |
84 | Any keys recorded in the blacklist of known-compromised keys (see | ||
85 | .Xr ssh-vulnkey 1 ) | ||
86 | will be refused. | ||
87 | .Pp | ||
84 | The options are as follows: | 88 | The options are as follows: |
85 | .Bl -tag -width Ds | 89 | .Bl -tag -width Ds |
86 | .It Fl c | 90 | .It Fl c |
@@ -186,6 +190,7 @@ is unable to contact the authentication agent. | |||
186 | .Xr ssh 1 , | 190 | .Xr ssh 1 , |
187 | .Xr ssh-agent 1 , | 191 | .Xr ssh-agent 1 , |
188 | .Xr ssh-keygen 1 , | 192 | .Xr ssh-keygen 1 , |
193 | .Xr ssh-vulnkey 1 , | ||
189 | .Xr sshd 8 | 194 | .Xr sshd 8 |
190 | .Sh AUTHORS | 195 | .Sh AUTHORS |
191 | OpenSSH is a derivative of the original and free | 196 | OpenSSH is a derivative of the original and free |
@@ -167,7 +167,7 @@ static int | |||
167 | add_file(AuthenticationConnection *ac, const char *filename, int key_only) | 167 | add_file(AuthenticationConnection *ac, const char *filename, int key_only) |
168 | { | 168 | { |
169 | Key *private, *cert; | 169 | Key *private, *cert; |
170 | char *comment = NULL; | 170 | char *comment = NULL, *fp; |
171 | char msg[1024], *certpath = NULL; | 171 | char msg[1024], *certpath = NULL; |
172 | int fd, perms_ok, ret = -1; | 172 | int fd, perms_ok, ret = -1; |
173 | Buffer keyblob; | 173 | Buffer keyblob; |
@@ -243,6 +243,14 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) | |||
243 | } else { | 243 | } else { |
244 | fprintf(stderr, "Could not add identity: %s\n", filename); | 244 | fprintf(stderr, "Could not add identity: %s\n", filename); |
245 | } | 245 | } |
246 | if (blacklisted_key(private, &fp) == 1) { | ||
247 | fprintf(stderr, "Public key %s blacklisted (see " | ||
248 | "ssh-vulnkey(1)); refusing to add it\n", fp); | ||
249 | free(fp); | ||
250 | key_free(private); | ||
251 | free(comment); | ||
252 | return -1; | ||
253 | } | ||
246 | 254 | ||
247 | /* Skip trying to load the cert if requested */ | 255 | /* Skip trying to load the cert if requested */ |
248 | if (key_only) | 256 | if (key_only) |
diff --git a/ssh-agent.1 b/ssh-agent.1 index bb801c902..d370531bb 100644 --- a/ssh-agent.1 +++ b/ssh-agent.1 | |||
@@ -182,6 +182,21 @@ environment variable holds the agent's process ID. | |||
182 | .Pp | 182 | .Pp |
183 | The agent exits automatically when the command given on the command | 183 | The agent exits automatically when the command given on the command |
184 | line terminates. | 184 | line terminates. |
185 | .Pp | ||
186 | In Debian, | ||
187 | .Nm | ||
188 | is installed with the set-group-id bit set, to prevent | ||
189 | .Xr ptrace 2 | ||
190 | attacks retrieving private key material. | ||
191 | This has the side-effect of causing the run-time linker to remove certain | ||
192 | environment variables which might have security implications for set-id | ||
193 | programs, including | ||
194 | .Ev LD_PRELOAD , | ||
195 | .Ev LD_LIBRARY_PATH , | ||
196 | and | ||
197 | .Ev TMPDIR . | ||
198 | If you need to set any of these environment variables, you will need to do | ||
199 | so in the program executed by ssh-agent. | ||
185 | .Sh FILES | 200 | .Sh FILES |
186 | .Bl -tag -width Ds | 201 | .Bl -tag -width Ds |
187 | .It Pa ~/.ssh/identity | 202 | .It Pa ~/.ssh/identity |
diff --git a/ssh-keygen.1 b/ssh-keygen.1 index 0d55854e9..753cc625b 100644 --- a/ssh-keygen.1 +++ b/ssh-keygen.1 | |||
@@ -171,9 +171,7 @@ key in | |||
171 | .Pa ~/.ssh/id_dsa | 171 | .Pa ~/.ssh/id_dsa |
172 | or | 172 | or |
173 | .Pa ~/.ssh/id_rsa . | 173 | .Pa ~/.ssh/id_rsa . |
174 | Additionally, the system administrator may use this to generate host keys, | 174 | Additionally, the system administrator may use this to generate host keys. |
175 | as seen in | ||
176 | .Pa /etc/rc . | ||
177 | .Pp | 175 | .Pp |
178 | Normally this program generates the key and asks for a file in which | 176 | Normally this program generates the key and asks for a file in which |
179 | to store the private key. | 177 | to store the private key. |
@@ -219,9 +217,7 @@ The options are as follows: | |||
219 | For each of the key types (rsa1, rsa, dsa and ecdsa) for which host keys | 217 | For each of the key types (rsa1, rsa, dsa and ecdsa) for which host keys |
220 | do not exist, generate the host keys with the default key file path, | 218 | do not exist, generate the host keys with the default key file path, |
221 | an empty passphrase, default bits for the key type, and default comment. | 219 | an empty passphrase, default bits for the key type, and default comment. |
222 | This is used by | 220 | This is used by system administration scripts to generate new host keys. |
223 | .Pa /etc/rc | ||
224 | to generate new host keys. | ||
225 | .It Fl a Ar trials | 221 | .It Fl a Ar trials |
226 | Specifies the number of primality tests to perform when screening DH-GEX | 222 | Specifies the number of primality tests to perform when screening DH-GEX |
227 | candidates using the | 223 | candidates using the |
@@ -605,7 +601,7 @@ option. | |||
605 | Valid generator values are 2, 3, and 5. | 601 | Valid generator values are 2, 3, and 5. |
606 | .Pp | 602 | .Pp |
607 | Screened DH groups may be installed in | 603 | Screened DH groups may be installed in |
608 | .Pa /etc/moduli . | 604 | .Pa /etc/ssh/moduli . |
609 | It is important that this file contains moduli of a range of bit lengths and | 605 | It is important that this file contains moduli of a range of bit lengths and |
610 | that both ends of a connection share common moduli. | 606 | that both ends of a connection share common moduli. |
611 | .Sh CERTIFICATES | 607 | .Sh CERTIFICATES |
@@ -800,7 +796,7 @@ on all machines | |||
800 | where the user wishes to log in using public key authentication. | 796 | where the user wishes to log in using public key authentication. |
801 | There is no need to keep the contents of this file secret. | 797 | There is no need to keep the contents of this file secret. |
802 | .Pp | 798 | .Pp |
803 | .It Pa /etc/moduli | 799 | .It Pa /etc/ssh/moduli |
804 | Contains Diffie-Hellman groups used for DH-GEX. | 800 | Contains Diffie-Hellman groups used for DH-GEX. |
805 | The file format is described in | 801 | The file format is described in |
806 | .Xr moduli 5 . | 802 | .Xr moduli 5 . |
@@ -809,6 +805,7 @@ The file format is described in | |||
809 | .Xr ssh 1 , | 805 | .Xr ssh 1 , |
810 | .Xr ssh-add 1 , | 806 | .Xr ssh-add 1 , |
811 | .Xr ssh-agent 1 , | 807 | .Xr ssh-agent 1 , |
808 | .Xr ssh-vulnkey 1 , | ||
812 | .Xr moduli 5 , | 809 | .Xr moduli 5 , |
813 | .Xr sshd 8 | 810 | .Xr sshd 8 |
814 | .Rs | 811 | .Rs |
diff --git a/ssh-vulnkey.1 b/ssh-vulnkey.1 new file mode 100644 index 000000000..bcb9d31c6 --- /dev/null +++ b/ssh-vulnkey.1 | |||
@@ -0,0 +1,242 @@ | |||
1 | .\" Copyright (c) 2008 Canonical Ltd. All rights reserved. | ||
2 | .\" | ||
3 | .\" Redistribution and use in source and binary forms, with or without | ||
4 | .\" modification, are permitted provided that the following conditions | ||
5 | .\" are met: | ||
6 | .\" 1. Redistributions of source code must retain the above copyright | ||
7 | .\" notice, this list of conditions and the following disclaimer. | ||
8 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
9 | .\" notice, this list of conditions and the following disclaimer in the | ||
10 | .\" documentation and/or other materials provided with the distribution. | ||
11 | .\" | ||
12 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
13 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
14 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
15 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
18 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
19 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | .\" | ||
23 | .Dd $Mdocdate: May 12 2008 $ | ||
24 | .Dt SSH-VULNKEY 1 | ||
25 | .Os | ||
26 | .Sh NAME | ||
27 | .Nm ssh-vulnkey | ||
28 | .Nd check blacklist of compromised keys | ||
29 | .Sh SYNOPSIS | ||
30 | .Nm | ||
31 | .Op Fl q | Fl v | ||
32 | .Ar file ... | ||
33 | .Nm | ||
34 | .Fl a | ||
35 | .Sh DESCRIPTION | ||
36 | .Nm | ||
37 | checks a key against a blacklist of compromised keys. | ||
38 | .Pp | ||
39 | A substantial number of keys are known to have been generated using a broken | ||
40 | version of OpenSSL distributed by Debian which failed to seed its random | ||
41 | number generator correctly. | ||
42 | Keys generated using these OpenSSL versions should be assumed to be | ||
43 | compromised. | ||
44 | This tool may be useful in checking for such keys. | ||
45 | .Pp | ||
46 | Keys that are compromised cannot be repaired; replacements must be generated | ||
47 | using | ||
48 | .Xr ssh-keygen 1 . | ||
49 | Make sure to update | ||
50 | .Pa authorized_keys | ||
51 | files on all systems where compromised keys were permitted to authenticate. | ||
52 | .Pp | ||
53 | The argument list will be interpreted as a list of paths to public key files | ||
54 | or | ||
55 | .Pa authorized_keys | ||
56 | files. | ||
57 | If no suitable file is found at a given path, | ||
58 | .Nm | ||
59 | will append | ||
60 | .Pa .pub | ||
61 | and retry, in case it was given a private key file. | ||
62 | If no files are given as arguments, | ||
63 | .Nm | ||
64 | will check | ||
65 | .Pa ~/.ssh/id_rsa , | ||
66 | .Pa ~/.ssh/id_dsa , | ||
67 | .Pa ~/.ssh/identity , | ||
68 | .Pa ~/.ssh/authorized_keys | ||
69 | and | ||
70 | .Pa ~/.ssh/authorized_keys2 , | ||
71 | as well as the system's host keys if readable. | ||
72 | .Pp | ||
73 | If | ||
74 | .Dq - | ||
75 | is given as an argument, | ||
76 | .Nm | ||
77 | will read from standard input. | ||
78 | This can be used to process output from | ||
79 | .Xr ssh-keyscan 1 , | ||
80 | for example: | ||
81 | .Pp | ||
82 | .Dl $ ssh-keyscan -t rsa remote.example.org | ssh-vulnkey - | ||
83 | .Pp | ||
84 | Unless the | ||
85 | .Cm PermitBlacklistedKeys | ||
86 | option is used, | ||
87 | .Xr sshd 8 | ||
88 | will reject attempts to authenticate with keys in the compromised list. | ||
89 | .Pp | ||
90 | The output from | ||
91 | .Nm | ||
92 | looks like this: | ||
93 | .Pp | ||
94 | .Bd -literal -offset indent | ||
95 | /etc/ssh/ssh_host_key:1: COMPROMISED: RSA1 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@host | ||
96 | /home/user/.ssh/id_dsa:1: Not blacklisted: DSA 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx /home/user/.ssh/id_dsa.pub | ||
97 | /home/user/.ssh/authorized_keys:3: Unknown (blacklist file not installed): RSA 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user@host | ||
98 | .Ed | ||
99 | .Pp | ||
100 | Each line is of the following format (any lines beginning with | ||
101 | .Dq # | ||
102 | should be ignored by scripts): | ||
103 | .Pp | ||
104 | .Dl Ar filename : Ns Ar line : Ar status : Ar type Ar size Ar fingerprint Ar comment | ||
105 | .Pp | ||
106 | It is important to distinguish between the possible values of | ||
107 | .Ar status : | ||
108 | .Pp | ||
109 | .Bl -tag -width Ds | ||
110 | .It COMPROMISED | ||
111 | These keys are listed in a blacklist file, normally because their | ||
112 | corresponding private keys are well-known. | ||
113 | Replacements must be generated using | ||
114 | .Xr ssh-keygen 1 . | ||
115 | .It Not blacklisted | ||
116 | A blacklist file exists for this key type and size, but this key is not | ||
117 | listed in it. | ||
118 | Unless there is some particular reason to believe otherwise, this key | ||
119 | may be used safely. | ||
120 | (Note that DSA keys used with the broken version of OpenSSL distributed | ||
121 | by Debian may be compromised in the event that anyone captured a network | ||
122 | trace, even if they were generated with a secure version of OpenSSL.) | ||
123 | .It Unknown (blacklist file not installed) | ||
124 | No blacklist file exists for this key type and size. | ||
125 | You should find a suitable published blacklist and install it before | ||
126 | deciding whether this key is safe to use. | ||
127 | .El | ||
128 | .Pp | ||
129 | The options are as follows: | ||
130 | .Bl -tag -width Ds | ||
131 | .It Fl a | ||
132 | Check keys of all users on the system. | ||
133 | You will typically need to run | ||
134 | .Nm | ||
135 | as root to use this option. | ||
136 | For each user, | ||
137 | .Nm | ||
138 | will check | ||
139 | .Pa ~/.ssh/id_rsa , | ||
140 | .Pa ~/.ssh/id_dsa , | ||
141 | .Pa ~/.ssh/identity , | ||
142 | .Pa ~/.ssh/authorized_keys | ||
143 | and | ||
144 | .Pa ~/.ssh/authorized_keys2 . | ||
145 | It will also check the system's host keys. | ||
146 | .It Fl q | ||
147 | Quiet mode. | ||
148 | Normally, | ||
149 | .Nm | ||
150 | outputs the fingerprint of each key scanned, with a description of its | ||
151 | status. | ||
152 | This option suppresses that output. | ||
153 | .It Fl v | ||
154 | Verbose mode. | ||
155 | Normally, | ||
156 | .Nm | ||
157 | does not output anything for keys that are not listed in their corresponding | ||
158 | blacklist file (although it still produces output for keys for which there | ||
159 | is no blacklist file, since their status is unknown). | ||
160 | This option causes | ||
161 | .Nm | ||
162 | to produce output for all keys. | ||
163 | .El | ||
164 | .Sh EXIT STATUS | ||
165 | .Nm | ||
166 | will exit zero if any of the given keys were in the compromised list, | ||
167 | otherwise non-zero. | ||
168 | .Sh BLACKLIST FILE FORMAT | ||
169 | The blacklist file may start with comments, on lines starting with | ||
170 | .Dq # . | ||
171 | After these initial comments, it must follow a strict format: | ||
172 | .Pp | ||
173 | .Bl -bullet -offset indent -compact | ||
174 | .It | ||
175 | All the lines must be exactly the same length (20 characters followed by a | ||
176 | newline) and must be in sorted order. | ||
177 | .It | ||
178 | Each line must consist of the lower-case hexadecimal MD5 key fingerprint, | ||
179 | without colons, and with the first 12 characters removed (that is, the least | ||
180 | significant 80 bits of the fingerprint). | ||
181 | .El | ||
182 | .Pp | ||
183 | The key fingerprint may be generated using | ||
184 | .Xr ssh-keygen 1 : | ||
185 | .Pp | ||
186 | .Dl $ ssh-keygen -l -f /path/to/key | ||
187 | .Pp | ||
188 | This strict format is necessary to allow the blacklist file to be checked | ||
189 | quickly, using a binary-search algorithm. | ||
190 | .Sh FILES | ||
191 | .Bl -tag -width Ds | ||
192 | .It Pa ~/.ssh/id_rsa | ||
193 | If present, contains the protocol version 2 RSA authentication identity of | ||
194 | the user. | ||
195 | .It Pa ~/.ssh/id_dsa | ||
196 | If present, contains the protocol version 2 DSA authentication identity of | ||
197 | the user. | ||
198 | .It Pa ~/.ssh/identity | ||
199 | If present, contains the protocol version 1 RSA authentication identity of | ||
200 | the user. | ||
201 | .It Pa ~/.ssh/authorized_keys | ||
202 | If present, lists the public keys (RSA/DSA) that can be used for logging in | ||
203 | as this user. | ||
204 | .It Pa ~/.ssh/authorized_keys2 | ||
205 | Obsolete name for | ||
206 | .Pa ~/.ssh/authorized_keys . | ||
207 | This file may still be present on some old systems, but should not be | ||
208 | created if it is missing. | ||
209 | .It Pa /etc/ssh/ssh_host_rsa_key | ||
210 | If present, contains the protocol version 2 RSA identity of the system. | ||
211 | .It Pa /etc/ssh/ssh_host_dsa_key | ||
212 | If present, contains the protocol version 2 DSA identity of the system. | ||
213 | .It Pa /etc/ssh/ssh_host_key | ||
214 | If present, contains the protocol version 1 RSA identity of the system. | ||
215 | .It Pa /usr/share/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH | ||
216 | If present, lists the blacklisted keys of type | ||
217 | .Ar TYPE | ||
218 | .Pf ( Dq RSA | ||
219 | or | ||
220 | .Dq DSA ) | ||
221 | and bit length | ||
222 | .Ar LENGTH . | ||
223 | The format of this file is described above. | ||
224 | RSA1 keys are converted to RSA before being checked in the blacklist. | ||
225 | Note that the fingerprints of RSA1 keys are computed differently, so you | ||
226 | will not be able to find them in the blacklist by hand. | ||
227 | .It Pa /etc/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH | ||
228 | Same as | ||
229 | .Pa /usr/share/ssh/blacklist. Ns Ar TYPE Ns Pa - Ns Ar LENGTH , | ||
230 | but may be edited by the system administrator to add new blacklist entries. | ||
231 | .El | ||
232 | .Sh SEE ALSO | ||
233 | .Xr ssh-keygen 1 , | ||
234 | .Xr sshd 8 | ||
235 | .Sh AUTHORS | ||
236 | .An -nosplit | ||
237 | .An Colin Watson Aq cjwatson@ubuntu.com | ||
238 | .Pp | ||
239 | Florian Weimer suggested the option to check keys of all users, and the idea | ||
240 | of processing | ||
241 | .Xr ssh-keyscan 1 | ||
242 | output. | ||
diff --git a/ssh-vulnkey.c b/ssh-vulnkey.c new file mode 100644 index 000000000..ca1a5be74 --- /dev/null +++ b/ssh-vulnkey.c | |||
@@ -0,0 +1,386 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008 Canonical Ltd. All rights reserved. | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions | ||
6 | * are met: | ||
7 | * 1. Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * 2. Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
14 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
15 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
16 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
19 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
20 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | */ | ||
24 | |||
25 | #include "includes.h" | ||
26 | |||
27 | #include <sys/types.h> | ||
28 | #include <sys/stat.h> | ||
29 | |||
30 | #include <errno.h> | ||
31 | #include <string.h> | ||
32 | #include <stdio.h> | ||
33 | #include <fcntl.h> | ||
34 | #include <unistd.h> | ||
35 | |||
36 | #include <openssl/evp.h> | ||
37 | |||
38 | #include "xmalloc.h" | ||
39 | #include "ssh.h" | ||
40 | #include "log.h" | ||
41 | #include "key.h" | ||
42 | #include "authfile.h" | ||
43 | #include "pathnames.h" | ||
44 | #include "uidswap.h" | ||
45 | #include "misc.h" | ||
46 | |||
47 | extern char *__progname; | ||
48 | |||
49 | /* Default files to check */ | ||
50 | static char *default_host_files[] = { | ||
51 | _PATH_HOST_RSA_KEY_FILE, | ||
52 | _PATH_HOST_DSA_KEY_FILE, | ||
53 | _PATH_HOST_KEY_FILE, | ||
54 | NULL | ||
55 | }; | ||
56 | static char *default_files[] = { | ||
57 | _PATH_SSH_CLIENT_ID_RSA, | ||
58 | _PATH_SSH_CLIENT_ID_DSA, | ||
59 | _PATH_SSH_CLIENT_IDENTITY, | ||
60 | _PATH_SSH_USER_PERMITTED_KEYS, | ||
61 | _PATH_SSH_USER_PERMITTED_KEYS2, | ||
62 | NULL | ||
63 | }; | ||
64 | |||
65 | static int verbosity = 0; | ||
66 | |||
67 | static int some_keys = 0; | ||
68 | static int some_unknown = 0; | ||
69 | static int some_compromised = 0; | ||
70 | |||
71 | static void | ||
72 | usage(void) | ||
73 | { | ||
74 | fprintf(stderr, "usage: %s [-aqv] [file ...]\n", __progname); | ||
75 | fprintf(stderr, "Options:\n"); | ||
76 | fprintf(stderr, " -a Check keys of all users.\n"); | ||
77 | fprintf(stderr, " -q Quiet mode.\n"); | ||
78 | fprintf(stderr, " -v Verbose mode.\n"); | ||
79 | exit(1); | ||
80 | } | ||
81 | |||
82 | static void | ||
83 | describe_key(const char *filename, u_long linenum, const char *msg, | ||
84 | Key *key, const char *comment, int min_verbosity) | ||
85 | { | ||
86 | char *fp; | ||
87 | |||
88 | fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); | ||
89 | if (verbosity >= min_verbosity) { | ||
90 | if (strchr(filename, ':')) | ||
91 | printf("\"%s\"", filename); | ||
92 | else | ||
93 | printf("%s", filename); | ||
94 | printf(":%lu: %s: %s %u %s %s\n", linenum, msg, | ||
95 | key_type(key), key_size(key), fp, comment); | ||
96 | } | ||
97 | free(fp); | ||
98 | } | ||
99 | |||
100 | static int | ||
101 | do_key(const char *filename, u_long linenum, | ||
102 | Key *key, const char *comment) | ||
103 | { | ||
104 | Key *public; | ||
105 | int blacklist_status; | ||
106 | int ret = 1; | ||
107 | |||
108 | some_keys = 1; | ||
109 | |||
110 | public = key_demote(key); | ||
111 | if (public->type == KEY_RSA1) | ||
112 | public->type = KEY_RSA; | ||
113 | |||
114 | blacklist_status = blacklisted_key(public, NULL); | ||
115 | if (blacklist_status == -1) { | ||
116 | describe_key(filename, linenum, | ||
117 | "Unknown (blacklist file not installed)", key, comment, 0); | ||
118 | some_unknown = 1; | ||
119 | } else if (blacklist_status == 1) { | ||
120 | describe_key(filename, linenum, | ||
121 | "COMPROMISED", key, comment, 0); | ||
122 | some_compromised = 1; | ||
123 | ret = 0; | ||
124 | } else | ||
125 | describe_key(filename, linenum, | ||
126 | "Not blacklisted", key, comment, 1); | ||
127 | |||
128 | key_free(public); | ||
129 | |||
130 | return ret; | ||
131 | } | ||
132 | |||
133 | static int | ||
134 | do_filename(const char *filename, int quiet_open) | ||
135 | { | ||
136 | FILE *f; | ||
137 | char line[SSH_MAX_PUBKEY_BYTES]; | ||
138 | char *cp; | ||
139 | u_long linenum = 0; | ||
140 | Key *key; | ||
141 | char *comment = NULL; | ||
142 | int found = 0, ret = 1; | ||
143 | |||
144 | /* Copy much of key_load_public's logic here so that we can read | ||
145 | * several keys from a single file (e.g. authorized_keys). | ||
146 | */ | ||
147 | |||
148 | if (strcmp(filename, "-") != 0) { | ||
149 | int save_errno; | ||
150 | f = fopen(filename, "r"); | ||
151 | save_errno = errno; | ||
152 | if (!f) { | ||
153 | char pubfile[MAXPATHLEN]; | ||
154 | if (strlcpy(pubfile, filename, sizeof pubfile) < | ||
155 | sizeof(pubfile) && | ||
156 | strlcat(pubfile, ".pub", sizeof pubfile) < | ||
157 | sizeof(pubfile)) | ||
158 | f = fopen(pubfile, "r"); | ||
159 | } | ||
160 | errno = save_errno; /* earlier errno is more useful */ | ||
161 | if (!f) { | ||
162 | if (!quiet_open) | ||
163 | perror(filename); | ||
164 | return -1; | ||
165 | } | ||
166 | if (verbosity > 0) | ||
167 | printf("# %s\n", filename); | ||
168 | } else | ||
169 | f = stdin; | ||
170 | while (read_keyfile_line(f, filename, line, sizeof(line), | ||
171 | &linenum) != -1) { | ||
172 | int i; | ||
173 | char *space; | ||
174 | int type; | ||
175 | char *end; | ||
176 | |||
177 | /* Chop trailing newline. */ | ||
178 | i = strlen(line) - 1; | ||
179 | if (line[i] == '\n') | ||
180 | line[i] = '\0'; | ||
181 | |||
182 | /* Skip leading whitespace, empty and comment lines. */ | ||
183 | for (cp = line; *cp == ' ' || *cp == '\t'; cp++) | ||
184 | ; | ||
185 | if (!*cp || *cp == '\n' || *cp == '#') | ||
186 | continue; | ||
187 | |||
188 | /* Cope with ssh-keyscan output and options in | ||
189 | * authorized_keys files. | ||
190 | */ | ||
191 | space = strchr(cp, ' '); | ||
192 | if (!space) | ||
193 | continue; | ||
194 | *space = '\0'; | ||
195 | type = key_type_from_name(cp); | ||
196 | *space = ' '; | ||
197 | /* Leading number (RSA1) or valid type (RSA/DSA) indicates | ||
198 | * that we have no host name or options to skip. | ||
199 | */ | ||
200 | if ((strtol(cp, &end, 10) == 0 || *end != ' ') && | ||
201 | type == KEY_UNSPEC) { | ||
202 | int quoted = 0; | ||
203 | |||
204 | for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { | ||
205 | if (*cp == '\\' && cp[1] == '"') | ||
206 | cp++; /* Skip both */ | ||
207 | else if (*cp == '"') | ||
208 | quoted = !quoted; | ||
209 | } | ||
210 | /* Skip remaining whitespace. */ | ||
211 | for (; *cp == ' ' || *cp == '\t'; cp++) | ||
212 | ; | ||
213 | if (!*cp) | ||
214 | continue; | ||
215 | } | ||
216 | |||
217 | /* Read and process the key itself. */ | ||
218 | key = key_new(KEY_RSA1); | ||
219 | if (key_read(key, &cp) == 1) { | ||
220 | while (*cp == ' ' || *cp == '\t') | ||
221 | cp++; | ||
222 | if (!do_key(filename, linenum, | ||
223 | key, *cp ? cp : filename)) | ||
224 | ret = 0; | ||
225 | found = 1; | ||
226 | } else { | ||
227 | key_free(key); | ||
228 | key = key_new(KEY_UNSPEC); | ||
229 | if (key_read(key, &cp) == 1) { | ||
230 | while (*cp == ' ' || *cp == '\t') | ||
231 | cp++; | ||
232 | if (!do_key(filename, linenum, | ||
233 | key, *cp ? cp : filename)) | ||
234 | ret = 0; | ||
235 | found = 1; | ||
236 | } | ||
237 | } | ||
238 | key_free(key); | ||
239 | } | ||
240 | if (f != stdin) | ||
241 | fclose(f); | ||
242 | |||
243 | if (!found && filename) { | ||
244 | key = key_load_public(filename, &comment); | ||
245 | if (key) { | ||
246 | if (!do_key(filename, 1, key, comment)) | ||
247 | ret = 0; | ||
248 | found = 1; | ||
249 | } | ||
250 | free(comment); | ||
251 | } | ||
252 | |||
253 | return ret; | ||
254 | } | ||
255 | |||
256 | static int | ||
257 | do_host(int quiet_open) | ||
258 | { | ||
259 | int i; | ||
260 | struct stat st; | ||
261 | int ret = 1; | ||
262 | |||
263 | for (i = 0; default_host_files[i]; i++) { | ||
264 | if (stat(default_host_files[i], &st) < 0 && errno == ENOENT) | ||
265 | continue; | ||
266 | if (!do_filename(default_host_files[i], quiet_open)) | ||
267 | ret = 0; | ||
268 | } | ||
269 | |||
270 | return ret; | ||
271 | } | ||
272 | |||
273 | static int | ||
274 | do_user(const char *dir) | ||
275 | { | ||
276 | int i; | ||
277 | char *file; | ||
278 | struct stat st; | ||
279 | int ret = 1; | ||
280 | |||
281 | for (i = 0; default_files[i]; i++) { | ||
282 | xasprintf(&file, "%s/%s", dir, default_files[i]); | ||
283 | if (stat(file, &st) < 0 && errno == ENOENT) { | ||
284 | free(file); | ||
285 | continue; | ||
286 | } | ||
287 | if (!do_filename(file, 0)) | ||
288 | ret = 0; | ||
289 | free(file); | ||
290 | } | ||
291 | |||
292 | return ret; | ||
293 | } | ||
294 | |||
295 | int | ||
296 | main(int argc, char **argv) | ||
297 | { | ||
298 | int opt, all_users = 0; | ||
299 | int ret = 1; | ||
300 | extern int optind; | ||
301 | |||
302 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | ||
303 | sanitise_stdfd(); | ||
304 | |||
305 | __progname = ssh_get_progname(argv[0]); | ||
306 | |||
307 | SSLeay_add_all_algorithms(); | ||
308 | log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); | ||
309 | |||
310 | /* We don't need the RNG ourselves, but symbol references here allow | ||
311 | * ld to link us properly. | ||
312 | */ | ||
313 | seed_rng(); | ||
314 | |||
315 | while ((opt = getopt(argc, argv, "ahqv")) != -1) { | ||
316 | switch (opt) { | ||
317 | case 'a': | ||
318 | all_users = 1; | ||
319 | break; | ||
320 | case 'q': | ||
321 | verbosity--; | ||
322 | break; | ||
323 | case 'v': | ||
324 | verbosity++; | ||
325 | break; | ||
326 | case 'h': | ||
327 | default: | ||
328 | usage(); | ||
329 | } | ||
330 | } | ||
331 | |||
332 | if (all_users) { | ||
333 | struct passwd *pw; | ||
334 | |||
335 | if (!do_host(0)) | ||
336 | ret = 0; | ||
337 | |||
338 | while ((pw = getpwent()) != NULL) { | ||
339 | if (pw->pw_dir) { | ||
340 | temporarily_use_uid(pw); | ||
341 | if (!do_user(pw->pw_dir)) | ||
342 | ret = 0; | ||
343 | restore_uid(); | ||
344 | } | ||
345 | } | ||
346 | } else if (optind == argc) { | ||
347 | struct passwd *pw; | ||
348 | |||
349 | if (!do_host(1)) | ||
350 | ret = 0; | ||
351 | |||
352 | if ((pw = getpwuid(geteuid())) == NULL) | ||
353 | fprintf(stderr, "No user found with uid %u\n", | ||
354 | (u_int)geteuid()); | ||
355 | else { | ||
356 | if (!do_user(pw->pw_dir)) | ||
357 | ret = 0; | ||
358 | } | ||
359 | } else { | ||
360 | while (optind < argc) | ||
361 | if (!do_filename(argv[optind++], 0)) | ||
362 | ret = 0; | ||
363 | } | ||
364 | |||
365 | if (verbosity >= 0) { | ||
366 | if (some_unknown) { | ||
367 | printf("#\n"); | ||
368 | printf("# The status of some keys on your system is unknown.\n"); | ||
369 | printf("# You may need to install additional blacklist files.\n"); | ||
370 | } | ||
371 | if (some_compromised) { | ||
372 | printf("#\n"); | ||
373 | printf("# Some keys on your system have been compromised!\n"); | ||
374 | printf("# You must replace them using ssh-keygen(1).\n"); | ||
375 | } | ||
376 | if (some_unknown || some_compromised) { | ||
377 | printf("#\n"); | ||
378 | printf("# See the ssh-vulnkey(1) manual page for further advice.\n"); | ||
379 | } else if (some_keys && verbosity > 0) { | ||
380 | printf("#\n"); | ||
381 | printf("# No blacklisted keys!\n"); | ||
382 | } | ||
383 | } | ||
384 | |||
385 | return ret; | ||
386 | } | ||
@@ -756,6 +756,10 @@ Protocol 1 is restricted to using only RSA keys, | |||
756 | but protocol 2 may use any. | 756 | but protocol 2 may use any. |
757 | The HISTORY section of | 757 | The HISTORY section of |
758 | .Xr ssl 8 | 758 | .Xr ssl 8 |
759 | (on non-OpenBSD systems, see | ||
760 | .nh | ||
761 | http://www.openbsd.org/cgi\-bin/man.cgi?query=ssl&sektion=8#HISTORY) | ||
762 | .hy | ||
759 | contains a brief discussion of the DSA and RSA algorithms. | 763 | contains a brief discussion of the DSA and RSA algorithms. |
760 | .Pp | 764 | .Pp |
761 | The file | 765 | The file |
@@ -1338,6 +1342,8 @@ The file format and configuration options are described in | |||
1338 | .Xr ssh_config 5 . | 1342 | .Xr ssh_config 5 . |
1339 | Because of the potential for abuse, this file must have strict permissions: | 1343 | Because of the potential for abuse, this file must have strict permissions: |
1340 | read/write for the user, and not writable by others. | 1344 | read/write for the user, and not writable by others. |
1345 | It may be group-writable provided that the group in question contains only | ||
1346 | the user. | ||
1341 | .Pp | 1347 | .Pp |
1342 | .It Pa ~/.ssh/environment | 1348 | .It Pa ~/.ssh/environment |
1343 | Contains additional definitions for environment variables; see | 1349 | Contains additional definitions for environment variables; see |
@@ -1445,8 +1451,10 @@ if an error occurred. | |||
1445 | .Xr sftp 1 , | 1451 | .Xr sftp 1 , |
1446 | .Xr ssh-add 1 , | 1452 | .Xr ssh-add 1 , |
1447 | .Xr ssh-agent 1 , | 1453 | .Xr ssh-agent 1 , |
1454 | .Xr ssh-argv0 1 , | ||
1448 | .Xr ssh-keygen 1 , | 1455 | .Xr ssh-keygen 1 , |
1449 | .Xr ssh-keyscan 1 , | 1456 | .Xr ssh-keyscan 1 , |
1457 | .Xr ssh-vulnkey 1 , | ||
1450 | .Xr tun 4 , | 1458 | .Xr tun 4 , |
1451 | .Xr hosts.equiv 5 , | 1459 | .Xr hosts.equiv 5 , |
1452 | .Xr ssh_config 5 , | 1460 | .Xr ssh_config 5 , |
@@ -740,7 +740,7 @@ main(int ac, char **av) | |||
740 | /* Do not allocate a tty if stdin is not a tty. */ | 740 | /* Do not allocate a tty if stdin is not a tty. */ |
741 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && | 741 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && |
742 | options.request_tty != REQUEST_TTY_FORCE) { | 742 | options.request_tty != REQUEST_TTY_FORCE) { |
743 | if (tty_flag) | 743 | if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) |
744 | logit("Pseudo-terminal will not be allocated because " | 744 | logit("Pseudo-terminal will not be allocated because " |
745 | "stdin is not a terminal."); | 745 | "stdin is not a terminal."); |
746 | tty_flag = 0; | 746 | tty_flag = 0; |
@@ -1525,7 +1525,7 @@ ssh_session2(void) | |||
1525 | static void | 1525 | static void |
1526 | load_public_identity_files(void) | 1526 | load_public_identity_files(void) |
1527 | { | 1527 | { |
1528 | char *filename, *cp, thishost[NI_MAXHOST]; | 1528 | char *filename, *cp, thishost[NI_MAXHOST], *fp; |
1529 | char *pwdir = NULL, *pwname = NULL; | 1529 | char *pwdir = NULL, *pwname = NULL; |
1530 | int i = 0; | 1530 | int i = 0; |
1531 | Key *public; | 1531 | Key *public; |
@@ -1583,6 +1583,22 @@ load_public_identity_files(void) | |||
1583 | public = key_load_public(filename, NULL); | 1583 | public = key_load_public(filename, NULL); |
1584 | debug("identity file %s type %d", filename, | 1584 | debug("identity file %s type %d", filename, |
1585 | public ? public->type : -1); | 1585 | public ? public->type : -1); |
1586 | if (public && blacklisted_key(public, &fp) == 1) { | ||
1587 | if (options.use_blacklisted_keys) | ||
1588 | logit("Public key %s blacklisted (see " | ||
1589 | "ssh-vulnkey(1)); continuing anyway", fp); | ||
1590 | else | ||
1591 | logit("Public key %s blacklisted (see " | ||
1592 | "ssh-vulnkey(1)); refusing to send it", | ||
1593 | fp); | ||
1594 | free(fp); | ||
1595 | if (!options.use_blacklisted_keys) { | ||
1596 | key_free(public); | ||
1597 | free(filename); | ||
1598 | filename = NULL; | ||
1599 | public = NULL; | ||
1600 | } | ||
1601 | } | ||
1586 | free(options.identity_files[i]); | 1602 | free(options.identity_files[i]); |
1587 | identity_files[n_ids] = filename; | 1603 | identity_files[n_ids] = filename; |
1588 | identity_keys[n_ids] = public; | 1604 | identity_keys[n_ids] = public; |
diff --git a/ssh_config b/ssh_config index 32343213f..064b59359 100644 --- a/ssh_config +++ b/ssh_config | |||
@@ -17,9 +17,10 @@ | |||
17 | # list of available options, their meanings and defaults, please see the | 17 | # list of available options, their meanings and defaults, please see the |
18 | # ssh_config(5) man page. | 18 | # ssh_config(5) man page. |
19 | 19 | ||
20 | # Host * | 20 | Host * |
21 | # ForwardAgent no | 21 | # ForwardAgent no |
22 | # ForwardX11 no | 22 | # ForwardX11 no |
23 | # ForwardX11Trusted yes | ||
23 | # RhostsRSAAuthentication no | 24 | # RhostsRSAAuthentication no |
24 | # RSAAuthentication yes | 25 | # RSAAuthentication yes |
25 | # PasswordAuthentication yes | 26 | # PasswordAuthentication yes |
@@ -48,3 +49,7 @@ | |||
48 | # VisualHostKey no | 49 | # VisualHostKey no |
49 | # ProxyCommand ssh -q -W %h:%p gateway.example.com | 50 | # ProxyCommand ssh -q -W %h:%p gateway.example.com |
50 | # RekeyLimit 1G 1h | 51 | # RekeyLimit 1G 1h |
52 | SendEnv LANG LC_* | ||
53 | HashKnownHosts yes | ||
54 | GSSAPIAuthentication yes | ||
55 | GSSAPIDelegateCredentials no | ||
diff --git a/ssh_config.5 b/ssh_config.5 index e72919a89..127540a60 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -71,6 +71,22 @@ Since the first obtained value for each parameter is used, more | |||
71 | host-specific declarations should be given near the beginning of the | 71 | host-specific declarations should be given near the beginning of the |
72 | file, and general defaults at the end. | 72 | file, and general defaults at the end. |
73 | .Pp | 73 | .Pp |
74 | Note that the Debian | ||
75 | .Ic openssh-client | ||
76 | package sets several options as standard in | ||
77 | .Pa /etc/ssh/ssh_config | ||
78 | which are not the default in | ||
79 | .Xr ssh 1 : | ||
80 | .Pp | ||
81 | .Bl -bullet -offset indent -compact | ||
82 | .It | ||
83 | .Cm SendEnv No LANG LC_* | ||
84 | .It | ||
85 | .Cm HashKnownHosts No yes | ||
86 | .It | ||
87 | .Cm GSSAPIAuthentication No yes | ||
88 | .El | ||
89 | .Pp | ||
74 | The configuration file has the following format: | 90 | The configuration file has the following format: |
75 | .Pp | 91 | .Pp |
76 | Empty lines and lines starting with | 92 | Empty lines and lines starting with |
@@ -136,8 +152,12 @@ Valid arguments are | |||
136 | If set to | 152 | If set to |
137 | .Dq yes , | 153 | .Dq yes , |
138 | passphrase/password querying will be disabled. | 154 | passphrase/password querying will be disabled. |
155 | In addition, the | ||
156 | .Cm ServerAliveInterval | ||
157 | option will be set to 300 seconds by default. | ||
139 | This option is useful in scripts and other batch jobs where no user | 158 | This option is useful in scripts and other batch jobs where no user |
140 | is present to supply the password. | 159 | is present to supply the password, |
160 | and where it is desirable to detect a broken network swiftly. | ||
141 | The argument must be | 161 | The argument must be |
142 | .Dq yes | 162 | .Dq yes |
143 | or | 163 | or |
@@ -497,7 +517,8 @@ token used for the session will be set to expire after 20 minutes. | |||
497 | Remote clients will be refused access after this time. | 517 | Remote clients will be refused access after this time. |
498 | .Pp | 518 | .Pp |
499 | The default is | 519 | The default is |
500 | .Dq no . | 520 | .Dq yes |
521 | (Debian-specific). | ||
501 | .Pp | 522 | .Pp |
502 | See the X11 SECURITY extension specification for full details on | 523 | See the X11 SECURITY extension specification for full details on |
503 | the restrictions imposed on untrusted clients. | 524 | the restrictions imposed on untrusted clients. |
@@ -583,6 +604,9 @@ Note that existing names and addresses in known hosts files | |||
583 | will not be converted automatically, | 604 | will not be converted automatically, |
584 | but may be manually hashed using | 605 | but may be manually hashed using |
585 | .Xr ssh-keygen 1 . | 606 | .Xr ssh-keygen 1 . |
607 | Use of this option may break facilities such as tab-completion that rely | ||
608 | on being able to read unhashed host names from | ||
609 | .Pa ~/.ssh/known_hosts . | ||
586 | .It Cm HostbasedAuthentication | 610 | .It Cm HostbasedAuthentication |
587 | Specifies whether to try rhosts based authentication with public key | 611 | Specifies whether to try rhosts based authentication with public key |
588 | authentication. | 612 | authentication. |
@@ -1130,7 +1154,10 @@ If, for example, | |||
1130 | .Cm ServerAliveCountMax | 1154 | .Cm ServerAliveCountMax |
1131 | is left at the default, if the server becomes unresponsive, | 1155 | is left at the default, if the server becomes unresponsive, |
1132 | ssh will disconnect after approximately 45 seconds. | 1156 | ssh will disconnect after approximately 45 seconds. |
1133 | This option applies to protocol version 2 only. | 1157 | This option applies to protocol version 2 only; in protocol version |
1158 | 1 there is no mechanism to request a response from the server to the | ||
1159 | server alive messages, so disconnection is the responsibility of the TCP | ||
1160 | stack. | ||
1134 | .It Cm ServerAliveInterval | 1161 | .It Cm ServerAliveInterval |
1135 | Sets a timeout interval in seconds after which if no data has been received | 1162 | Sets a timeout interval in seconds after which if no data has been received |
1136 | from the server, | 1163 | from the server, |
@@ -1138,8 +1165,15 @@ from the server, | |||
1138 | will send a message through the encrypted | 1165 | will send a message through the encrypted |
1139 | channel to request a response from the server. | 1166 | channel to request a response from the server. |
1140 | The default | 1167 | The default |
1141 | is 0, indicating that these messages will not be sent to the server. | 1168 | is 0, indicating that these messages will not be sent to the server, |
1169 | or 300 if the | ||
1170 | .Cm BatchMode | ||
1171 | option is set. | ||
1142 | This option applies to protocol version 2 only. | 1172 | This option applies to protocol version 2 only. |
1173 | .Cm ProtocolKeepAlives | ||
1174 | and | ||
1175 | .Cm SetupTimeOut | ||
1176 | are Debian-specific compatibility aliases for this option. | ||
1143 | .It Cm StrictHostKeyChecking | 1177 | .It Cm StrictHostKeyChecking |
1144 | If this flag is set to | 1178 | If this flag is set to |
1145 | .Dq yes , | 1179 | .Dq yes , |
@@ -1178,6 +1212,12 @@ Specifies whether the system should send TCP keepalive messages to the | |||
1178 | other side. | 1212 | other side. |
1179 | If they are sent, death of the connection or crash of one | 1213 | If they are sent, death of the connection or crash of one |
1180 | of the machines will be properly noticed. | 1214 | of the machines will be properly noticed. |
1215 | This option only uses TCP keepalives (as opposed to using ssh level | ||
1216 | keepalives), so takes a long time to notice when the connection dies. | ||
1217 | As such, you probably want | ||
1218 | the | ||
1219 | .Cm ServerAliveInterval | ||
1220 | option as well. | ||
1181 | However, this means that | 1221 | However, this means that |
1182 | connections will die if the route is down temporarily, and some people | 1222 | connections will die if the route is down temporarily, and some people |
1183 | find it annoying. | 1223 | find it annoying. |
@@ -1229,6 +1269,23 @@ is not specified, it defaults to | |||
1229 | .Dq any . | 1269 | .Dq any . |
1230 | The default is | 1270 | The default is |
1231 | .Dq any:any . | 1271 | .Dq any:any . |
1272 | .It Cm UseBlacklistedKeys | ||
1273 | Specifies whether | ||
1274 | .Xr ssh 1 | ||
1275 | should use keys recorded in its blacklist of known-compromised keys (see | ||
1276 | .Xr ssh-vulnkey 1 ) | ||
1277 | for authentication. | ||
1278 | If | ||
1279 | .Dq yes , | ||
1280 | then attempts to use compromised keys for authentication will be logged but | ||
1281 | accepted. | ||
1282 | It is strongly recommended that this be used only to install new authorized | ||
1283 | keys on the remote system, and even then only with the utmost care. | ||
1284 | If | ||
1285 | .Dq no , | ||
1286 | then attempts to use compromised keys for authentication will be prevented. | ||
1287 | The default is | ||
1288 | .Dq no . | ||
1232 | .It Cm UsePrivilegedPort | 1289 | .It Cm UsePrivilegedPort |
1233 | Specifies whether to use a privileged port for outgoing connections. | 1290 | Specifies whether to use a privileged port for outgoing connections. |
1234 | The argument must be | 1291 | The argument must be |
@@ -1345,6 +1402,8 @@ The format of this file is described above. | |||
1345 | This file is used by the SSH client. | 1402 | This file is used by the SSH client. |
1346 | Because of the potential for abuse, this file must have strict permissions: | 1403 | Because of the potential for abuse, this file must have strict permissions: |
1347 | read/write for the user, and not accessible by others. | 1404 | read/write for the user, and not accessible by others. |
1405 | It may be group-writable provided that the group in question contains only | ||
1406 | the user. | ||
1348 | .It Pa /etc/ssh/ssh_config | 1407 | .It Pa /etc/ssh/ssh_config |
1349 | Systemwide configuration file. | 1408 | Systemwide configuration file. |
1350 | This file provides defaults for those | 1409 | This file provides defaults for those |
diff --git a/sshconnect.c b/sshconnect.c index 483eb85ac..ad960fdbf 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -151,7 +151,7 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command) | |||
151 | /* Execute the proxy command. Note that we gave up any | 151 | /* Execute the proxy command. Note that we gave up any |
152 | extra privileges above. */ | 152 | extra privileges above. */ |
153 | signal(SIGPIPE, SIG_DFL); | 153 | signal(SIGPIPE, SIG_DFL); |
154 | execv(argv[0], argv); | 154 | execvp(argv[0], argv); |
155 | perror(argv[0]); | 155 | perror(argv[0]); |
156 | exit(1); | 156 | exit(1); |
157 | } | 157 | } |
@@ -442,10 +442,10 @@ send_client_banner(int connection_out, int minor1) | |||
442 | /* Send our own protocol version identification. */ | 442 | /* Send our own protocol version identification. */ |
443 | if (compat20) { | 443 | if (compat20) { |
444 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n", | 444 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n", |
445 | PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION); | 445 | PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE); |
446 | } else { | 446 | } else { |
447 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n", | 447 | xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n", |
448 | PROTOCOL_MAJOR_1, minor1, SSH_VERSION); | 448 | PROTOCOL_MAJOR_1, minor1, SSH_RELEASE); |
449 | } | 449 | } |
450 | if (roaming_atomicio(vwrite, connection_out, client_version_string, | 450 | if (roaming_atomicio(vwrite, connection_out, client_version_string, |
451 | strlen(client_version_string)) != strlen(client_version_string)) | 451 | strlen(client_version_string)) != strlen(client_version_string)) |
@@ -981,9 +981,12 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, | |||
981 | error("%s. This could either mean that", key_msg); | 981 | error("%s. This could either mean that", key_msg); |
982 | error("DNS SPOOFING is happening or the IP address for the host"); | 982 | error("DNS SPOOFING is happening or the IP address for the host"); |
983 | error("and its host key have changed at the same time."); | 983 | error("and its host key have changed at the same time."); |
984 | if (ip_status != HOST_NEW) | 984 | if (ip_status != HOST_NEW) { |
985 | error("Offending key for IP in %s:%lu", | 985 | error("Offending key for IP in %s:%lu", |
986 | ip_found->file, ip_found->line); | 986 | ip_found->file, ip_found->line); |
987 | error(" remove with: ssh-keygen -f \"%s\" -R %s", | ||
988 | ip_found->file, ip); | ||
989 | } | ||
987 | } | 990 | } |
988 | /* The host key has changed. */ | 991 | /* The host key has changed. */ |
989 | warn_changed_key(host_key); | 992 | warn_changed_key(host_key); |
@@ -991,6 +994,8 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, | |||
991 | user_hostfiles[0]); | 994 | user_hostfiles[0]); |
992 | error("Offending %s key in %s:%lu", key_type(host_found->key), | 995 | error("Offending %s key in %s:%lu", key_type(host_found->key), |
993 | host_found->file, host_found->line); | 996 | host_found->file, host_found->line); |
997 | error(" remove with: ssh-keygen -f \"%s\" -R %s", | ||
998 | host_found->file, host); | ||
994 | 999 | ||
995 | /* | 1000 | /* |
996 | * If strict host key checking is in use, the user will have | 1001 | * If strict host key checking is in use, the user will have |
@@ -1298,7 +1303,7 @@ ssh_local_cmd(const char *args) | |||
1298 | if (pid == 0) { | 1303 | if (pid == 0) { |
1299 | signal(SIGPIPE, SIG_DFL); | 1304 | signal(SIGPIPE, SIG_DFL); |
1300 | debug3("Executing %s -c \"%s\"", shell, args); | 1305 | debug3("Executing %s -c \"%s\"", shell, args); |
1301 | execl(shell, shell, "-c", args, (char *)NULL); | 1306 | execlp(shell, shell, "-c", args, (char *)NULL); |
1302 | error("Couldn't execute %s -c \"%s\": %s", | 1307 | error("Couldn't execute %s -c \"%s\": %s", |
1303 | shell, args, strerror(errno)); | 1308 | shell, args, strerror(errno)); |
1304 | _exit(1); | 1309 | _exit(1); |
diff --git a/sshconnect2.c b/sshconnect2.c index 0b13530ce..93818c991 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1491,6 +1491,8 @@ pubkey_prepare(Authctxt *authctxt) | |||
1491 | 1491 | ||
1492 | /* list of keys stored in the filesystem and PKCS#11 */ | 1492 | /* list of keys stored in the filesystem and PKCS#11 */ |
1493 | for (i = 0; i < options.num_identity_files; i++) { | 1493 | for (i = 0; i < options.num_identity_files; i++) { |
1494 | if (options.identity_files[i] == NULL) | ||
1495 | continue; | ||
1494 | key = options.identity_keys[i]; | 1496 | key = options.identity_keys[i]; |
1495 | if (key && key->type == KEY_RSA1) | 1497 | if (key && key->type == KEY_RSA1) |
1496 | continue; | 1498 | continue; |
@@ -1608,7 +1610,7 @@ userauth_pubkey(Authctxt *authctxt) | |||
1608 | debug("Offering %s public key: %s", key_type(id->key), | 1610 | debug("Offering %s public key: %s", key_type(id->key), |
1609 | id->filename); | 1611 | id->filename); |
1610 | sent = send_pubkey_test(authctxt, id); | 1612 | sent = send_pubkey_test(authctxt, id); |
1611 | } else if (id->key == NULL) { | 1613 | } else if (id->key == NULL && id->filename) { |
1612 | debug("Trying private key: %s", id->filename); | 1614 | debug("Trying private key: %s", id->filename); |
1613 | id->key = load_identity_file(id->filename, | 1615 | id->key = load_identity_file(id->filename, |
1614 | id->userprovided); | 1616 | id->userprovided); |
@@ -70,7 +70,10 @@ over an insecure network. | |||
70 | .Nm | 70 | .Nm |
71 | listens for connections from clients. | 71 | listens for connections from clients. |
72 | It is normally started at boot from | 72 | It is normally started at boot from |
73 | .Pa /etc/rc . | 73 | .Pa /etc/init.d/ssh |
74 | (or | ||
75 | .Pa /etc/init/ssh.conf | ||
76 | on systems using the Upstart init daemon). | ||
74 | It forks a new | 77 | It forks a new |
75 | daemon for each incoming connection. | 78 | daemon for each incoming connection. |
76 | The forked daemons handle | 79 | The forked daemons handle |
@@ -859,7 +862,7 @@ This file is for host-based authentication (see | |||
859 | .Xr ssh 1 ) . | 862 | .Xr ssh 1 ) . |
860 | It should only be writable by root. | 863 | It should only be writable by root. |
861 | .Pp | 864 | .Pp |
862 | .It Pa /etc/moduli | 865 | .It Pa /etc/ssh/moduli |
863 | Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange". | 866 | Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange". |
864 | The file format is described in | 867 | The file format is described in |
865 | .Xr moduli 5 . | 868 | .Xr moduli 5 . |
@@ -954,9 +957,9 @@ The content of this file is not sensitive; it can be world-readable. | |||
954 | .Xr ssh-agent 1 , | 957 | .Xr ssh-agent 1 , |
955 | .Xr ssh-keygen 1 , | 958 | .Xr ssh-keygen 1 , |
956 | .Xr ssh-keyscan 1 , | 959 | .Xr ssh-keyscan 1 , |
960 | .Xr ssh-vulnkey 1 , | ||
957 | .Xr chroot 2 , | 961 | .Xr chroot 2 , |
958 | .Xr hosts_access 5 , | 962 | .Xr hosts_access 5 , |
959 | .Xr login.conf 5 , | ||
960 | .Xr moduli 5 , | 963 | .Xr moduli 5 , |
961 | .Xr sshd_config 5 , | 964 | .Xr sshd_config 5 , |
962 | .Xr inetd 8 , | 965 | .Xr inetd 8 , |
@@ -440,7 +440,8 @@ sshd_exchange_identification(int sock_in, int sock_out) | |||
440 | } | 440 | } |
441 | 441 | ||
442 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", | 442 | xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", |
443 | major, minor, SSH_VERSION, | 443 | major, minor, |
444 | options.debian_banner ? SSH_RELEASE : SSH_RELEASE_MINIMUM, | ||
444 | *options.version_addendum == '\0' ? "" : " ", | 445 | *options.version_addendum == '\0' ? "" : " ", |
445 | options.version_addendum, newline); | 446 | options.version_addendum, newline); |
446 | 447 | ||
@@ -753,7 +754,7 @@ privsep_postauth(Authctxt *authctxt) | |||
753 | RAND_seed(rnd, sizeof(rnd)); | 754 | RAND_seed(rnd, sizeof(rnd)); |
754 | 755 | ||
755 | /* Drop privileges */ | 756 | /* Drop privileges */ |
756 | do_setusercontext(authctxt->pw); | 757 | do_setusercontext(authctxt->pw, authctxt->role); |
757 | 758 | ||
758 | skip: | 759 | skip: |
759 | /* It is safe now to apply the key state */ | 760 | /* It is safe now to apply the key state */ |
@@ -1688,6 +1689,11 @@ main(int ac, char **av) | |||
1688 | sensitive_data.host_pubkeys[i] = NULL; | 1689 | sensitive_data.host_pubkeys[i] = NULL; |
1689 | continue; | 1690 | continue; |
1690 | } | 1691 | } |
1692 | if (auth_key_is_revoked(key != NULL ? key : pubkey, 1)) { | ||
1693 | sensitive_data.host_keys[i] = NULL; | ||
1694 | sensitive_data.host_pubkeys[i] = NULL; | ||
1695 | continue; | ||
1696 | } | ||
1691 | 1697 | ||
1692 | switch (keytype) { | 1698 | switch (keytype) { |
1693 | case KEY_RSA1: | 1699 | case KEY_RSA1: |
@@ -1908,6 +1914,10 @@ main(int ac, char **av) | |||
1908 | } | 1914 | } |
1909 | } | 1915 | } |
1910 | 1916 | ||
1917 | if (getenv("SSH_SIGSTOP")) | ||
1918 | /* Tell service supervisor that we are ready. */ | ||
1919 | kill(getpid(), SIGSTOP); | ||
1920 | |||
1911 | /* Accept a connection and return in a forked child */ | 1921 | /* Accept a connection and return in a forked child */ |
1912 | server_accept_loop(&sock_in, &sock_out, | 1922 | server_accept_loop(&sock_in, &sock_out, |
1913 | &newsock, config_s); | 1923 | &newsock, config_s); |
diff --git a/sshd_config b/sshd_config index 945014124..9cfe28d03 100644 --- a/sshd_config +++ b/sshd_config | |||
@@ -40,6 +40,7 @@ | |||
40 | # Authentication: | 40 | # Authentication: |
41 | 41 | ||
42 | #LoginGraceTime 2m | 42 | #LoginGraceTime 2m |
43 | # See /usr/share/doc/openssh-server/README.Debian.gz. | ||
43 | #PermitRootLogin yes | 44 | #PermitRootLogin yes |
44 | #StrictModes yes | 45 | #StrictModes yes |
45 | #MaxAuthTries 6 | 46 | #MaxAuthTries 6 |
diff --git a/sshd_config.5 b/sshd_config.5 index 525d9c858..faf93fc90 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -57,6 +57,33 @@ Arguments may optionally be enclosed in double quotes | |||
57 | .Pq \&" | 57 | .Pq \&" |
58 | in order to represent arguments containing spaces. | 58 | in order to represent arguments containing spaces. |
59 | .Pp | 59 | .Pp |
60 | Note that the Debian | ||
61 | .Ic openssh-server | ||
62 | package sets several options as standard in | ||
63 | .Pa /etc/ssh/sshd_config | ||
64 | which are not the default in | ||
65 | .Xr sshd 8 . | ||
66 | The exact list depends on whether the package was installed fresh or | ||
67 | upgraded from various possible previous versions, but includes at least the | ||
68 | following: | ||
69 | .Pp | ||
70 | .Bl -bullet -offset indent -compact | ||
71 | .It | ||
72 | .Cm Protocol No 2 | ||
73 | .It | ||
74 | .Cm ChallengeResponseAuthentication No no | ||
75 | .It | ||
76 | .Cm X11Forwarding No yes | ||
77 | .It | ||
78 | .Cm PrintMotd No no | ||
79 | .It | ||
80 | .Cm AcceptEnv No LANG LC_* | ||
81 | .It | ||
82 | .Cm Subsystem No sftp /usr/lib/openssh/sftp-server | ||
83 | .It | ||
84 | .Cm UsePAM No yes | ||
85 | .El | ||
86 | .Pp | ||
60 | The possible | 87 | The possible |
61 | keywords and their meanings are as follows (note that | 88 | keywords and their meanings are as follows (note that |
62 | keywords are case-insensitive and arguments are case-sensitive): | 89 | keywords are case-insensitive and arguments are case-sensitive): |
@@ -283,8 +310,7 @@ This option is only available for protocol version 2. | |||
283 | By default, no banner is displayed. | 310 | By default, no banner is displayed. |
284 | .It Cm ChallengeResponseAuthentication | 311 | .It Cm ChallengeResponseAuthentication |
285 | Specifies whether challenge-response authentication is allowed (e.g. via | 312 | Specifies whether challenge-response authentication is allowed (e.g. via |
286 | PAM or though authentication styles supported in | 313 | PAM). |
287 | .Xr login.conf 5 ) | ||
288 | The default is | 314 | The default is |
289 | .Dq yes . | 315 | .Dq yes . |
290 | .It Cm ChrootDirectory | 316 | .It Cm ChrootDirectory |
@@ -404,6 +430,11 @@ or | |||
404 | .Dq no . | 430 | .Dq no . |
405 | The default is | 431 | The default is |
406 | .Dq delayed . | 432 | .Dq delayed . |
433 | .It Cm DebianBanner | ||
434 | Specifies whether the distribution-specified extra version suffix is | ||
435 | included during initial protocol handshake. | ||
436 | The default is | ||
437 | .Dq yes . | ||
407 | .It Cm DenyGroups | 438 | .It Cm DenyGroups |
408 | This keyword can be followed by a list of group name patterns, separated | 439 | This keyword can be followed by a list of group name patterns, separated |
409 | by spaces. | 440 | by spaces. |
@@ -885,6 +916,20 @@ are refused if the number of unauthenticated connections reaches | |||
885 | Specifies whether password authentication is allowed. | 916 | Specifies whether password authentication is allowed. |
886 | The default is | 917 | The default is |
887 | .Dq yes . | 918 | .Dq yes . |
919 | .It Cm PermitBlacklistedKeys | ||
920 | Specifies whether | ||
921 | .Xr sshd 8 | ||
922 | should allow keys recorded in its blacklist of known-compromised keys (see | ||
923 | .Xr ssh-vulnkey 1 ) . | ||
924 | If | ||
925 | .Dq yes , | ||
926 | then attempts to authenticate with compromised keys will be logged but | ||
927 | accepted. | ||
928 | If | ||
929 | .Dq no , | ||
930 | then attempts to authenticate with compromised keys will be rejected. | ||
931 | The default is | ||
932 | .Dq no . | ||
888 | .It Cm PermitEmptyPasswords | 933 | .It Cm PermitEmptyPasswords |
889 | When password authentication is allowed, it specifies whether the | 934 | When password authentication is allowed, it specifies whether the |
890 | server allows login to accounts with empty password strings. | 935 | server allows login to accounts with empty password strings. |
@@ -1147,6 +1192,9 @@ This avoids infinitely hanging sessions. | |||
1147 | .Pp | 1192 | .Pp |
1148 | To disable TCP keepalive messages, the value should be set to | 1193 | To disable TCP keepalive messages, the value should be set to |
1149 | .Dq no . | 1194 | .Dq no . |
1195 | .Pp | ||
1196 | This option was formerly called | ||
1197 | .Cm KeepAlive . | ||
1150 | .It Cm TrustedUserCAKeys | 1198 | .It Cm TrustedUserCAKeys |
1151 | Specifies a file containing public keys of certificate authorities that are | 1199 | Specifies a file containing public keys of certificate authorities that are |
1152 | trusted to sign user certificates for authentication. | 1200 | trusted to sign user certificates for authentication. |
@@ -200,7 +200,7 @@ pty_change_window_size(int ptyfd, u_int row, u_int col, | |||
200 | } | 200 | } |
201 | 201 | ||
202 | void | 202 | void |
203 | pty_setowner(struct passwd *pw, const char *tty) | 203 | pty_setowner(struct passwd *pw, const char *tty, const char *role) |
204 | { | 204 | { |
205 | struct group *grp; | 205 | struct group *grp; |
206 | gid_t gid; | 206 | gid_t gid; |
@@ -227,7 +227,7 @@ pty_setowner(struct passwd *pw, const char *tty) | |||
227 | strerror(errno)); | 227 | strerror(errno)); |
228 | 228 | ||
229 | #ifdef WITH_SELINUX | 229 | #ifdef WITH_SELINUX |
230 | ssh_selinux_setup_pty(pw->pw_name, tty); | 230 | ssh_selinux_setup_pty(pw->pw_name, tty, role); |
231 | #endif | 231 | #endif |
232 | 232 | ||
233 | if (st.st_uid != pw->pw_uid || st.st_gid != gid) { | 233 | if (st.st_uid != pw->pw_uid || st.st_gid != gid) { |
@@ -24,4 +24,4 @@ int pty_allocate(int *, int *, char *, size_t); | |||
24 | void pty_release(const char *); | 24 | void pty_release(const char *); |
25 | void pty_make_controlling_tty(int *, const char *); | 25 | void pty_make_controlling_tty(int *, const char *); |
26 | void pty_change_window_size(int, u_int, u_int, u_int, u_int); | 26 | void pty_change_window_size(int, u_int, u_int, u_int, u_int); |
27 | void pty_setowner(struct passwd *, const char *); | 27 | void pty_setowner(struct passwd *, const char *, const char *); |
@@ -3,4 +3,9 @@ | |||
3 | #define SSH_VERSION "OpenSSH_6.3" | 3 | #define SSH_VERSION "OpenSSH_6.3" |
4 | 4 | ||
5 | #define SSH_PORTABLE "p1" | 5 | #define SSH_PORTABLE "p1" |
6 | #define SSH_RELEASE SSH_VERSION SSH_PORTABLE | 6 | #define SSH_RELEASE_MINIMUM SSH_VERSION SSH_PORTABLE |
7 | #ifdef SSH_EXTRAVERSION | ||
8 | #define SSH_RELEASE SSH_RELEASE_MINIMUM " " SSH_EXTRAVERSION | ||
9 | #else | ||
10 | #define SSH_RELEASE SSH_RELEASE_MINIMUM | ||
11 | #endif | ||