From 6cd875acfc962884356fcb441c33ef0aff6497c853b55fca54a9cba6c6db7495 Mon Sep 17 00:00:00 2001 From: Petr Cerny Date: Thu, 19 Sep 2013 04:09:33 +0000 Subject: [PATCH 1/9] Accepting request 199679 from home:pcerny:factory - spec file cleanup (don't pointelssly build whole OpenSSH) - spec file and patch cleanup * removing obsoleted auditing patch (openssh-%{version}-audit.patch) - added patches from SLE * GSSAPI key exchange * FIPS enablement (currently disabled) * small bugfixes - split the LDAP helper into a separate package: openssh-akc-ldap OBS-URL: https://build.opensuse.org/request/show/199679 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=55 --- converter-linking.patch | 11 - converter.tar.bz2 | 3 - openssh-5.9p1-audit.patch | 224 - openssh-5.9p1-blocksigalrm.diff | 43 - openssh-5.9p1-default-protocol.diff | 13 - openssh-5.9p1-eal3.diff | 45 - openssh-5.9p1-engines.diff | 140 - openssh-5.9p1-gssapimitm.patch | 259 -- openssh-5.9p1-host_ident.diff | 16 - openssh-5.9p1-pam-fix2.diff | 22 - openssh-5.9p1-pam-fix3.diff | 15 - openssh-5.9p1-pts.diff | 24 - openssh-5.9p1-saveargv-fix.diff | 25 - ...ssh-5.9p1-sshconfig-knownhostschanges.diff | 19 - openssh-5.9p1-sshd_config.diff | 51 - openssh-5.9p1-xauthlocalhostname.diff | 78 - openssh-6.2p2-X11-forwarding.patch | 61 + ...h-6.2p2-audit1-remove_duplicit_audit.patch | 33 + ...-audit2-better_audit_of_user_actions.patch | 868 ++++ openssh-6.2p2-audit3-key_auth_usage.patch | 563 +++ openssh-6.2p2-audit4-kex_results.patch | 771 ++++ ...6.2p2-audit5-session_key_destruction.patch | 979 +++++ ...-6.2p2-audit6-server_key_destruction.patch | 737 ++++ openssh-6.2p2-audit7-libaudit_compat.patch | 107 + ...h-6.2p2-audit8-libaudit_dns_timeouts.patch | 47 + openssh-6.2p2-blocksigalrm.patch | 73 + openssh-6.2p2-default-protocol.patch | 24 + openssh-6.2p2-disable-openssl-abi-check.patch | 32 + openssh-6.2p2-eal3.patch | 85 + openssh-6.2p2-fingerprint_hash.patch | 671 +++ openssh-6.2p2-fips.patch | 1186 +++++ openssh-6.2p2-gssapi_key_exchange.patch | 3890 +++++++++++++++++ openssh-6.2p2-gssapimitm.patch | 430 ++ openssh-6.2p2-host_ident.patch | 28 + openssh-6.2p2-key-converter.patch | 534 +++ openssh-6.2p2-lastlog.patch | 24 + openssh-6.2p2-ldap.patch | 2805 ++++++++++++ openssh-6.2p2-login_options.patch | 28 + openssh-6.2p2-no_fork-no_pid_file.patch | 24 + openssh-6.2p2-pam-check-locks.patch | 226 + openssh-6.2p2-pam-fix2.patch | 44 + openssh-6.2p2-pam-fix3.patch | 26 + openssh-6.2p2-pts.patch | 46 + openssh-6.2p2-saveargv-fix.patch | 46 + openssh-6.2p2-seed-prng.patch | 542 +++ ...le.diff => openssh-6.2p2-send_locale.patch | 37 +- ...tch => openssh-6.2p2-sftp_homechroot.patch | 275 +- ...p1-xauth.diff => openssh-6.2p2-xauth.patch | 24 +- openssh-6.2p2-xauthlocalhostname.patch | 141 + openssh-askpass-gnome.changes | 5 + openssh-askpass-gnome.spec | 31 +- openssh-nocrazyabicheck.patch | 17 - openssh-nodaemon-nopid.patch | 11 - openssh.changes | 12 + openssh.spec | 350 +- ssh-askpass | 6 +- sshd-gen-keys-start | 26 +- sshd.init | 118 +- sshd.pamd | 14 +- 59 files changed, 15623 insertions(+), 1362 deletions(-) delete mode 100644 converter-linking.patch delete mode 100644 converter.tar.bz2 delete mode 100644 openssh-5.9p1-audit.patch delete mode 100644 openssh-5.9p1-blocksigalrm.diff delete mode 100644 openssh-5.9p1-default-protocol.diff delete mode 100644 openssh-5.9p1-eal3.diff delete mode 100644 openssh-5.9p1-engines.diff delete mode 100644 openssh-5.9p1-gssapimitm.patch delete mode 100644 openssh-5.9p1-host_ident.diff delete mode 100644 openssh-5.9p1-pam-fix2.diff delete mode 100644 openssh-5.9p1-pam-fix3.diff delete mode 100644 openssh-5.9p1-pts.diff delete mode 100644 openssh-5.9p1-saveargv-fix.diff delete mode 100644 openssh-5.9p1-sshconfig-knownhostschanges.diff delete mode 100644 openssh-5.9p1-sshd_config.diff delete mode 100644 openssh-5.9p1-xauthlocalhostname.diff create mode 100644 openssh-6.2p2-X11-forwarding.patch create mode 100644 openssh-6.2p2-audit1-remove_duplicit_audit.patch create mode 100644 openssh-6.2p2-audit2-better_audit_of_user_actions.patch create mode 100644 openssh-6.2p2-audit3-key_auth_usage.patch create mode 100644 openssh-6.2p2-audit4-kex_results.patch create mode 100644 openssh-6.2p2-audit5-session_key_destruction.patch create mode 100644 openssh-6.2p2-audit6-server_key_destruction.patch create mode 100644 openssh-6.2p2-audit7-libaudit_compat.patch create mode 100644 openssh-6.2p2-audit8-libaudit_dns_timeouts.patch create mode 100644 openssh-6.2p2-blocksigalrm.patch create mode 100644 openssh-6.2p2-default-protocol.patch create mode 100644 openssh-6.2p2-disable-openssl-abi-check.patch create mode 100644 openssh-6.2p2-eal3.patch create mode 100644 openssh-6.2p2-fingerprint_hash.patch create mode 100644 openssh-6.2p2-fips.patch create mode 100644 openssh-6.2p2-gssapi_key_exchange.patch create mode 100644 openssh-6.2p2-gssapimitm.patch create mode 100644 openssh-6.2p2-host_ident.patch create mode 100644 openssh-6.2p2-key-converter.patch create mode 100644 openssh-6.2p2-lastlog.patch create mode 100644 openssh-6.2p2-ldap.patch create mode 100644 openssh-6.2p2-login_options.patch create mode 100644 openssh-6.2p2-no_fork-no_pid_file.patch create mode 100644 openssh-6.2p2-pam-check-locks.patch create mode 100644 openssh-6.2p2-pam-fix2.patch create mode 100644 openssh-6.2p2-pam-fix3.patch create mode 100644 openssh-6.2p2-pts.patch create mode 100644 openssh-6.2p2-saveargv-fix.patch create mode 100644 openssh-6.2p2-seed-prng.patch rename openssh-5.9p1-send_locale.diff => openssh-6.2p2-send_locale.patch (52%) rename openssh-5.9p1-homechroot.patch => openssh-6.2p2-sftp_homechroot.patch (55%) rename openssh-5.9p1-xauth.diff => openssh-6.2p2-xauth.patch (64%) create mode 100644 openssh-6.2p2-xauthlocalhostname.patch delete mode 100644 openssh-nocrazyabicheck.patch delete mode 100644 openssh-nodaemon-nopid.patch diff --git a/converter-linking.patch b/converter-linking.patch deleted file mode 100644 index 9c8ecc8..0000000 --- a/converter-linking.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- converter/Makefile.orig -+++ converter/Makefile -@@ -8,7 +8,7 @@ ssh-keyconverter.o: ssh-keyconverter.c . - gcc $(RPM_OPT_FLAGS) -c -I../ $< -o $@ - - ssh-keyconverter: ssh-keyconverter.o ../libssh.a ../openbsd-compat/libopenbsd-compat.a -- gcc $< -L../ -L../openbsd-compat/ -lssh -lopenbsd-compat -lssh -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ -+ gcc -Wl,--no-as-needed $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ $< -lssl -lcrypto -lssh -lopenbsd-compat -lssl -lssh -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -o $@ - - install: ssh-keyconverter ssh-keyconverter.1 - if [ ! -d $(DESTDIR)$(bindir) ]; then install -d -m 755 $(DESTDIR)$(bindir); fi diff --git a/converter.tar.bz2 b/converter.tar.bz2 deleted file mode 100644 index 7a6af80..0000000 --- a/converter.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da7ff204375259aef8aaf3ad89c7f311134354fe0129cddce927de5d4f7ab349 -size 4792 diff --git a/openssh-5.9p1-audit.patch b/openssh-5.9p1-audit.patch deleted file mode 100644 index aed05e2..0000000 --- a/openssh-5.9p1-audit.patch +++ /dev/null @@ -1,224 +0,0 @@ -# add support for Linux audit (FATE #120269) -================================================================================ ---- openssh-6.2p2.orig/Makefile.in -+++ openssh-6.2p2/Makefile.in -@@ -47,6 +47,7 @@ LIBS=@LIBS@ - K5LIBS=@K5LIBS@ - GSSLIBS=@GSSLIBS@ - SSHLIBS=@SSHLIBS@ -+LIBAUDIT=@LIBAUDIT@ - SSHDLIBS=@SSHDLIBS@ - LIBEDIT=@LIBEDIT@ - AR=@AR@ -@@ -144,7 +145,7 @@ ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SS - $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) $(GSSLIBS) - - sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) -- $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS) -+ $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS) $(LIBAUDIT) - - scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o - $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ---- openssh-6.2p2.orig/auth.c -+++ openssh-6.2p2/auth.c -@@ -298,6 +298,12 @@ auth_log(Authctxt *authctxt, int authent - get_canonical_hostname(options.use_dns), "ssh", &loginmsg); - # endif - #endif -+#if HAVE_LINUX_AUDIT -+ if (authenticated == 0 && !authctxt->postponed) { -+ linux_audit_record_event(-1, authctxt->user, NULL, -+ get_remote_ipaddr(), "sshd", 0); -+ } -+#endif - #ifdef SSH_AUDIT_EVENTS - if (authenticated == 0 && !authctxt->postponed) - audit_event(audit_classify_auth(method)); -@@ -606,6 +612,10 @@ getpwnamallow(const char *user) - record_failed_login(user, - get_canonical_hostname(options.use_dns), "ssh"); - #endif -+#ifdef HAVE_LINUX_AUDIT -+ linux_audit_record_event(-1, user, NULL, get_remote_ipaddr(), -+ "sshd", 0); -+#endif - #ifdef SSH_AUDIT_EVENTS - audit_event(SSH_INVALID_USER); - #endif /* SSH_AUDIT_EVENTS */ ---- openssh-6.2p2.orig/config.h.in -+++ openssh-6.2p2/config.h.in -@@ -1554,6 +1554,9 @@ - /* Define if you want SELinux support. */ - #undef WITH_SELINUX - -+/* Define if you want Linux audit support. */ -+#undef HAVE_LINUX_AUDIT -+ - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ - #if defined AC_APPLE_UNIVERSAL_BUILD ---- openssh-6.2p2.orig/configure.ac -+++ openssh-6.2p2/configure.ac -@@ -3653,6 +3653,20 @@ AC_ARG_WITH([selinux], - AC_SUBST([SSHLIBS]) - AC_SUBST([SSHDLIBS]) - -+# Check whether user wants Linux audit support -+LINUX_AUDIT_MSG="no" -+LIBAUDIT="" -+AC_ARG_WITH([linux-audit], -+ [ --with-linux-audit Enable Linux audit support], -+ [ if test "x$withval" != "xno" ; then -+ AC_DEFINE([HAVE_LINUX_AUDIT],[1],[Define if you want Linux audit support.]) -+ LINUX_AUDIT_MSG="yes" -+ AC_CHECK_HEADERS([libaudit.h]) -+ LIBAUDIT="-laudit" -+ fi -+ ]) -+AC_SUBST([LIBAUDIT]) -+ - # Check whether user wants Kerberos 5 support - KRB5_MSG="no" - AC_ARG_WITH([kerberos5], -@@ -4569,6 +4583,7 @@ echo " PAM support - echo " OSF SIA support: $SIA_MSG" - echo " KerberosV support: $KRB5_MSG" - echo " SELinux support: $SELINUX_MSG" -+echo " Linux audit support: $LINUX_AUDIT_MSG" - echo " Smartcard support: $SCARD_MSG" - echo " S/KEY support: $SKEY_MSG" - echo " TCP Wrappers support: $TCPW_MSG" ---- openssh-6.2p2.orig/loginrec.c -+++ openssh-6.2p2/loginrec.c -@@ -176,6 +176,10 @@ - #include "auth.h" - #include "buffer.h" - -+#ifdef HAVE_LINUX_AUDIT -+# include -+#endif -+ - #ifdef HAVE_UTIL_H - # include - #endif -@@ -198,6 +202,9 @@ int utmp_write_entry(struct logininfo *l - int utmpx_write_entry(struct logininfo *li); - int wtmp_write_entry(struct logininfo *li); - int wtmpx_write_entry(struct logininfo *li); -+#ifdef HAVE_LINUX_AUDIT -+int linux_audit_write_entry(struct logininfo *li); -+#endif - int lastlog_write_entry(struct logininfo *li); - int syslogin_write_entry(struct logininfo *li); - -@@ -438,6 +445,10 @@ login_write(struct logininfo *li) - - /* set the timestamp */ - login_set_current_time(li); -+#ifdef HAVE_LINUX_AUDIT -+ if (linux_audit_write_entry(li) == 0) -+ fatal("linux_audit_write_entry failed: %s", strerror(errno)); -+#endif - #ifdef USE_LOGIN - syslogin_write_entry(li); - #endif -@@ -1402,6 +1413,87 @@ wtmpx_get_entry(struct logininfo *li) - } - #endif /* USE_WTMPX */ - -+#ifdef HAVE_LINUX_AUDIT -+static void -+_audit_hexscape(const char *what, char *where, unsigned int size) -+{ -+ const char *ptr = what; -+ const char *hex = "0123456789ABCDEF"; -+ -+ while (*ptr) { -+ if (*ptr == '"' || *ptr < 0x21 || *ptr > 0x7E) { -+ unsigned int i; -+ ptr = what; -+ for (i = 0; *ptr && i+2 < size; i += 2) { -+ where[i] = hex[((unsigned)*ptr & 0xF0)>>4]; /* Upper nibble */ -+ where[i+1] = hex[(unsigned)*ptr & 0x0F]; /* Lower nibble */ -+ ptr++; -+ } -+ where[i] = '\0'; -+ return; -+ } -+ ptr++; -+ } -+ where[0] = '"'; -+ if ((unsigned)(ptr - what) < size - 3) -+ { -+ size = ptr - what + 3; -+ } -+ strncpy(where + 1, what, size - 3); -+ where[size-2] = '"'; -+ where[size-1] = '\0'; -+} -+ -+#define AUDIT_LOG_SIZE 128 -+#define AUDIT_ACCT_SIZE (AUDIT_LOG_SIZE - 8) -+ -+int -+linux_audit_record_event(int uid, const char *username, -+ const char *hostname, const char *ip, const char *ttyn, int success) -+{ -+ char buf[AUDIT_LOG_SIZE]; -+ int audit_fd, rc; -+ -+ audit_fd = audit_open(); -+ if (audit_fd < 0) { -+ if (errno == EINVAL || errno == EPROTONOSUPPORT || -+ errno == EAFNOSUPPORT) -+ return 1; /* No audit support in kernel */ -+ else -+ return 0; /* Must prevent login */ -+ } -+ if (username == NULL) -+ snprintf(buf, sizeof(buf), "uid=%d", uid); -+ else { -+ char encoded[AUDIT_ACCT_SIZE]; -+ _audit_hexscape(username, encoded, sizeof(encoded)); -+ snprintf(buf, sizeof(buf), "acct=%s", encoded); -+ } -+ rc = audit_log_user_message(audit_fd, AUDIT_USER_LOGIN, -+ buf, hostname, ip, ttyn, success); -+ close(audit_fd); -+ if (rc >= 0) -+ return 1; -+ else -+ return 0; -+} -+ -+int -+linux_audit_write_entry(struct logininfo *li) -+{ -+ switch(li->type) { -+ case LTYPE_LOGIN: -+ return (linux_audit_record_event(li->uid, NULL, li->hostname, -+ NULL, li->line, 1)); -+ case LTYPE_LOGOUT: -+ return (1); /* We only care about logins */ -+ default: -+ logit("%s: invalid type field", __func__); -+ return (0); -+ } -+} -+#endif /* HAVE_LINUX_AUDIT */ -+ - /** - ** Low-level libutil login() functions - **/ ---- openssh-6.2p2.orig/loginrec.h -+++ openssh-6.2p2/loginrec.h -@@ -127,5 +127,9 @@ char *line_stripname(char *dst, const ch - char *line_abbrevname(char *dst, const char *src, int dstsize); - - void record_failed_login(const char *, const char *, const char *); -+#ifdef HAVE_LINUX_AUDIT -+int linux_audit_record_event(int uid, const char *username, -+ const char *hostname, const char *ip, const char *ttyn, int success); -+#endif /* HAVE_LINUX_AUDIT */ - - #endif /* _HAVE_LOGINREC_H_ */ diff --git a/openssh-5.9p1-blocksigalrm.diff b/openssh-5.9p1-blocksigalrm.diff deleted file mode 100644 index 08ef58c..0000000 --- a/openssh-5.9p1-blocksigalrm.diff +++ /dev/null @@ -1,43 +0,0 @@ -Index: log.c -=================================================================== ---- log.c.orig -+++ log.c -@@ -51,6 +51,7 @@ - - #include "xmalloc.h" - #include "log.h" -+#include - - static LogLevel log_level = SYSLOG_LEVEL_INFO; - static int log_on_stderr = 1; -@@ -336,6 +337,7 @@ do_log(LogLevel level, const char *fmt, - char fmtbuf[MSGBUFSIZ]; - char *txt = NULL; - int pri = LOG_INFO; -+ sigset_t nset, oset; - int saved_errno = errno; - log_handler_fn *tmp_handler; - -@@ -387,6 +389,14 @@ do_log(LogLevel level, const char *fmt, - snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); - write(STDERR_FILENO, msgbuf, strlen(msgbuf)); - } else { -+ /* Prevent a race between the grace_alarm -+ * which writes a log message and terminates -+ * and main sshd code that leads to deadlock -+ * as syslog is not async safe. -+ */ -+ sigemptyset(&nset); -+ sigaddset(&nset, SIGALRM); -+ sigprocmask(SIG_BLOCK, &nset, &oset); - #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) - openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); - syslog_r(pri, &sdata, "%.500s", fmtbuf); -@@ -396,6 +406,7 @@ do_log(LogLevel level, const char *fmt, - syslog(pri, "%.500s", fmtbuf); - closelog(); - #endif -+ sigprocmask(SIG_SETMASK, &oset, NULL); - } - errno = saved_errno; - } diff --git a/openssh-5.9p1-default-protocol.diff b/openssh-5.9p1-default-protocol.diff deleted file mode 100644 index 4f5bb44..0000000 --- a/openssh-5.9p1-default-protocol.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: ssh_config -=================================================================== ---- ssh_config.orig -+++ ssh_config -@@ -46,7 +46,7 @@ ForwardX11Trusted yes - # IdentityFile ~/.ssh/id_rsa - # IdentityFile ~/.ssh/id_dsa - # Port 22 --# Protocol 2,1 -+ Protocol 2 - # Cipher 3des - # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc - # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 diff --git a/openssh-5.9p1-eal3.diff b/openssh-5.9p1-eal3.diff deleted file mode 100644 index dc0f058..0000000 --- a/openssh-5.9p1-eal3.diff +++ /dev/null @@ -1,45 +0,0 @@ -Index: openssh-5.8p1/sshd.8 -=================================================================== ---- openssh-5.8p1.orig/sshd.8 -+++ openssh-5.8p1/sshd.8 -@@ -855,7 +855,7 @@ Contains Diffie-Hellman groups used for - The file format is described in - .Xr moduli 5 . - .Pp --.It Pa /etc/motd -+.It Pa /etc/lib/motd - See - .Xr motd 5 . - .Pp -@@ -868,7 +868,7 @@ are displayed to anyone trying to log in - refused. - The file should be world-readable. - .Pp --.It Pa /etc/shosts.equiv -+.It Pa /etc/ssh/shosts.equiv - This file is used in exactly the same way as - .Pa hosts.equiv , - but allows host-based authentication without permitting login with -@@ -947,8 +947,7 @@ The content of this file is not sensitiv - .Xr ssh-keyscan 1 , - .Xr chroot 2 , - .Xr hosts_access 5 , --.Xr login.conf 5 , --.Xr moduli 5 , -+.Xr login.defs 5 , - .Xr sshd_config 5 , - .Xr inetd 8 , - .Xr sftp-server 8 -Index: openssh-5.8p1/sshd_config.5 -=================================================================== ---- openssh-5.8p1.orig/sshd_config.5 -+++ openssh-5.8p1/sshd_config.5 -@@ -497,7 +497,7 @@ or - .Pp - .Pa /etc/hosts.equiv - and --.Pa /etc/shosts.equiv -+.Pa /etc/ssh/shosts.equiv - are still used. - The default is - .Dq yes . diff --git a/openssh-5.9p1-engines.diff b/openssh-5.9p1-engines.diff deleted file mode 100644 index f7cb94d..0000000 --- a/openssh-5.9p1-engines.diff +++ /dev/null @@ -1,140 +0,0 @@ -Index: openssh-5.8p1/ssh-add.c -=================================================================== ---- openssh-5.8p1.orig/ssh-add.c -+++ openssh-5.8p1/ssh-add.c -@@ -43,6 +43,7 @@ - - #include - #include "openbsd-compat/openssl-compat.h" -+#include - - #include - #include -@@ -377,6 +378,10 @@ main(int argc, char **argv) - - OpenSSL_add_all_algorithms(); - -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - /* At first, get a connection to the authentication agent. */ - ac = ssh_get_authentication_connection(); - if (ac == NULL) { -Index: openssh-5.8p1/ssh-agent.c -=================================================================== ---- openssh-5.8p1.orig/ssh-agent.c -+++ openssh-5.8p1/ssh-agent.c -@@ -52,6 +52,7 @@ - #include - #include - #include "openbsd-compat/openssl-compat.h" -+#include - - #include - #include -@@ -1153,6 +1154,10 @@ main(int ac, char **av) - - OpenSSL_add_all_algorithms(); - -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - __progname = ssh_get_progname(av[0]); - seed_rng(); - -Index: openssh-5.8p1/ssh-keygen.c -=================================================================== ---- openssh-5.8p1.orig/ssh-keygen.c -+++ openssh-5.8p1/ssh-keygen.c -@@ -22,6 +22,7 @@ - #include - #include - #include "openbsd-compat/openssl-compat.h" -+#include - - #include - #include -@@ -1815,6 +1816,11 @@ main(int argc, char **argv) - __progname = ssh_get_progname(argv[0]); - - OpenSSL_add_all_algorithms(); -+ -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); - - seed_rng(); -Index: openssh-5.8p1/ssh-keysign.c -=================================================================== ---- openssh-5.8p1.orig/ssh-keysign.c -+++ openssh-5.8p1/ssh-keysign.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - - #include "xmalloc.h" - #include "log.h" -@@ -195,6 +196,11 @@ main(int argc, char **argv) - fatal("could not open any host key"); - - OpenSSL_add_all_algorithms(); -+ -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - for (i = 0; i < 256; i++) - rnd[i] = arc4random(); - RAND_seed(rnd, sizeof(rnd)); -Index: openssh-5.8p1/ssh.c -=================================================================== ---- openssh-5.8p1.orig/ssh.c -+++ openssh-5.8p1/ssh.c -@@ -75,6 +75,7 @@ - #include - #include "openbsd-compat/openssl-compat.h" - #include "openbsd-compat/sys-queue.h" -+#include - - #include "xmalloc.h" - #include "ssh.h" -@@ -601,6 +602,10 @@ main(int ac, char **av) - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - /* Initialize the command to execute on remote host. */ - buffer_init(&command); - -Index: openssh-5.8p1/sshd.c -=================================================================== ---- openssh-5.8p1.orig/sshd.c -+++ openssh-5.8p1/sshd.c -@@ -77,6 +77,7 @@ - #include - #include - #include "openbsd-compat/openssl-compat.h" -+#include - - #ifdef HAVE_SECUREWARE - #include -@@ -1474,6 +1475,10 @@ main(int ac, char **av) - - OpenSSL_add_all_algorithms(); - -+ /* Init available hardware crypto engines. */ -+ ENGINE_load_builtin_engines(); -+ ENGINE_register_all_complete(); -+ - /* - * Force logging to stderr until we have loaded the private host - * key (unless started from inetd) diff --git a/openssh-5.9p1-gssapimitm.patch b/openssh-5.9p1-gssapimitm.patch deleted file mode 100644 index 2999d6c..0000000 --- a/openssh-5.9p1-gssapimitm.patch +++ /dev/null @@ -1,259 +0,0 @@ -The patch below adds support for the deprecated 'gssapi' authentication -mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included -in this release. The use of 'gssapi' is deprecated due to the presence of -potential man-in-the-middle attacks, which 'gssapi-with-mic' is not -susceptible to. - -To use the patch apply it to a OpenSSH 3.8p1 source tree. After compiling, -backwards compatibility may be obtained by supplying the -'GssapiEnableMitmAttack yes' option to either the client or server. - -It should be noted that this patch is being made available purely as a means -of easing the process of moving to OpenSSH 3.8p1. Any new installations are -recommended to use the 'gssapi-with-mic' mechanism. Existing installations -are encouraged to upgrade as soon as possible. - -Index: auth2-gss.c -=================================================================== ---- auth2-gss.c.orig -+++ auth2-gss.c -@@ -177,6 +177,15 @@ input_gssapi_token(int type, u_int32_t p - dispatch_set( - SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, - &input_gssapi_exchange_complete); -+ -+ /* -+ * Old style 'gssapi' didn't have the GSSAPI_MIC -+ * and went straight to sending exchange_complete -+ */ -+ if (options.gss_enable_mitm) -+ dispatch_set( -+ SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, -+ &input_gssapi_exchange_complete); - } - } - -@@ -298,4 +307,10 @@ Authmethod method_gssapi = { - &options.gss_authentication - }; - -+Authmethod method_gssapi_old = { -+ "gssapi", -+ userauth_gssapi, -+ &options.gss_enable_mitm -+}; -+ - #endif /* GSSAPI */ -Index: auth2.c -=================================================================== ---- auth2.c.orig -+++ auth2.c -@@ -70,6 +70,7 @@ extern Authmethod method_kbdint; - extern Authmethod method_hostbased; - #ifdef GSSAPI - extern Authmethod method_gssapi; -+extern Authmethod method_gssapi_old; - #endif - #ifdef JPAKE - extern Authmethod method_jpake; -@@ -80,6 +81,7 @@ Authmethod *authmethods[] = { - &method_pubkey, - #ifdef GSSAPI - &method_gssapi, -+ &method_gssapi_old, - #endif - #ifdef JPAKE - &method_jpake, -Index: readconf.c -=================================================================== ---- readconf.c.orig -+++ readconf.c -@@ -128,7 +128,7 @@ typedef enum { - oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, - oClearAllForwardings, oNoHostAuthenticationForLocalhost, - oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, -- oAddressFamily, oGssAuthentication, oGssDelegateCreds, -+ oAddressFamily, oGssAuthentication, oGssDelegateCreds, oGssEnableMITM, - oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, - oSendEnv, oControlPath, oControlMaster, oControlPersist, - oHashKnownHosts, -@@ -170,9 +170,11 @@ static struct { - #if defined(GSSAPI) - { "gssapiauthentication", oGssAuthentication }, - { "gssapidelegatecredentials", oGssDelegateCreds }, -+ { "gssapienablemitmattack", oGssEnableMITM }, - #else - { "gssapiauthentication", oUnsupported }, - { "gssapidelegatecredentials", oUnsupported }, -+ { "gssapienablemitmattack", oUnsupported }, - #endif - { "fallbacktorsh", oDeprecated }, - { "usersh", oDeprecated }, -@@ -483,6 +485,10 @@ parse_flag: - intptr = &options->gss_deleg_creds; - goto parse_flag; - -+ case oGssEnableMITM: -+ intptr = &options->gss_enable_mitm; -+ goto parse_flag; -+ - case oBatchMode: - intptr = &options->batch_mode; - goto parse_flag; -@@ -1093,6 +1099,7 @@ initialize_options(Options * options) - options->challenge_response_authentication = -1; - options->gss_authentication = -1; - options->gss_deleg_creds = -1; -+ options->gss_enable_mitm = -1; - options->password_authentication = -1; - options->kbd_interactive_authentication = -1; - options->kbd_interactive_devices = NULL; -@@ -1195,6 +1202,8 @@ fill_default_options(Options * options) - options->gss_authentication = 0; - if (options->gss_deleg_creds == -1) - options->gss_deleg_creds = 0; -+ if (options->gss_enable_mitm == -1) -+ options->gss_enable_mitm = 0; - if (options->password_authentication == -1) - options->password_authentication = 1; - if (options->kbd_interactive_authentication == -1) -Index: readconf.h -=================================================================== ---- readconf.h.orig -+++ readconf.h -@@ -47,6 +47,7 @@ typedef struct { - /* Try S/Key or TIS, authentication. */ - int gss_authentication; /* Try GSS authentication */ - int gss_deleg_creds; /* Delegate GSS credentials */ -+ int gss_enable_mitm; /* Enable old style gssapi auth */ - int password_authentication; /* Try password - * authentication. */ - int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ -Index: servconf.c -=================================================================== ---- servconf.c.orig -+++ servconf.c -@@ -98,6 +98,7 @@ initialize_server_options(ServerOptions - options->kerberos_get_afs_token = -1; - options->gss_authentication=-1; - options->gss_cleanup_creds = -1; -+ options->gss_enable_mitm = -1; - options->password_authentication = -1; - options->kbd_interactive_authentication = -1; - options->challenge_response_authentication = -1; -@@ -228,6 +229,8 @@ fill_default_server_options(ServerOption - options->gss_authentication = 0; - if (options->gss_cleanup_creds == -1) - options->gss_cleanup_creds = 1; -+ if (options->gss_enable_mitm == -1) -+ options->gss_enable_mitm = 0; - if (options->password_authentication == -1) - options->password_authentication = 1; - if (options->kbd_interactive_authentication == -1) -@@ -322,7 +325,7 @@ typedef enum { - sBanner, sUseDNS, sHostbasedAuthentication, - sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, - sClientAliveCountMax, sAuthorizedKeysFile, -- sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, -+ sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, sGssEnableMITM, - sMatch, sPermitOpen, sForceCommand, sChrootDirectory, - sUsePrivilegeSeparation, sAllowAgentForwarding, - sZeroKnowledgePasswordAuthentication, sHostCertificate, -@@ -386,9 +389,11 @@ static struct { - #ifdef GSSAPI - { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, - { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, -+ { "gssapienablemitmattack", sGssEnableMITM }, - #else - { "gssapiauthentication", sUnsupported, SSHCFG_ALL }, - { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL }, -+ { "gssapienablemitmattack", sUnsupported }, - #endif - { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, - { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, -@@ -948,6 +953,10 @@ process_server_config_line(ServerOptions - intptr = &options->gss_cleanup_creds; - goto parse_flag; - -+ case sGssEnableMITM: -+ intptr = &options->gss_enable_mitm; -+ goto parse_flag; -+ - case sPasswordAuthentication: - intptr = &options->password_authentication; - goto parse_flag; -Index: servconf.h -=================================================================== ---- servconf.h.orig -+++ servconf.h -@@ -98,6 +98,7 @@ typedef struct { - * authenticated with Kerberos. */ - int gss_authentication; /* If true, permit GSSAPI authentication */ - int gss_cleanup_creds; /* If true, destroy cred cache on logout */ -+ int gss_enable_mitm; /* If true, enable old style GSSAPI */ - int password_authentication; /* If true, permit password - * authentication. */ - int kbd_interactive_authentication; /* If true, permit */ -Index: ssh_config -=================================================================== ---- ssh_config.orig -+++ ssh_config -@@ -54,5 +54,15 @@ ForwardX11Trusted yes - # Tunnel no - # TunnelDevice any:any - # PermitLocalCommand no -+# GSSAPIAuthentication no -+# GSSAPIDelegateCredentials no -+ -+# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication -+# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included -+# in this release. The use of 'gssapi' is deprecated due to the presence of -+# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. -+# GSSAPIEnableMITMAttack no -+ -+>>>>>>> - # VisualHostKey no - # ProxyCommand ssh -q -W %h:%p gateway.example.com -Index: sshconnect2.c -=================================================================== ---- sshconnect2.c.orig -+++ sshconnect2.c -@@ -324,6 +324,10 @@ Authmethod authmethods[] = { - NULL, - &options.gss_authentication, - NULL}, -+ {"gssapi", -+ userauth_gssapi, -+ &options.gss_enable_mitm, -+ NULL}, - #endif - {"hostbased", - userauth_hostbased, -@@ -701,7 +705,9 @@ process_gssapi_token(void *ctxt, gss_buf - - if (status == GSS_S_COMPLETE) { - /* send either complete or MIC, depending on mechanism */ -- if (!(flags & GSS_C_INTEG_FLAG)) { -+ -+ if (strcmp(authctxt->method->name,"gssapi")==0 || -+ (!(flags & GSS_C_INTEG_FLAG))) { - packet_start(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE); - packet_send(); - } else { -Index: sshd_config -=================================================================== ---- sshd_config.orig -+++ sshd_config -@@ -73,6 +73,12 @@ PasswordAuthentication no - #GSSAPIAuthentication no - #GSSAPICleanupCredentials yes - -+# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication -+# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included -+# in this release. The use of 'gssapi' is deprecated due to the presence of -+# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. -+#GSSAPIEnableMITMAttack no -+ - # Set this to 'yes' to enable PAM authentication, account processing, - # and session processing. If this is enabled, PAM authentication will - # be allowed through the ChallengeResponseAuthentication and diff --git a/openssh-5.9p1-host_ident.diff b/openssh-5.9p1-host_ident.diff deleted file mode 100644 index b50f31d..0000000 --- a/openssh-5.9p1-host_ident.diff +++ /dev/null @@ -1,16 +0,0 @@ -Index: openssh-5.7p1/sshconnect.c -=================================================================== ---- openssh-5.7p1.orig/sshconnect.c -+++ openssh-5.7p1/sshconnect.c -@@ -958,6 +958,11 @@ check_host_key(char *hostname, struct so - user_hostfiles[0]); - error("Offending %s key in %s:%lu", key_type(host_found->key), - host_found->file, host_found->line); -+ error("You can use following command to remove all keys for this IP:"); -+ if (host_found->file) -+ error("ssh-keygen -R %s -f %s", hostname, host_found->file); -+ else -+ error("ssh-keygen -R %s", hostname); - - /* - * If strict host key checking is in use, the user will have diff --git a/openssh-5.9p1-pam-fix2.diff b/openssh-5.9p1-pam-fix2.diff deleted file mode 100644 index ff9a74d..0000000 --- a/openssh-5.9p1-pam-fix2.diff +++ /dev/null @@ -1,22 +0,0 @@ -Index: sshd_config -=================================================================== ---- sshd_config.orig -+++ sshd_config -@@ -57,7 +57,7 @@ - #IgnoreRhosts yes - - # To disable tunneled clear text passwords, change to no here! --#PasswordAuthentication yes -+PasswordAuthentication no - #PermitEmptyPasswords no - - # Change to no to disable s/key passwords -@@ -82,7 +82,7 @@ - # If you just want the PAM account and session checks to run without - # PAM authentication, then enable this but set PasswordAuthentication - # and ChallengeResponseAuthentication to 'no'. --#UsePAM no -+UsePAM yes - - #AllowAgentForwarding yes - #AllowTcpForwarding yes diff --git a/openssh-5.9p1-pam-fix3.diff b/openssh-5.9p1-pam-fix3.diff deleted file mode 100644 index 00f907f..0000000 --- a/openssh-5.9p1-pam-fix3.diff +++ /dev/null @@ -1,15 +0,0 @@ -Index: auth-pam.c -=================================================================== ---- auth-pam.c.orig -+++ auth-pam.c -@@ -786,7 +786,9 @@ sshpam_query(void *ctx, char **name, cha - fatal("Internal error: PAM auth " - "succeeded when it should have " - "failed"); -- import_environments(&buffer); -+#ifndef USE_POSIX_THREADS -+ import_environments(&buffer); -+#endif - *num = 0; - **echo_on = 0; - ctxt->pam_done = 1; diff --git a/openssh-5.9p1-pts.diff b/openssh-5.9p1-pts.diff deleted file mode 100644 index 0b0588c..0000000 --- a/openssh-5.9p1-pts.diff +++ /dev/null @@ -1,24 +0,0 @@ -Index: loginrec.c -=================================================================== ---- loginrec.c.orig -+++ loginrec.c -@@ -555,7 +555,7 @@ getlast_entry(struct logininfo *li) - * 1. The full filename (including '/dev') - * 2. The stripped name (excluding '/dev') - * 3. The abbreviated name (e.g. /dev/ttyp00 -> yp00 -- * /dev/pts/1 -> ts/1 ) -+ * /dev/pts/1 -> /1 ) - * - * Form 3 is used on some systems to identify a .tmp.? entry when - * attempting to remove it. Typically both addition and removal is -@@ -616,6 +616,10 @@ line_abbrevname(char *dst, const char *s - if (strncmp(src, "tty", 3) == 0) - src += 3; - #endif -+ if (strncmp(src, "pts/", 4) == 0) { -+ src += 3; -+ if (strlen(src) > 4) src++; -+ } - - len = strlen(src); - diff --git a/openssh-5.9p1-saveargv-fix.diff b/openssh-5.9p1-saveargv-fix.diff deleted file mode 100644 index 5615eb9..0000000 --- a/openssh-5.9p1-saveargv-fix.diff +++ /dev/null @@ -1,25 +0,0 @@ -Index: sshd.c -=================================================================== ---- sshd.c.orig -+++ sshd.c -@@ -306,6 +306,7 @@ sighup_handler(int sig) - static void - sighup_restart(void) - { -+ int i; - logit("Received SIGHUP; restarting."); - close_listen_socks(); - close_startup_pipes(); -@@ -1319,7 +1320,11 @@ main(int ac, char **av) - #ifndef HAVE_SETPROCTITLE - /* Prepare for later setproctitle emulation */ - compat_init_setproctitle(ac, av); -- av = saved_argv; -+ -+ av = xmalloc(sizeof(*saved_argv) * (saved_argc + 1)); -+ for (i = 0; i < saved_argc; i++) -+ av[i] = xstrdup(saved_argv[i]); -+ av[i] = NULL; - #endif - - if (geteuid() == 0 && setgroups(0, NULL) == -1) diff --git a/openssh-5.9p1-sshconfig-knownhostschanges.diff b/openssh-5.9p1-sshconfig-knownhostschanges.diff deleted file mode 100644 index 3c40d16..0000000 --- a/openssh-5.9p1-sshconfig-knownhostschanges.diff +++ /dev/null @@ -1,19 +0,0 @@ -Index: ssh_config -=================================================================== ---- ssh_config.orig -+++ ssh_config -@@ -67,5 +67,13 @@ ForwardX11Trusted yes - SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES - SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT - SendEnv LC_IDENTIFICATION LC_ALL --# VisualHostKey no -+ -+# This will print the fingerprint of the host key in "visual" form -+# this should make it easier to also recognize bad things -+VisualHostKey no -+ -+# This will hash new host keys and make them so unusable for malicious -+# people or software trying to use known_hosts to find further hops. -+HashKnownHosts yes -+ - # ProxyCommand ssh -q -W %h:%p gateway.example.com diff --git a/openssh-5.9p1-sshd_config.diff b/openssh-5.9p1-sshd_config.diff deleted file mode 100644 index 6272e6e..0000000 --- a/openssh-5.9p1-sshd_config.diff +++ /dev/null @@ -1,51 +0,0 @@ -Index: ssh_config -=================================================================== ---- ssh_config.orig -+++ ssh_config -@@ -17,9 +17,20 @@ - # list of available options, their meanings and defaults, please see the - # ssh_config(5) man page. - --# Host * -+Host * - # ForwardAgent no - # ForwardX11 no -+ -+# If you do not trust your remote host (or its administrator), you -+# should not forward X11 connections to your local X11-display for -+# security reasons: Someone stealing the authentification data on the -+# remote side (the "spoofed" X-server by the remote sshd) can read your -+# keystrokes as you type, just like any other X11 client could do. -+# Set this to "no" here for global effect or in your own ~/.ssh/config -+# file if you want to have the remote X11 authentification data to -+# expire after two minutes after remote login. -+ForwardX11Trusted yes -+ - # RhostsRSAAuthentication no - # RSAAuthentication yes - # PasswordAuthentication yes -Index: sshd_config -=================================================================== ---- sshd_config.orig -+++ sshd_config -@@ -87,7 +87,7 @@ - #AllowAgentForwarding yes - #AllowTcpForwarding yes - #GatewayPorts no --#X11Forwarding no -+X11Forwarding yes - #X11DisplayOffset 10 - #X11UseLocalhost yes - #PrintMotd yes -Index: sshlogin.c -=================================================================== ---- sshlogin.c.orig -+++ sshlogin.c -@@ -133,6 +133,7 @@ record_login(pid_t pid, const char *tty, - - li = login_alloc_entry(pid, user, host, tty); - login_set_addr(li, addr, addrlen); -+ li->uid=uid; - login_login(li); - login_free_entry(li); - } diff --git a/openssh-5.9p1-xauthlocalhostname.diff b/openssh-5.9p1-xauthlocalhostname.diff deleted file mode 100644 index 31e548f..0000000 --- a/openssh-5.9p1-xauthlocalhostname.diff +++ /dev/null @@ -1,78 +0,0 @@ -Index: session.c -=================================================================== ---- session.c.orig -+++ session.c -@@ -1116,7 +1116,7 @@ copy_environment(char **source, char *** - } - - static char ** --do_setup_env(Session *s, const char *shell) -+do_setup_env(Session *s, const char *shell, int *env_size) - { - char buf[256]; - u_int i, envsize; -@@ -1303,6 +1303,8 @@ do_setup_env(Session *s, const char *she - for (i = 0; env[i]; i++) - fprintf(stderr, " %.200s\n", env[i]); - } -+ -+ *env_size = envsize; - return env; - } - -@@ -1311,7 +1313,7 @@ do_setup_env(Session *s, const char *she - * first in this order). - */ - static void --do_rc_files(Session *s, const char *shell) -+do_rc_files(Session *s, const char *shell, char **env, int *env_size) - { - FILE *f = NULL; - char cmd[1024]; -@@ -1365,12 +1367,20 @@ do_rc_files(Session *s, const char *shel - options.xauth_location); - f = popen(cmd, "w"); - if (f) { -+ char hostname[MAXHOSTNAMELEN]; -+ - fprintf(f, "remove %s\n", - s->auth_display); - fprintf(f, "add %s %s %s\n", - s->auth_display, s->auth_proto, - s->auth_data); - pclose(f); -+ if (gethostname(hostname,sizeof(hostname)) >= 0) -+ child_set_env(&env,env_size,"XAUTHLOCALHOSTNAME", -+ hostname); -+ else -+ debug("Cannot set up XAUTHLOCALHOSTNAME %s\n", -+ strerror(errno)); - } else { - fprintf(stderr, "Could not run %s\n", - cmd); -@@ -1608,6 +1618,7 @@ do_child(Session *s, const char *command - { - extern char **environ; - char **env; -+ int env_size; - char *argv[ARGV_MAX]; - const char *shell, *shell0, *hostname = NULL; - struct passwd *pw = s->pw; -@@ -1674,7 +1685,7 @@ do_child(Session *s, const char *command - * Make sure $SHELL points to the shell from the password file, - * even if shell is overridden from login.conf - */ -- env = do_setup_env(s, shell); -+ env = do_setup_env(s, shell, &env_size); - - #ifdef HAVE_LOGIN_CAP - shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); -@@ -1743,7 +1754,7 @@ do_child(Session *s, const char *command - closefrom(STDERR_FILENO + 1); - - if (!options.use_login) -- do_rc_files(s, shell); -+ do_rc_files(s, shell, env, &env_size); - - /* restore SIGPIPE for child */ - signal(SIGPIPE, SIG_DFL); diff --git a/openssh-6.2p2-X11-forwarding.patch b/openssh-6.2p2-X11-forwarding.patch new file mode 100644 index 0000000..1f3f946 --- /dev/null +++ b/openssh-6.2p2-X11-forwarding.patch @@ -0,0 +1,61 @@ +# enable trusted X11 forwarding by default in both sshd and sshsystem-wide +# configuration +# bnc#50836 (was suse #35836) + +diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +--- a/openssh-6.2p2/ssh_config ++++ b/openssh-6.2p2/ssh_config +@@ -12,19 +12,30 @@ + # Any configuration value is only changed the first time it is set. + # Thus, host-specific definitions should be at the beginning of the + # configuration file, and defaults at the end. + + # Site-wide defaults for some commonly used options. For a comprehensive + # list of available options, their meanings and defaults, please see the + # ssh_config(5) man page. + +-# Host * ++Host * + # ForwardAgent no + # ForwardX11 no ++ ++# If you do not trust your remote host (or its administrator), you ++# should not forward X11 connections to your local X11-display for ++# security reasons: Someone stealing the authentification data on the ++# remote side (the "spoofed" X-server by the remote sshd) can read your ++# keystrokes as you type, just like any other X11 client could do. ++# Set this to "no" here for global effect or in your own ~/.ssh/config ++# file if you want to have the remote X11 authentification data to ++# expire after two minutes after remote login. ++ForwardX11Trusted yes ++ + # RhostsRSAAuthentication no + # RSAAuthentication yes + # PasswordAuthentication yes + # HostbasedAuthentication no + # GSSAPIAuthentication no + # GSSAPIDelegateCredentials no + # BatchMode no + # CheckHostIP yes +diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config +--- a/openssh-6.2p2/sshd_config ++++ b/openssh-6.2p2/sshd_config +@@ -90,17 +90,17 @@ AuthorizedKeysFile .ssh/authorized_keys + # If you just want the PAM account and session checks to run without + # PAM authentication, then enable this but set PasswordAuthentication + # and ChallengeResponseAuthentication to 'no'. + #UsePAM no + + #AllowAgentForwarding yes + #AllowTcpForwarding yes + #GatewayPorts no +-#X11Forwarding no ++X11Forwarding yes + #X11DisplayOffset 10 + #X11UseLocalhost yes + #PrintMotd yes + #PrintLastLog yes + #TCPKeepAlive yes + #UseLogin no + UsePrivilegeSeparation sandbox # Default for new installations. + #PermitUserEnvironment no diff --git a/openssh-6.2p2-audit1-remove_duplicit_audit.patch b/openssh-6.2p2-audit1-remove_duplicit_audit.patch new file mode 100644 index 0000000..72398cf --- /dev/null +++ b/openssh-6.2p2-audit1-remove_duplicit_audit.patch @@ -0,0 +1,33 @@ +# Don't audit SSH_INVALID_USER twice. +# PRIVSEP(getpwnamallow()) a few lines above already did this. +# +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2010 +# by jchadima@redhat.com +# +# PRIVSEP(getpwnamallow()) a few lines above already did this. + +diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c +--- a/openssh-6.2p2/auth2.c ++++ b/openssh-6.2p2/auth2.c +@@ -239,19 +239,16 @@ input_userauth_request(int type, u_int32 + authctxt->pw = PRIVSEP(getpwnamallow(user)); + authctxt->user = xstrdup(user); + if (authctxt->pw && strcmp(service, "ssh-connection")==0) { + authctxt->valid = 1; + debug2("input_userauth_request: setting up authctxt for %s", user); + } else { + logit("input_userauth_request: invalid user %s", user); + authctxt->pw = fakepw(); +-#ifdef SSH_AUDIT_EVENTS +- PRIVSEP(audit_event(SSH_INVALID_USER)); +-#endif + } + #ifdef USE_PAM + if (options.use_pam) + PRIVSEP(start_pam(authctxt)); + #endif + setproctitle("%s%s", authctxt->valid ? user : "unknown", + use_privsep ? " [net]" : ""); + authctxt->service = xstrdup(service); diff --git a/openssh-6.2p2-audit2-better_audit_of_user_actions.patch b/openssh-6.2p2-audit2-better_audit_of_user_actions.patch new file mode 100644 index 0000000..27d6798 --- /dev/null +++ b/openssh-6.2p2-audit2-better_audit_of_user_actions.patch @@ -0,0 +1,868 @@ +# extended auditing of user actions +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2011 +# by jchadima@redhat.com + +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -370,20 +370,33 @@ audit_connection_from(const char *host, + /* this is used on IPv4-only machines */ + tid->port = (dev_t)port; + tid->machine = inet_addr(host); + snprintf(buf, sizeof(buf), "%08x", tid->machine); + debug3("BSM audit: machine ID %s", buf); + #endif + } + +-void ++int + audit_run_command(const char *command) + { + /* not implemented */ ++ return 0; ++} ++ ++void ++audit_end_command(int handle, const char *command) ++{ ++ /* not implemented */ ++} ++ ++void ++audit_count_session_open(void) ++{ ++ /* not necessary */ + } + + void + audit_session_open(struct logininfo *li) + { + /* not implemented */ + } + +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -30,97 +30,210 @@ + #include "includes.h" + #if defined(USE_LINUX_AUDIT) + #include + #include + #include + + #include "log.h" + #include "audit.h" ++#include "key.h" ++#include "hostfile.h" ++#include "auth.h" ++#include "servconf.h" + #include "canohost.h" + ++extern ServerOptions options; ++extern Authctxt *the_authctxt; ++extern u_int utmp_len; + const char* audit_username(void); + +-int +-linux_audit_record_event(int uid, const char *username, +- const char *hostname, const char *ip, const char *ttyn, int success) ++static void ++linux_audit_user_logxxx(int uid, const char *username, ++ const char *hostname, const char *ip, const char *ttyn, int success, int event) + { + int audit_fd, rc, saved_errno; + + audit_fd = audit_open(); + if (audit_fd < 0) { + if (errno == EINVAL || errno == EPROTONOSUPPORT || + errno == EAFNOSUPPORT) +- return 1; /* No audit support in kernel */ ++ return; /* No audit support in kernel */ + else +- return 0; /* Must prevent login */ ++ goto fatal_report; /* Must prevent login */ + } +- rc = audit_log_acct_message(audit_fd, AUDIT_USER_LOGIN, ++ rc = audit_log_acct_message(audit_fd, event, + NULL, "login", username ? username : "(unknown)", + username == NULL ? uid : -1, hostname, ip, ttyn, success); + saved_errno = errno; + close(audit_fd); + /* + * Do not report error if the error is EPERM and sshd is run as non + * root user. + */ + if ((rc == -EPERM) && (geteuid() != 0)) + rc = 0; + errno = saved_errno; +- return (rc >= 0); ++ if (rc < 0) { ++fatal_report: ++ fatal("linux_audit_write_entry failed: %s", strerror(errno)); ++ } + } + ++static void ++linux_audit_user_auth(int uid, const char *username, ++ const char *hostname, const char *ip, const char *ttyn, int success, int event) ++{ ++ int audit_fd, rc, saved_errno; ++ static const char *event_name[] = { ++ "maxtries exceeded", ++ "root denied", ++ "success", ++ "none", ++ "password", ++ "challenge-response", ++ "pubkey", ++ "hostbased", ++ "gssapi", ++ "invalid user", ++ "nologin", ++ "connection closed", ++ "connection abandoned", ++ "unknown" ++ }; ++ ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno == EINVAL || errno == EPROTONOSUPPORT || ++ errno == EAFNOSUPPORT) ++ return; /* No audit support in kernel */ ++ else ++ goto fatal_report; /* Must prevent login */ ++ } ++ ++ if ((event < 0) || (event > SSH_AUDIT_UNKNOWN)) ++ event = SSH_AUDIT_UNKNOWN; ++ ++ rc = audit_log_acct_message(audit_fd, AUDIT_USER_AUTH, ++ NULL, event_name[event], username ? username : "(unknown)", ++ username == NULL ? uid : -1, hostname, ip, ttyn, success); ++ saved_errno = errno; ++ close(audit_fd); ++ /* ++ * Do not report error if the error is EPERM and sshd is run as non ++ * root user. ++ */ ++ if ((rc == -EPERM) && (geteuid() != 0)) ++ rc = 0; ++ errno = saved_errno; ++ if (rc < 0) { ++fatal_report: ++ fatal("linux_audit_write_entry failed: %s", strerror(errno)); ++ } ++} ++ ++static int user_login_count = 0; ++ + /* Below is the sshd audit API code */ + + void + audit_connection_from(const char *host, int port) + { ++ /* not implemented */ + } +- /* not implemented */ ++ ++int ++audit_run_command(const char *command) ++{ ++ if (!user_login_count++) ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_LOGIN); ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_START); ++ return 0; ++} + + void +-audit_run_command(const char *command) ++audit_end_command(int handle, const char *command) + { +- /* not implemented */ ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_END); ++ if (user_login_count && !--user_login_count) ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_LOGOUT); ++} ++ ++void ++audit_count_session_open(void) ++{ ++ user_login_count++; + } + + void + audit_session_open(struct logininfo *li) + { +- if (linux_audit_record_event(li->uid, NULL, li->hostname, +- NULL, li->line, 1) == 0) +- fatal("linux_audit_write_entry failed: %s", strerror(errno)); ++ if (!user_login_count++) ++ linux_audit_user_logxxx(li->uid, NULL, li->hostname, ++ NULL, li->line, 1, AUDIT_USER_LOGIN); ++ linux_audit_user_logxxx(li->uid, NULL, li->hostname, ++ NULL, li->line, 1, AUDIT_USER_START); + } + + void + audit_session_close(struct logininfo *li) + { +- /* not implemented */ ++ linux_audit_user_logxxx(li->uid, NULL, li->hostname, ++ NULL, li->line, 1, AUDIT_USER_END); ++ if (user_login_count && !--user_login_count) ++ linux_audit_user_logxxx(li->uid, NULL, li->hostname, ++ NULL, li->line, 1, AUDIT_USER_LOGOUT); + } + + void + audit_event(ssh_audit_event_t event) + { + switch(event) { + case SSH_AUTH_SUCCESS: +- case SSH_CONNECTION_CLOSE: +- case SSH_NOLOGIN: +- case SSH_LOGIN_EXCEED_MAXTRIES: +- case SSH_LOGIN_ROOT_DENIED: ++ linux_audit_user_auth(-1, audit_username(), NULL, ++ get_remote_ipaddr(), "ssh", 1, event); + break; + ++ case SSH_NOLOGIN: ++ case SSH_LOGIN_ROOT_DENIED: ++ linux_audit_user_auth(-1, audit_username(), NULL, ++ get_remote_ipaddr(), "ssh", 0, event); ++ linux_audit_user_logxxx(-1, audit_username(), NULL, ++ get_remote_ipaddr(), "ssh", 0, AUDIT_USER_LOGIN); ++ break; ++ ++ case SSH_LOGIN_EXCEED_MAXTRIES: + case SSH_AUTH_FAIL_NONE: + case SSH_AUTH_FAIL_PASSWD: + case SSH_AUTH_FAIL_KBDINT: + case SSH_AUTH_FAIL_PUBKEY: + case SSH_AUTH_FAIL_HOSTBASED: + case SSH_AUTH_FAIL_GSSAPI: ++ linux_audit_user_auth(-1, audit_username(), NULL, ++ get_remote_ipaddr(), "ssh", 0, event); ++ break; ++ ++ case SSH_CONNECTION_CLOSE: ++ if (user_login_count) { ++ while (user_login_count--) ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_END); ++ linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns), ++ NULL, "ssh", 1, AUDIT_USER_LOGOUT); ++ } ++ break; ++ ++ case SSH_CONNECTION_ABANDON: + case SSH_INVALID_USER: +- linux_audit_record_event(-1, audit_username(), NULL, +- get_remote_ipaddr(), "sshd", 0); ++ linux_audit_user_logxxx(-1, audit_username(), NULL, ++ get_remote_ipaddr(), "ssh", 0, AUDIT_USER_LOGIN); + break; + + default: + debug("%s: unhandled event %d", __func__, event); + } + } + + #endif /* USE_LINUX_AUDIT */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -135,16 +135,27 @@ audit_connection_from(const char *host, + void + audit_event(ssh_audit_event_t event) + { + debug("audit event euid %d user %s event %d (%s)", geteuid(), + audit_username(), event, audit_event_lookup(event)); + } + + /* ++ * Called when a child process has called, or will soon call, ++ * audit_session_open. ++ */ ++void ++audit_count_session_open(void) ++{ ++ debug("audit count session open euid %d user %s", geteuid(), ++ audit_username()); ++} ++ ++/* + * Called when a user session is started. Argument is the tty allocated to + * the session, or NULL if no tty was allocated. + * + * Note that this may be called multiple times if multiple sessions are used + * within a single connection. + */ + void + audit_session_open(struct logininfo *li) +@@ -169,18 +180,34 @@ audit_session_close(struct logininfo *li + + debug("audit session close euid %d user %s tty name %s", geteuid(), + audit_username(), t); + } + + /* + * This will be called when a user runs a non-interactive command. Note that + * it may be called multiple times for a single connection since SSH2 allows +- * multiple sessions within a single connection. ++ * multiple sessions within a single connection. Returns a "handle" for ++ * audit_end_command. + */ +-void ++int + audit_run_command(const char *command) + { + debug("audit run command euid %d user %s command '%.200s'", geteuid(), + audit_username(), command); ++ return 0; + } ++ ++/* ++ * This will be called when the non-interactive command finishes. Note that ++ * it may be called multiple times for a single connection since SSH2 allows ++ * multiple sessions within a single connection. "handle" should come from ++ * the corresponding audit_run_command. ++ */ ++void ++audit_end_command(int handle, const char *command) ++{ ++ debug("audit end nopty exec euid %d user %s command '%.200s'", geteuid(), ++ audit_username(), command); ++} ++ + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -44,14 +44,16 @@ enum ssh_audit_event_type { + SSH_CONNECTION_CLOSE, /* closed after attempting auth or session */ + SSH_CONNECTION_ABANDON, /* closed without completing auth */ + SSH_AUDIT_UNKNOWN + }; + typedef enum ssh_audit_event_type ssh_audit_event_t; + + void audit_connection_from(const char *, int); + void audit_event(ssh_audit_event_t); ++void audit_count_session_open(void); + void audit_session_open(struct logininfo *); + void audit_session_close(struct logininfo *); +-void audit_run_command(const char *); ++int audit_run_command(const char *); ++void audit_end_command(int, const char *); + ssh_audit_event_t audit_classify_auth(const char *); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -180,16 +180,17 @@ int mm_answer_gss_setup_ctx(int, Buffer + int mm_answer_gss_accept_ctx(int, Buffer *); + int mm_answer_gss_userok(int, Buffer *); + int mm_answer_gss_checkmic(int, Buffer *); + #endif + + #ifdef SSH_AUDIT_EVENTS + int mm_answer_audit_event(int, Buffer *); + int mm_answer_audit_command(int, Buffer *); ++int mm_answer_audit_end_command(int, Buffer *); + #endif + + static int monitor_read_log(struct monitor *); + + static Authctxt *authctxt; + static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ + + /* local state for key verify */ +@@ -267,16 +268,17 @@ struct mon_table mon_dispatch_postauth20 + {MONITOR_REQ_MODULI, 0, mm_answer_moduli}, + {MONITOR_REQ_SIGN, 0, mm_answer_sign}, + {MONITOR_REQ_PTY, 0, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, ++ {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_proto15[] = { + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, + {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, +@@ -309,16 +311,17 @@ struct mon_table mon_dispatch_proto15[] + + struct mon_table mon_dispatch_postauth15[] = { + {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, MON_ONCE, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, ++ {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + #endif + {0, 0, NULL} + }; + + struct mon_table *mon_dispatch; + + /* Specifies if a certain message is allowed at the moment */ + +@@ -1427,16 +1430,22 @@ mm_record_login(Session *s, struct passw + static void + mm_session_close(Session *s) + { + debug3("%s: session %d pid %ld", __func__, s->self, (long)s->pid); + if (s->ttyfd != -1) { + debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); + session_pty_cleanup2(s); + } ++#ifdef SSH_AUDIT_EVENTS ++ if (s->command != NULL) { ++ debug3("%s: command %d", __func__, s->command_handle); ++ session_end_command2(s); ++ } ++#endif + session_unused(s->self); + } + + int + mm_answer_pty(int sock, Buffer *m) + { + extern struct monitor *pmonitor; + Session *s; +@@ -1749,21 +1758,54 @@ mm_answer_audit_event(int socket, Buffer + return (0); + } + + int + mm_answer_audit_command(int socket, Buffer *m) + { + u_int len; + char *cmd; ++ Session *s; + + debug3("%s entering", __func__); + cmd = buffer_get_string(m, &len); ++ + /* sanity check command, if so how? */ +- audit_run_command(cmd); ++ s = session_new(); ++ if (s == NULL) ++ fatal("%s: error allocating a session", __func__); ++ s->command = cmd; ++ s->command_handle = audit_run_command(cmd); ++ ++ buffer_clear(m); ++ buffer_put_int(m, s->self); ++ ++ mm_request_send(socket, MONITOR_ANS_AUDIT_COMMAND, m); ++ ++ return (0); ++} ++ ++int ++mm_answer_audit_end_command(int socket, Buffer *m) ++{ ++ int handle; ++ u_int len; ++ char *cmd; ++ Session *s; ++ ++ debug3("%s entering", __func__); ++ handle = buffer_get_int(m); ++ cmd = buffer_get_string(m, &len); ++ ++ s = session_by_id(handle); ++ if (s == NULL || s->ttyfd != -1 || s->command == NULL || ++ strcmp(s->command, cmd) != 0) ++ fatal("%s: invalid handle", __func__); ++ mm_session_close(s); ++ + xfree(cmd); + return (0); + } + #endif /* SSH_AUDIT_EVENTS */ + + void + monitor_apply_keystate(struct monitor *pmonitor) + { +diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h +--- a/openssh-6.2p2/monitor.h ++++ b/openssh-6.2p2/monitor.h +@@ -64,16 +64,17 @@ enum monitor_reqtype { + + MONITOR_REQ_PAM_START = 100, + MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, + MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105, + MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, + MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, + MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, + MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, ++ MONITOR_ANS_AUDIT_COMMAND = 114, MONITOR_REQ_AUDIT_END_COMMAND = 115, + + }; + + struct mm_master; + struct monitor { + int m_recvfd; + int m_sendfd; + int m_log_recvfd; +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -1184,27 +1184,48 @@ mm_audit_event(ssh_audit_event_t event) + + buffer_init(&m); + buffer_put_int(&m, event); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_EVENT, &m); + buffer_free(&m); + } + +-void ++int + mm_audit_run_command(const char *command) + { + Buffer m; ++ int handle; + + debug3("%s entering command %s", __func__, command); + + buffer_init(&m); + buffer_put_cstring(&m, command); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_COMMAND, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_COMMAND, &m); ++ ++ handle = buffer_get_int(&m); ++ buffer_free(&m); ++ ++ return (handle); ++} ++ ++void ++mm_audit_end_command(int handle, const char *command) ++{ ++ Buffer m; ++ ++ debug3("%s entering command %s", __func__, command); ++ ++ buffer_init(&m); ++ buffer_put_int(&m, handle); ++ buffer_put_cstring(&m, command); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_END_COMMAND, &m); + buffer_free(&m); + } + #endif /* SSH_AUDIT_EVENTS */ + + #ifdef GSSAPI + OM_uint32 + mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID goid) + { +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -69,17 +69,18 @@ void *mm_sshpam_init_ctx(struct Authctxt + int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); + int mm_sshpam_respond(void *, u_int, char **); + void mm_sshpam_free_ctx(void *); + #endif + + #ifdef SSH_AUDIT_EVENTS + #include "audit.h" + void mm_audit_event(ssh_audit_event_t); +-void mm_audit_run_command(const char *); ++int mm_audit_run_command(const char *); ++void mm_audit_end_command(int, const char *); + #endif + + struct Session; + void mm_terminate(void); + int mm_pty_allocate(int *, int *, char *, size_t); + void mm_session_pty_cleanup2(struct Session *); + + /* SSHv1 interfaces */ +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -740,16 +740,24 @@ do_exec_pty(Session *s, const char *comm + cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); + #endif + + s->pid = pid; + + /* Parent. Close the slave side of the pseudo tty. */ + close(ttyfd); + ++#ifndef HAVE_OSF_SIA ++ /* do_login in the child did not affect state in this process, ++ compensate. From an architectural standpoint, this is extremely ++ ugly. */ ++ if (!(options.use_login && command == NULL)) ++ audit_count_session_open(); ++#endif ++ + /* Enter interactive session. */ + s->ptymaster = ptymaster; + packet_set_interactive(1, + options.ip_qos_interactive, options.ip_qos_bulk); + if (compat20) { + session_set_fds(s, ptyfd, fdout, -1, 1, 1); + } else { + server_loop(pid, ptyfd, fdout, -1); +@@ -811,25 +819,29 @@ do_exec(Session *s, const char *command) + s->is_subsystem = s->is_subsystem ? + SUBSYSTEM_INT_SFTP : SUBSYSTEM_INT_SFTP_ERROR; + } else if (s->is_subsystem) + s->is_subsystem = SUBSYSTEM_EXT; + debug("Forced command (key option) '%.900s'", command); + } + + #ifdef SSH_AUDIT_EVENTS ++ if (s->command != NULL || s->command_handle != -1) ++ fatal("do_exec: command already set"); + if (command != NULL) +- PRIVSEP(audit_run_command(command)); ++ s->command = xstrdup(command); + else if (s->ttyfd == -1) { + char *shell = s->pw->pw_shell; + + if (shell[0] == '\0') /* empty shell means /bin/sh */ + shell =_PATH_BSHELL; +- PRIVSEP(audit_run_command(shell)); ++ s->command = xstrdup(shell); + } ++ if (s->command != NULL) ++ s->command_handle = PRIVSEP(audit_run_command(s->command)); + #endif + if (s->ttyfd != -1) + ret = do_exec_pty(s, command); + else + ret = do_exec_no_pty(s, command); + + original_command = NULL; + +@@ -1862,16 +1874,17 @@ session_unused(int id) + bzero(&sessions[id], sizeof(*sessions)); + sessions[id].self = id; + sessions[id].used = 0; + sessions[id].chanid = -1; + sessions[id].ptyfd = -1; + sessions[id].ttyfd = -1; + sessions[id].ptymaster = -1; + sessions[id].x11_chanids = NULL; ++ sessions[id].command_handle = -1; + sessions[id].next_unused = sessions_first_unused; + sessions_first_unused = id; + } + + Session * + session_new(void) + { + Session *s, *tmp; +@@ -1944,16 +1957,29 @@ session_open(Authctxt *authctxt, int cha + if (s->pw == NULL || !authctxt->valid) + fatal("no user for session %d", s->self); + debug("session_open: session %d: link with channel %d", s->self, chanid); + s->chanid = chanid; + return 1; + } + + Session * ++session_by_id(int id) ++{ ++ if (id >= 0 && id < sessions_nalloc) { ++ Session *s = &sessions[id]; ++ if (s->used) ++ return s; ++ } ++ debug("session_by_id: unknown id %d", id); ++ session_dump(); ++ return NULL; ++} ++ ++Session * + session_by_tty(char *tty) + { + int i; + for (i = 0; i < sessions_nalloc; i++) { + Session *s = &sessions[i]; + if (s->used && s->ttyfd != -1 && strcmp(s->tty, tty) == 0) { + debug("session_by_tty: session %d tty %s", i, tty); + return s; +@@ -2469,16 +2495,40 @@ session_exit_message(Session *s, int sta + * interested in data we write. + * Note that we must not call 'chan_read_failed', since there could + * be some more data waiting in the pipe. + */ + if (c->ostate != CHAN_OUTPUT_CLOSED) + chan_write_failed(c); + } + ++#ifdef SSH_AUDIT_EVENTS ++void ++session_end_command2(Session *s) ++{ ++ if (s->command != NULL) { ++ audit_end_command(s->command_handle, s->command); ++ xfree(s->command); ++ s->command = NULL; ++ s->command_handle = -1; ++ } ++} ++ ++static void ++session_end_command(Session *s) ++{ ++ if (s->command != NULL) { ++ PRIVSEP(audit_end_command(s->command_handle, s->command)); ++ xfree(s->command); ++ s->command = NULL; ++ s->command_handle = -1; ++ } ++} ++#endif ++ + void + session_close(Session *s) + { + u_int i; + int do_xauth; + + debug("session_close: session %d pid %ld", s->self, (long)s->pid); + +@@ -2509,16 +2559,20 @@ session_close(Session *s) + int status; + + waitpid(pid, &status, 0); + } + } + + if (s->ttyfd != -1) + session_pty_cleanup(s); ++#ifdef SSH_AUDIT_EVENTS ++ if (s->command) ++ session_end_command(s); ++#endif + if (s->term) + xfree(s->term); + if (s->display) + xfree(s->display); + if (s->x11_chanids) + xfree(s->x11_chanids); + if (s->auth_display) + xfree(s->auth_display); +@@ -2728,16 +2782,25 @@ session_setup_x11fwd(Session *s) + } + + static void + do_authenticated2(Authctxt *authctxt) + { + server_loop2(authctxt); + } + ++static void ++do_cleanup_one_session(Session *s) ++{ ++ session_pty_cleanup2(s); ++#ifdef SSH_AUDIT_EVENTS ++ session_end_command2(s); ++#endif ++} ++ + void + do_cleanup(Authctxt *authctxt) + { + static int called = 0; + + debug("do_cleanup"); + + /* no cleanup if we're in the child for login shell */ +@@ -2776,10 +2839,10 @@ do_cleanup(Authctxt *authctxt) + /* remove agent socket */ + auth_sock_cleanup_proc(authctxt->pw); + + /* + * Cleanup ptys/utmp only if privsep is disabled, + * or if running in monitor. + */ + if (!use_privsep || mm_is_monitor()) +- session_destroy_all(session_pty_cleanup2); ++ session_destroy_all(do_cleanup_one_session); + } +diff --git a/openssh-6.2p2/session.h b/openssh-6.2p2/session.h +--- a/openssh-6.2p2/session.h ++++ b/openssh-6.2p2/session.h +@@ -55,29 +55,37 @@ struct Session { + int chanid; + int *x11_chanids; + int is_subsystem; + u_int num_env; + struct { + char *name; + char *val; + } *env; ++ ++ /* exec */ ++#ifdef SSH_AUDIT_EVENTS ++ int command_handle; ++ char *command; ++#endif + }; + + void do_authenticated(Authctxt *); + void do_cleanup(Authctxt *); + + int session_open(Authctxt *, int); + void session_unused(int); + int session_input_channel_req(Channel *, const char *); + void session_close_by_pid(pid_t, int); + void session_close_by_channel(int, void *); + void session_destroy_all(void (*)(Session *)); + void session_pty_cleanup2(Session *); ++void session_end_command2(Session *); + + Session *session_new(void); ++Session *session_by_id(int); + Session *session_by_tty(char *); + void session_close(Session *); + void do_setusercontext(struct passwd *); + void child_set_env(char ***envp, u_int *envsizep, const char *name, + const char *value); + + #endif +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -2404,13 +2404,14 @@ cleanup_exit(int i) + if (kill(pmonitor->m_pid, SIGKILL) != 0 && + errno != ESRCH) + error("%s: kill(%d): %s", __func__, + pmonitor->m_pid, strerror(errno)); + } + } + #ifdef SSH_AUDIT_EVENTS + /* done after do_cleanup so it can cancel the PAM auth 'thread' */ +- if (!use_privsep || mm_is_monitor()) ++ if ((the_authctxt == NULL || !the_authctxt->authenticated) && ++ (!use_privsep || mm_is_monitor())) + audit_event(SSH_CONNECTION_ABANDON); + #endif + _exit(i); + } diff --git a/openssh-6.2p2-audit3-key_auth_usage.patch b/openssh-6.2p2-audit3-key_auth_usage.patch new file mode 100644 index 0000000..5aae675 --- /dev/null +++ b/openssh-6.2p2-audit3-key_auth_usage.patch @@ -0,0 +1,563 @@ +# auditing key-based authentication (both server and client) +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2012 +# (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1975) +# by jchadima@redhat.com + +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -401,16 +401,22 @@ audit_session_open(struct logininfo *li) + } + + void + audit_session_close(struct logininfo *li) + { + /* not implemented */ + } + ++int ++audit_keyusage(int host_user, const char *type, unsigned bits, char *fp, int rv) ++{ ++ /* not implemented */ ++} ++ + void + audit_event(ssh_audit_event_t event) + { + char textbuf[BSM_TEXTBUFSZ]; + static int logged_in = 0; + const char *user = the_authctxt ? the_authctxt->user : "(unknown user)"; + + if (cannot_audit(0)) +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -36,16 +36,18 @@ + #include "log.h" + #include "audit.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" + #include "servconf.h" + #include "canohost.h" + ++#define AUDIT_LOG_SIZE 128 ++ + extern ServerOptions options; + extern Authctxt *the_authctxt; + extern u_int utmp_len; + const char* audit_username(void); + + static void + linux_audit_user_logxxx(int uid, const char *username, + const char *hostname, const char *ip, const char *ttyn, int success, int event) +@@ -125,16 +127,47 @@ linux_audit_user_auth(int uid, const cha + rc = 0; + errno = saved_errno; + if (rc < 0) { + fatal_report: + fatal("linux_audit_write_entry failed: %s", strerror(errno)); + } + } + ++int ++audit_keyusage(int host_user, const char *type, unsigned bits, char *fp, int rv) ++{ ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, rc, saved_errno; ++ ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno == EINVAL || errno == EPROTONOSUPPORT || ++ errno == EAFNOSUPPORT) ++ return 1; /* No audit support in kernel */ ++ else ++ return 0; /* Must prevent login */ ++ } ++ snprintf(buf, sizeof(buf), "%s_auth rport=%d", host_user ? "pubkey" : "hostbased", get_remote_port()); ++ rc = audit_log_acct_message(audit_fd, AUDIT_USER_AUTH, NULL, ++ buf, audit_username(), -1, NULL, get_remote_ipaddr(), NULL, rv); ++ if ((rc < 0) && ((rc != -1) || (getuid() == 0))) ++ goto out; ++ snprintf(buf, sizeof(buf), "key algo=%s size=%d fp=%s rport=%d", ++ type, bits, fp, get_remote_port()); ++ rc = audit_log_acct_message(audit_fd, AUDIT_USER_AUTH, NULL, ++ buf, audit_username(), -1, NULL, get_remote_ipaddr(), NULL, rv); ++out: ++ saved_errno = errno; ++ audit_close(audit_fd); ++ errno = saved_errno; ++ /* do not report error if the error is EPERM and sshd is run as non root user */ ++ return (rc >= 0) || ((rc == -EPERM) && (getuid() != 0)); ++} ++ + static int user_login_count = 0; + + /* Below is the sshd audit API code */ + + void + audit_connection_from(const char *host, int port) + { + /* not implemented */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -31,16 +31,17 @@ + + #ifdef SSH_AUDIT_EVENTS + + #include "audit.h" + #include "log.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" ++#include "xmalloc.h" + + /* + * Care must be taken when using this since it WILL NOT be initialized when + * audit_connection_from() is called and MAY NOT be initialized when + * audit_event(CONNECTION_ABANDON) is called. Test for NULL before using. + */ + extern Authctxt *the_authctxt; + +@@ -106,16 +107,32 @@ audit_event_lookup(ssh_audit_event_t ev) + }; + + for (i = 0; event_lookup[i].event != SSH_AUDIT_UNKNOWN; i++) + if (event_lookup[i].event == ev) + break; + return(event_lookup[i].name); + } + ++void ++audit_key(int host_user, int *rv, const Key *key) ++{ ++ char *fp; ++ const char *crypto_name; ++ ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); ++ if (key->type == KEY_RSA1) ++ crypto_name = "ssh-rsa1"; ++ else ++ crypto_name = key_ssh_name(key); ++ if (audit_keyusage(host_user, crypto_name, key_size(key), fp, *rv) == 0) ++ *rv = 0; ++ xfree(fp); ++} ++ + # ifndef CUSTOM_SSH_AUDIT_EVENTS + /* + * Null implementations of audit functions. + * These get used if SSH_AUDIT_EVENTS is defined but no audit module is enabled. + */ + + /* + * Called after a connection has been accepted but before any authentication +@@ -204,10 +221,22 @@ audit_run_command(const char *command) + */ + void + audit_end_command(int handle, const char *command) + { + debug("audit end nopty exec euid %d user %s command '%.200s'", geteuid(), + audit_username(), command); + } + ++/* ++ * This will be called when user is successfully autherized by the RSA1/RSA/DSA key. ++ * ++ * Type is the key type, len is the key length(byte) and fp is the fingerprint of the key. ++ */ ++int ++audit_keyusage(int host_user, const char *type, unsigned bits, char *fp, int rv) ++{ ++ debug("audit %s key usage euid %d user %s key type %s key length %d fingerprint %s, result %d", ++ host_user ? "pubkey" : "hostbased", geteuid(), audit_username(), type, bits, ++ fp, rv); ++} + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -23,16 +23,17 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + #ifndef _SSH_AUDIT_H + # define _SSH_AUDIT_H + + #include "loginrec.h" ++#include "key.h" + + enum ssh_audit_event_type { + SSH_LOGIN_EXCEED_MAXTRIES, + SSH_LOGIN_ROOT_DENIED, + SSH_AUTH_SUCCESS, + SSH_AUTH_FAIL_NONE, + SSH_AUTH_FAIL_PASSWD, + SSH_AUTH_FAIL_KBDINT, /* keyboard-interactive or challenge-response */ +@@ -50,10 +51,12 @@ typedef enum ssh_audit_event_type ssh_au + void audit_connection_from(const char *, int); + void audit_event(ssh_audit_event_t); + void audit_count_session_open(void); + void audit_session_open(struct logininfo *); + void audit_session_close(struct logininfo *); + int audit_run_command(const char *); + void audit_end_command(int, const char *); + ssh_audit_event_t audit_classify_auth(const char *); ++int audit_keyusage(int, const char *, unsigned, char *, int); ++void audit_key(int, int *, const Key *); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c +--- a/openssh-6.2p2/auth-rsa.c ++++ b/openssh-6.2p2/auth-rsa.c +@@ -87,17 +87,20 @@ auth_rsa_generate_challenge(Key *key) + return challenge; + } + + int + auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16]) + { + u_char buf[32], mdbuf[16]; + MD5_CTX md; +- int len; ++ int len, rv; ++#ifdef SSH_AUDIT_EVENTS ++ char *fp; ++#endif + + /* don't allow short keys */ + if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { + error("auth_rsa_verify_response: RSA modulus too small: %d < minimum %d bits", + BN_num_bits(key->rsa->n), SSH_RSA_MINIMUM_MODULUS_SIZE); + return (0); + } + +@@ -108,22 +111,28 @@ auth_rsa_verify_response(Key *key, BIGNU + memset(buf, 0, 32); + BN_bn2bin(challenge, buf + 32 - len); + MD5_Init(&md); + MD5_Update(&md, buf, 32); + MD5_Update(&md, session_id, 16); + MD5_Final(mdbuf, &md); + + /* Verify that the response is the original challenge. */ +- if (timingsafe_bcmp(response, mdbuf, 16) != 0) { +- /* Wrong answer. */ +- return (0); ++ rv = timingsafe_bcmp(response, mdbuf, 16) == 0; ++ ++#ifdef SSH_AUDIT_EVENTS ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); ++ if (audit_keyusage(1, "ssh-rsa1", RSA_size(key->rsa) * 8, fp, rv) == 0) { ++ debug("unsuccessful audit"); ++ rv = 0; + } +- /* Correct answer. */ +- return (1); ++ xfree(fp); ++#endif ++ ++ return rv; + } + + /* + * Performs the RSA authentication challenge-response dialog with the client, + * and returns true (non-zero) if the client gave the correct answer to + * our challenge; returns zero if the client gives a wrong answer. + */ + +diff --git a/openssh-6.2p2/auth.h b/openssh-6.2p2/auth.h +--- a/openssh-6.2p2/auth.h ++++ b/openssh-6.2p2/auth.h +@@ -176,31 +176,33 @@ int allowed_user(struct passwd *); + struct passwd * getpwnamallow(const char *user); + + char *get_challenge(Authctxt *); + int verify_response(Authctxt *, const char *); + void abandon_challenge_response(Authctxt *); + + char *expand_authorized_keys(const char *, struct passwd *pw); + char *authorized_principals_file(struct passwd *); ++int user_key_verify(const Key *, const u_char *, u_int, const u_char *, u_int); + + FILE *auth_openkeyfile(const char *, struct passwd *, int); + FILE *auth_openprincipals(const char *, struct passwd *, int); + int auth_key_is_revoked(Key *); + + HostStatus + check_key_in_hostfiles(struct passwd *, Key *, const char *, + const char *, const char *); + + /* hostkey handling */ + Key *get_hostkey_by_index(int); + Key *get_hostkey_public_by_type(int); + Key *get_hostkey_private_by_type(int); + int get_hostkey_index(Key *); + int ssh1_session_key(BIGNUM *); ++int hostbased_key_verify(const Key *, const u_char *, u_int, const u_char *, u_int); + + /* debug messages during authentication */ + void auth_debug_add(const char *fmt,...) __attribute__((format(printf, 1, 2))); + void auth_debug_send(void); + void auth_debug_reset(void); + + struct passwd *fakepw(void); + +diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c +--- a/openssh-6.2p2/auth2-hostbased.c ++++ b/openssh-6.2p2/auth2-hostbased.c +@@ -114,33 +114,45 @@ userauth_hostbased(Authctxt *authctxt) + buffer_put_cstring(&b, chost); + buffer_put_cstring(&b, cuser); + #ifdef DEBUG_PK + buffer_dump(&b); + #endif + /* test for allowed key and correct signature */ + authenticated = 0; + if (PRIVSEP(hostbased_key_allowed(authctxt->pw, cuser, chost, key)) && +- PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), ++ PRIVSEP(hostbased_key_verify(key, sig, slen, buffer_ptr(&b), + buffer_len(&b))) == 1) + authenticated = 1; + + buffer_free(&b); + done: + debug2("userauth_hostbased: authenticated %d", authenticated); + if (key != NULL) + key_free(key); + xfree(pkalg); + xfree(pkblob); + xfree(cuser); + xfree(chost); + xfree(sig); + return authenticated; + } + ++int ++hostbased_key_verify(const Key *key, const u_char *sig, u_int slen, const u_char *data, u_int datalen) ++{ ++ int rv; ++ ++ rv = key_verify(key, sig, slen, data, datalen); ++#ifdef SSH_AUDIT_EVENTS ++ audit_key(0, &rv, key); ++#endif ++ return rv; ++} ++ + /* return 1 if given hostkey is allowed */ + int + hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, + Key *key) + { + const char *resolvedname, *ipaddr, *lookup, *reason; + HostStatus host_status; + int len; +diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c +--- a/openssh-6.2p2/auth2-pubkey.c ++++ b/openssh-6.2p2/auth2-pubkey.c +@@ -141,17 +141,17 @@ userauth_pubkey(Authctxt *authctxt) + } + buffer_put_string(&b, pkblob, blen); + #ifdef DEBUG_PK + buffer_dump(&b); + #endif + /* test for correct signature */ + authenticated = 0; + if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && +- PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), ++ PRIVSEP(user_key_verify(key, sig, slen, buffer_ptr(&b), + buffer_len(&b))) == 1) + authenticated = 1; + buffer_free(&b); + xfree(sig); + } else { + debug("test whether pkalg/pkblob are acceptable"); + packet_check_eom(); + +@@ -178,16 +178,28 @@ done: + debug2("userauth_pubkey: authenticated %d pkalg %s", authenticated, pkalg); + if (key != NULL) + key_free(key); + xfree(pkalg); + xfree(pkblob); + return authenticated; + } + ++int ++user_key_verify(const Key *key, const u_char *sig, u_int slen, const u_char *data, u_int datalen) ++{ ++ int rv; ++ ++ rv = key_verify(key, sig, slen, data, datalen); ++#ifdef SSH_AUDIT_EVENTS ++ audit_key(1, &rv, key); ++#endif ++ return rv; ++} ++ + static int + match_principals_option(const char *principal_list, struct KeyCert *cert) + { + char *result; + u_int i; + + /* XXX percent_expand() sequences for authorized_principals? */ + +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -1347,26 +1347,30 @@ monitor_valid_hostbasedblob(u_char *data + } + + int + mm_answer_keyverify(int sock, Buffer *m) + { + Key *key; + u_char *signature, *data, *blob; + u_int signaturelen, datalen, bloblen; ++ int type = 0; + int verified = 0; + int valid_data = 0; + ++ type = buffer_get_int(m); + blob = buffer_get_string(m, &bloblen); + signature = buffer_get_string(m, &signaturelen); + data = buffer_get_string(m, &datalen); + + if (hostbased_cuser == NULL || hostbased_chost == NULL || + !monitor_allowed_key(blob, bloblen)) + fatal("%s: bad key, not previously allowed", __func__); ++ if (type != key_blobtype) ++ fatal("%s: bad key type", __func__); + + key = key_from_blob(blob, bloblen); + if (key == NULL) + fatal("%s: bad public key blob", __func__); + + switch (key_blobtype) { + case MM_USERKEY: + valid_data = monitor_valid_userblob(data, datalen); +@@ -1377,17 +1381,27 @@ mm_answer_keyverify(int sock, Buffer *m) + break; + default: + valid_data = 0; + break; + } + if (!valid_data) + fatal("%s: bad signature data blob", __func__); + +- verified = key_verify(key, signature, signaturelen, data, datalen); ++ switch (key_blobtype) { ++ case MM_USERKEY: ++ verified = user_key_verify(key, signature, signaturelen, data, datalen); ++ break; ++ case MM_HOSTKEY: ++ verified = hostbased_key_verify(key, signature, signaturelen, data, datalen); ++ break; ++ default: ++ verified = 0; ++ break; ++ } + debug3("%s: key %p signature %s", + __func__, key, (verified == 1) ? "verified" : "unverified"); + + key_free(key); + xfree(blob); + xfree(signature); + xfree(data); + +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -426,30 +426,31 @@ mm_key_allowed(enum mm_keytype type, cha + + /* + * This key verify needs to send the key type along, because the + * privileged parent makes the decision if the key is allowed + * for authentication. + */ + + int +-mm_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) ++mm_key_verify(enum mm_keytype type, Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) + { + Buffer m; + u_char *blob; + u_int len; + int verified = 0; + + debug3("%s entering", __func__); + + /* Convert the key to a blob and the pass it over */ + if (!key_to_blob(key, &blob, &len)) + return (0); + + buffer_init(&m); ++ buffer_put_int(&m, type); + buffer_put_string(&m, blob, len); + buffer_put_string(&m, sig, siglen); + buffer_put_string(&m, data, datalen); + xfree(blob); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m); + + debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __func__); +@@ -457,16 +458,29 @@ mm_key_verify(Key *key, u_char *sig, u_i + + verified = buffer_get_int(&m); + + buffer_free(&m); + + return (verified); + } + ++int ++mm_hostbased_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) ++{ ++ return mm_key_verify(MM_HOSTKEY, key, sig, siglen, data, datalen); ++} ++ ++int ++mm_user_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen) ++{ ++ return mm_key_verify(MM_USERKEY, key, sig, siglen, data, datalen); ++} ++ ++ + /* Export key state after authentication */ + Newkeys * + mm_newkeys_from_blob(u_char *blob, int blen) + { + Buffer b; + u_int len; + Newkeys *newkey = NULL; + Enc *enc; +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -44,17 +44,18 @@ int mm_key_sign(Key *, u_char **, u_int + void mm_inform_authserv(char *, char *); + struct passwd *mm_getpwnamallow(const char *); + char *mm_auth2_read_banner(void); + int mm_auth_password(struct Authctxt *, char *); + int mm_key_allowed(enum mm_keytype, char *, char *, Key *); + int mm_user_key_allowed(struct passwd *, Key *); + int mm_hostbased_key_allowed(struct passwd *, char *, char *, Key *); + int mm_auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *); +-int mm_key_verify(Key *, u_char *, u_int, u_char *, u_int); ++int mm_hostbased_key_verify(Key *, u_char *, u_int, u_char *, u_int); ++int mm_user_key_verify(Key *, u_char *, u_int, u_char *, u_int); + int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); + int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); + BIGNUM *mm_auth_rsa_generate_challenge(Key *); + + #ifdef GSSAPI + OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID); + OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *, + gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *); diff --git a/openssh-6.2p2-audit4-kex_results.patch b/openssh-6.2p2-audit4-kex_results.patch new file mode 100644 index 0000000..172894b --- /dev/null +++ b/openssh-6.2p2-audit4-kex_results.patch @@ -0,0 +1,771 @@ +# key exhange auditing +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2013 +# (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1976) +# by jchadima@redhat.com + +diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in +--- a/openssh-6.2p2/Makefile.in ++++ b/openssh-6.2p2/Makefile.in +@@ -68,17 +68,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o + cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ + compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ + log.o match.o md-sha256.o moduli.o nchan.o packet.o \ + readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ + atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ + monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ + kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ + msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ +- jpake.o schnorr.o ssh-pkcs11.o krl.o ++ jpake.o schnorr.o ssh-pkcs11.o krl.o auditstub.o + + SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ + sshconnect.o sshconnect1.o sshconnect2.o mux.o \ + roaming_common.o roaming_client.o + + SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ + audit.o audit-bsm.o audit-linux.o platform.o \ + sshpty.o sshlogin.o servconf.o serverloop.o \ +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -468,9 +468,21 @@ audit_event(ssh_audit_event_t event) + case SSH_AUTH_FAIL_KBDINT: + bsm_audit_bad_login("interactive password entry"); + break; + + default: + debug("%s: unhandled event %d", __func__, event); + } + } ++ ++void ++audit_unsupported_body(int what) ++{ ++ /* not implemented */ ++} ++ ++void ++audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, uid_t uid) ++{ ++ /* not implemented */ ++} + #endif /* BSM */ +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -35,16 +35,18 @@ + + #include "log.h" + #include "audit.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" + #include "servconf.h" + #include "canohost.h" ++#include "packet.h" ++#include "cipher.h" + + #define AUDIT_LOG_SIZE 128 + + extern ServerOptions options; + extern Authctxt *the_authctxt; + extern u_int utmp_len; + const char* audit_username(void); + +@@ -264,9 +266,65 @@ audit_event(ssh_audit_event_t event) + get_remote_ipaddr(), "ssh", 0, AUDIT_USER_LOGIN); + break; + + default: + debug("%s: unhandled event %d", __func__, event); + } + } + ++void ++audit_unsupported_body(int what) ++{ ++#ifdef AUDIT_CRYPTO_SESSION ++ char buf[AUDIT_LOG_SIZE]; ++ const static char *name[] = { "cipher", "mac", "comp" }; ++ char *s; ++ int audit_fd; ++ ++ snprintf(buf, sizeof(buf), "op=unsupported-%s direction=? cipher=? ksize=? rport=%d laddr=%s lport=%d ", ++ name[what], get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), ++ get_local_port()); ++ xfree(s); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) ++ /* no problem, the next instruction will be fatal() */ ++ return; ++ audit_log_user_message(audit_fd, AUDIT_CRYPTO_SESSION, ++ buf, NULL, get_remote_ipaddr(), NULL, 0); ++ audit_close(audit_fd); ++#endif ++} ++ ++void ++audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, ++ uid_t uid) ++{ ++#ifdef AUDIT_CRYPTO_SESSION ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, audit_ok; ++ const static char *direction[] = { "from-server", "from-client", "both" }; ++ Cipher *cipher = cipher_by_name(enc); ++ char *s; ++ ++ snprintf(buf, sizeof(buf), "op=start direction=%s cipher=%s ksize=%d spid=%jd suid=%jd rport=%d laddr=%s lport=%d ", ++ direction[ctos], enc, cipher ? 8 * cipher->key_len : 0, ++ (intmax_t)pid, (intmax_t)uid, ++ get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), get_local_port()); ++ xfree(s); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno == EINVAL || errno == EPROTONOSUPPORT || ++ errno == EAFNOSUPPORT) ++ return; /* No audit support in kernel */ ++ else ++ fatal("cannot open audit"); /* Must prevent login */ ++ } ++ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_SESSION, ++ buf, NULL, get_remote_ipaddr(), NULL, 1); ++ audit_close(audit_fd); ++ /* do not abort if the error is EPERM and sshd is run as non root user */ ++ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) ++ fatal("cannot write into audit"); /* Must prevent login */ ++#endif ++} ++ + #endif /* USE_LINUX_AUDIT */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -23,24 +23,27 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + #include "includes.h" + + #include + #include ++#include + + #ifdef SSH_AUDIT_EVENTS + + #include "audit.h" + #include "log.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" ++#include "ssh-gss.h" ++#include "monitor_wrap.h" + #include "xmalloc.h" + + /* + * Care must be taken when using this since it WILL NOT be initialized when + * audit_connection_from() is called and MAY NOT be initialized when + * audit_event(CONNECTION_ABANDON) is called. Test for NULL before using. + */ + extern Authctxt *the_authctxt; +@@ -123,16 +126,28 @@ audit_key(int host_user, int *rv, const + crypto_name = "ssh-rsa1"; + else + crypto_name = key_ssh_name(key); + if (audit_keyusage(host_user, crypto_name, key_size(key), fp, *rv) == 0) + *rv = 0; + xfree(fp); + } + ++void ++audit_unsupported(int what) ++{ ++ PRIVSEP(audit_unsupported_body(what)); ++} ++ ++void ++audit_kex(int ctos, char *enc, char *mac, char *comp) ++{ ++ PRIVSEP(audit_kex_body(ctos, enc, mac, comp, getpid(), getuid())); ++} ++ + # ifndef CUSTOM_SSH_AUDIT_EVENTS + /* + * Null implementations of audit functions. + * These get used if SSH_AUDIT_EVENTS is defined but no audit module is enabled. + */ + + /* + * Called after a connection has been accepted but before any authentication +@@ -233,10 +248,31 @@ audit_end_command(int handle, const char + */ + int + audit_keyusage(int host_user, const char *type, unsigned bits, char *fp, int rv) + { + debug("audit %s key usage euid %d user %s key type %s key length %d fingerprint %s, result %d", + host_user ? "pubkey" : "hostbased", geteuid(), audit_username(), type, bits, + fp, rv); + } ++ ++/* ++ * This will be called when the protocol negotiation fails. ++ */ ++void ++audit_unsupported_body(int what) ++{ ++ debug("audit unsupported protocol euid %d type %d", geteuid(), what); ++} ++ ++/* ++ * This will be called on succesfull protocol negotiation. ++ */ ++void ++audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, ++ uid_t uid) ++{ ++ debug("audit protocol negotiation euid %d direction %d cipher %s mac %s compresion %s from pid %ld uid %u", ++ (unsigned)geteuid(), ctos, enc, mac, compress, (long)pid, ++ (unsigned)uid); ++} + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -53,10 +53,14 @@ void audit_event(ssh_audit_event_t); + void audit_count_session_open(void); + void audit_session_open(struct logininfo *); + void audit_session_close(struct logininfo *); + int audit_run_command(const char *); + void audit_end_command(int, const char *); + ssh_audit_event_t audit_classify_auth(const char *); + int audit_keyusage(int, const char *, unsigned, char *, int); + void audit_key(int, int *, const Key *); ++void audit_unsupported(int); ++void audit_kex(int, char *, char *, char *); ++void audit_unsupported_body(int); ++void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/auditstub.c b/openssh-6.2p2/auditstub.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/auditstub.c +@@ -0,0 +1,39 @@ ++/* $Id: auditstub.c,v 1.1 jfch Exp $ */ ++ ++/* ++ * Copyright 2010 Red Hat, Inc. All rights reserved. ++ * Use is subject to license terms. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * Red Hat author: Jan F. Chadima ++ */ ++ ++void ++audit_unsupported(int n) ++{ ++} ++ ++void ++audit_kex(int ctos, char *enc, char *mac, char *comp) ++{ ++} ++ +diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c +--- a/openssh-6.2p2/cipher.c ++++ b/openssh-6.2p2/cipher.c +@@ -50,27 +50,17 @@ + + /* compatibility with old or broken OpenSSL versions */ + #include "openbsd-compat/openssl-compat.h" + + extern const EVP_CIPHER *evp_ssh1_bf(void); + extern const EVP_CIPHER *evp_ssh1_3des(void); + extern void ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int); + +-struct Cipher { +- char *name; +- int number; /* for ssh1 only */ +- u_int block_size; +- u_int key_len; +- u_int iv_len; /* defaults to block_size */ +- u_int auth_len; +- u_int discard_len; +- u_int cbc_mode; +- const EVP_CIPHER *(*evptype)(void); +-} ciphers[] = { ++struct Cipher ciphers[] = { + { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null }, + { "des", SSH_CIPHER_DES, 8, 8, 0, 0, 0, 1, EVP_des_cbc }, + { "3des", SSH_CIPHER_3DES, 8, 16, 0, 0, 0, 1, evp_ssh1_3des }, + { "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, 0, 1, evp_ssh1_bf }, + + { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc }, + { "blowfish-cbc", + SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc }, +diff --git a/openssh-6.2p2/cipher.h b/openssh-6.2p2/cipher.h +--- a/openssh-6.2p2/cipher.h ++++ b/openssh-6.2p2/cipher.h +@@ -56,17 +56,28 @@ + #define SSH_CIPHER_MAX 31 + + #define CIPHER_ENCRYPT 1 + #define CIPHER_DECRYPT 0 + + typedef struct Cipher Cipher; + typedef struct CipherContext CipherContext; + +-struct Cipher; ++struct Cipher { ++ char *name; ++ int number; /* for ssh1 only */ ++ u_int block_size; ++ u_int key_len; ++ u_int iv_len; /* defaults to block_size */ ++ u_int auth_len; ++ u_int discard_len; ++ u_int cbc_mode; ++ const EVP_CIPHER *(*evptype)(void); ++}; ++ + struct CipherContext { + int plaintext; + int encrypt; + EVP_CIPHER_CTX evp; + Cipher *cipher; + }; + + u_int cipher_mask_ssh1(int); +diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c +--- a/openssh-6.2p2/kex.c ++++ b/openssh-6.2p2/kex.c +@@ -44,16 +44,17 @@ + #include "key.h" + #include "kex.h" + #include "log.h" + #include "mac.h" + #include "match.h" + #include "dispatch.h" + #include "monitor.h" + #include "roaming.h" ++#include "audit.h" + + #if OPENSSL_VERSION_NUMBER >= 0x00907000L + # if defined(HAVE_EVP_SHA256) + # define evp_ssh_sha256 EVP_sha256 + # else + extern const EVP_MD *evp_ssh_sha256(void); + # endif + #endif +@@ -291,53 +292,65 @@ kex_kexinit_finish(Kex *kex) + fatal("Unsupported key exchange %d", kex->kex_type); + } + } + + static void + choose_enc(Enc *enc, char *client, char *server) + { + char *name = match_list(client, server, NULL); +- if (name == NULL) ++ if (name == NULL) { ++#ifdef SSH_AUDIT_EVENTS ++ audit_unsupported(0); ++#endif + fatal("no matching cipher found: client %s server %s", + client, server); ++ } + if ((enc->cipher = cipher_by_name(name)) == NULL) + fatal("matching cipher is not supported: %s", name); + enc->name = name; + enc->enabled = 0; + enc->iv = NULL; + enc->iv_len = cipher_ivlen(enc->cipher); + enc->key = NULL; + enc->key_len = cipher_keylen(enc->cipher); + enc->block_size = cipher_blocksize(enc->cipher); + } + + static void + choose_mac(Mac *mac, char *client, char *server) + { + char *name = match_list(client, server, NULL); +- if (name == NULL) ++ if (name == NULL) { ++#ifdef SSH_AUDIT_EVENTS ++ audit_unsupported(1); ++#endif + fatal("no matching mac found: client %s server %s", + client, server); ++ } + if (mac_setup(mac, name) < 0) + fatal("unsupported mac %s", name); + /* truncate the key */ + if (datafellows & SSH_BUG_HMAC) + mac->key_len = 16; + mac->name = name; + mac->key = NULL; + mac->enabled = 0; + } + + static void + choose_comp(Comp *comp, char *client, char *server) + { + char *name = match_list(client, server, NULL); +- if (name == NULL) ++ if (name == NULL) { ++#ifdef SSH_AUDIT_EVENTS ++ audit_unsupported(2); ++#endif + fatal("no matching comp found: client %s server %s", client, server); ++ } + if (strcmp(name, "zlib@openssh.com") == 0) { + comp->type = COMP_DELAYED; + } else if (strcmp(name, "zlib") == 0) { + comp->type = COMP_ZLIB; + } else if (strcmp(name, "none") == 0) { + comp->type = COMP_NONE; + } else { + fatal("unsupported comp %s", name); +@@ -455,16 +468,19 @@ kex_choose_conf(Kex *kex) + if (authlen == 0) + choose_mac(&newkeys->mac, cprop[nmac], sprop[nmac]); + choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); + debug("kex: %s %s %s %s", + ctos ? "client->server" : "server->client", + newkeys->enc.name, + authlen == 0 ? newkeys->mac.name : "", + newkeys->comp.name); ++#ifdef SSH_AUDIT_EVENTS ++ audit_kex(ctos, newkeys->enc.name, newkeys->mac.name, newkeys->comp.name); ++#endif + } + choose_kex(kex, cprop[PROPOSAL_KEX_ALGS], sprop[PROPOSAL_KEX_ALGS]); + choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS], + sprop[PROPOSAL_SERVER_HOST_KEY_ALGS]); + need = 0; + for (mode = 0; mode < MODE_MAX; mode++) { + newkeys = kex->newkeys[mode]; + if (need < newkeys->enc.key_len) +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -92,16 +92,17 @@ + #endif + #include "monitor_wrap.h" + #include "monitor_fdpass.h" + #include "misc.h" + #include "compat.h" + #include "ssh2.h" + #include "jpake.h" + #include "roaming.h" ++#include "audit.h" + + #ifdef GSSAPI + static Gssctxt *gsscontext = NULL; + #endif + + /* Imports */ + extern ServerOptions options; + extern u_int utmp_len; +@@ -181,16 +182,18 @@ int mm_answer_gss_accept_ctx(int, Buffer + int mm_answer_gss_userok(int, Buffer *); + int mm_answer_gss_checkmic(int, Buffer *); + #endif + + #ifdef SSH_AUDIT_EVENTS + int mm_answer_audit_event(int, Buffer *); + int mm_answer_audit_command(int, Buffer *); + int mm_answer_audit_end_command(int, Buffer *); ++int mm_answer_audit_unsupported_body(int, Buffer *); ++int mm_answer_audit_kex_body(int, Buffer *); + #endif + + static int monitor_read_log(struct monitor *); + + static Authctxt *authctxt; + static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ + + /* local state for key verify */ +@@ -232,16 +235,18 @@ struct mon_table mon_dispatch_proto20[] + {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, + {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, + {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, ++ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, ++ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + #endif + #ifdef BSD_AUTH + {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, + {MONITOR_REQ_BSDAUTHRESPOND, MON_AUTH, mm_answer_bsdauthrespond}, + #endif + #ifdef SKEY + {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, + {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, +@@ -269,16 +274,18 @@ struct mon_table mon_dispatch_postauth20 + {MONITOR_REQ_SIGN, 0, mm_answer_sign}, + {MONITOR_REQ_PTY, 0, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, ++ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, ++ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_proto15[] = { + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, + {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, +@@ -300,28 +307,32 @@ struct mon_table mon_dispatch_proto15[] + {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, + {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, + {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, ++ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, ++ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_postauth15[] = { + {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, MON_ONCE, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, ++ {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, ++ {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table *mon_dispatch; + + /* Specifies if a certain message is allowed at the moment */ + +@@ -2391,8 +2402,52 @@ mm_answer_jpake_check_confirm(int sock, + + monitor_permit(mon_dispatch, MONITOR_REQ_JPAKE_STEP1, 1); + + auth_method = "jpake-01@openssh.com"; + return authenticated; + } + + #endif /* JPAKE */ ++ ++#ifdef SSH_AUDIT_EVENTS ++int ++mm_answer_audit_unsupported_body(int sock, Buffer *m) ++{ ++ int what; ++ ++ what = buffer_get_int(m); ++ ++ audit_unsupported_body(what); ++ ++ buffer_clear(m); ++ ++ mm_request_send(sock, MONITOR_ANS_AUDIT_UNSUPPORTED, m); ++ return 0; ++} ++ ++int ++mm_answer_audit_kex_body(int sock, Buffer *m) ++{ ++ int ctos, len; ++ char *cipher, *mac, *compress; ++ pid_t pid; ++ uid_t uid; ++ ++ ctos = buffer_get_int(m); ++ cipher = buffer_get_string(m, &len); ++ mac = buffer_get_string(m, &len); ++ compress = buffer_get_string(m, &len); ++ pid = buffer_get_int64(m); ++ uid = buffer_get_int64(m); ++ ++ audit_kex_body(ctos, cipher, mac, compress, pid, uid); ++ ++ xfree(cipher); ++ xfree(mac); ++ xfree(compress); ++ buffer_clear(m); ++ ++ mm_request_send(sock, MONITOR_ANS_AUDIT_KEX, m); ++ return 0; ++} ++ ++#endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h +--- a/openssh-6.2p2/monitor.h ++++ b/openssh-6.2p2/monitor.h +@@ -65,16 +65,18 @@ enum monitor_reqtype { + MONITOR_REQ_PAM_START = 100, + MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, + MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105, + MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, + MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, + MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, + MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, + MONITOR_ANS_AUDIT_COMMAND = 114, MONITOR_REQ_AUDIT_END_COMMAND = 115, ++ MONITOR_REQ_AUDIT_UNSUPPORTED = 116, MONITOR_ANS_AUDIT_UNSUPPORTED = 117, ++ MONITOR_REQ_AUDIT_KEX = 118, MONITOR_ANS_AUDIT_KEX = 119, + + }; + + struct mm_master; + struct monitor { + int m_recvfd; + int m_sendfd; + int m_log_recvfd; +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -1481,8 +1481,46 @@ mm_jpake_check_confirm(const BIGNUM *k, + + success = buffer_get_int(&m); + buffer_free(&m); + + debug3("%s: success = %d", __func__, success); + return success; + } + #endif /* JPAKE */ ++ ++#ifdef SSH_AUDIT_EVENTS ++void ++mm_audit_unsupported_body(int what) ++{ ++ Buffer m; ++ ++ buffer_init(&m); ++ buffer_put_int(&m, what); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_UNSUPPORTED, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_UNSUPPORTED, ++ &m); ++ ++ buffer_free(&m); ++} ++ ++void ++mm_audit_kex_body(int ctos, char *cipher, char *mac, char *compress, pid_t pid, ++ uid_t uid) ++{ ++ Buffer m; ++ ++ buffer_init(&m); ++ buffer_put_int(&m, ctos); ++ buffer_put_cstring(&m, cipher); ++ buffer_put_cstring(&m, mac); ++ buffer_put_cstring(&m, compress); ++ buffer_put_int64(&m, pid); ++ buffer_put_int64(&m, uid); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_KEX, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_KEX, ++ &m); ++ ++ buffer_free(&m); ++} ++#endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -72,16 +72,18 @@ int mm_sshpam_respond(void *, u_int, cha + void mm_sshpam_free_ctx(void *); + #endif + + #ifdef SSH_AUDIT_EVENTS + #include "audit.h" + void mm_audit_event(ssh_audit_event_t); + int mm_audit_run_command(const char *); + void mm_audit_end_command(int, const char *); ++void mm_audit_unsupported_body(int); ++void mm_audit_kex_body(int, char *, char *, char *, pid_t, uid_t); + #endif + + struct Session; + void mm_terminate(void); + int mm_pty_allocate(int *, int *, char *, size_t); + void mm_session_pty_cleanup2(struct Session *); + + /* SSHv1 interfaces */ +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -113,16 +113,17 @@ + #include "session.h" + #include "monitor_mm.h" + #include "monitor.h" + #ifdef GSSAPI + #include "ssh-gss.h" + #endif + #include "monitor_wrap.h" + #include "roaming.h" ++#include "audit.h" + #include "ssh-sandbox.h" + #include "version.h" + + #ifdef LIBWRAP + #include + #include + int allow_severity; + int deny_severity; +@@ -2236,16 +2237,20 @@ do_ssh1_kex(void) + packet_disconnect("Warning: client selects unsupported cipher."); + + /* Get check bytes from the packet. These must match those we + sent earlier with the public key packet. */ + for (i = 0; i < 8; i++) + if (cookie[i] != packet_get_char()) + packet_disconnect("IP Spoofing check bytes do not match."); + ++#ifdef SSH_AUDIT_EVENTS ++ audit_kex(2, cipher_name(cipher_type), "crc", "none"); ++#endif ++ + debug("Encryption type: %.200s", cipher_name(cipher_type)); + + /* Get the encrypted integer. */ + if ((session_key_int = BN_new()) == NULL) + fatal("do_ssh1_kex: BN_new failed"); + packet_get_bignum(session_key_int); + + protocol_flags = packet_get_int(); diff --git a/openssh-6.2p2-audit5-session_key_destruction.patch b/openssh-6.2p2-audit5-session_key_destruction.patch new file mode 100644 index 0000000..4e67c5a --- /dev/null +++ b/openssh-6.2p2-audit5-session_key_destruction.patch @@ -0,0 +1,979 @@ +# session key destruction and auditing +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2014 +# by jchadima@redhat.com + +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -480,9 +480,15 @@ audit_unsupported_body(int what) + /* not implemented */ + } + + void + audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, uid_t uid) + { + /* not implemented */ + } ++ ++void ++audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) ++{ ++ /* not implemented */ ++} + #endif /* BSM */ +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -289,24 +289,25 @@ audit_unsupported_body(int what) + /* no problem, the next instruction will be fatal() */ + return; + audit_log_user_message(audit_fd, AUDIT_CRYPTO_SESSION, + buf, NULL, get_remote_ipaddr(), NULL, 0); + audit_close(audit_fd); + #endif + } + ++const static char *direction[] = { "from-server", "from-client", "both" }; ++ + void + audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, + uid_t uid) + { + #ifdef AUDIT_CRYPTO_SESSION + char buf[AUDIT_LOG_SIZE]; + int audit_fd, audit_ok; +- const static char *direction[] = { "from-server", "from-client", "both" }; + Cipher *cipher = cipher_by_name(enc); + char *s; + + snprintf(buf, sizeof(buf), "op=start direction=%s cipher=%s ksize=%d spid=%jd suid=%jd rport=%d laddr=%s lport=%d ", + direction[ctos], enc, cipher ? 8 * cipher->key_len : 0, + (intmax_t)pid, (intmax_t)uid, + get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), get_local_port()); + xfree(s); +@@ -322,9 +323,37 @@ audit_kex_body(int ctos, char *enc, char + buf, NULL, get_remote_ipaddr(), NULL, 1); + audit_close(audit_fd); + /* do not abort if the error is EPERM and sshd is run as non root user */ + if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) + fatal("cannot write into audit"); /* Must prevent login */ + #endif + } + ++void ++audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) ++{ ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, audit_ok; ++ char *s; ++ ++ snprintf(buf, sizeof(buf), "op=destroy kind=session fp=? direction=%s spid=%jd suid=%jd rport=%d laddr=%s lport=%d ", ++ direction[ctos], (intmax_t)pid, (intmax_t)uid, ++ get_remote_port(), ++ (s = get_local_ipaddr(packet_get_connection_in())), ++ get_local_port()); ++ xfree(s); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno != EINVAL && errno != EPROTONOSUPPORT && ++ errno != EAFNOSUPPORT) ++ error("cannot open audit"); ++ return; ++ } ++ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, ++ buf, NULL, get_remote_ipaddr(), NULL, 1); ++ audit_close(audit_fd); ++ /* do not abort if the error is EPERM and sshd is run as non root user */ ++ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) ++ error("cannot write into audit"); ++} ++ + #endif /* USE_LINUX_AUDIT */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -138,16 +138,22 @@ audit_unsupported(int what) + } + + void + audit_kex(int ctos, char *enc, char *mac, char *comp) + { + PRIVSEP(audit_kex_body(ctos, enc, mac, comp, getpid(), getuid())); + } + ++void ++audit_session_key_free(int ctos) ++{ ++ PRIVSEP(audit_session_key_free_body(ctos, getpid(), getuid())); ++} ++ + # ifndef CUSTOM_SSH_AUDIT_EVENTS + /* + * Null implementations of audit functions. + * These get used if SSH_AUDIT_EVENTS is defined but no audit module is enabled. + */ + + /* + * Called after a connection has been accepted but before any authentication +@@ -269,10 +275,20 @@ audit_unsupported_body(int what) + void + audit_kex_body(int ctos, char *enc, char *mac, char *compress, pid_t pid, + uid_t uid) + { + debug("audit protocol negotiation euid %d direction %d cipher %s mac %s compresion %s from pid %ld uid %u", + (unsigned)geteuid(), ctos, enc, mac, compress, (long)pid, + (unsigned)uid); + } ++ ++/* ++ * This will be called on succesfull session key discard ++ */ ++void ++audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) ++{ ++ debug("audit session key discard euid %u direction %d from pid %ld uid %u", ++ (unsigned)geteuid(), ctos, (long)pid, (unsigned)uid); ++} + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -57,10 +57,12 @@ int audit_run_command(const char *); + void audit_end_command(int, const char *); + ssh_audit_event_t audit_classify_auth(const char *); + int audit_keyusage(int, const char *, unsigned, char *, int); + void audit_key(int, int *, const Key *); + void audit_unsupported(int); + void audit_kex(int, char *, char *, char *); + void audit_unsupported_body(int); + void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); ++void audit_session_key_free(int ctos); ++void audit_session_key_free_body(int ctos, pid_t, uid_t); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/auditstub.c b/openssh-6.2p2/auditstub.c +--- a/openssh-6.2p2/auditstub.c ++++ b/openssh-6.2p2/auditstub.c +@@ -22,18 +22,29 @@ + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Red Hat author: Jan F. Chadima + */ + ++#include ++ + void + audit_unsupported(int n) + { + } + + void + audit_kex(int ctos, char *enc, char *mac, char *comp) + { + } + ++void ++audit_session_key_free(int ctos) ++{ ++} ++ ++void ++audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) ++{ ++} +diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c +--- a/openssh-6.2p2/kex.c ++++ b/openssh-6.2p2/kex.c +@@ -635,8 +635,39 @@ dump_digest(char *msg, u_char *digest, i + if (i%32 == 31) + fprintf(stderr, "\n"); + else if (i%8 == 7) + fprintf(stderr, " "); + } + fprintf(stderr, "\n"); + } + #endif ++ ++static void ++enc_destroy(Enc *enc) ++{ ++ if (enc == NULL) ++ return; ++ ++ if (enc->key) { ++ memset(enc->key, 0, enc->key_len); ++ xfree(enc->key); ++ } ++ ++ if (enc->iv) { ++ memset(enc->iv, 0, enc->block_size); ++ xfree(enc->iv); ++ } ++ ++ memset(enc, 0, sizeof(*enc)); ++} ++ ++void ++newkeys_destroy(Newkeys *newkeys) ++{ ++ if (newkeys == NULL) ++ return; ++ ++ enc_destroy(&newkeys->enc); ++ mac_destroy(&newkeys->mac); ++ memset(&newkeys->comp, 0, sizeof(newkeys->comp)); ++} ++ +diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h +--- a/openssh-6.2p2/kex.h ++++ b/openssh-6.2p2/kex.h +@@ -153,16 +153,18 @@ Newkeys *kex_get_newkeys(int); + + void kexdh_client(Kex *); + void kexdh_server(Kex *); + void kexgex_client(Kex *); + void kexgex_server(Kex *); + void kexecdh_client(Kex *); + void kexecdh_server(Kex *); + ++void newkeys_destroy(Newkeys *newkeys); ++ + void + kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, + BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); + void + kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, + int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, + BIGNUM *, BIGNUM *, u_char **, u_int *); + #ifdef OPENSSL_HAS_ECC +diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c +--- a/openssh-6.2p2/mac.c ++++ b/openssh-6.2p2/mac.c +@@ -194,16 +194,30 @@ mac_clear(Mac *mac) + if (mac->umac_ctx != NULL) + umac128_delete(mac->umac_ctx); + } else if (mac->evp_md != NULL) + HMAC_cleanup(&mac->evp_ctx); + mac->evp_md = NULL; + mac->umac_ctx = NULL; + } + ++void ++mac_destroy(Mac *mac) ++{ ++ if (mac == NULL) ++ return; ++ ++ if (mac->key) { ++ memset(mac->key, 0, mac->key_len); ++ xfree(mac->key); ++ } ++ ++ memset(mac, 0, sizeof(*mac)); ++} ++ + /* XXX copied from ciphers_valid */ + #define MAC_SEP "," + int + mac_valid(const char *names) + { + char *maclist, *cp, *p; + + if (names == NULL || strcmp(names, "") == 0) +diff --git a/openssh-6.2p2/mac.h b/openssh-6.2p2/mac.h +--- a/openssh-6.2p2/mac.h ++++ b/openssh-6.2p2/mac.h +@@ -23,8 +23,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + int mac_valid(const char *); + int mac_setup(Mac *, char *); + int mac_init(Mac *); + u_char *mac_compute(Mac *, u_int32_t, u_char *, int); + void mac_clear(Mac *); ++void mac_destroy(Mac *); +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -184,16 +184,17 @@ int mm_answer_gss_checkmic(int, Buffer * + #endif + + #ifdef SSH_AUDIT_EVENTS + int mm_answer_audit_event(int, Buffer *); + int mm_answer_audit_command(int, Buffer *); + int mm_answer_audit_end_command(int, Buffer *); + int mm_answer_audit_unsupported_body(int, Buffer *); + int mm_answer_audit_kex_body(int, Buffer *); ++int mm_answer_audit_session_key_free_body(int, Buffer *); + #endif + + static int monitor_read_log(struct monitor *); + + static Authctxt *authctxt; + static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ + + /* local state for key verify */ +@@ -237,16 +238,17 @@ struct mon_table mon_dispatch_proto20[] + {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, ++ {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, + #endif + #ifdef BSD_AUTH + {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, + {MONITOR_REQ_BSDAUTHRESPOND, MON_AUTH, mm_answer_bsdauthrespond}, + #endif + #ifdef SKEY + {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, + {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, +@@ -276,16 +278,17 @@ struct mon_table mon_dispatch_postauth20 + {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, ++ {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_proto15[] = { + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, + {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, +@@ -309,30 +312,32 @@ struct mon_table mon_dispatch_proto15[] + {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, ++ {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_postauth15[] = { + {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, MON_ONCE, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, ++ {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, + #endif + {0, 0, NULL} + }; + + struct mon_table *mon_dispatch; + + /* Specifies if a certain message is allowed at the moment */ + +@@ -1951,21 +1956,23 @@ mm_get_keystate(struct monitor *pmonitor + goto skip; + } else { + /* Get the Kex for rekeying */ + *pmonitor->m_pkex = mm_get_kex(&m); + } + + blob = buffer_get_string(&m, &bloblen); + current_keys[MODE_OUT] = mm_newkeys_from_blob(blob, bloblen); ++ memset(blob, 0, bloblen); + xfree(blob); + + debug3("%s: Waiting for second key", __func__); + blob = buffer_get_string(&m, &bloblen); + current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); ++ memset(blob, 0, bloblen); + xfree(blob); + + /* Now get sequence numbers for the packets */ + seqnr = buffer_get_int(&m); + blocks = buffer_get_int64(&m); + packets = buffer_get_int(&m); + bytes = buffer_get_int64(&m); + packet_set_state(MODE_OUT, seqnr, blocks, packets, bytes); +@@ -2001,16 +2008,31 @@ mm_get_keystate(struct monitor *pmonitor + + /* Roaming */ + if (compat20) { + child_state.sent_bytes = buffer_get_int64(&m); + child_state.recv_bytes = buffer_get_int64(&m); + } + + buffer_free(&m); ++ ++#ifdef SSH_AUDIT_EVENTS ++ if (compat20) { ++ buffer_init(&m); ++ mm_request_receive_expect(pmonitor->m_sendfd, ++ MONITOR_REQ_AUDIT_SESSION_KEY_FREE, &m); ++ mm_answer_audit_session_key_free_body(pmonitor->m_sendfd, &m); ++ buffer_free(&m); ++ } ++#endif ++ ++ /* Drain any buffered messages from the child */ ++ while (pmonitor->m_log_recvfd >= 0 && monitor_read_log(pmonitor) == 0) ++ ; ++ + } + + + /* Allocation functions for zlib */ + void * + mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) + { + size_t len = (size_t) size * ncount; +@@ -2445,9 +2467,27 @@ mm_answer_audit_kex_body(int sock, Buffe + xfree(mac); + xfree(compress); + buffer_clear(m); + + mm_request_send(sock, MONITOR_ANS_AUDIT_KEX, m); + return 0; + } + ++int ++mm_answer_audit_session_key_free_body(int sock, Buffer *m) ++{ ++ int ctos; ++ pid_t pid; ++ uid_t uid; ++ ++ ctos = buffer_get_int(m); ++ pid = buffer_get_int64(m); ++ uid = buffer_get_int64(m); ++ ++ audit_session_key_free_body(ctos, pid, uid); ++ ++ buffer_clear(m); ++ ++ mm_request_send(sock, MONITOR_ANS_AUDIT_SESSION_KEY_FREE, m); ++ return 0; ++} + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h +--- a/openssh-6.2p2/monitor.h ++++ b/openssh-6.2p2/monitor.h +@@ -67,16 +67,17 @@ enum monitor_reqtype { + MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105, + MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, + MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, + MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, + MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, + MONITOR_ANS_AUDIT_COMMAND = 114, MONITOR_REQ_AUDIT_END_COMMAND = 115, + MONITOR_REQ_AUDIT_UNSUPPORTED = 116, MONITOR_ANS_AUDIT_UNSUPPORTED = 117, + MONITOR_REQ_AUDIT_KEX = 118, MONITOR_ANS_AUDIT_KEX = 119, ++ MONITOR_REQ_AUDIT_SESSION_KEY_FREE = 120, MONITOR_ANS_AUDIT_SESSION_KEY_FREE = 121, + + }; + + struct mm_master; + struct monitor { + int m_recvfd; + int m_sendfd; + int m_log_recvfd; +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -649,22 +649,24 @@ mm_send_keystate(struct monitor *monitor + __func__, packet_get_newkeys(MODE_OUT), + packet_get_newkeys(MODE_IN)); + + /* Keys from Kex */ + if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen)) + fatal("%s: conversion of newkeys failed", __func__); + + buffer_put_string(&m, blob, bloblen); ++ memset(blob, 0, bloblen); + xfree(blob); + + if (!mm_newkeys_to_blob(MODE_IN, &blob, &bloblen)) + fatal("%s: conversion of newkeys failed", __func__); + + buffer_put_string(&m, blob, bloblen); ++ memset(blob, 0, bloblen); + xfree(blob); + + packet_get_state(MODE_OUT, &seqnr, &blocks, &packets, &bytes); + buffer_put_int(&m, seqnr); + buffer_put_int64(&m, blocks); + buffer_put_int(&m, packets); + buffer_put_int64(&m, bytes); + packet_get_state(MODE_IN, &seqnr, &blocks, &packets, &bytes); +@@ -1518,9 +1520,24 @@ mm_audit_kex_body(int ctos, char *cipher + buffer_put_int64(&m, uid); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_KEX, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_KEX, + &m); + + buffer_free(&m); + } ++ ++void ++mm_audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) ++{ ++ Buffer m; ++ ++ buffer_init(&m); ++ buffer_put_int(&m, ctos); ++ buffer_put_int64(&m, pid); ++ buffer_put_int64(&m, uid); ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_SESSION_KEY_FREE, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_SESSION_KEY_FREE, ++ &m); ++ buffer_free(&m); ++} + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -74,16 +74,17 @@ void mm_sshpam_free_ctx(void *); + + #ifdef SSH_AUDIT_EVENTS + #include "audit.h" + void mm_audit_event(ssh_audit_event_t); + int mm_audit_run_command(const char *); + void mm_audit_end_command(int, const char *); + void mm_audit_unsupported_body(int); + void mm_audit_kex_body(int, char *, char *, char *, pid_t, uid_t); ++void mm_audit_session_key_free_body(int, pid_t, uid_t); + #endif + + struct Session; + void mm_terminate(void); + int mm_pty_allocate(int *, int *, char *, size_t); + void mm_session_pty_cleanup2(struct Session *); + + /* SSHv1 interfaces */ +diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c +--- a/openssh-6.2p2/packet.c ++++ b/openssh-6.2p2/packet.c +@@ -55,16 +55,17 @@ + #include + #include + #include + #include + #include + #include + + #include "xmalloc.h" ++#include "audit.h" + #include "buffer.h" + #include "packet.h" + #include "crc32.h" + #include "compress.h" + #include "deattack.h" + #include "channels.h" + #include "compat.h" + #include "ssh1.h" +@@ -463,41 +464,51 @@ packet_get_connection_in(void) + /* Returns the descriptor used for writing. */ + + int + packet_get_connection_out(void) + { + return active_state->connection_out; + } + ++static int ++packet_state_has_keys (const struct session_state *state) ++{ ++ return state != NULL && ++ (state->newkeys[MODE_IN] != NULL || state->newkeys[MODE_OUT] != NULL); ++} ++ + /* Closes the connection and clears and frees internal data structures. */ + + void + packet_close(void) + { + if (!active_state->initialized) + return; + active_state->initialized = 0; +- if (active_state->connection_in == active_state->connection_out) { +- shutdown(active_state->connection_out, SHUT_RDWR); +- close(active_state->connection_out); +- } else { +- close(active_state->connection_in); +- close(active_state->connection_out); +- } + buffer_free(&active_state->input); + buffer_free(&active_state->output); + buffer_free(&active_state->outgoing_packet); + buffer_free(&active_state->incoming_packet); + if (active_state->compression_buffer_ready) { + buffer_free(&active_state->compression_buffer); + buffer_compress_uninit(); + } +- cipher_cleanup(&active_state->send_context); +- cipher_cleanup(&active_state->receive_context); ++ if (packet_state_has_keys(active_state)) { ++ cipher_cleanup(&active_state->send_context); ++ cipher_cleanup(&active_state->receive_context); ++ audit_session_key_free(2); ++ } ++ if (active_state->connection_in == active_state->connection_out) { ++ shutdown(active_state->connection_out, SHUT_RDWR); ++ close(active_state->connection_out); ++ } else { ++ close(active_state->connection_in); ++ close(active_state->connection_out); ++ } + } + + /* Sets remote side protocol flags. */ + + void + packet_set_protocol_flags(u_int protocol_flags) + { + active_state->remote_protocol_flags = protocol_flags; +@@ -722,16 +733,33 @@ packet_send1(void) + + /* + * Note that the packet is now only buffered in output. It won't be + * actually sent until packet_write_wait or packet_write_poll is + * called. + */ + } + ++static void ++newkeys_destroy_and_free(Newkeys *newkeys) ++{ ++ if (newkeys == NULL) ++ return; ++ ++ xfree(newkeys->enc.name); ++ ++ mac_clear(&newkeys->mac); ++ xfree(newkeys->mac.name); ++ ++ xfree(newkeys->comp.name); ++ ++ newkeys_destroy(newkeys); ++ xfree(newkeys); ++} ++ + void + set_newkeys(int mode) + { + Enc *enc; + Mac *mac; + Comp *comp; + CipherContext *cc; + u_int64_t *max_blocks; +@@ -747,31 +775,19 @@ set_newkeys(int mode) + } else { + cc = &active_state->receive_context; + crypt_type = CIPHER_DECRYPT; + active_state->p_read.packets = active_state->p_read.blocks = 0; + max_blocks = &active_state->max_blocks_in; + } + if (active_state->newkeys[mode] != NULL) { + debug("set_newkeys: rekeying"); ++ audit_session_key_free(mode); + cipher_cleanup(cc); +- enc = &active_state->newkeys[mode]->enc; +- mac = &active_state->newkeys[mode]->mac; +- comp = &active_state->newkeys[mode]->comp; +- mac_clear(mac); +- memset(enc->iv, 0, enc->iv_len); +- memset(enc->key, 0, enc->key_len); +- memset(mac->key, 0, mac->key_len); +- xfree(enc->name); +- xfree(enc->iv); +- xfree(enc->key); +- xfree(mac->name); +- xfree(mac->key); +- xfree(comp->name); +- xfree(active_state->newkeys[mode]); ++ newkeys_destroy_and_free(active_state->newkeys[mode]); + } + active_state->newkeys[mode] = kex_get_newkeys(mode); + if (active_state->newkeys[mode] == NULL) + fatal("newkeys: no keys for mode %d", mode); + enc = &active_state->newkeys[mode]->enc; + mac = &active_state->newkeys[mode]->mac; + comp = &active_state->newkeys[mode]->comp; + if (cipher_authlen(enc->cipher) == 0 && mac_init(mac) == 0) +@@ -1967,54 +1983,93 @@ packet_get_output(void) + } + + void * + packet_get_newkeys(int mode) + { + return (void *)active_state->newkeys[mode]; + } + ++static void ++packet_destroy_state(struct session_state *state) ++{ ++ if (state == NULL) ++ return; ++ ++ cipher_cleanup(&state->receive_context); ++ cipher_cleanup(&state->send_context); ++ ++ buffer_free(&state->input); ++ buffer_free(&state->output); ++ buffer_free(&state->outgoing_packet); ++ buffer_free(&state->incoming_packet); ++ buffer_free(&state->compression_buffer); ++ newkeys_destroy_and_free(state->newkeys[MODE_IN]); ++ state->newkeys[MODE_IN] = NULL; ++ newkeys_destroy_and_free(state->newkeys[MODE_OUT]); ++ state->newkeys[MODE_OUT] = NULL; ++ mac_destroy(state->packet_discard_mac); ++// TAILQ_HEAD(, packet) outgoing; ++// memset(state, 0, sizeof(state)); ++} ++ ++void ++packet_destroy_all(int audit_it, int privsep) ++{ ++ if (audit_it) ++ audit_it = packet_state_has_keys (active_state) || ++ packet_state_has_keys (backup_state); ++ packet_destroy_state(active_state); ++ packet_destroy_state(backup_state); ++ if (audit_it) { ++#ifdef SSH_AUDIT_EVENTS ++ if (privsep) ++ audit_session_key_free(2); ++ else ++ audit_session_key_free_body(2, getpid(), getuid()); ++#endif ++ } ++} ++ + /* + * Save the state for the real connection, and use a separate state when + * resuming a suspended connection. + */ + void + packet_backup_state(void) + { +- struct session_state *tmp; +- + close(active_state->connection_in); + active_state->connection_in = -1; + close(active_state->connection_out); + active_state->connection_out = -1; +- if (backup_state) +- tmp = backup_state; +- else +- tmp = alloc_session_state(); + backup_state = active_state; +- active_state = tmp; ++ active_state = alloc_session_state(); + } + + /* + * Swap in the old state when resuming a connecion. + */ + void + packet_restore_state(void) + { + struct session_state *tmp; + void *buf; + u_int len; + + tmp = backup_state; + backup_state = active_state; + active_state = tmp; + active_state->connection_in = backup_state->connection_in; +- backup_state->connection_in = -1; + active_state->connection_out = backup_state->connection_out; +- backup_state->connection_out = -1; + len = buffer_len(&backup_state->input); + if (len > 0) { + buf = buffer_ptr(&backup_state->input); + buffer_append(&active_state->input, buf, len); + buffer_clear(&backup_state->input); + add_recv_bytes(len); + } ++ backup_state->connection_in = -1; ++ backup_state->connection_out = -1; ++ packet_destroy_state(backup_state); ++ xfree(backup_state); ++ backup_state = NULL; + } ++ +diff --git a/openssh-6.2p2/packet.h b/openssh-6.2p2/packet.h +--- a/openssh-6.2p2/packet.h ++++ b/openssh-6.2p2/packet.h +@@ -118,9 +118,10 @@ int packet_need_rekeying(void); + void packet_set_rekey_limit(u_int32_t); + + void packet_backup_state(void); + void packet_restore_state(void); + + void *packet_get_input(void); + void *packet_get_output(void); + ++void packet_destroy_all(int, int); + #endif /* PACKET_H */ +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -1648,16 +1648,19 @@ do_child(Session *s, const char *command + int env_size; + char *argv[ARGV_MAX]; + const char *shell, *shell0, *hostname = NULL; + struct passwd *pw = s->pw; + int r = 0; + + /* remove hostkey from the child's memory */ + destroy_sensitive_data(); ++ /* Don't audit this - both us and the parent would be talking to the ++ monitor over a single socket, with no synchronization. */ ++ packet_destroy_all(0, 1); + + /* Force a password change */ + if (s->authctxt->force_pwchange) { + do_setusercontext(pw); + child_close_fds(); + do_pwchange(s); + exit(1); + } +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -695,16 +695,18 @@ privsep_preauth(Authctxt *authctxt) + setproctitle("%s", "[net]"); + if (box != NULL) + ssh_sandbox_child(box); + + return 0; + } + } + ++extern Newkeys *current_keys[]; ++ + static void + privsep_postauth(Authctxt *authctxt) + { + u_int32_t rnd[256]; + + #ifdef DISABLE_FD_PASSING + if (1) { + #else +@@ -719,16 +721,20 @@ privsep_postauth(Authctxt *authctxt) + monitor_reinit(pmonitor); + + pmonitor->m_pid = fork(); + if (pmonitor->m_pid == -1) + fatal("fork of unprivileged child failed"); + else if (pmonitor->m_pid != 0) { + verbose("User child is on pid %ld", (long)pmonitor->m_pid); + buffer_clear(&loginmsg); ++ newkeys_destroy(current_keys[MODE_OUT]); ++ newkeys_destroy(current_keys[MODE_IN]); ++ audit_session_key_free_body(2, getpid(), getuid()); ++ packet_destroy_all(0, 0); + monitor_child_postauth(pmonitor); + + /* NEVERREACHED */ + exit(0); + } + + /* child */ + +@@ -2028,16 +2034,17 @@ main(int ac, char **av) + do_authentication(authctxt); + } + /* + * If we use privilege separation, the unprivileged child transfers + * the current keystate and exits + */ + if (use_privsep) { + mm_send_keystate(pmonitor); ++ packet_destroy_all(1, 1); + exit(0); + } + + authenticated: + /* + * Cancel the alarm we set to limit the time taken for + * authentication. + */ +@@ -2080,16 +2087,18 @@ main(int ac, char **av) + + packet_set_timeout(options.client_alive_interval, + options.client_alive_count_max); + + /* Start session. */ + do_authenticated(authctxt); + + /* The connection has been terminated. */ ++ packet_destroy_all(1, 1); ++ + packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); + packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes); + verbose("Transferred: sent %llu, received %llu bytes", + (unsigned long long)obytes, (unsigned long long)ibytes); + + verbose("Closing connection to %.500s port %d", remote_ip, remote_port); + + #ifdef USE_PAM +@@ -2397,26 +2406,38 @@ do_ssh2_kex(void) + #endif + debug("KEX done"); + } + + /* server specific fatal cleanup */ + void + cleanup_exit(int i) + { ++ static int in_cleanup = 0; ++ int is_privsep_child; ++ ++ /* cleanup_exit can be called at the very least from the privsep ++ wrappers used for auditing. Make sure we don't recurse ++ indefinitely. */ ++ if (in_cleanup) ++ _exit(i); ++ in_cleanup = 1; ++ + if (the_authctxt) { + do_cleanup(the_authctxt); + if (use_privsep && privsep_is_preauth && pmonitor->m_pid > 1) { + debug("Killing privsep child %d", pmonitor->m_pid); + if (kill(pmonitor->m_pid, SIGKILL) != 0 && + errno != ESRCH) + error("%s: kill(%d): %s", __func__, + pmonitor->m_pid, strerror(errno)); + } + } ++ is_privsep_child = use_privsep && (pmonitor != NULL) && !mm_is_monitor(); ++ packet_destroy_all(1, is_privsep_child); + #ifdef SSH_AUDIT_EVENTS + /* done after do_cleanup so it can cancel the PAM auth 'thread' */ + if ((the_authctxt == NULL || !the_authctxt->authenticated) && + (!use_privsep || mm_is_monitor())) + audit_event(SSH_CONNECTION_ABANDON); + #endif + _exit(i); + } diff --git a/openssh-6.2p2-audit6-server_key_destruction.patch b/openssh-6.2p2-audit6-server_key_destruction.patch new file mode 100644 index 0000000..26e1bba --- /dev/null +++ b/openssh-6.2p2-audit6-server_key_destruction.patch @@ -0,0 +1,737 @@ +# server key destruction and auditing +# based on: +# https://bugzilla.mindrot.org/show_bug.cgi?id=1402 +# https://bugzilla.mindrot.org/attachment.cgi?id=2015 +# by jchadima@redhat.com + +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -486,9 +486,27 @@ audit_kex_body(int ctos, char *enc, char + /* not implemented */ + } + + void + audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) + { + /* not implemented */ + } ++ ++void ++audit_destroy_sensitive_data(const char *fp) ++{ ++ /* not implemented */ ++} ++ ++void ++audit_destroy_sensitive_data(const char *fp, pid_t pid, uid_t uid) ++{ ++ /* not implemented */ ++} ++ ++void ++audit_generate_ephemeral_server_key(const char *fp) ++{ ++ /* not implemented */ ++} + #endif /* BSM */ +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -351,9 +351,55 @@ audit_session_key_free_body(int ctos, pi + audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, + buf, NULL, get_remote_ipaddr(), NULL, 1); + audit_close(audit_fd); + /* do not abort if the error is EPERM and sshd is run as non root user */ + if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) + error("cannot write into audit"); + } + ++void ++audit_destroy_sensitive_data(const char *fp, pid_t pid, uid_t uid) ++{ ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, audit_ok; ++ ++ snprintf(buf, sizeof(buf), "op=destroy kind=server fp=%s direction=? spid=%jd suid=%jd ", ++ fp, (intmax_t)pid, (intmax_t)uid); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno != EINVAL && errno != EPROTONOSUPPORT && ++ errno != EAFNOSUPPORT) ++ error("cannot open audit"); ++ return; ++ } ++ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, ++ buf, NULL, ++ listening_for_clients() ? NULL : get_remote_ipaddr(), ++ NULL, 1); ++ audit_close(audit_fd); ++ /* do not abort if the error is EPERM and sshd is run as non root user */ ++ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) ++ error("cannot write into audit"); ++} ++ ++void ++audit_generate_ephemeral_server_key(const char *fp) ++{ ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, audit_ok; ++ ++ snprintf(buf, sizeof(buf), "op=create kind=server fp=%s direction=? ", fp); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno != EINVAL && errno != EPROTONOSUPPORT && ++ errno != EAFNOSUPPORT) ++ error("cannot open audit"); ++ return; ++ } ++ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, ++ buf, NULL, 0, NULL, 1); ++ audit_close(audit_fd); ++ /* do not abort if the error is EPERM and sshd is run as non root user */ ++ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) ++ error("cannot write into audit"); ++} + #endif /* USE_LINUX_AUDIT */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -285,10 +285,29 @@ audit_kex_body(int ctos, char *enc, char + * This will be called on succesfull session key discard + */ + void + audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) + { + debug("audit session key discard euid %u direction %d from pid %ld uid %u", + (unsigned)geteuid(), ctos, (long)pid, (unsigned)uid); + } ++ ++/* ++ * This will be called on destroy private part of the server key ++ */ ++void ++audit_destroy_sensitive_data(const char *fp, pid_t pid, uid_t uid) ++{ ++ debug("audit destroy sensitive data euid %d fingerprint %s from pid %ld uid %u", ++ geteuid(), fp, (long)pid, (unsigned)uid); ++} ++ ++/* ++ * This will be called on generation of the ephemeral server key ++ */ ++void ++audit_generate_ephemeral_server_key(const char *) ++{ ++ debug("audit create ephemeral server key euid %d fingerprint %s", geteuid(), fp); ++} + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -43,26 +43,30 @@ enum ssh_audit_event_type { + SSH_INVALID_USER, + SSH_NOLOGIN, /* denied by /etc/nologin, not implemented */ + SSH_CONNECTION_CLOSE, /* closed after attempting auth or session */ + SSH_CONNECTION_ABANDON, /* closed without completing auth */ + SSH_AUDIT_UNKNOWN + }; + typedef enum ssh_audit_event_type ssh_audit_event_t; + ++int listening_for_clients(void); ++ + void audit_connection_from(const char *, int); + void audit_event(ssh_audit_event_t); + void audit_count_session_open(void); + void audit_session_open(struct logininfo *); + void audit_session_close(struct logininfo *); + int audit_run_command(const char *); + void audit_end_command(int, const char *); + ssh_audit_event_t audit_classify_auth(const char *); + int audit_keyusage(int, const char *, unsigned, char *, int); + void audit_key(int, int *, const Key *); + void audit_unsupported(int); + void audit_kex(int, char *, char *, char *); + void audit_unsupported_body(int); + void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); + void audit_session_key_free(int ctos); + void audit_session_key_free_body(int ctos, pid_t, uid_t); ++void audit_destroy_sensitive_data(const char *, pid_t, uid_t); ++void audit_generate_ephemeral_server_key(const char *); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c +--- a/openssh-6.2p2/key.c ++++ b/openssh-6.2p2/key.c +@@ -1841,16 +1841,40 @@ key_demote(const Key *k) + fatal("key_free: bad key type %d", k->type); + break; + } + + return (pk); + } + + int ++key_is_private(const Key *k) ++{ ++ switch (k->type) { ++ case KEY_RSA_CERT_V00: ++ case KEY_RSA_CERT: ++ case KEY_RSA1: ++ case KEY_RSA: ++ return k->rsa->d != NULL; ++ case KEY_DSA_CERT_V00: ++ case KEY_DSA_CERT: ++ case KEY_DSA: ++ return k->dsa->priv_key != NULL; ++#ifdef OPENSSL_HAS_ECC ++ case KEY_ECDSA_CERT: ++ case KEY_ECDSA: ++ return EC_KEY_get0_private_key(k->ecdsa) != NULL; ++#endif ++ default: ++ fatal("key_is_private: bad key type %d", k->type); ++ return 1; ++ } ++} ++ ++int + key_is_cert(const Key *k) + { + if (k == NULL) + return 0; + switch (k->type) { + case KEY_RSA_CERT_V00: + case KEY_DSA_CERT_V00: + case KEY_RSA_CERT: +diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h +--- a/openssh-6.2p2/key.h ++++ b/openssh-6.2p2/key.h +@@ -106,16 +106,17 @@ int key_read(Key *, char **); + u_int key_size(const Key *); + enum fp_type key_fp_type_select(void); + char *key_fp_type_str(enum fp_type); + + Key *key_generate(int, u_int); + Key *key_from_private(const Key *); + int key_type_from_name(char *); + int key_is_cert(const Key *); ++int key_is_private(const Key *k); + int key_type_plain(int); + int key_to_certified(Key *, int); + int key_drop_cert(Key *); + int key_certify(Key *, Key *); + void key_cert_copy(const Key *, struct Key *); + int key_cert_check_authority(const Key *, int, int, const char *, + const char **); + int key_cert_is_legacy(const Key *); +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -109,16 +109,18 @@ extern u_int utmp_len; + extern Newkeys *current_keys[]; + extern z_stream incoming_stream; + extern z_stream outgoing_stream; + extern u_char session_id[]; + extern Buffer auth_debug; + extern int auth_debug_init; + extern Buffer loginmsg; + ++extern void destroy_sensitive_data(int); ++ + /* State exported from the child */ + + struct { + z_stream incoming; + z_stream outgoing; + u_char *keyin; + u_int keyinlen; + u_char *keyout; +@@ -185,16 +187,17 @@ int mm_answer_gss_checkmic(int, Buffer * + + #ifdef SSH_AUDIT_EVENTS + int mm_answer_audit_event(int, Buffer *); + int mm_answer_audit_command(int, Buffer *); + int mm_answer_audit_end_command(int, Buffer *); + int mm_answer_audit_unsupported_body(int, Buffer *); + int mm_answer_audit_kex_body(int, Buffer *); + int mm_answer_audit_session_key_free_body(int, Buffer *); ++int mm_answer_audit_server_key_free(int, Buffer *); + #endif + + static int monitor_read_log(struct monitor *); + + static Authctxt *authctxt; + static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ + + /* local state for key verify */ +@@ -239,16 +242,17 @@ struct mon_table mon_dispatch_proto20[] + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, ++ {MONITOR_REQ_AUDIT_SERVER_KEY_FREE, MON_PERMIT, mm_answer_audit_server_key_free}, + #endif + #ifdef BSD_AUTH + {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, + {MONITOR_REQ_BSDAUTHRESPOND, MON_AUTH, mm_answer_bsdauthrespond}, + #endif + #ifdef SKEY + {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, + {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, +@@ -279,16 +283,17 @@ struct mon_table mon_dispatch_postauth20 + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, ++ {MONITOR_REQ_AUDIT_SERVER_KEY_FREE, MON_PERMIT, mm_answer_audit_server_key_free}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_proto15[] = { + {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, + {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, + {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, +@@ -313,31 +318,33 @@ struct mon_table mon_dispatch_proto15[] + {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, + {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, + #endif + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, ++ {MONITOR_REQ_AUDIT_SERVER_KEY_FREE, MON_PERMIT, mm_answer_audit_server_key_free}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_postauth15[] = { + {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, MON_ONCE, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT|MON_ONCE, mm_answer_audit_command}, + {MONITOR_REQ_AUDIT_END_COMMAND, MON_PERMIT, mm_answer_audit_end_command}, + {MONITOR_REQ_AUDIT_UNSUPPORTED, MON_PERMIT, mm_answer_audit_unsupported_body}, + {MONITOR_REQ_AUDIT_KEX, MON_PERMIT, mm_answer_audit_kex_body}, + {MONITOR_REQ_AUDIT_SESSION_KEY_FREE, MON_PERMIT, mm_answer_audit_session_key_free_body}, ++ {MONITOR_REQ_AUDIT_SERVER_KEY_FREE, MON_PERMIT, mm_answer_audit_server_key_free}, + #endif + {0, 0, NULL} + }; + + struct mon_table *mon_dispatch; + + /* Specifies if a certain message is allowed at the moment */ + +@@ -1746,16 +1753,18 @@ mm_answer_term(int sock, Buffer *req) + /* The child is terminating */ + session_destroy_all(&mm_session_close); + + #ifdef USE_PAM + if (options.use_pam) + sshpam_cleanup(); + #endif + ++ destroy_sensitive_data(0); ++ + while (waitpid(pmonitor->m_pid, &status, 0) == -1) + if (errno != EINTR) + exit(1); + + res = WIFEXITED(status) ? WEXITSTATUS(status) : 1; + + /* Terminate process */ + exit(res); +@@ -2485,9 +2494,30 @@ mm_answer_audit_session_key_free_body(in + + audit_session_key_free_body(ctos, pid, uid); + + buffer_clear(m); + + mm_request_send(sock, MONITOR_ANS_AUDIT_SESSION_KEY_FREE, m); + return 0; + } ++ ++int ++mm_answer_audit_server_key_free(int sock, Buffer *m) ++{ ++ int len; ++ char *fp; ++ pid_t pid; ++ uid_t uid; ++ ++ fp = buffer_get_string(m, &len); ++ pid = buffer_get_int64(m); ++ uid = buffer_get_int64(m); ++ ++ audit_destroy_sensitive_data(fp, pid, uid); ++ ++ xfree(fp); ++ buffer_clear(m); ++ ++ mm_request_send(sock, MONITOR_ANS_AUDIT_SERVER_KEY_FREE, m); ++ return 0; ++} + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h +--- a/openssh-6.2p2/monitor.h ++++ b/openssh-6.2p2/monitor.h +@@ -68,16 +68,17 @@ enum monitor_reqtype { + MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, + MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, + MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, + MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, + MONITOR_ANS_AUDIT_COMMAND = 114, MONITOR_REQ_AUDIT_END_COMMAND = 115, + MONITOR_REQ_AUDIT_UNSUPPORTED = 116, MONITOR_ANS_AUDIT_UNSUPPORTED = 117, + MONITOR_REQ_AUDIT_KEX = 118, MONITOR_ANS_AUDIT_KEX = 119, + MONITOR_REQ_AUDIT_SESSION_KEY_FREE = 120, MONITOR_ANS_AUDIT_SESSION_KEY_FREE = 121, ++ MONITOR_REQ_AUDIT_SERVER_KEY_FREE = 122, MONITOR_ANS_AUDIT_SERVER_KEY_FREE = 123, + + }; + + struct mm_master; + struct monitor { + int m_recvfd; + int m_sendfd; + int m_log_recvfd; +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -1535,9 +1535,25 @@ mm_audit_session_key_free_body(int ctos, + buffer_put_int(&m, ctos); + buffer_put_int64(&m, pid); + buffer_put_int64(&m, uid); + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_SESSION_KEY_FREE, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_SESSION_KEY_FREE, + &m); + buffer_free(&m); + } ++ ++void ++mm_audit_destroy_sensitive_data(const char *fp, pid_t pid, uid_t uid) ++{ ++ Buffer m; ++ ++ buffer_init(&m); ++ buffer_put_cstring(&m, fp); ++ buffer_put_int64(&m, pid); ++ buffer_put_int64(&m, uid); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_SERVER_KEY_FREE, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUDIT_SERVER_KEY_FREE, ++ &m); ++ buffer_free(&m); ++} + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -75,16 +75,17 @@ void mm_sshpam_free_ctx(void *); + #ifdef SSH_AUDIT_EVENTS + #include "audit.h" + void mm_audit_event(ssh_audit_event_t); + int mm_audit_run_command(const char *); + void mm_audit_end_command(int, const char *); + void mm_audit_unsupported_body(int); + void mm_audit_kex_body(int, char *, char *, char *, pid_t, uid_t); + void mm_audit_session_key_free_body(int, pid_t, uid_t); ++void mm_audit_destroy_sensitive_data(const char *, pid_t, uid_t); + #endif + + struct Session; + void mm_terminate(void); + int mm_pty_allocate(int *, int *, char *, size_t); + void mm_session_pty_cleanup2(struct Session *); + + /* SSHv1 interfaces */ +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -131,17 +131,17 @@ static int session_pty_req(Session *); + + /* import */ + extern ServerOptions options; + extern char *__progname; + extern int log_stderr; + extern int debug_flag; + extern u_int utmp_len; + extern int startup_pipe; +-extern void destroy_sensitive_data(void); ++extern void destroy_sensitive_data(int); + extern Buffer loginmsg; + + /* original command from peer. */ + const char *original_command = NULL; + + /* data */ + static int sessions_first_unused = -1; + static int sessions_nalloc = 0; +@@ -1647,17 +1647,17 @@ do_child(Session *s, const char *command + char **env; + int env_size; + char *argv[ARGV_MAX]; + const char *shell, *shell0, *hostname = NULL; + struct passwd *pw = s->pw; + int r = 0; + + /* remove hostkey from the child's memory */ +- destroy_sensitive_data(); ++ destroy_sensitive_data(1); + /* Don't audit this - both us and the parent would be talking to the + monitor over a single socket, with no synchronization. */ + packet_destroy_all(0, 1); + + /* Force a password change */ + if (s->authctxt->force_pwchange) { + do_setusercontext(pw); + child_close_fds(); +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -250,17 +250,17 @@ Buffer cfg; + + /* message to be displayed after login */ + Buffer loginmsg; + + /* Unprivileged user */ + struct passwd *privsep_pw = NULL; + + /* Prototypes for various functions defined later in this file. */ +-void destroy_sensitive_data(void); ++void destroy_sensitive_data(int); + void demote_sensitive_data(void); + + static void do_ssh1_kex(void); + static void do_ssh2_kex(void); + + /* + * Close all listening sockets + */ +@@ -269,16 +269,25 @@ close_listen_socks(void) + { + int i; + + for (i = 0; i < num_listen_socks; i++) + close(listen_socks[i]); + num_listen_socks = -1; + } + ++/* ++ * Is this process listening for clients (i.e. not specific to any specific ++ * client connection?) ++ */ ++int listening_for_clients(void) ++{ ++ return num_listen_socks > 0; ++} ++ + static void + close_startup_pipes(void) + { + int i; + + if (startup_pipes) + for (i = 0; i < options.max_startups; i++) + if (startup_pipes[i] != -1) +@@ -541,60 +550,99 @@ sshd_exchange_identification(int sock_in + close(sock_out); + logit("Protocol major versions differ for %s: %.200s vs. %.200s", + get_remote_ipaddr(), + server_version_string, client_version_string); + cleanup_exit(255); + } + } + +-/* Destroy the host and server keys. They will no longer be needed. */ ++/* ++ * Destroy the host and server keys. They will no longer be needed. Careful, ++ * this can be called from cleanup_exit() - i.e. from just about anywhere. ++ */ + void +-destroy_sensitive_data(void) ++destroy_sensitive_data(int privsep) + { + int i; ++ pid_t pid; ++ uid_t uid; + + if (sensitive_data.server_key) { + key_free(sensitive_data.server_key); + sensitive_data.server_key = NULL; + } ++ pid = getpid(); ++ uid = getuid(); + for (i = 0; i < options.num_host_key_files; i++) { + if (sensitive_data.host_keys[i]) { ++ char *fp; ++ ++ if (key_is_private(sensitive_data.host_keys[i])) ++ fp = key_fingerprint(sensitive_data.host_keys[i], ++ key_fp_type_select(), SSH_FP_HEX); ++ else ++ fp = NULL; + key_free(sensitive_data.host_keys[i]); + sensitive_data.host_keys[i] = NULL; ++ if (fp != NULL) { ++ if (privsep) ++ PRIVSEP(audit_destroy_sensitive_data(fp, ++ pid, uid)); ++ else ++ audit_destroy_sensitive_data(fp, ++ pid, uid); ++ xfree(fp); ++ } + } +- if (sensitive_data.host_certificates[i]) { ++ if (sensitive_data.host_certificates ++ && sensitive_data.host_certificates[i]) { + key_free(sensitive_data.host_certificates[i]); + sensitive_data.host_certificates[i] = NULL; + } + } + sensitive_data.ssh1_host_key = NULL; + memset(sensitive_data.ssh1_cookie, 0, SSH_SESSION_KEY_LENGTH); + } + + /* Demote private to public keys for network child */ + void + demote_sensitive_data(void) + { + Key *tmp; ++ pid_t pid; ++ uid_t uid; + int i; + + if (sensitive_data.server_key) { + tmp = key_demote(sensitive_data.server_key); + key_free(sensitive_data.server_key); + sensitive_data.server_key = tmp; + } + ++ pid = getpid(); ++ uid = getuid(); + for (i = 0; i < options.num_host_key_files; i++) { + if (sensitive_data.host_keys[i]) { ++ char *fp; ++ ++ if (key_is_private(sensitive_data.host_keys[i])) ++ fp = key_fingerprint(sensitive_data.host_keys[i], ++ key_fp_type_select(), SSH_FP_HEX); ++ else ++ fp = NULL; + tmp = key_demote(sensitive_data.host_keys[i]); + key_free(sensitive_data.host_keys[i]); + sensitive_data.host_keys[i] = tmp; + if (tmp->type == KEY_RSA1) + sensitive_data.ssh1_host_key = tmp; ++ if (fp != NULL) { ++ audit_destroy_sensitive_data(fp, pid, uid); ++ xfree(fp); ++ } + } + /* Certs do not need demotion */ + } + + /* We do not clear ssh1_host key and cookie. XXX - Okay Niels? */ + } + + static void +@@ -1154,16 +1202,17 @@ server_accept_loop(int *sock_in, int *so + + /* Wait in select until there is a connection. */ + ret = select(maxfd+1, fdset, NULL, NULL, NULL); + if (ret < 0 && errno != EINTR) + error("select: %.100s", strerror(errno)); + if (received_sigterm) { + logit("Received signal %d; terminating.", + (int) received_sigterm); ++ destroy_sensitive_data(0); + close_listen_socks(); + unlink(options.pid_file); + exit(received_sigterm == SIGTERM ? 0 : 255); + } + if (key_used && key_do_regen) { + generate_ephemeral_server_key(); + key_used = 0; + key_do_regen = 0; +@@ -2077,27 +2126,28 @@ main(int ac, char **av) + /* + * In privilege separation, we fork another child and prepare + * file descriptor passing. + */ + if (use_privsep) { + privsep_postauth(authctxt); + /* the monitor process [priv] will not return */ + if (!compat20) +- destroy_sensitive_data(); ++ destroy_sensitive_data(0); + } + + packet_set_timeout(options.client_alive_interval, + options.client_alive_count_max); + + /* Start session. */ + do_authenticated(authctxt); + + /* The connection has been terminated. */ + packet_destroy_all(1, 1); ++ destroy_sensitive_data(1); + + packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); + packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes); + verbose("Transferred: sent %llu, received %llu bytes", + (unsigned long long)obytes, (unsigned long long)ibytes); + + verbose("Closing connection to %.500s port %d", remote_ip, remote_port); + +@@ -2316,17 +2366,17 @@ do_ssh1_kex(void) + MD5_Update(&md, sensitive_data.ssh1_cookie, SSH_SESSION_KEY_LENGTH); + MD5_Final(session_key + 16, &md); + memset(buf, 0, bytes); + xfree(buf); + for (i = 0; i < 16; i++) + session_id[i] = session_key[i] ^ session_key[i + 16]; + } + /* Destroy the private and public keys. No longer. */ +- destroy_sensitive_data(); ++ destroy_sensitive_data(0); + + if (use_privsep) + mm_ssh1_session_id(session_id); + + /* Destroy the decrypted integer. It is no longer needed. */ + BN_clear_free(session_key_int); + + /* Set the session key. From this on all communications will be encrypted. */ +@@ -2427,16 +2477,18 @@ cleanup_exit(int i) + debug("Killing privsep child %d", pmonitor->m_pid); + if (kill(pmonitor->m_pid, SIGKILL) != 0 && + errno != ESRCH) + error("%s: kill(%d): %s", __func__, + pmonitor->m_pid, strerror(errno)); + } + } + is_privsep_child = use_privsep && (pmonitor != NULL) && !mm_is_monitor(); ++ if (sensitive_data.host_keys != NULL) ++ destroy_sensitive_data(is_privsep_child); + packet_destroy_all(1, is_privsep_child); + #ifdef SSH_AUDIT_EVENTS + /* done after do_cleanup so it can cancel the PAM auth 'thread' */ + if ((the_authctxt == NULL || !the_authctxt->authenticated) && + (!use_privsep || mm_is_monitor())) + audit_event(SSH_CONNECTION_ABANDON); + #endif + _exit(i); diff --git a/openssh-6.2p2-audit7-libaudit_compat.patch b/openssh-6.2p2-audit7-libaudit_compat.patch new file mode 100644 index 0000000..4def265 --- /dev/null +++ b/openssh-6.2p2-audit7-libaudit_compat.patch @@ -0,0 +1,107 @@ +# definitions for AUDIT_CRYPTO_* symbols fom libaudit 2.x + +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -25,16 +25,17 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Red Hat author: Jan F. Chadima + */ + + #include "includes.h" + #if defined(USE_LINUX_AUDIT) + #include ++#include "compat-libaudit.h" + #include + #include + + #include "log.h" + #include "audit.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" +diff --git a/openssh-6.2p2/compat-libaudit.h b/openssh-6.2p2/compat-libaudit.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/compat-libaudit.h +@@ -0,0 +1,79 @@ ++/* AUDIT_CRYPTO symbol definitions from libaudit 2.x */ ++/* libaudit.h -- ++ * Copyright 2004-2011 Red Hat Inc., Durham, North Carolina. ++ * All Rights Reserved. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Authors: ++ * Steve Grubb ++ * Rickard E. (Rik) Faith ++ */ ++#ifndef _COMPAT_LIBAUDIT_H_ ++#define _COMPAT_LIBAUDIT_H_ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#ifndef AUDIT_FIRST_CRYPTO_MSG ++#define AUDIT_FIRST_CRYPTO_MSG 2400 ++#endif ++ ++#ifndef AUDIT_CRYPTO_TEST_USER ++#define AUDIT_CRYPTO_TEST_USER 2400 /* Crypto test results */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_PARAM_CHANGE_USER ++#define AUDIT_CRYPTO_PARAM_CHANGE_USER 2401 /* Crypto attribute change */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_LOGIN ++#define AUDIT_CRYPTO_LOGIN 2402 /* Logged in as crypto officer */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_LOGOUT ++#define AUDIT_CRYPTO_LOGOUT 2403 /* Logged out from crypto */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_KEY_USER ++#define AUDIT_CRYPTO_KEY_USER 2404 /* Create,delete,negotiate */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_FAILURE_USER ++#define AUDIT_CRYPTO_FAILURE_USER 2405 /* Fail decrypt,encrypt,randomiz */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_REPLAY_USER ++#define AUDIT_CRYPTO_REPLAY_USER 2406 /* Crypto replay detected */ ++#endif ++ ++#ifndef AUDIT_CRYPTO_SESSION ++#define AUDIT_CRYPTO_SESSION 2407 /* Record parameters set during ++ TLS session establishment */ ++#endif ++ ++ ++#ifndef AUDIT_LAST_CRYPTO_MSG ++#define AUDIT_LAST_CRYPTO_MSG 2499 ++#endif ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _COMPAT_LIBAUDIT_H_ */ ++ diff --git a/openssh-6.2p2-audit8-libaudit_dns_timeouts.patch b/openssh-6.2p2-audit8-libaudit_dns_timeouts.patch new file mode 100644 index 0000000..8e7f191 --- /dev/null +++ b/openssh-6.2p2-audit8-libaudit_dns_timeouts.patch @@ -0,0 +1,47 @@ +# bnc#752354, bnc#757360 +# prevent timeouts in libaudit code caused by DNS misconfiguration by +# explicitely disabling DNS lookups in libaudit when UseDNS is false. +# Note that this particular solution causes the logs to always contain +# "hostname=?, addr=?" when DNS lookups are disabled. + +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -62,17 +62,17 @@ linux_audit_user_logxxx(int uid, const c + if (errno == EINVAL || errno == EPROTONOSUPPORT || + errno == EAFNOSUPPORT) + return; /* No audit support in kernel */ + else + goto fatal_report; /* Must prevent login */ + } + rc = audit_log_acct_message(audit_fd, event, + NULL, "login", username ? username : "(unknown)", +- username == NULL ? uid : -1, hostname, ip, ttyn, success); ++ username == NULL ? uid : -1, options.use_dns ? hostname : NULL, ip, ttyn, success); + saved_errno = errno; + close(audit_fd); + /* + * Do not report error if the error is EPERM and sshd is run as non + * root user. + */ + if ((rc == -EPERM) && (geteuid() != 0)) + rc = 0; +@@ -114,17 +114,17 @@ linux_audit_user_auth(int uid, const cha + goto fatal_report; /* Must prevent login */ + } + + if ((event < 0) || (event > SSH_AUDIT_UNKNOWN)) + event = SSH_AUDIT_UNKNOWN; + + rc = audit_log_acct_message(audit_fd, AUDIT_USER_AUTH, + NULL, event_name[event], username ? username : "(unknown)", +- username == NULL ? uid : -1, hostname, ip, ttyn, success); ++ username == NULL ? uid : -1, options.use_dns ? hostname : NULL, ip, ttyn, success); + saved_errno = errno; + close(audit_fd); + /* + * Do not report error if the error is EPERM and sshd is run as non + * root user. + */ + if ((rc == -EPERM) && (geteuid() != 0)) + rc = 0; diff --git a/openssh-6.2p2-blocksigalrm.patch b/openssh-6.2p2-blocksigalrm.patch new file mode 100644 index 0000000..c709009 --- /dev/null +++ b/openssh-6.2p2-blocksigalrm.patch @@ -0,0 +1,73 @@ +# block SIGALRM while logging through syslog to prevent deadlocks (through +# grace_alarm_handler) +# bnc#57354 + +diff --git a/openssh-6.2p2/log.c b/openssh-6.2p2/log.c +--- a/openssh-6.2p2/log.c ++++ b/openssh-6.2p2/log.c +@@ -46,16 +46,17 @@ + #include + #include + #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) + # include + #endif + + #include "xmalloc.h" + #include "log.h" ++#include + + static LogLevel log_level = SYSLOG_LEVEL_INFO; + static int log_on_stderr = 1; + static int log_facility = LOG_AUTH; + static char *argv0; + static log_handler_fn *log_handler; + static void *log_handler_ctx; + +@@ -368,16 +369,17 @@ do_log(LogLevel level, const char *fmt, + { + #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) + struct syslog_data sdata = SYSLOG_DATA_INIT; + #endif + char msgbuf[MSGBUFSIZ]; + char fmtbuf[MSGBUFSIZ]; + char *txt = NULL; + int pri = LOG_INFO; ++ sigset_t nset, oset; + int saved_errno = errno; + log_handler_fn *tmp_handler; + + if (level > log_level) + return; + + switch (level) { + case SYSLOG_LEVEL_FATAL: +@@ -426,20 +428,29 @@ do_log(LogLevel level, const char *fmt, + tmp_handler = log_handler; + log_handler = NULL; + tmp_handler(level, fmtbuf, log_handler_ctx); + log_handler = tmp_handler; + } else if (log_on_stderr) { + snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); + write(STDERR_FILENO, msgbuf, strlen(msgbuf)); + } else { ++ /* Prevent a race between the grace_alarm ++ * which writes a log message and terminates ++ * and main sshd code that leads to deadlock ++ * as syslog is not async safe. ++ */ ++ sigemptyset(&nset); ++ sigaddset(&nset, SIGALRM); ++ sigprocmask(SIG_BLOCK, &nset, &oset); + #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) + openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); + syslog_r(pri, &sdata, "%.500s", fmtbuf); + closelog_r(&sdata); + #else + openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); + syslog(pri, "%.500s", fmtbuf); + closelog(); + #endif ++ sigprocmask(SIG_SETMASK, &oset, NULL); + } + errno = saved_errno; + } diff --git a/openssh-6.2p2-default-protocol.patch b/openssh-6.2p2-default-protocol.patch new file mode 100644 index 0000000..6d2d2b8 --- /dev/null +++ b/openssh-6.2p2-default-protocol.patch @@ -0,0 +1,24 @@ +# only enable SSHv2 protocol by default (upstream default is fallback to v1) + +diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +--- a/openssh-6.2p2/ssh_config ++++ b/openssh-6.2p2/ssh_config +@@ -41,17 +41,17 @@ ForwardX11Trusted yes + # CheckHostIP yes + # AddressFamily any + # ConnectTimeout 0 + # StrictHostKeyChecking ask + # IdentityFile ~/.ssh/identity + # IdentityFile ~/.ssh/id_rsa + # IdentityFile ~/.ssh/id_dsa + # Port 22 +-# Protocol 2,1 ++Protocol 2 + # Cipher 3des + # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc + # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 + # EscapeChar ~ + # Tunnel no + # TunnelDevice any:any + # PermitLocalCommand no + # VisualHostKey no diff --git a/openssh-6.2p2-disable-openssl-abi-check.patch b/openssh-6.2p2-disable-openssl-abi-check.patch new file mode 100644 index 0000000..3f382ff --- /dev/null +++ b/openssh-6.2p2-disable-openssl-abi-check.patch @@ -0,0 +1,32 @@ +# disable run-time check for OpenSSL ABI by version number as that is not a +# reliable indicator of ABI changes and doesn't make much sense in a +# distribution package + +diff --git a/openssh-6.2p2/entropy.c b/openssh-6.2p2/entropy.c +--- a/openssh-6.2p2/entropy.c ++++ b/openssh-6.2p2/entropy.c +@@ -212,22 +212,23 @@ seed_rng(void) + #endif + /* + * OpenSSL version numbers: MNNFFPPS: major minor fix patch status + * We match major, minor, fix and status (not patch) for <1.0.0. + * After that, we acceptable compatible fix versions (so we + * allow 1.0.1 to work with 1.0.0). Going backwards is only allowed + * within a patch series. + */ ++#if 0 + u_long version_mask = SSLeay() >= 0x1000000f ? ~0xffff0L : ~0xff0L; + if (((SSLeay() ^ OPENSSL_VERSION_NUMBER) & version_mask) || + (SSLeay() >> 12) < (OPENSSL_VERSION_NUMBER >> 12)) + fatal("OpenSSL version mismatch. Built against %lx, you " + "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay()); +- ++#endif + #ifndef OPENSSL_PRNG_ONLY + if (RAND_status() == 1) { + debug3("RNG is ready, skipping seeding"); + return; + } + + if (seed_from_prngd(buf, sizeof(buf)) == -1) + fatal("Could not obtain seed from PRNGd"); diff --git a/openssh-6.2p2-eal3.patch b/openssh-6.2p2-eal3.patch new file mode 100644 index 0000000..77501c9 --- /dev/null +++ b/openssh-6.2p2-eal3.patch @@ -0,0 +1,85 @@ +# fix paths and references in sshd man pages + +diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 +--- a/openssh-6.2p2/sshd.8 ++++ b/openssh-6.2p2/sshd.8 +@@ -871,17 +871,17 @@ See + If this file exists, + .Nm + refuses to let anyone except root log in. + The contents of the file + are displayed to anyone trying to log in, and non-root connections are + refused. + The file should be world-readable. + .Pp +-.It Pa /etc/shosts.equiv ++.It Pa /etc/ssh/shosts.equiv + This file is used in exactly the same way as + .Pa hosts.equiv , + but allows host-based authentication without permitting login with + rlogin/rsh. + .Pp + .It Pa /etc/ssh/ssh_host_key + .It Pa /etc/ssh/ssh_host_dsa_key + .It Pa /etc/ssh/ssh_host_ecdsa_key +@@ -950,17 +950,17 @@ The content of this file is not sensitiv + .Xr sftp 1 , + .Xr ssh 1 , + .Xr ssh-add 1 , + .Xr ssh-agent 1 , + .Xr ssh-keygen 1 , + .Xr ssh-keyscan 1 , + .Xr chroot 2 , + .Xr hosts_access 5 , +-.Xr login.conf 5 , ++.Xr login.defs 5 , + .Xr moduli 5 , + .Xr sshd_config 5 , + .Xr inetd 8 , + .Xr sftp-server 8 + .Sh AUTHORS + OpenSSH is a derivative of the original and free + ssh 1.2.12 release by Tatu Ylonen. + Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, +diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 +--- a/openssh-6.2p2/sshd_config.5 ++++ b/openssh-6.2p2/sshd_config.5 +@@ -271,18 +271,17 @@ The contents of the specified file are s + authentication is allowed. + If the argument is + .Dq none + then no banner is displayed. + This option is only available for protocol version 2. + By default, no banner is displayed. + .It Cm ChallengeResponseAuthentication + Specifies whether challenge-response authentication is allowed (e.g. via +-PAM or though authentication styles supported in +-.Xr login.conf 5 ) ++PAM) + The default is + .Dq yes . + .It Cm ChrootDirectory + Specifies the pathname of a directory to + .Xr chroot 2 + to after authentication. + All components of the pathname must be root-owned directories that are + not writable by any other user or group. +@@ -550,17 +549,17 @@ and + .Pa .shosts + files will not be used in + .Cm RhostsRSAAuthentication + or + .Cm HostbasedAuthentication . + .Pp + .Pa /etc/hosts.equiv + and +-.Pa /etc/shosts.equiv ++.Pa /etc/ssh/shosts.equiv + are still used. + The default is + .Dq yes . + .It Cm IgnoreUserKnownHosts + Specifies whether + .Xr sshd 8 + should ignore the user's + .Pa ~/.ssh/known_hosts diff --git a/openssh-6.2p2-fingerprint_hash.patch b/openssh-6.2p2-fingerprint_hash.patch new file mode 100644 index 0000000..41f07e8 --- /dev/null +++ b/openssh-6.2p2-fingerprint_hash.patch @@ -0,0 +1,671 @@ +# HG changeset patch +# Parent 3d1c0ed188101c45a132baae0b78f93a1d0e6160 + +# select fingerprint hash algorithms based on the environment variable +# SSH_FP_TYPE_ENVVAR and append it to hex and randomart fingerprints +# Petr Cerny + +diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c +--- a/openssh-6.2p2/auth-rsa.c ++++ b/openssh-6.2p2/auth-rsa.c +@@ -323,17 +323,17 @@ auth_rsa(Authctxt *authctxt, BIGNUM *cli + return (0); + } + /* + * Correct response. The client has been successfully + * authenticated. Note that we have not yet processed the + * options; this will be reset if the options cause the + * authentication to be rejected. + */ +- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + verbose("Found matching %s key: %s", + key_type(key), fp); + xfree(fp); + key_free(key); + + packet_send_debug("RSA authentication accepted."); + return (1); + } +diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c +--- a/openssh-6.2p2/auth.c ++++ b/openssh-6.2p2/auth.c +@@ -658,17 +658,17 @@ auth_key_is_revoked(Key *key) + case -1: + /* Error opening revoked_keys_file: refuse all keys */ + error("Revoked keys file is unreadable: refusing public key " + "authentication"); + return 1; + case 1: + revoked: + /* Key revoked */ +- key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ key_fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + error("WARNING: authentication attempt with a revoked " + "%s key %s ", key_type(key), key_fp); + xfree(key_fp); + return 1; + } + fatal("key_in_file returned junk"); + } + +diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c +--- a/openssh-6.2p2/auth2-hostbased.c ++++ b/openssh-6.2p2/auth2-hostbased.c +@@ -192,23 +192,23 @@ hostbased_key_allowed(struct passwd *pw, + _PATH_SSH_SYSTEM_HOSTFILE2, + options.ignore_user_known_hosts ? NULL : + _PATH_SSH_USER_HOSTFILE2); + } + + if (host_status == HOST_OK) { + if (key_is_cert(key)) { + fp = key_fingerprint(key->cert->signature_key, +- SSH_FP_MD5, SSH_FP_HEX); ++ key_fp_type_select(), SSH_FP_HEX); + verbose("Accepted certificate ID \"%s\" signed by " + "%s CA %s from %s@%s", key->cert->key_id, + key_type(key->cert->signature_key), fp, + cuser, lookup); + } else { +- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + verbose("Accepted %s public key %s from %s@%s", + key_type(key), fp, cuser, lookup); + } + xfree(fp); + } + + return (host_status == HOST_OK); + } +diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c +--- a/openssh-6.2p2/auth2-pubkey.c ++++ b/openssh-6.2p2/auth2-pubkey.c +@@ -312,17 +312,17 @@ check_authkeys_file(FILE *f, char *file, + if (key_is_cert(key)) { + if (!key_equal(found, key->cert->signature_key)) + continue; + if (auth_parse_options(pw, key_options, file, + linenum) != 1) + continue; + if (!key_is_cert_authority) + continue; +- fp = key_fingerprint(found, SSH_FP_MD5, ++ fp = key_fingerprint(found, key_fp_type_select(), + SSH_FP_HEX); + debug("matching CA found: file %s, line %lu, %s %s", + file, linenum, key_type(found), fp); + /* + * If the user has specified a list of principals as + * a key option, then prefer that list to matching + * their username in the certificate principals list. + */ +@@ -355,17 +355,17 @@ check_authkeys_file(FILE *f, char *file, + if (auth_parse_options(pw, key_options, file, + linenum) != 1) + continue; + if (key_is_cert_authority) + continue; + found_key = 1; + debug("matching key found: file %s, line %lu", + file, linenum); +- fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(found, key_fp_type_select(), SSH_FP_HEX); + verbose("Found matching %s key: %s", + key_type(found), fp); + xfree(fp); + break; + } + } + key_free(found); + if (!found_key) +@@ -380,17 +380,17 @@ user_cert_trusted_ca(struct passwd *pw, + char *ca_fp, *principals_file = NULL; + const char *reason; + int ret = 0; + + if (!key_is_cert(key) || options.trusted_user_ca_keys == NULL) + return 0; + + ca_fp = key_fingerprint(key->cert->signature_key, +- SSH_FP_MD5, SSH_FP_HEX); ++ key_fp_type_select(), SSH_FP_HEX); + + if (key_in_file(key->cert->signature_key, + options.trusted_user_ca_keys, 1) != 1) { + debug2("%s: CA %s %s is not listed in %s", __func__, + key_type(key->cert->signature_key), ca_fp, + options.trusted_user_ca_keys); + goto out; + } +diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c +--- a/openssh-6.2p2/key.c ++++ b/openssh-6.2p2/key.c +@@ -391,30 +391,38 @@ key_fingerprint_raw(const Key *k, enum f + xfree(blob); + } else { + fatal("key_fingerprint_raw: blob is null"); + } + return retval; + } + + static char * +-key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len) ++key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len, enum fp_type dgst_type) + { + char *retval; + u_int i; + +- retval = xcalloc(1, dgst_raw_len * 3 + 1); ++ retval = xcalloc(1, dgst_raw_len * 3 + 1 + SSH_FP_TYPE_STRLEN + 2); + for (i = 0; i < dgst_raw_len; i++) { + char hex[4]; + snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); + strlcat(retval, hex, dgst_raw_len * 3 + 1); + } + + /* Remove the trailing ':' character */ +- retval[(dgst_raw_len * 3) - 1] = '\0'; ++ retval[(dgst_raw_len * 3) - 1] = ' '; ++ ++ /* Append hash type */ ++ { ++ char hash[SSH_FP_TYPE_STRLEN + 2 + 1]; ++ snprintf(hash, sizeof(hash), "[%s]", key_fp_type_str(dgst_type)); ++ strlcat(retval, hash, dgst_raw_len * 3 + 1 + SSH_FP_TYPE_STRLEN + 2); ++ } ++ + return retval; + } + + static char * + key_fingerprint_bubblebabble(u_char *dgst_raw, u_int dgst_raw_len) + { + char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; + char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm', +@@ -489,17 +497,18 @@ key_fingerprint_bubblebabble(u_char *dgs + * can be in the exact middle of the picture, and FLDBASE should be >=8 . + * Else pictures would be too dense, and drawing the frame would + * fail, too, because the key type would not fit in anymore. + */ + #define FLDBASE 8 + #define FLDSIZE_Y (FLDBASE + 1) + #define FLDSIZE_X (FLDBASE * 2 + 1) + static char * +-key_fingerprint_randomart(u_char *dgst_raw, u_int dgst_raw_len, const Key *k) ++key_fingerprint_randomart(u_char *dgst_raw, u_int dgst_raw_len, const Key *k, ++ enum fp_type dgst_type) + { + /* + * Chars to be used after each other every time the worm + * intersects with itself. Matter of taste. + */ + char *augmentation_string = " .o+=*BOX@%&#/^SE"; + char *retval, *p; + u_char field[FLDSIZE_X][FLDSIZE_Y]; +@@ -556,18 +565,19 @@ key_fingerprint_randomart(u_char *dgst_r + *p++ = '|'; + for (x = 0; x < FLDSIZE_X; x++) + *p++ = augmentation_string[MIN(field[x][y], len)]; + *p++ = '|'; + *p++ = '\n'; + } + + /* output lower border */ +- *p++ = '+'; +- for (i = 0; i < FLDSIZE_X; i++) ++ i = snprintf(p, FLDSIZE_X, "+--[%s]", key_fp_type_str(dgst_type)); ++ p += i; ++ for (i--; i < FLDSIZE_X; i++) + *p++ = '-'; + *p++ = '+'; + + return retval; + } + + char * + key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep) +@@ -576,34 +586,91 @@ key_fingerprint(Key *k, enum fp_type dgs + u_char *dgst_raw; + u_int dgst_raw_len; + + dgst_raw = key_fingerprint_raw(k, dgst_type, &dgst_raw_len); + if (!dgst_raw) + fatal("key_fingerprint: null from key_fingerprint_raw()"); + switch (dgst_rep) { + case SSH_FP_HEX: +- retval = key_fingerprint_hex(dgst_raw, dgst_raw_len); ++ retval = key_fingerprint_hex(dgst_raw, dgst_raw_len, dgst_type); + break; + case SSH_FP_BUBBLEBABBLE: + retval = key_fingerprint_bubblebabble(dgst_raw, dgst_raw_len); + break; + case SSH_FP_RANDOMART: +- retval = key_fingerprint_randomart(dgst_raw, dgst_raw_len, k); ++ retval = key_fingerprint_randomart(dgst_raw, dgst_raw_len, k, dgst_type); + break; + default: + fatal("key_fingerprint: bad digest representation %d", + dgst_rep); + break; + } + memset(dgst_raw, 0, dgst_raw_len); + xfree(dgst_raw); + return retval; + } + ++enum fp_type ++key_fp_type_select(void) ++{ ++ static enum fp_type fp; ++ static char fp_defined = 0; ++ char *env; ++ ++ if (!fp_defined) { ++ env = getenv(SSH_FP_TYPE_ENVVAR); ++ if (env) { ++ if (!strcasecmp(env, "md5") || ++ !strcasecmp(env, "md-5")) ++ fp = SSH_FP_MD5; ++ else if (!strcasecmp(env, "sha1") || ++ !strcasecmp(env, "sha-1")) ++ fp = SSH_FP_SHA1; ++#ifdef HAVE_EVP_SHA256 ++ else if (!strcasecmp(env, "sha256") || ++ !strcasecmp(env, "sha-256")) ++ fp = SSH_FP_SHA256; ++#endif ++ else { ++ error("invalid key type in environment variable " ++ SSH_FP_TYPE_ENVVAR ": '%s' - falling back to MD5.", ++ env); ++ fp = SSH_FP_MD5; ++ } ++ } else ++ fp = SSH_FP_MD5; ++ ++ fp_defined = 1; ++ } ++ return fp; ++} ++ ++/* ++ * string lengths must be less or equal to SSH_FP_TYPE_STRLEN (defined in ++ * key.h) as to fit into the fingerprint string buffer ++ */ ++char * ++key_fp_type_str(enum fp_type dgst_type) ++{ ++ switch (dgst_type) { ++ case SSH_FP_MD5: ++ return "MD5"; ++ case SSH_FP_SHA1: ++ return "SHA-1"; ++#ifdef HAVE_EVP_SHA256 ++ case SSH_FP_SHA256: ++ return "SHA-256"; ++#endif ++ default: ++ fatal("%s: unknown key fingerprint hash algorithm requested", __func__); ++ } ++} ++ ++ + /* + * Reads a multiple-precision integer in decimal from the buffer, and advances + * the pointer. The integer must already be initialized. This function is + * permitted to modify the buffer. This leaves *cpp to point just beyond the + * last processed (and maybe modified) character. Note that this may modify + * the buffer containing the number. + */ + static int +diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h +--- a/openssh-6.2p2/key.h ++++ b/openssh-6.2p2/key.h +@@ -51,16 +51,18 @@ enum fp_type { + SSH_FP_MD5, + SSH_FP_SHA256 + }; + enum fp_rep { + SSH_FP_HEX, + SSH_FP_BUBBLEBABBLE, + SSH_FP_RANDOMART + }; ++#define SSH_FP_TYPE_ENVVAR "SSH_FINGERPRINT_TYPE" ++#define SSH_FP_TYPE_STRLEN 8 + + /* key is stored in external hardware */ + #define KEY_FLAG_EXT 0x0001 + + #define CERT_MAX_PRINCIPALS 256 + struct KeyCert { + Buffer certblob; /* Kept around for use on wire */ + u_int type; /* SSH2_CERT_TYPE_USER or SSH2_CERT_TYPE_HOST */ +@@ -97,16 +99,18 @@ int key_equal_public(const Key *, cons + int key_equal(const Key *, const Key *); + char *key_fingerprint(Key *, enum fp_type, enum fp_rep); + u_char *key_fingerprint_raw(const Key *, enum fp_type, u_int *); + const char *key_type(const Key *); + const char *key_cert_type(const Key *); + int key_write(const Key *, FILE *); + int key_read(Key *, char **); + u_int key_size(const Key *); ++enum fp_type key_fp_type_select(void); ++char *key_fp_type_str(enum fp_type); + + Key *key_generate(int, u_int); + Key *key_from_private(const Key *); + int key_type_from_name(char *); + int key_is_cert(const Key *); + int key_type_plain(int); + int key_to_certified(Key *, int); + int key_drop_cert(Key *); +diff --git a/openssh-6.2p2/ssh-add.c b/openssh-6.2p2/ssh-add.c +--- a/openssh-6.2p2/ssh-add.c ++++ b/openssh-6.2p2/ssh-add.c +@@ -321,17 +321,17 @@ list_identities(AuthenticationConnection + int version; + + for (version = 1; version <= 2; version++) { + for (key = ssh_get_first_identity(ac, &comment, version); + key != NULL; + key = ssh_get_next_identity(ac, &comment, version)) { + had_identities = 1; + if (do_fp) { +- fp = key_fingerprint(key, SSH_FP_MD5, ++ fp = key_fingerprint(key, key_fp_type_select(), + SSH_FP_HEX); + printf("%d %s %s (%s)\n", + key_size(key), fp, comment, key_type(key)); + xfree(fp); + } else { + if (!key_write(key, stdout)) + fprintf(stderr, "key_write failed"); + fprintf(stdout, " %s\n", comment); +diff --git a/openssh-6.2p2/ssh-agent.c b/openssh-6.2p2/ssh-agent.c +--- a/openssh-6.2p2/ssh-agent.c ++++ b/openssh-6.2p2/ssh-agent.c +@@ -194,17 +194,17 @@ lookup_identity(Key *key, int version) + + /* Check confirmation of keysign request */ + static int + confirm_key(Identity *id) + { + char *p; + int ret = -1; + +- p = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX); ++ p = key_fingerprint(id->key, key_fp_type_select(), SSH_FP_HEX); + if (ask_permission("Allow use of key %s?\nKey fingerprint %s.", + id->comment, p)) + ret = 0; + xfree(p); + + return (ret); + } + +diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c +--- a/openssh-6.2p2/ssh-keygen.c ++++ b/openssh-6.2p2/ssh-keygen.c +@@ -768,29 +768,29 @@ do_fingerprint(struct passwd *pw) + FILE *f; + Key *public; + char *comment = NULL, *cp, *ep, line[16*1024], *fp, *ra; + int i, skip = 0, num = 0, invalid = 1; + enum fp_rep rep; + enum fp_type fptype; + struct stat st; + +- fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; ++ fptype = print_bubblebabble ? SSH_FP_SHA1 : key_fp_type_select(); + rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; + + if (!have_identity) + ask_filename(pw, "Enter file in which the key is"); + if (stat(identity_file, &st) < 0) { + perror(identity_file); + exit(1); + } + public = key_load_public(identity_file, &comment); + if (public != NULL) { + fp = key_fingerprint(public, fptype, rep); +- ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); ++ ra = key_fingerprint(public, key_fp_type_select(), SSH_FP_RANDOMART); + printf("%u %s %s (%s)\n", key_size(public), fp, comment, + key_type(public)); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); + key_free(public); + xfree(comment); + xfree(ra); + xfree(fp); +@@ -846,17 +846,17 @@ do_fingerprint(struct passwd *pw) + public = key_new(KEY_UNSPEC); + if (key_read(public, &cp) != 1) { + key_free(public); + continue; + } + } + comment = *cp ? cp : comment; + fp = key_fingerprint(public, fptype, rep); +- ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); ++ ra = key_fingerprint(public, key_fp_type_select(), SSH_FP_RANDOMART); + printf("%u %s %s (%s)\n", key_size(public), fp, + comment ? comment : "no comment", key_type(public)); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); + xfree(ra); + xfree(fp); + key_free(public); + invalid = 0; +@@ -967,20 +967,20 @@ do_gen_all_hostkeys(struct passwd *pw) + static void + printhost(FILE *f, const char *name, Key *public, int ca, int hash) + { + if (print_fingerprint) { + enum fp_rep rep; + enum fp_type fptype; + char *fp, *ra; + +- fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; ++ fptype = print_bubblebabble ? SSH_FP_SHA1 : key_fp_type_select(); + rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; + fp = key_fingerprint(public, fptype, rep); +- ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); ++ ra = key_fingerprint(public, key_fp_type_select(), SSH_FP_RANDOMART); + printf("%u %s %s (%s)\n", key_size(public), fp, name, + key_type(public)); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); + xfree(ra); + xfree(fp); + } else { + if (hash && (name = host_hash(name, NULL, 0)) == NULL) +@@ -1849,19 +1849,19 @@ do_show_cert(struct passwd *pw) + if (stat(identity_file, &st) < 0) + fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); + if ((key = key_load_public(identity_file, NULL)) == NULL) + fatal("%s is not a public key", identity_file); + if (!key_is_cert(key)) + fatal("%s is not a certificate", identity_file); + v00 = key->type == KEY_RSA_CERT_V00 || key->type == KEY_DSA_CERT_V00; + +- key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ key_fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + ca_fp = key_fingerprint(key->cert->signature_key, +- SSH_FP_MD5, SSH_FP_HEX); ++ key_fp_type_select(), SSH_FP_HEX); + + printf("%s:\n", identity_file); + printf(" Type: %s %s certificate\n", key_ssh_name(key), + key_cert_type(key)); + printf(" Public key: %s %s\n", key_type(key), key_fp); + printf(" Signing CA: %s %s\n", + key_type(key->cert->signature_key), ca_fp); + printf(" Key ID: \"%s\"\n", key->cert->key_id); +@@ -2646,18 +2646,18 @@ passphrase_again: + exit(1); + } + if (!key_write(public, f)) + fprintf(stderr, "write key failed\n"); + fprintf(f, " %s\n", comment); + fclose(f); + + if (!quiet) { +- char *fp = key_fingerprint(public, SSH_FP_MD5, SSH_FP_HEX); +- char *ra = key_fingerprint(public, SSH_FP_MD5, ++ char *fp = key_fingerprint(public, key_fp_type_select(), SSH_FP_HEX); ++ char *ra = key_fingerprint(public, key_fp_type_select(), + SSH_FP_RANDOMART); + printf("Your public key has been saved in %s.\n", + identity_file); + printf("The key fingerprint is:\n"); + printf("%s %s\n", fp, comment); + printf("The key's randomart image is:\n"); + printf("%s\n", ra); + xfree(ra); +diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c +--- a/openssh-6.2p2/sshconnect.c ++++ b/openssh-6.2p2/sshconnect.c +@@ -826,18 +826,18 @@ check_host_key(char *hostname, struct so + "address '%.128s' to the list of known " + "hosts (%.30s).", type, ip, + user_hostfiles[0]); + else + logit("Warning: Permanently added the %s host " + "key for IP address '%.128s' to the list " + "of known hosts.", type, ip); + } else if (options.visual_host_key) { +- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); +- ra = key_fingerprint(host_key, SSH_FP_MD5, ++ fp = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_HEX); ++ ra = key_fingerprint(host_key, key_fp_type_select(), + SSH_FP_RANDOMART); + logit("Host key fingerprint is %s\n%s\n", fp, ra); + xfree(ra); + xfree(fp); + } + break; + case HOST_NEW: + if (options.host_key_alias == NULL && port != 0 && +@@ -867,18 +867,18 @@ check_host_key(char *hostname, struct so + + if (show_other_keys(host_hostkeys, host_key)) + snprintf(msg1, sizeof(msg1), + "\nbut keys of different type are already" + " known for this host."); + else + snprintf(msg1, sizeof(msg1), "."); + /* The default */ +- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); +- ra = key_fingerprint(host_key, SSH_FP_MD5, ++ fp = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_HEX); ++ ra = key_fingerprint(host_key, key_fp_type_select(), + SSH_FP_RANDOMART); + msg2[0] = '\0'; + if (options.verify_host_key_dns) { + if (matching_host_key_dns) + snprintf(msg2, sizeof(msg2), + "Matching host key fingerprint" + " found in DNS.\n"); + else +@@ -1132,17 +1132,17 @@ fail: + + /* returns 0 if key verifies or -1 if key does NOT verify */ + int + verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key) + { + int flags = 0; + char *fp; + +- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_HEX); + debug("Server host key: %s %s", key_type(host_key), fp); + xfree(fp); + + /* XXX certs are not yet supported for DNS */ + if (!key_is_cert(host_key) && options.verify_host_key_dns && + verify_host_key_dns(host, hostaddr, host_key, &flags) == 0) { + if (flags & DNS_VERIFY_FOUND) { + +@@ -1234,18 +1234,18 @@ show_other_keys(struct hostkeys *hostkey + char *fp, *ra; + const struct hostkey_entry *found; + + for (i = 0; type[i] != -1; i++) { + if (type[i] == key->type) + continue; + if (!lookup_key_in_hostkeys_by_type(hostkeys, type[i], &found)) + continue; +- fp = key_fingerprint(found->key, SSH_FP_MD5, SSH_FP_HEX); +- ra = key_fingerprint(found->key, SSH_FP_MD5, SSH_FP_RANDOMART); ++ fp = key_fingerprint(found->key, key_fp_type_select(), SSH_FP_HEX); ++ ra = key_fingerprint(found->key, key_fp_type_select(), SSH_FP_RANDOMART); + logit("WARNING: %s key found for host %s\n" + "in %s:%lu\n" + "%s key fingerprint %s.", + key_type(found->key), + found->host, found->file, found->line, + key_type(found->key), fp); + if (options.visual_host_key) + logit("%s", ra); +@@ -1256,17 +1256,17 @@ show_other_keys(struct hostkeys *hostkey + return ret; + } + + static void + warn_changed_key(Key *host_key) + { + char *fp; + +- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_HEX); + + error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); + error("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); + error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); + error("IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!"); + error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); + error("It is also possible that a host key has just been changed."); + error("The fingerprint for the %s key sent by the remote host is\n%s.", +diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c +--- a/openssh-6.2p2/sshconnect2.c ++++ b/openssh-6.2p2/sshconnect2.c +@@ -592,17 +592,17 @@ input_userauth_pk_ok(int type, u_int32_t + goto done; + } + if (key->type != pktype) { + error("input_userauth_pk_ok: type mismatch " + "for decoded key (received %d, expected %d)", + key->type, pktype); + goto done; + } +- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + debug2("input_userauth_pk_ok: fp %s", fp); + xfree(fp); + + /* + * search keys in the reverse order, because last candidate has been + * moved to the end of the queue. this also avoids confusion by + * duplicate keys + */ +@@ -1207,17 +1207,17 @@ sign_and_send_pubkey(Authctxt *authctxt, + Buffer b; + u_char *blob, *signature; + u_int bloblen, slen; + u_int skip = 0; + int ret = -1; + int have_sig = 1; + char *fp; + +- fp = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(id->key, key_fp_type_select(), SSH_FP_HEX); + debug3("sign_and_send_pubkey: %s %s", key_type(id->key), fp); + xfree(fp); + + if (key_to_blob(id->key, &blob, &bloblen) == 0) { + /* we cannot handle this key */ + debug3("sign_and_send_pubkey: cannot handle key"); + return 0; + } diff --git a/openssh-6.2p2-fips.patch b/openssh-6.2p2-fips.patch new file mode 100644 index 0000000..d441f12 --- /dev/null +++ b/openssh-6.2p2-fips.patch @@ -0,0 +1,1186 @@ +# comply with FIPS 140-2 by using only approved crypto algorithms +# when OpenSSL is detected to be running in FIPS mode +# +# HG changeset patch +# Parent 6536ed881743cbf05afe962021b985f9b1eab495 + +diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in +--- a/openssh-6.2p2/Makefile.in ++++ b/openssh-6.2p2/Makefile.in +@@ -72,17 +72,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o + cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ + compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ + log.o match.o md-sha256.o moduli.o nchan.o packet.o \ + readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ + atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ + monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ + kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ + msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ +- jpake.o schnorr.o ssh-pkcs11.o krl.o auditstub.o ++ jpake.o schnorr.o ssh-pkcs11.o krl.o auditstub.o fips.o + + SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ + sshconnect.o sshconnect1.o sshconnect2.o mux.o \ + roaming_common.o roaming_client.o + + SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ + audit.o audit-bsm.o audit-linux.o platform.o \ + sshpty.o sshlogin.o servconf.o serverloop.o \ +diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c +--- a/openssh-6.2p2/auth-rsa.c ++++ b/openssh-6.2p2/auth-rsa.c +@@ -15,17 +15,17 @@ + */ + + #include "includes.h" + + #include + #include + + #include +-#include ++#include + + #include + #include + #include + #include + + #include "xmalloc.h" + #include "rsa.h" +@@ -42,16 +42,17 @@ + #include "hostfile.h" + #include "auth.h" + #ifdef GSSAPI + #include "ssh-gss.h" + #endif + #include "monitor_wrap.h" + #include "ssh.h" + #include "misc.h" ++#include "fips.h" + + /* import */ + extern ServerOptions options; + + /* + * Session identifier that is used to bind key exchange and authentication + * responses to a particular session. + */ +@@ -83,45 +84,54 @@ auth_rsa_generate_challenge(Key *key) + if (BN_mod(challenge, challenge, key->rsa->n, ctx) == 0) + fatal("auth_rsa_generate_challenge: BN_mod failed"); + BN_CTX_free(ctx); + + return challenge; + } + + int +-auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16]) ++auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[MAX_HASH_LEN]) + { +- u_char buf[32], mdbuf[16]; +- MD5_CTX md; ++ u_char buf[2 * MAX_HASH_LEN], mdbuf[MAX_HASH_LEN]; ++ const EVP_MD *evp_md; ++ EVP_MD_CTX md; + int len, rv; + #ifdef SSH_AUDIT_EVENTS + char *fp; + #endif ++ int hash_len; + + /* don't allow short keys */ + if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { + error("auth_rsa_verify_response: RSA modulus too small: %d < minimum %d bits", + BN_num_bits(key->rsa->n), SSH_RSA_MINIMUM_MODULUS_SIZE); + return (0); + } + +- /* The response is MD5 of decrypted challenge plus session id. */ ++ hash_len = fips_hash_len(fips_hash_min()); ++ ++ /* The response is a hash of decrypted challenge plus session id. ++ * Normally this is MD5, in FIPS mode a stronger function is used. */ + len = BN_num_bytes(challenge); +- if (len <= 0 || len > 32) ++ if (len <= 0 || len > (2 * hash_len)) + fatal("auth_rsa_verify_response: bad challenge length %d", len); +- memset(buf, 0, 32); +- BN_bn2bin(challenge, buf + 32 - len); +- MD5_Init(&md); +- MD5_Update(&md, buf, 32); +- MD5_Update(&md, session_id, 16); +- MD5_Final(mdbuf, &md); ++ memset(buf, 0, sizeof(buf)); ++ BN_bn2bin(challenge, buf + 2 * hash_len - len); ++ ++ if ((evp_md = fips_EVP_get_digest_min()) == NULL) { ++ fatal("auth_rsa_verify_response: fips_EVP_get_digest_min failed"); ++ } ++ EVP_DigestInit(&md, evp_md); ++ EVP_DigestUpdate(&md, buf, 2 * hash_len); ++ EVP_DigestUpdate(&md, session_id, hash_len); ++ EVP_DigestFinal(&md, mdbuf, NULL); + + /* Verify that the response is the original challenge. */ +- rv = timingsafe_bcmp(response, mdbuf, 16) == 0; ++ rv = timingsafe_bcmp(response, mdbuf, hash_len) == 0; + + #ifdef SSH_AUDIT_EVENTS + fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + if (audit_keyusage(1, "ssh-rsa1", RSA_size(key->rsa) * 8, fp, rv) == 0) { + debug("unsuccessful audit"); + rv = 0; + } + xfree(fp); +@@ -135,17 +145,17 @@ auth_rsa_verify_response(Key *key, BIGNU + * and returns true (non-zero) if the client gave the correct answer to + * our challenge; returns zero if the client gives a wrong answer. + */ + + int + auth_rsa_challenge_dialog(Key *key) + { + BIGNUM *challenge, *encrypted_challenge; +- u_char response[16]; ++ u_char response[MAX_HASH_LEN]; + int i, success; + + if ((encrypted_challenge = BN_new()) == NULL) + fatal("auth_rsa_challenge_dialog: BN_new() failed"); + + challenge = PRIVSEP(auth_rsa_generate_challenge(key)); + + /* Encrypt the challenge with the public key. */ +@@ -155,17 +165,17 @@ auth_rsa_challenge_dialog(Key *key) + packet_start(SSH_SMSG_AUTH_RSA_CHALLENGE); + packet_put_bignum(encrypted_challenge); + packet_send(); + BN_clear_free(encrypted_challenge); + packet_write_wait(); + + /* Wait for a response. */ + packet_read_expect(SSH_CMSG_AUTH_RSA_RESPONSE); +- for (i = 0; i < 16; i++) ++ for (i = 0; i < fips_hash_len(fips_hash_min()); i++) + response[i] = (u_char)packet_get_char(); + packet_check_eom(); + + success = PRIVSEP(auth_rsa_verify_response(key, challenge, response)); + BN_clear_free(challenge); + return (success); + } + +diff --git a/openssh-6.2p2/cipher-ctr.c b/openssh-6.2p2/cipher-ctr.c +--- a/openssh-6.2p2/cipher-ctr.c ++++ b/openssh-6.2p2/cipher-ctr.c +@@ -21,16 +21,17 @@ + + #include + #include + + #include + + #include "xmalloc.h" + #include "log.h" ++#include "fips.h" + + /* compatibility with old or broken OpenSSL versions */ + #include "openbsd-compat/openssl-compat.h" + + #ifndef USE_BUILTIN_RIJNDAEL + #include + #endif + +@@ -134,13 +135,15 @@ evp_aes_128_ctr(void) + aes_ctr.iv_len = AES_BLOCK_SIZE; + aes_ctr.key_len = 16; + aes_ctr.init = ssh_aes_ctr_init; + aes_ctr.cleanup = ssh_aes_ctr_cleanup; + aes_ctr.do_cipher = ssh_aes_ctr; + #ifndef SSH_OLD_EVP + aes_ctr.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | + EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV; ++ if (fips_mode()) ++ aes_ctr.flags |= EVP_CIPH_FLAG_FIPS; + #endif + return (&aes_ctr); + } + + #endif /* OPENSSL_HAVE_EVPCTR */ +diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c +--- a/openssh-6.2p2/cipher.c ++++ b/openssh-6.2p2/cipher.c +@@ -42,16 +42,17 @@ + #include + + #include + #include + + #include "xmalloc.h" + #include "log.h" + #include "cipher.h" ++#include "fips.h" + + /* compatibility with old or broken OpenSSL versions */ + #include "openbsd-compat/openssl-compat.h" + + extern const EVP_CIPHER *evp_ssh1_bf(void); + extern const EVP_CIPHER *evp_ssh1_3des(void); + extern void ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int); + +@@ -81,18 +82,57 @@ struct Cipher ciphers[] = { + { "aes128-gcm@openssh.com", + SSH_CIPHER_SSH2, 16, 16, 12, 16, 0, 0, EVP_aes_128_gcm }, + { "aes256-gcm@openssh.com", + SSH_CIPHER_SSH2, 16, 32, 12, 16, 0, 0, EVP_aes_256_gcm }, + #endif + { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, 0, 0, NULL } + }; + ++struct Cipher ciphers_fips140_2[] = { ++ { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null }, ++ { "3des", SSH_CIPHER_3DES, 8, 16, 0, 0, 0, 1, evp_ssh1_3des }, ++ ++ { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc }, ++ { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, 0, 0, 1, EVP_aes_128_cbc }, ++ { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, 0, 0, 1, EVP_aes_192_cbc }, ++ { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, 0, 0, 1, EVP_aes_256_cbc }, ++ { "rijndael-cbc@lysator.liu.se", ++ SSH_CIPHER_SSH2, 16, 32, 0, 0, 0, 1, EVP_aes_256_cbc }, ++ { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, 0, 0, 0, 0, EVP_aes_128_ctr }, ++ { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, 0, 0, 0, 0, EVP_aes_192_ctr }, ++ { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, 0, 0, 0, 0, EVP_aes_256_ctr }, ++#ifdef OPENSSL_HAVE_EVPGCM ++ { "aes128-gcm@openssh.com", ++ SSH_CIPHER_SSH2, 16, 16, 12, 16, 0, 0, EVP_aes_128_gcm }, ++ { "aes256-gcm@openssh.com", ++ SSH_CIPHER_SSH2, 16, 32, 12, 16, 0, 0, EVP_aes_256_gcm }, ++#endif ++ { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, 0, 0, NULL } ++}; ++ + /*--*/ + ++static struct Cipher * ++fips_select_ciphers(void) ++{ ++ int fips = fips_mode(); ++ switch (fips) { ++ case 0: ++ return ciphers; ++ case 1: ++ return ciphers_fips140_2; ++ default: ++ /* should not be reached */ ++ fatal("Fatal error: incorrect FIPS mode '%i' at %s:%u", ++ fips, __FILE__, __LINE__); ++// return NULL; ++ } ++} ++ + u_int + cipher_blocksize(const Cipher *c) + { + return (c->block_size); + } + + u_int + cipher_keylen(const Cipher *c) +@@ -135,27 +175,27 @@ cipher_mask_ssh1(int client) + } + return mask; + } + + Cipher * + cipher_by_name(const char *name) + { + Cipher *c; +- for (c = ciphers; c->name != NULL; c++) ++ for (c = fips_select_ciphers(); c->name != NULL; c++) + if (strcmp(c->name, name) == 0) + return c; + return NULL; + } + + Cipher * + cipher_by_number(int id) + { + Cipher *c; +- for (c = ciphers; c->name != NULL; c++) ++ for (c = fips_select_ciphers(); c->name != NULL; c++) + if (c->number == id) + return c; + return NULL; + } + + #define CIPHER_SEP "," + int + ciphers_valid(const char *names) +@@ -189,17 +229,17 @@ ciphers_valid(const char *names) + */ + + int + cipher_number(const char *name) + { + Cipher *c; + if (name == NULL) + return -1; +- for (c = ciphers; c->name != NULL; c++) ++ for (c = fips_select_ciphers(); c->name != NULL; c++) + if (strcasecmp(c->name, name) == 0) + return c->number; + return -1; + } + + char * + cipher_name(int id) + { +@@ -352,24 +392,29 @@ cipher_cleanup(CipherContext *cc) + * Selects the cipher, and keys if by computing the MD5 checksum of the + * passphrase and using the resulting 16 bytes as the key. + */ + + void + cipher_set_key_string(CipherContext *cc, Cipher *cipher, + const char *passphrase, int do_encrypt) + { +- MD5_CTX md; +- u_char digest[16]; ++ const EVP_MD *evp_md; ++ EVP_MD_CTX md; ++ u_char digest[MAX_HASH_LEN]; ++ int dlen; + +- MD5_Init(&md); +- MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase)); +- MD5_Final(digest, &md); +- +- cipher_init(cc, cipher, digest, 16, NULL, 0, do_encrypt); ++ if ((evp_md = fips_EVP_get_digest_min()) == NULL) { ++ fatal("auth_rsa_verify_response: fips_EVP_get_digest_min failed"); ++ } ++ EVP_DigestInit(&md, evp_md); ++ EVP_DigestUpdate(&md, (const u_char *)passphrase, strlen(passphrase)); ++ EVP_DigestFinal(&md, digest, &dlen); ++ ++ cipher_init(cc, cipher, digest, dlen, NULL, 0, do_encrypt); + + memset(digest, 0, sizeof(digest)); + memset(&md, 0, sizeof(md)); + } + + /* + * Exports an IV from the CipherContext required to export the key + * state back from the unprivileged child to the privileged parent +diff --git a/openssh-6.2p2/fips.c b/openssh-6.2p2/fips.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/fips.c +@@ -0,0 +1,176 @@ ++/* ++ * Copyright (c) 2012 Petr Cerny. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "fips.h" ++ ++#include "log.h" ++ ++enum hgp { ++ HGP_LEN, ++ HGP_NID ++}; ++ ++static int fips_state = -1; ++ ++static const struct Hashes { ++ enum hash_type ht; ++ int byte_length; ++ int nid; ++} hashes[] = { ++ { HASH_MD5, HASH_LEN_MD5, NID_md5 }, ++ { HASH_SHA1, HASH_LEN_SHA1, NID_sha1 }, ++ { HASH_SHA256, HASH_LEN_SHA256, NID_sha256 }, ++ { HASH_err, -1, -1 } ++}; ++ ++int ++fips_mode() ++{ ++ if (-1 == fips_state) { ++ fips_state = FIPS_mode(); ++ if (fips_state) ++ debug("FIPS mode initialized"); ++ } ++ return fips_state; ++} ++ ++static int ++fips_hash_get_param(enum hash_type ht, int param) ++{ ++ int i; ++ for (i = 0; i < HASH_err; i++) { ++ if (hashes[i].ht == ht) { ++ switch (param) { ++ case HGP_LEN: ++ return hashes[i].byte_length; ++ case HGP_NID: ++ return hashes[i].nid; ++ default: ++ fatal("Fatal error: internal error at %s:%u", ++ __FILE__, __LINE__); ++ } ++ } ++ } ++ /* should not be reached */ ++ fatal("Fatal error: incorrect hash type '%i' at %s:%u", ++ ht, __FILE__, __LINE__); ++// return -1; ++} ++ ++int ++fips_hash2nid(enum hash_type ht) ++{ ++ return fips_hash_get_param(ht, HGP_NID); ++} ++ ++int ++fips_hash_len(enum hash_type ht) ++{ ++ return fips_hash_get_param(ht, HGP_LEN); ++} ++ ++void ++fips_correct_fp_type(enum fp_type *fp) ++{ ++ int fips; ++ ++ fips = fips_mode(); ++ switch (fips) { ++ case 0: ++ break; ++ case 1: ++ if (SSH_FP_MD5 == *fp) { ++ *fp = SSH_FP_SHA1; ++ logit("MD5 not allowed in FIPS 140-2 mode, " ++ "using SHA-1 for key fingerprints instead."); ++ } ++ break; ++ default: ++ /* should not be reached */ ++ fatal("Fatal error: incorrect FIPS mode '%i' at %s:%u", ++ fips, __FILE__, __LINE__); ++ } ++ ++ return; ++} ++ ++void ++fips_correct_nid(int *nid) ++{ ++ int fips; ++ ++ fips = fips_mode(); ++ switch (fips) { ++ case 0: ++ break; ++ case 1: ++ if (NID_md5 == *nid) { ++ *nid = NID_sha1; ++ logit("MD5 not allowed in FIPS 140-2 mode, " ++ "using SHA-1 for hashing instead."); ++ } ++ break; ++ default: ++ /* should not be reached */ ++ fatal("Fatal error: incorrect FIPS mode '%i' at %s:%u", ++ fips, __FILE__, __LINE__); ++ } ++ ++ return; ++} ++ ++enum hash_type ++fips_hash_min(void) ++{ ++ int fips; ++ enum hash_type ht; ++ ++ fips = fips_mode(); ++ switch (fips) { ++ case 0: ++ ht = HASH_MD5; ++ break; ++ case 1: ++ ht = HASH_SHA1; ++ break; ++ default: ++ /* should not be reached */ ++ fatal("Fatal error: incorrect FIPS mode '%i' at %s:%u", ++ fips, __FILE__, __LINE__); ++ } ++ return ht; ++} ++ ++enum hash_type ++fips_hash_nid_min() ++{ ++ return fips_hash2nid(fips_hash_min()); ++} ++ ++const EVP_MD * ++fips_EVP_get_digest_min(void) ++{ ++ return EVP_get_digestbynid(fips_hash_nid_min()); ++} ++ +diff --git a/openssh-6.2p2/fips.h b/openssh-6.2p2/fips.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/fips.h +@@ -0,0 +1,54 @@ ++/* ++ * Copyright (c) 2012 Petr Cerny. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++#ifndef FIPS_H ++#define FIPS_H ++ ++#include ++#include ++ ++#include "key.h" ++ ++#define HASH_LEN_MD5 16 ++#define HASH_LEN_SHA1 20 ++#define HASH_LEN_SHA256 32 ++#define MAX_HASH_LEN HASH_LEN_SHA256 ++ ++enum hash_type { ++ HASH_MD5 = 1, ++ HASH_SHA1, ++ HASH_SHA256, ++ HASH_err ++}; ++ ++int fips_mode(void); ++void fips_correct_fp_type(enum fp_type *); ++void fips_correct_nid(int *); ++ ++enum hash_type fips_hash_min(void); ++const EVP_MD *fips_EVP_get_digest_min(void); ++int fips_hash2nid(enum hash_type); ++int fips_hash_len(enum hash_type); ++ ++#endif ++ +diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c +--- a/openssh-6.2p2/key.c ++++ b/openssh-6.2p2/key.c +@@ -49,16 +49,17 @@ + #include "xmalloc.h" + #include "key.h" + #include "rsa.h" + #include "uuencode.h" + #include "buffer.h" + #include "log.h" + #include "misc.h" + #include "ssh2.h" ++#include "fips.h" + + static int to_blob(const Key *, u_char **, u_int *, int); + + static struct KeyCert * + cert_new(void) + { + struct KeyCert *cert; + +@@ -634,16 +635,19 @@ key_fp_type_select(void) + error("invalid key type in environment variable " + SSH_FP_TYPE_ENVVAR ": '%s' - falling back to MD5.", + env); + fp = SSH_FP_MD5; + } + } else + fp = SSH_FP_MD5; + ++ if (fips_mode()) ++ fips_correct_fp_type(&fp); ++ + fp_defined = 1; + } + return fp; + } + + /* + * string lengths must be less or equal to SSH_FP_TYPE_STRLEN (defined in + * key.h) as to fit into the fingerprint string buffer +diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c +--- a/openssh-6.2p2/mac.c ++++ b/openssh-6.2p2/mac.c +@@ -36,34 +36,35 @@ + #include "xmalloc.h" + #include "log.h" + #include "cipher.h" + #include "buffer.h" + #include "key.h" + #include "kex.h" + #include "mac.h" + #include "misc.h" ++#include "fips.h" + + #include "umac.h" + + #include "openbsd-compat/openssl-compat.h" + + #define SSH_EVP 1 /* OpenSSL EVP-based MAC */ + #define SSH_UMAC 2 /* UMAC (not integrated with OpenSSL) */ + #define SSH_UMAC128 3 + +-struct { ++struct Macs { + char *name; + int type; + const EVP_MD * (*mdfunc)(void); + int truncatebits; /* truncate digest if != 0 */ + int key_len; /* just for UMAC */ + int len; /* just for UMAC */ + int etm; /* Encrypt-then-MAC */ +-} macs[] = { ++} macs_all[] = { + /* Encrypt-and-MAC (encrypt-and-authenticate) variants */ + { "hmac-sha1", SSH_EVP, EVP_sha1, 0, 0, 0, 0 }, + { "hmac-sha1-96", SSH_EVP, EVP_sha1, 96, 0, 0, 0 }, + #ifdef HAVE_EVP_SHA256 + { "hmac-sha2-256", SSH_EVP, EVP_sha256, 0, 0, 0, 0 }, + { "hmac-sha2-512", SSH_EVP, EVP_sha512, 0, 0, 0, 0 }, + #endif + { "hmac-md5", SSH_EVP, EVP_md5, 0, 0, 0, 0 }, +@@ -84,19 +85,46 @@ struct { + { "hmac-md5-96-etm@openssh.com", SSH_EVP, EVP_md5, 96, 0, 0, 1 }, + { "hmac-ripemd160-etm@openssh.com", SSH_EVP, EVP_ripemd160, 0, 0, 0, 1 }, + { "umac-64-etm@openssh.com", SSH_UMAC, NULL, 0, 128, 64, 1 }, + { "umac-128-etm@openssh.com", SSH_UMAC128, NULL, 0, 128, 128, 1 }, + + { NULL, 0, NULL, 0, 0, 0, 0 } + }; + ++struct Macs macs_fips140_2[] = { ++ { "hmac-sha1", SSH_EVP, EVP_sha1, 0, 0, 0, 0 }, ++#ifdef HAVE_EVP_SHA256 ++ { "hmac-sha2-256", SSH_EVP, EVP_sha256, 0, 0, 0, 0 }, ++ { "hmac-sha2-512", SSH_EVP, EVP_sha512, 0, 0, 0, 0 }, ++#endif ++ { NULL, 0, NULL, 0, 0, 0, 0 } ++}; ++ ++static struct Macs * ++fips_select_macs(void) ++{ ++ int fips = fips_mode(); ++ switch (fips) { ++ case 0: ++ return macs_all; ++ case 1: ++ return macs_fips140_2; ++ default: ++ /* should not be reached */ ++ fatal("Fatal error: incorrect FIPS mode '%i' at %s:%u", ++ fips, __FILE__, __LINE__); ++// return NULL; ++ } ++} ++ + static void + mac_setup_by_id(Mac *mac, int which) + { ++ struct Macs *macs = fips_select_macs(); + int evp_len; + mac->type = macs[which].type; + if (mac->type == SSH_EVP) { + mac->evp_md = (*macs[which].mdfunc)(); + if ((evp_len = EVP_MD_size(mac->evp_md)) <= 0) + fatal("mac %s len %d", mac->name, evp_len); + mac->key_len = mac->mac_len = (u_int)evp_len; + } else { +@@ -107,16 +135,17 @@ mac_setup_by_id(Mac *mac, int which) + if (macs[which].truncatebits != 0) + mac->mac_len = macs[which].truncatebits / 8; + mac->etm = macs[which].etm; + } + + int + mac_setup(Mac *mac, char *name) + { ++ struct Macs *macs = fips_select_macs(); + int i; + + for (i = 0; macs[i].name; i++) { + if (strcmp(name, macs[i].name) == 0) { + if (mac != NULL) + mac_setup_by_id(mac, i); + debug2("mac_setup: found %s", name); + return (0); +diff --git a/openssh-6.2p2/myproposal.h b/openssh-6.2p2/myproposal.h +--- a/openssh-6.2p2/myproposal.h ++++ b/openssh-6.2p2/myproposal.h +@@ -71,16 +71,20 @@ + "ssh-dss" + + #define KEX_DEFAULT_ENCRYPT \ + "aes128-ctr,aes192-ctr,aes256-ctr," \ + "arcfour256,arcfour128," \ + "aes128-gcm@openssh.com,aes256-gcm@openssh.com," \ + "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ + "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" ++#define KEX_FIPS_140_2_ENCRYPT \ ++ "aes128-ctr,aes192-ctr,aes256-ctr," \ ++ "aes128-cbc,3des-cbc," \ ++ "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se" + #ifdef HAVE_EVP_SHA256 + #define SHA2_HMAC_MODES \ + "hmac-sha2-256," \ + "hmac-sha2-512," + #else + # define SHA2_HMAC_MODES + #endif + #define KEX_DEFAULT_MAC \ +@@ -97,16 +101,19 @@ + "hmac-sha1," \ + "umac-64@openssh.com," \ + "umac-128@openssh.com," \ + SHA2_HMAC_MODES \ + "hmac-ripemd160," \ + "hmac-ripemd160@openssh.com," \ + "hmac-sha1-96," \ + "hmac-md5-96" ++#define KEX_FIPS_140_2_MAC \ ++ "hmac-sha1," \ ++ SHA2_HMAC_MODES \ + + #define KEX_DEFAULT_COMP "none,zlib@openssh.com,zlib" + #define KEX_DEFAULT_LANG "" + + + static char *myproposal[PROPOSAL_MAX] = { + KEX_DEFAULT_KEX, + KEX_DEFAULT_PK_ALG, +diff --git a/openssh-6.2p2/openbsd-compat/bsd-arc4random.c b/openssh-6.2p2/openbsd-compat/bsd-arc4random.c +--- a/openssh-6.2p2/openbsd-compat/bsd-arc4random.c ++++ b/openssh-6.2p2/openbsd-compat/bsd-arc4random.c +@@ -18,34 +18,35 @@ + + #include + + #include + #include + #include + + #include "log.h" ++#include "fips.h" + + #ifndef HAVE_ARC4RANDOM + + #include + #include + #include + + /* Size of key to use */ + #define SEED_SIZE 20 + + /* Number of bytes to reseed after */ + #define REKEY_BYTES (1 << 24) + + static int rc4_ready = 0; + static RC4_KEY rc4; + +-unsigned int +-arc4random(void) ++static unsigned int ++arc4random_bsd(void) + { + unsigned int r = 0; + static int first_time = 1; + + if (rc4_ready <= 0) { + if (first_time) + seed_rng(); + first_time = 0; +@@ -54,18 +55,18 @@ arc4random(void) + + RC4(&rc4, sizeof(r), (unsigned char *)&r, (unsigned char *)&r); + + rc4_ready -= sizeof(r); + + return(r); + } + +-void +-arc4random_stir(void) ++static void ++arc4random_stir_bsd(void) + { + unsigned char rand_buf[SEED_SIZE]; + int i; + + memset(&rc4, 0, sizeof(rc4)); + if (RAND_bytes(rand_buf, sizeof(rand_buf)) <= 0) + fatal("Couldn't obtain random bytes (error %ld)", + ERR_get_error()); +@@ -77,16 +78,63 @@ arc4random_stir(void) + */ + for(i = 0; i <= 256; i += sizeof(rand_buf)) + RC4(&rc4, sizeof(rand_buf), rand_buf, rand_buf); + + memset(rand_buf, 0, sizeof(rand_buf)); + + rc4_ready = REKEY_BYTES; + } ++ ++static unsigned int ++arc4random_fips(void) ++{ ++ unsigned int r = 0; ++ void *rp = &r; ++ static int first_time = 1; ++ ++ if (first_time) { ++ seed_rng(); ++ first_time = 0; ++ } ++ if (!rc4_ready) ++ arc4random_stir(); ++ RAND_bytes(rp, sizeof(r)); ++ ++ return(r); ++} ++ ++static void ++arc4random_stir_fips(void) ++{ ++ unsigned char rand_buf[SEED_SIZE]; ++ ++ if (RAND_bytes(rand_buf, sizeof(rand_buf)) <= 0) ++ fatal("Couldn't obtain random bytes (error %ld)", ++ ERR_get_error()); ++ rc4_ready = 1; ++} ++ ++unsigned int ++arc4random(void) ++{ ++ if (fips_mode()) ++ return arc4random_fips(); ++ else ++ return arc4random_bsd(); ++} ++ ++void ++arc4random_stir(void) ++{ ++ if (fips_mode()) ++ return arc4random_stir_fips(); ++ else ++ return arc4random_stir_bsd(); ++} + #endif /* !HAVE_ARC4RANDOM */ + + #ifndef HAVE_ARC4RANDOM_BUF + void + arc4random_buf(void *_buf, size_t n) + { + size_t i; + u_int32_t r = 0; +diff --git a/openssh-6.2p2/ssh-rsa.c b/openssh-6.2p2/ssh-rsa.c +--- a/openssh-6.2p2/ssh-rsa.c ++++ b/openssh-6.2p2/ssh-rsa.c +@@ -27,16 +27,17 @@ + + #include "xmalloc.h" + #include "log.h" + #include "buffer.h" + #include "key.h" + #include "compat.h" + #include "misc.h" + #include "ssh.h" ++#include "fips.h" + + static int openssh_RSA_verify(int, u_char *, u_int, u_char *, u_int, RSA *); + + /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */ + int + ssh_rsa_sign(const Key *key, u_char **sigp, u_int *lenp, + const u_char *data, u_int datalen) + { +@@ -48,16 +49,17 @@ ssh_rsa_sign(const Key *key, u_char **si + Buffer b; + + if (key == NULL || key->rsa == NULL || (key->type != KEY_RSA && + key->type != KEY_RSA_CERT && key->type != KEY_RSA_CERT_V00)) { + error("ssh_rsa_sign: no RSA key"); + return -1; + } + nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1; ++ fips_correct_nid(&nid); + if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { + error("ssh_rsa_sign: EVP_get_digestbynid %d failed", nid); + return -1; + } + EVP_DigestInit(&md, evp_md); + EVP_DigestUpdate(&md, data, datalen); + EVP_DigestFinal(&md, digest, &dlen); + +@@ -154,16 +156,17 @@ ssh_rsa_verify(const Key *key, const u_c + debug("ssh_rsa_verify: add padding: modlen %u > len %u", + modlen, len); + sigblob = xrealloc(sigblob, 1, modlen); + memmove(sigblob + diff, sigblob, len); + memset(sigblob, 0, diff); + len = modlen; + } + nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1; ++ fips_correct_nid(&nid); + if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { + error("ssh_rsa_verify: EVP_get_digestbynid %d failed", nid); + xfree(sigblob); + return -1; + } + EVP_DigestInit(&md, evp_md); + EVP_DigestUpdate(&md, data, datalen); + EVP_DigestFinal(&md, digest, &dlen); +diff --git a/openssh-6.2p2/ssh.c b/openssh-6.2p2/ssh.c +--- a/openssh-6.2p2/ssh.c ++++ b/openssh-6.2p2/ssh.c +@@ -99,16 +99,17 @@ + #include "kex.h" + #include "mac.h" + #include "sshpty.h" + #include "match.h" + #include "msg.h" + #include "uidswap.h" + #include "roaming.h" + #include "version.h" ++#include "fips.h" + + #ifdef ENABLE_PKCS11 + #include "ssh-pkcs11.h" + #endif + + extern char *__progname; + + /* Saves a copy of argv for setproctitle emulation */ +@@ -324,16 +325,18 @@ main(int ac, char **av) + use_syslog = 0; + argv0 = av[0]; + + again: + while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" + "ACD:F:I:KL:MNO:PR:S:TVw:W:XYy")) != -1) { + switch (opt) { + case '1': ++ if (fips_mode()) ++ fatal("Protocol 1 not allowed in the FIPS mode."); + options.protocol = SSH_PROTO_1; + break; + case '2': + options.protocol = SSH_PROTO_2; + break; + case '4': + options.address_family = AF_INET; + break; +@@ -781,17 +784,22 @@ main(int ac, char **av) + xfree(cp); + } + if (muxclient_command != 0 && options.control_path == NULL) + fatal("No ControlPath specified for \"-O\" command"); + if (options.control_path != NULL) + muxclient(options.control_path); + + timeout_ms = options.connection_timeout * 1000; +- ++ if (FIPS_mode()) { ++ options.protocol &= SSH_PROTO_2; ++ if (options.protocol == 0) ++ fatal("Protocol 2 disabled by configuration but required in the FIPS mode"); ++ } ++ + /* Open a connection to the remote host. */ + if (ssh_connect(host, &hostaddr, options.port, + options.address_family, options.connection_attempts, &timeout_ms, + options.tcp_keep_alive, + #ifdef HAVE_CYGWIN + options.use_privileged_port, + #else + original_effective_uid == 0 && options.use_privileged_port, +diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c +--- a/openssh-6.2p2/sshconnect2.c ++++ b/openssh-6.2p2/sshconnect2.c +@@ -67,16 +67,17 @@ + #include "dispatch.h" + #include "canohost.h" + #include "msg.h" + #include "pathnames.h" + #include "uidswap.h" + #include "hostfile.h" + #include "schnorr.h" + #include "jpake.h" ++#include "fips.h" + + #ifdef GSSAPI + #include "ssh-gss.h" + #endif + + /* import */ + extern char *client_version_string; + extern char *server_version_string; +@@ -165,31 +166,37 @@ ssh_kex2(char *host, struct sockaddr *ho + + if (options.ciphers == (char *)-1) { + logit("No valid ciphers for protocol version 2 given, using defaults."); + options.ciphers = NULL; + } + if (options.ciphers != NULL) { + myproposal[PROPOSAL_ENC_ALGS_CTOS] = + myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers; ++ } else if (fips_mode()) { ++ myproposal[PROPOSAL_ENC_ALGS_CTOS] = ++ myproposal[PROPOSAL_ENC_ALGS_STOC] = KEX_FIPS_140_2_ENCRYPT; + } + myproposal[PROPOSAL_ENC_ALGS_CTOS] = + compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_CTOS]); + myproposal[PROPOSAL_ENC_ALGS_STOC] = + compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_STOC]); + if (options.compression) { + myproposal[PROPOSAL_COMP_ALGS_CTOS] = + myproposal[PROPOSAL_COMP_ALGS_STOC] = "zlib@openssh.com,zlib,none"; + } else { + myproposal[PROPOSAL_COMP_ALGS_CTOS] = + myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib@openssh.com,zlib"; + } + if (options.macs != NULL) { + myproposal[PROPOSAL_MAC_ALGS_CTOS] = + myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs; ++ } else if (fips_mode()) { ++ myproposal[PROPOSAL_MAC_ALGS_CTOS] = ++ myproposal[PROPOSAL_MAC_ALGS_STOC] = KEX_FIPS_140_2_MAC; + } + if (options.hostkeyalgorithms != NULL) + myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = + options.hostkeyalgorithms; + else { + /* Prefer algorithms that we already have keys for */ + myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = + order_hostkeyalgs(host, hostaddr, port); +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -118,16 +118,17 @@ + #ifdef GSSAPI + #include "ssh-gss.h" + #endif + #include "monitor_wrap.h" + #include "roaming.h" + #include "audit.h" + #include "ssh-sandbox.h" + #include "version.h" ++#include "fips.h" + + #ifdef LIBWRAP + #include + #include + int allow_severity; + int deny_severity; + #endif /* LIBWRAP */ + +@@ -1711,16 +1712,20 @@ main(int ac, char **av) + case KEY_DSA: + case KEY_ECDSA: + sensitive_data.have_ssh2_key = 1; + break; + } + debug("private host key: #%d type %d %s", i, key->type, + key_type(key)); + } ++ if ((options.protocol & SSH_PROTO_1) && fips_mode()) { ++ logit("Disabling protocol version 1. Not allowed in the FIPS mode."); ++ options.protocol &= ~SSH_PROTO_1; ++ } + if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) { + logit("Disabling protocol version 1. Could not load host key"); + options.protocol &= ~SSH_PROTO_1; + } + if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) { + logit("Disabling protocol version 2. Could not load host key"); + options.protocol &= ~SSH_PROTO_2; + } +@@ -2413,25 +2418,31 @@ do_ssh1_kex(void) + static void + do_ssh2_kex(void) + { + Kex *kex; + + if (options.ciphers != NULL) { + myproposal[PROPOSAL_ENC_ALGS_CTOS] = + myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers; ++ } else if (fips_mode()) { ++ myproposal[PROPOSAL_ENC_ALGS_CTOS] = ++ myproposal[PROPOSAL_ENC_ALGS_STOC] = KEX_FIPS_140_2_ENCRYPT; + } + myproposal[PROPOSAL_ENC_ALGS_CTOS] = + compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_CTOS]); + myproposal[PROPOSAL_ENC_ALGS_STOC] = + compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_STOC]); + + if (options.macs != NULL) { + myproposal[PROPOSAL_MAC_ALGS_CTOS] = + myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs; ++ } else if (fips_mode()) { ++ myproposal[PROPOSAL_MAC_ALGS_CTOS] = ++ myproposal[PROPOSAL_MAC_ALGS_STOC] = KEX_FIPS_140_2_MAC; + } + if (options.compression == COMP_NONE) { + myproposal[PROPOSAL_COMP_ALGS_CTOS] = + myproposal[PROPOSAL_COMP_ALGS_STOC] = "none"; + } else if (options.compression == COMP_DELAYED) { + myproposal[PROPOSAL_COMP_ALGS_CTOS] = + myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib@openssh.com"; + } diff --git a/openssh-6.2p2-gssapi_key_exchange.patch b/openssh-6.2p2-gssapi_key_exchange.patch new file mode 100644 index 0000000..b172ef3 --- /dev/null +++ b/openssh-6.2p2-gssapi_key_exchange.patch @@ -0,0 +1,3890 @@ +# HG changeset patch +# Parent 4c530768d07db136fcc679119220a02eb28b0127 + +diff --git a/openssh-6.2p2/ChangeLog.gssapi b/openssh-6.2p2/ChangeLog.gssapi +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ChangeLog.gssapi +@@ -0,0 +1,113 @@ ++20110101 ++ - Finally update for OpenSSH 5.6p1 ++ - Add GSSAPIServerIdentity option from Jim Basney ++ ++20100308 ++ - [ Makefile.in, key.c, key.h ] ++ Updates for OpenSSH 5.4p1 ++ - [ servconf.c ] ++ Include GSSAPI options in the sshd -T configuration dump, and flag ++ some older configuration options as being unsupported. Thanks to Colin ++ Watson. ++ - ++ ++20100124 ++ - [ sshconnect2.c ] ++ Adapt to deal with additional element in Authmethod structure. Thanks to ++ Colin Watson ++ ++20090615 ++ - [ gss-genr.c gss-serv.c kexgssc.c kexgsss.c monitor.c sshconnect2.c ++ sshd.c ] ++ Fix issues identified by Greg Hudson following a code review ++ Check return value of gss_indicate_mechs ++ Protect GSSAPI calls in monitor, so they can only be used if enabled ++ Check return values of bignum functions in key exchange ++ Use BN_clear_free to clear other side's DH value ++ Make ssh_gssapi_id_kex more robust ++ Only configure kex table pointers if GSSAPI is enabled ++ Don't leak mechanism list, or gss mechanism list ++ Cast data.length before printing ++ If serverkey isn't provided, use an empty string, rather than NULL ++ ++20090201 ++ - [ gss-genr.c gss-serv.c kex.h kexgssc.c readconf.c readconf.h ssh-gss.h ++ ssh_config.5 sshconnet2.c ] ++ Add support for the GSSAPIClientIdentity option, which allows the user ++ to specify which GSSAPI identity to use to contact a given server ++ ++20080404 ++ - [ gss-serv.c ] ++ Add code to actually implement GSSAPIStrictAcceptCheck, which had somehow ++ been omitted from a previous version of this patch. Reported by Borislav ++ Stoichkov ++ ++20070317 ++ - [ gss-serv-krb5.c ] ++ Remove C99ism, where new_ccname was being declared in the middle of a ++ function ++ ++20061220 ++ - [ servconf.c ] ++ Make default for GSSAPIStrictAcceptorCheck be Yes, to match previous, and ++ documented, behaviour. Reported by Dan Watson. ++ ++20060910 ++ - [ gss-genr.c kexgssc.c kexgsss.c kex.h monitor.c sshconnect2.c sshd.c ++ ssh-gss.h ] ++ add support for gss-group14-sha1 key exchange mechanisms ++ - [ gss-serv.c servconf.c servconf.h sshd_config sshd_config.5 ] ++ Add GSSAPIStrictAcceptorCheck option to allow the disabling of ++ acceptor principal checking on multi-homed machines. ++ ++ - [ sshd_config ssh_config ] ++ Add settings for GSSAPIKeyExchange and GSSAPITrustDNS to the sample ++ configuration files ++ - [ kexgss.c kegsss.c sshconnect2.c sshd.c ] ++ Code cleanup. Replace strlen/xmalloc/snprintf sequences with xasprintf() ++ Limit length of error messages displayed by client ++ ++20060909 ++ - [ gss-genr.c gss-serv.c ] ++ move ssh_gssapi_acquire_cred() and ssh_gssapi_server_ctx to be server ++ only, where they belong ++ ++ ++20060829 ++ - [ gss-serv-krb5.c ] ++ Fix CCAPI credentials cache name when creating KRB5CCNAME environment ++ variable ++ ++20060828 ++ - [ gss-genr.c ] ++ Avoid Heimdal context freeing problem ++ ++ ++20060818 ++ - [ gss-genr.c ssh-gss.h sshconnect2.c ] ++ Make sure that SPENGO is disabled ++ ++ ++20060421 ++ - [ gssgenr.c, sshconnect2.c ] ++ a few type changes (signed versus unsigned, int versus size_t) to ++ fix compiler errors/warnings ++ (from jbasney AT ncsa.uiuc.edu) ++ - [ kexgssc.c, sshconnect2.c ] ++ fix uninitialized variable warnings ++ (from jbasney AT ncsa.uiuc.edu) ++ - [ gssgenr.c ] ++ pass oid to gss_display_status (helpful when using GSSAPI mechglue) ++ (from jbasney AT ncsa.uiuc.edu) ++ ++ - [ gss-serv-krb5.c ] ++ #ifdef HAVE_GSSAPI_KRB5 should be #ifdef HAVE_GSSAPI_KRB5_H ++ (from jbasney AT ncsa.uiuc.edu) ++ ++ - [ readconf.c, readconf.h, ssh_config.5, sshconnect2.c ++ add client-side GssapiKeyExchange option ++ (from jbasney AT ncsa.uiuc.edu) ++ - [ sshconnect2.c ] ++ add support for GssapiTrustDns option for gssapi-with-mic ++ (from jbasney AT ncsa.uiuc.edu) ++ +diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in +--- a/openssh-6.2p2/Makefile.in ++++ b/openssh-6.2p2/Makefile.in +@@ -71,33 +71,34 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o + canohost.o channels.o cipher.o cipher-aes.o \ + cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ + compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ + log.o match.o md-sha256.o moduli.o nchan.o packet.o \ + readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ + atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ + monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ + kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ ++ kexgssc.o \ + msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ + jpake.o schnorr.o ssh-pkcs11.o krl.o auditstub.o + + SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ + sshconnect.o sshconnect1.o sshconnect2.o mux.o \ + roaming_common.o roaming_client.o + + SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ + audit.o audit-bsm.o audit-linux.o platform.o \ + sshpty.o sshlogin.o servconf.o serverloop.o \ + auth.o auth1.o auth2.o auth-options.o session.o \ + auth-chall.o auth2-chall.o groupaccess.o \ + auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ + auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ + monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ + auth-krb5.o \ +- auth2-gss.o gss-serv.o gss-serv-krb5.o \ ++ auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o\ + loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ + sftp-server.o sftp-common.o \ + roaming_common.o roaming_serv.o \ + sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ + sandbox-seccomp-filter.o + + 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 ssh-ldap-helper.8.out ssh-ldap.conf.5.out + 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 ssh-ldap-helper.8 ssh-ldap.conf.5 +diff --git a/openssh-6.2p2/auth-krb5.c b/openssh-6.2p2/auth-krb5.c +--- a/openssh-6.2p2/auth-krb5.c ++++ b/openssh-6.2p2/auth-krb5.c +@@ -165,18 +165,23 @@ auth_krb5_password(Authctxt *authctxt, c + if (problem) + goto out; + #endif + + authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache); + + len = strlen(authctxt->krb5_ticket_file) + 6; + authctxt->krb5_ccname = xmalloc(len); ++#ifdef USE_CCAPI ++ snprintf(authctxt->krb5_ccname, len, "API:%s", ++ authctxt->krb5_ticket_file); ++#else + snprintf(authctxt->krb5_ccname, len, "FILE:%s", + authctxt->krb5_ticket_file); ++#endif + + #ifdef USE_PAM + if (options.use_pam) + do_pam_putenv("KRB5CCNAME", authctxt->krb5_ccname); + #endif + + out: + restore_uid(); +@@ -224,35 +229,42 @@ krb5_cleanup_proc(Authctxt *authctxt) + } + + #ifndef HEIMDAL + krb5_error_code + ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { + int tmpfd, ret, oerrno; + char ccname[40]; + mode_t old_umask; ++#ifdef USE_CCAPI ++ char cctemplate[] = "API:krb5cc_%d"; ++#else ++ char cctemplate[] = "FILE:/tmp/krb5cc_%d_XXXXXXXXXX"; ++#endif + + ret = snprintf(ccname, sizeof(ccname), +- "FILE:/tmp/krb5cc_%d_XXXXXXXXXX", geteuid()); ++ cctemplate, geteuid()); + if (ret < 0 || (size_t)ret >= sizeof(ccname)) + return ENOMEM; + ++#ifndef USE_CCAPI + old_umask = umask(0177); + tmpfd = mkstemp(ccname + strlen("FILE:")); + oerrno = errno; + umask(old_umask); + if (tmpfd == -1) { + logit("mkstemp(): %.100s", strerror(oerrno)); + return oerrno; + } + + if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { + oerrno = errno; + logit("fchmod(): %.100s", strerror(oerrno)); + close(tmpfd); + return oerrno; + } + close(tmpfd); ++#endif + + return (krb5_cc_resolve(ctx, ccname, ccache)); + } + #endif /* !HEIMDAL */ + #endif /* KRB5 */ +diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c +--- a/openssh-6.2p2/auth2-gss.c ++++ b/openssh-6.2p2/auth2-gss.c +@@ -1,12 +1,12 @@ + /* $OpenBSD: auth2-gss.c,v 1.18 2012/12/02 20:34:09 djm Exp $ */ + + /* +- * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. ++ * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the +@@ -47,16 +47,50 @@ + + extern ServerOptions options; + + static void input_gssapi_token(int type, u_int32_t plen, void *ctxt); + static void input_gssapi_mic(int type, u_int32_t plen, void *ctxt); + static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt); + static void input_gssapi_errtok(int, u_int32_t, void *); + ++/* ++ * The 'gssapi_keyex' userauth mechanism. ++ */ ++static int ++userauth_gsskeyex(Authctxt *authctxt) ++{ ++ int authenticated = 0; ++ Buffer b; ++ gss_buffer_desc mic, gssbuf; ++ u_int len; ++ ++ mic.value = packet_get_string(&len); ++ mic.length = len; ++ ++ packet_check_eom(); ++ ++ ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service, ++ "gssapi-keyex"); ++ ++ gssbuf.value = buffer_ptr(&b); ++ gssbuf.length = buffer_len(&b); ++ ++ /* gss_kex_context is NULL with privsep, so we can't check it here */ ++ if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gss_kex_context, ++ &gssbuf, &mic)))) ++ authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user, ++ authctxt->pw)); ++ ++ buffer_free(&b); ++ xfree(mic.value); ++ ++ return (authenticated); ++} ++ + /* + * We only support those mechanisms that we know about (ie ones that we know + * how to check local user kuserok and the like) + */ + static int + userauth_gssapi(Authctxt *authctxt) + { + gss_OID_desc goid = {0, NULL}; +@@ -248,17 +282,18 @@ input_gssapi_exchange_complete(int type, + + /* + * We don't need to check the status, because we're only enabled in + * the dispatcher once the exchange is complete + */ + + packet_check_eom(); + +- authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user)); ++ authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user, ++ authctxt->pw)); + + authctxt->postponed = 0; + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); + userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); + } +@@ -283,31 +318,38 @@ input_gssapi_mic(int type, u_int32_t ple + + ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service, + "gssapi-with-mic"); + + gssbuf.value = buffer_ptr(&b); + gssbuf.length = buffer_len(&b); + + if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gssctxt, &gssbuf, &mic)))) +- authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user)); ++ authenticated = ++ PRIVSEP(ssh_gssapi_userok(authctxt->user, authctxt->pw)); + else + logit("GSSAPI MIC check failed"); + + buffer_free(&b); + xfree(mic.value); + + authctxt->postponed = 0; + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); + userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); + } + ++Authmethod method_gsskeyex = { ++ "gssapi-keyex", ++ userauth_gsskeyex, ++ &options.gss_authentication ++}; ++ + Authmethod method_gssapi = { + "gssapi-with-mic", + userauth_gssapi, + &options.gss_authentication + }; + + Authmethod method_gssapi_old = { + "gssapi", +diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c +--- a/openssh-6.2p2/auth2.c ++++ b/openssh-6.2p2/auth2.c +@@ -64,27 +64,29 @@ extern Buffer loginmsg; + /* methods */ + + extern Authmethod method_none; + extern Authmethod method_pubkey; + extern Authmethod method_passwd; + extern Authmethod method_kbdint; + extern Authmethod method_hostbased; + #ifdef GSSAPI ++extern Authmethod method_gsskeyex; + extern Authmethod method_gssapi; + extern Authmethod method_gssapi_old; + #endif + #ifdef JPAKE + extern Authmethod method_jpake; + #endif + + Authmethod *authmethods[] = { + &method_none, + &method_pubkey, + #ifdef GSSAPI ++ &method_gsskeyex, + &method_gssapi, + &method_gssapi_old, + #endif + #ifdef JPAKE + &method_jpake, + #endif + &method_passwd, + &method_kbdint, +diff --git a/openssh-6.2p2/clientloop.c b/openssh-6.2p2/clientloop.c +--- a/openssh-6.2p2/clientloop.c ++++ b/openssh-6.2p2/clientloop.c +@@ -106,16 +106,20 @@ + #include "authfd.h" + #include "atomicio.h" + #include "sshpty.h" + #include "misc.h" + #include "match.h" + #include "msg.h" + #include "roaming.h" + ++#ifdef GSSAPI ++#include "ssh-gss.h" ++#endif ++ + /* import options */ + extern Options options; + + /* Flag indicating that stdin should be redirected from /dev/null. */ + extern int stdin_null_flag; + + /* Flag indicating that no shell has been requested */ + extern int no_shell_flag; +@@ -1594,16 +1598,25 @@ client_loop(int have_pty, int escape_cha + &max_fd2, &nalloc, rekeying); + + if (quit_pending) + break; + + /* Do channel operations unless rekeying in progress. */ + if (!rekeying) { + channel_after_select(readset, writeset); ++ ++#ifdef GSSAPI ++ if (options.gss_renewal_rekey && ++ ssh_gssapi_credentials_updated(GSS_C_NO_CONTEXT)) { ++ debug("credentials updated - forcing rekey"); ++ need_rekeying = 1; ++ } ++#endif ++ + if (need_rekeying || packet_need_rekeying()) { + debug("need rekeying"); + xxx_kex->done = 0; + kex_send_kexinit(xxx_kex); + need_rekeying = 0; + } + } + +diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac +--- a/openssh-6.2p2/configure.ac ++++ b/openssh-6.2p2/configure.ac +@@ -528,16 +528,40 @@ main() { if (NSVersionOfRunTimeLibrary(" + AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) + AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], + [Define if your resolver libs need this for getrrsetbyname]) + AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) + AC_DEFINE([SSH_TUN_COMPAT_AF], [1], + [Use tunnel device compatibility to OpenBSD]) + AC_DEFINE([SSH_TUN_PREPEND_AF], [1], + [Prepend the address family to IP tunnel traffic]) ++ AC_MSG_CHECKING(if we have the Security Authorization Session API) ++ AC_TRY_COMPILE([#include ], ++ [SessionCreate(0, 0);], ++ [ac_cv_use_security_session_api="yes" ++ AC_DEFINE(USE_SECURITY_SESSION_API, 1, ++ [platform has the Security Authorization Session API]) ++ LIBS="$LIBS -framework Security" ++ AC_MSG_RESULT(yes)], ++ [ac_cv_use_security_session_api="no" ++ AC_MSG_RESULT(no)]) ++ AC_MSG_CHECKING(if we have an in-memory credentials cache) ++ AC_TRY_COMPILE( ++ [#include ], ++ [cc_context_t c; ++ (void) cc_initialize (&c, 0, NULL, NULL);], ++ [AC_DEFINE(USE_CCAPI, 1, ++ [platform uses an in-memory credentials cache]) ++ LIBS="$LIBS -framework Security" ++ AC_MSG_RESULT(yes) ++ if test "x$ac_cv_use_security_session_api" = "xno"; then ++ AC_MSG_ERROR(*** Need a security framework to use the credentials cache API ***) ++ fi], ++ [AC_MSG_RESULT(no)] ++ ) + m4_pattern_allow([AU_IPv]) + AC_CHECK_DECL([AU_IPv4], [], + AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) + [#include ] + AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], + [Define if pututxline updates lastlog too]) + ) + AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], +diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c +--- a/openssh-6.2p2/gss-genr.c ++++ b/openssh-6.2p2/gss-genr.c +@@ -1,12 +1,12 @@ + /* $OpenBSD: gss-genr.c,v 1.20 2009/06/22 05:39:28 dtucker Exp $ */ + + /* +- * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. ++ * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the +@@ -34,22 +34,177 @@ + #include + #include + #include + + #include "xmalloc.h" + #include "buffer.h" + #include "log.h" + #include "ssh2.h" ++#include "cipher.h" ++#include "key.h" ++#include "kex.h" ++#include + + #include "ssh-gss.h" + + extern u_char *session_id2; + extern u_int session_id2_len; + ++typedef struct { ++ char *encoded; ++ gss_OID oid; ++} ssh_gss_kex_mapping; ++ ++/* ++ * XXX - It would be nice to find a more elegant way of handling the ++ * XXX passing of the key exchange context to the userauth routines ++ */ ++ ++Gssctxt *gss_kex_context = NULL; ++ ++static ssh_gss_kex_mapping *gss_enc2oid = NULL; ++ ++int ++ssh_gssapi_oid_table_ok() { ++ return (gss_enc2oid != NULL); ++} ++ ++/* ++ * Return a list of the gss-group1-sha1 mechanisms supported by this program ++ * ++ * We test mechanisms to ensure that we can use them, to avoid starting ++ * a key exchange with a bad mechanism ++ */ ++ ++char * ++ssh_gssapi_client_mechanisms(const char *host, const char *client) { ++ gss_OID_set gss_supported; ++ OM_uint32 min_status; ++ ++ if (GSS_ERROR(gss_indicate_mechs(&min_status, &gss_supported))) ++ return NULL; ++ ++ return(ssh_gssapi_kex_mechs(gss_supported, ssh_gssapi_check_mechanism, ++ host, client)); ++} ++ ++char * ++ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check, ++ const char *host, const char *client) { ++ Buffer buf; ++ size_t i; ++ int oidpos, enclen; ++ char *mechs, *encoded; ++ u_char digest[EVP_MAX_MD_SIZE]; ++ char deroid[2]; ++ const EVP_MD *evp_md = EVP_md5(); ++ EVP_MD_CTX md; ++ ++ if (gss_enc2oid != NULL) { ++ for (i = 0; gss_enc2oid[i].encoded != NULL; i++) ++ xfree(gss_enc2oid[i].encoded); ++ xfree(gss_enc2oid); ++ } ++ ++ gss_enc2oid = xmalloc(sizeof(ssh_gss_kex_mapping) * ++ (gss_supported->count + 1)); ++ ++ buffer_init(&buf); ++ ++ oidpos = 0; ++ for (i = 0; i < gss_supported->count; i++) { ++ if (gss_supported->elements[i].length < 128 && ++ (*check)(NULL, &(gss_supported->elements[i]), host, client)) { ++ ++ deroid[0] = SSH_GSS_OIDTYPE; ++ deroid[1] = gss_supported->elements[i].length; ++ ++ EVP_DigestInit(&md, evp_md); ++ EVP_DigestUpdate(&md, deroid, 2); ++ EVP_DigestUpdate(&md, ++ gss_supported->elements[i].elements, ++ gss_supported->elements[i].length); ++ EVP_DigestFinal(&md, digest, NULL); ++ ++ encoded = xmalloc(EVP_MD_size(evp_md) * 2); ++ enclen = __b64_ntop(digest, EVP_MD_size(evp_md), ++ encoded, EVP_MD_size(evp_md) * 2); ++ ++ if (oidpos != 0) ++ buffer_put_char(&buf, ','); ++ ++ buffer_append(&buf, KEX_GSS_GEX_SHA1_ID, ++ sizeof(KEX_GSS_GEX_SHA1_ID) - 1); ++ buffer_append(&buf, encoded, enclen); ++ buffer_put_char(&buf, ','); ++ buffer_append(&buf, KEX_GSS_GRP1_SHA1_ID, ++ sizeof(KEX_GSS_GRP1_SHA1_ID) - 1); ++ buffer_append(&buf, encoded, enclen); ++ buffer_put_char(&buf, ','); ++ buffer_append(&buf, KEX_GSS_GRP14_SHA1_ID, ++ sizeof(KEX_GSS_GRP14_SHA1_ID) - 1); ++ buffer_append(&buf, encoded, enclen); ++ ++ gss_enc2oid[oidpos].oid = &(gss_supported->elements[i]); ++ gss_enc2oid[oidpos].encoded = encoded; ++ oidpos++; ++ } ++ } ++ gss_enc2oid[oidpos].oid = NULL; ++ gss_enc2oid[oidpos].encoded = NULL; ++ ++ buffer_put_char(&buf, '\0'); ++ ++ mechs = xmalloc(buffer_len(&buf)); ++ buffer_get(&buf, mechs, buffer_len(&buf)); ++ buffer_free(&buf); ++ ++ if (strlen(mechs) == 0) { ++ xfree(mechs); ++ mechs = NULL; ++ } ++ ++ return (mechs); ++} ++ ++gss_OID ++ssh_gssapi_id_kex(Gssctxt *ctx, char *name, int kex_type) { ++ int i = 0; ++ ++ switch (kex_type) { ++ case KEX_GSS_GRP1_SHA1: ++ if (strlen(name) < sizeof(KEX_GSS_GRP1_SHA1_ID)) ++ return GSS_C_NO_OID; ++ name += sizeof(KEX_GSS_GRP1_SHA1_ID) - 1; ++ break; ++ case KEX_GSS_GRP14_SHA1: ++ if (strlen(name) < sizeof(KEX_GSS_GRP14_SHA1_ID)) ++ return GSS_C_NO_OID; ++ name += sizeof(KEX_GSS_GRP14_SHA1_ID) - 1; ++ break; ++ case KEX_GSS_GEX_SHA1: ++ if (strlen(name) < sizeof(KEX_GSS_GEX_SHA1_ID)) ++ return GSS_C_NO_OID; ++ name += sizeof(KEX_GSS_GEX_SHA1_ID) - 1; ++ break; ++ default: ++ return GSS_C_NO_OID; ++ } ++ ++ while (gss_enc2oid[i].encoded != NULL && ++ strcmp(name, gss_enc2oid[i].encoded) != 0) ++ i++; ++ ++ if (gss_enc2oid[i].oid != NULL && ctx != NULL) ++ ssh_gssapi_set_oid(ctx, gss_enc2oid[i].oid); ++ ++ return gss_enc2oid[i].oid; ++} ++ + /* Check that the OID in a data stream matches that in the context */ + int + ssh_gssapi_check_oid(Gssctxt *ctx, void *data, size_t len) + { + return (ctx != NULL && ctx->oid != GSS_C_NO_OID && + ctx->oid->length == len && + memcmp(ctx->oid->elements, data, len) == 0); + } +@@ -192,17 +347,17 @@ ssh_gssapi_init_ctx(Gssctxt *ctx, int de + int deleg_flag = 0; + + if (deleg_creds) { + deleg_flag = GSS_C_DELEG_FLAG; + debug("Delegating credentials"); + } + + ctx->major = gss_init_sec_context(&ctx->minor, +- GSS_C_NO_CREDENTIAL, &ctx->context, ctx->name, ctx->oid, ++ ctx->client_creds, &ctx->context, ctx->name, ctx->oid, + GSS_C_MUTUAL_FLAG | GSS_C_INTEG_FLAG | deleg_flag, + 0, NULL, recv_tok, NULL, send_tok, flags, NULL); + + if (GSS_ERROR(ctx->major)) + ssh_gssapi_error(ctx); + + return (ctx->major); + } +@@ -222,60 +377,173 @@ ssh_gssapi_import_name(Gssctxt *ctx, con + &gssbuf, GSS_C_NT_HOSTBASED_SERVICE, &ctx->name))) + ssh_gssapi_error(ctx); + + xfree(gssbuf.value); + return (ctx->major); + } + + OM_uint32 ++ssh_gssapi_client_identity(Gssctxt *ctx, const char *name) ++{ ++ gss_buffer_desc gssbuf; ++ gss_name_t gssname; ++ OM_uint32 status; ++ gss_OID_set oidset; ++ ++ gssbuf.value = (void *) name; ++ gssbuf.length = strlen(gssbuf.value); ++ ++ gss_create_empty_oid_set(&status, &oidset); ++ gss_add_oid_set_member(&status, ctx->oid, &oidset); ++ ++ ctx->major = gss_import_name(&ctx->minor, &gssbuf, ++ GSS_C_NT_USER_NAME, &gssname); ++ ++ if (!ctx->major) ++ ctx->major = gss_acquire_cred(&ctx->minor, ++ gssname, 0, oidset, GSS_C_INITIATE, ++ &ctx->client_creds, NULL, NULL); ++ ++ gss_release_name(&status, &gssname); ++ gss_release_oid_set(&status, &oidset); ++ ++ if (ctx->major) ++ ssh_gssapi_error(ctx); ++ ++ return(ctx->major); ++} ++ ++OM_uint32 + ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash) + { ++ if (ctx == NULL) ++ return -1; ++ + if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context, + GSS_C_QOP_DEFAULT, buffer, hash))) + ssh_gssapi_error(ctx); + + return (ctx->major); + } + ++/* Priviledged when used by server */ ++OM_uint32 ++ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) ++{ ++ if (ctx == NULL) ++ return -1; ++ ++ ctx->major = gss_verify_mic(&ctx->minor, ctx->context, ++ gssbuf, gssmic, NULL); ++ ++ return (ctx->major); ++} ++ + void + ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service, + const char *context) + { + buffer_init(b); + buffer_put_string(b, session_id2, session_id2_len); + buffer_put_char(b, SSH2_MSG_USERAUTH_REQUEST); + buffer_put_cstring(b, user); + buffer_put_cstring(b, service); + buffer_put_cstring(b, context); + } + + int +-ssh_gssapi_check_mechanism(Gssctxt **ctx, gss_OID oid, const char *host) ++ssh_gssapi_check_mechanism(Gssctxt **ctx, gss_OID oid, const char *host, ++ const char *client) + { + gss_buffer_desc token = GSS_C_EMPTY_BUFFER; + OM_uint32 major, minor; + gss_OID_desc spnego_oid = {6, (void *)"\x2B\x06\x01\x05\x05\x02"}; ++ Gssctxt *intctx = NULL; ++ ++ if (ctx == NULL) ++ ctx = &intctx; + + /* RFC 4462 says we MUST NOT do SPNEGO */ + if (oid->length == spnego_oid.length && + (memcmp(oid->elements, spnego_oid.elements, oid->length) == 0)) + return 0; /* false */ + + ssh_gssapi_build_ctx(ctx); + ssh_gssapi_set_oid(*ctx, oid); + major = ssh_gssapi_import_name(*ctx, host); ++ ++ if (!GSS_ERROR(major) && client) ++ major = ssh_gssapi_client_identity(*ctx, client); ++ + if (!GSS_ERROR(major)) { + major = ssh_gssapi_init_ctx(*ctx, 0, GSS_C_NO_BUFFER, &token, + NULL); + gss_release_buffer(&minor, &token); + if ((*ctx)->context != GSS_C_NO_CONTEXT) + gss_delete_sec_context(&minor, &(*ctx)->context, + GSS_C_NO_BUFFER); + } + +- if (GSS_ERROR(major)) ++ if (GSS_ERROR(major) || intctx != NULL) + ssh_gssapi_delete_ctx(ctx); + + return (!GSS_ERROR(major)); + } + ++int ++ssh_gssapi_credentials_updated(Gssctxt *ctxt) { ++ static gss_name_t saved_name = GSS_C_NO_NAME; ++ static OM_uint32 saved_lifetime = 0; ++ static gss_OID saved_mech = GSS_C_NO_OID; ++ static gss_name_t name; ++ static OM_uint32 last_call = 0; ++ OM_uint32 lifetime, now, major, minor; ++ int equal; ++ gss_cred_usage_t usage = GSS_C_INITIATE; ++ ++ now = time(NULL); ++ ++ if (ctxt) { ++ debug("Rekey has happened - updating saved versions"); ++ ++ if (saved_name != GSS_C_NO_NAME) ++ gss_release_name(&minor, &saved_name); ++ ++ major = gss_inquire_cred(&minor, GSS_C_NO_CREDENTIAL, ++ &saved_name, &saved_lifetime, NULL, NULL); ++ ++ if (!GSS_ERROR(major)) { ++ saved_mech = ctxt->oid; ++ saved_lifetime+= now; ++ } else { ++ /* Handle the error */ ++ } ++ return 0; ++ } ++ ++ if (now - last_call < 10) ++ return 0; ++ ++ last_call = now; ++ ++ if (saved_mech == GSS_C_NO_OID) ++ return 0; ++ ++ major = gss_inquire_cred(&minor, GSS_C_NO_CREDENTIAL, ++ &name, &lifetime, NULL, NULL); ++ if (major == GSS_S_CREDENTIALS_EXPIRED) ++ return 0; ++ else if (GSS_ERROR(major)) ++ return 0; ++ ++ major = gss_compare_name(&minor, saved_name, name, &equal); ++ gss_release_name(&minor, &name); ++ if (GSS_ERROR(major)) ++ return 0; ++ ++ if (equal && (saved_lifetime < lifetime + now - 10)) ++ return 1; ++ ++ return 0; ++} ++ + #endif /* GSSAPI */ +diff --git a/openssh-6.2p2/gss-serv-krb5.c b/openssh-6.2p2/gss-serv-krb5.c +--- a/openssh-6.2p2/gss-serv-krb5.c ++++ b/openssh-6.2p2/gss-serv-krb5.c +@@ -1,12 +1,12 @@ + /* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */ + + /* +- * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. ++ * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the +@@ -115,16 +115,17 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client + static void + ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client) + { + krb5_ccache ccache; + krb5_error_code problem; + krb5_principal princ; + OM_uint32 maj_status, min_status; + int len; ++ const char *new_ccname; + + if (client->creds == NULL) { + debug("No credentials stored"); + return; + } + + if (ssh_gssapi_krb5_init() == 0) + return; +@@ -163,37 +164,108 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_cl + + if ((maj_status = gss_krb5_copy_ccache(&min_status, + client->creds, ccache))) { + logit("gss_krb5_copy_ccache() failed"); + krb5_cc_destroy(krb_context, ccache); + return; + } + +- client->store.filename = xstrdup(krb5_cc_get_name(krb_context, ccache)); ++ new_ccname = krb5_cc_get_name(krb_context, ccache); ++ + client->store.envvar = "KRB5CCNAME"; +- len = strlen(client->store.filename) + 6; +- client->store.envval = xmalloc(len); +- snprintf(client->store.envval, len, "FILE:%s", client->store.filename); ++#ifdef USE_CCAPI ++ xasprintf(&client->store.envval, "API:%s", new_ccname); ++ client->store.filename = NULL; ++#else ++ xasprintf(&client->store.envval, "FILE:%s", new_ccname); ++ client->store.filename = xstrdup(new_ccname); ++#endif + + #ifdef USE_PAM + if (options.use_pam) + do_pam_putenv(client->store.envvar, client->store.envval); + #endif + + krb5_cc_close(krb_context, ccache); + + return; + } + ++int ++ssh_gssapi_krb5_updatecreds(ssh_gssapi_ccache *store, ++ ssh_gssapi_client *client) ++{ ++ krb5_ccache ccache = NULL; ++ krb5_principal principal = NULL; ++ char *name = NULL; ++ krb5_error_code problem; ++ OM_uint32 maj_status, min_status; ++ ++ if ((problem = krb5_cc_resolve(krb_context, store->envval, &ccache))) { ++ logit("krb5_cc_resolve(): %.100s", ++ krb5_get_err_text(krb_context, problem)); ++ return 0; ++ } ++ ++ /* Find out who the principal in this cache is */ ++ if ((problem = krb5_cc_get_principal(krb_context, ccache, ++ &principal))) { ++ logit("krb5_cc_get_principal(): %.100s", ++ krb5_get_err_text(krb_context, problem)); ++ krb5_cc_close(krb_context, ccache); ++ return 0; ++ } ++ ++ if ((problem = krb5_unparse_name(krb_context, principal, &name))) { ++ logit("krb5_unparse_name(): %.100s", ++ krb5_get_err_text(krb_context, problem)); ++ krb5_free_principal(krb_context, principal); ++ krb5_cc_close(krb_context, ccache); ++ return 0; ++ } ++ ++ ++ if (strcmp(name,client->exportedname.value)!=0) { ++ debug("Name in local credentials cache differs. Not storing"); ++ krb5_free_principal(krb_context, principal); ++ krb5_cc_close(krb_context, ccache); ++ krb5_free_unparsed_name(krb_context, name); ++ return 0; ++ } ++ krb5_free_unparsed_name(krb_context, name); ++ ++ /* Name matches, so lets get on with it! */ ++ ++ if ((problem = krb5_cc_initialize(krb_context, ccache, principal))) { ++ logit("krb5_cc_initialize(): %.100s", ++ krb5_get_err_text(krb_context, problem)); ++ krb5_free_principal(krb_context, principal); ++ krb5_cc_close(krb_context, ccache); ++ return 0; ++ } ++ ++ krb5_free_principal(krb_context, principal); ++ ++ if ((maj_status = gss_krb5_copy_ccache(&min_status, client->creds, ++ ccache))) { ++ logit("gss_krb5_copy_ccache() failed. Sorry!"); ++ krb5_cc_close(krb_context, ccache); ++ return 0; ++ } ++ ++ return 1; ++} ++ + ssh_gssapi_mech gssapi_kerberos_mech = { + "toWM5Slw5Ew8Mqkay+al2g==", + "Kerberos", + {9, "\x2A\x86\x48\x86\xF7\x12\x01\x02\x02"}, + NULL, + &ssh_gssapi_krb5_userok, + NULL, +- &ssh_gssapi_krb5_storecreds ++ &ssh_gssapi_krb5_storecreds, ++ &ssh_gssapi_krb5_updatecreds + }; + + #endif /* KRB5 */ + + #endif /* GSSAPI */ +diff --git a/openssh-6.2p2/gss-serv.c b/openssh-6.2p2/gss-serv.c +--- a/openssh-6.2p2/gss-serv.c ++++ b/openssh-6.2p2/gss-serv.c +@@ -1,12 +1,12 @@ + /* $OpenBSD: gss-serv.c,v 1.23 2011/08/01 19:18:15 markus Exp $ */ + + /* +- * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. ++ * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the +@@ -40,25 +40,30 @@ + #include "buffer.h" + #include "key.h" + #include "hostfile.h" + #include "auth.h" + #include "log.h" + #include "channels.h" + #include "session.h" + #include "misc.h" ++#include "servconf.h" ++#include "uidswap.h" + + #include "ssh-gss.h" ++#include "monitor_wrap.h" ++ ++extern ServerOptions options; + + static ssh_gssapi_client gssapi_client = + { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER, +- GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL}}; ++ GSS_C_NO_CREDENTIAL, GSS_C_NO_NAME, NULL, {NULL, NULL, NULL}, 0, 0}; + + ssh_gssapi_mech gssapi_null_mech = +- { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL}; ++ { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL, NULL}; + + #ifdef KRB5 + extern ssh_gssapi_mech gssapi_kerberos_mech; + #endif + + ssh_gssapi_mech* supported_mechs[]= { + #ifdef KRB5 + &gssapi_kerberos_mech, +@@ -76,59 +81,91 @@ ssh_gssapi_mech* supported_mechs[]= { + /* Privileged (called from ssh_gssapi_server_ctx) */ + static OM_uint32 + ssh_gssapi_acquire_cred(Gssctxt *ctx) + { + OM_uint32 status; + char lname[MAXHOSTNAMELEN]; + gss_OID_set oidset; + +- gss_create_empty_oid_set(&status, &oidset); +- gss_add_oid_set_member(&status, ctx->oid, &oidset); ++ if (options.gss_strict_acceptor) { ++ gss_create_empty_oid_set(&status, &oidset); ++ gss_add_oid_set_member(&status, ctx->oid, &oidset); + +- if (gethostname(lname, MAXHOSTNAMELEN)) { +- gss_release_oid_set(&status, &oidset); +- return (-1); +- } ++ if (gethostname(lname, MAXHOSTNAMELEN)) { ++ gss_release_oid_set(&status, &oidset); ++ return (-1); ++ } + +- if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) { ++ if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) { ++ gss_release_oid_set(&status, &oidset); ++ return (ctx->major); ++ } ++ ++ if ((ctx->major = gss_acquire_cred(&ctx->minor, ++ ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, ++ NULL, NULL))) ++ ssh_gssapi_error(ctx); ++ + gss_release_oid_set(&status, &oidset); + return (ctx->major); ++ } else { ++ ctx->name = GSS_C_NO_NAME; ++ ctx->creds = GSS_C_NO_CREDENTIAL; + } +- +- if ((ctx->major = gss_acquire_cred(&ctx->minor, +- ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL))) +- ssh_gssapi_error(ctx); +- +- gss_release_oid_set(&status, &oidset); +- return (ctx->major); ++ return GSS_S_COMPLETE; + } + + /* Privileged */ + OM_uint32 + ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) + { + if (*ctx) + ssh_gssapi_delete_ctx(ctx); + ssh_gssapi_build_ctx(ctx); + ssh_gssapi_set_oid(*ctx, oid); + return (ssh_gssapi_acquire_cred(*ctx)); + } + + /* Unprivileged */ ++char * ++ssh_gssapi_server_mechanisms() { ++ gss_OID_set supported; ++ ++ ssh_gssapi_supported_oids(&supported); ++ return (ssh_gssapi_kex_mechs(supported, &ssh_gssapi_server_check_mech, ++ NULL, NULL)); ++} ++ ++/* Unprivileged */ ++int ++ssh_gssapi_server_check_mech(Gssctxt **dum, gss_OID oid, const char *data, ++ const char *dummy) { ++ Gssctxt *ctx = NULL; ++ int res; ++ ++ res = !GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctx, oid))); ++ ssh_gssapi_delete_ctx(&ctx); ++ ++ return (res); ++} ++ ++/* Unprivileged */ + void + ssh_gssapi_supported_oids(gss_OID_set *oidset) + { + int i = 0; + OM_uint32 min_status; + int present; + gss_OID_set supported; + + gss_create_empty_oid_set(&min_status, oidset); +- gss_indicate_mechs(&min_status, &supported); ++ ++ if (GSS_ERROR(gss_indicate_mechs(&min_status, &supported))) ++ return; + + while (supported_mechs[i]->name != NULL) { + if (GSS_ERROR(gss_test_oid_set_member(&min_status, + &supported_mechs[i]->oid, supported, &present))) + present = 0; + if (present) + gss_add_oid_set_member(&min_status, + &supported_mechs[i]->oid, oidset); +@@ -244,32 +281,79 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss + /* Extract the client details from a given context. This can only reliably + * be called once for a context */ + + /* Privileged (called from accept_secure_ctx) */ + OM_uint32 + ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client) + { + int i = 0; ++ int equal = 0; ++ gss_name_t new_name = GSS_C_NO_NAME; ++ gss_buffer_desc ename = GSS_C_EMPTY_BUFFER; + +- gss_buffer_desc ename; ++ if (options.gss_store_rekey && client->used && ctx->client_creds) { ++ if (client->mech->oid.length != ctx->oid->length || ++ (memcmp(client->mech->oid.elements, ++ ctx->oid->elements, ctx->oid->length) !=0)) { ++ debug("Rekeyed credentials have different mechanism"); ++ return GSS_S_COMPLETE; ++ } ++ ++ if ((ctx->major = gss_inquire_cred_by_mech(&ctx->minor, ++ ctx->client_creds, ctx->oid, &new_name, ++ NULL, NULL, NULL))) { ++ ssh_gssapi_error(ctx); ++ return (ctx->major); ++ } ++ ++ ctx->major = gss_compare_name(&ctx->minor, client->name, ++ new_name, &equal); ++ ++ if (GSS_ERROR(ctx->major)) { ++ ssh_gssapi_error(ctx); ++ return (ctx->major); ++ } ++ ++ if (!equal) { ++ debug("Rekeyed credentials have different name"); ++ return GSS_S_COMPLETE; ++ } ++ ++ debug("Marking rekeyed credentials for export"); ++ ++ gss_release_name(&ctx->minor, &client->name); ++ gss_release_cred(&ctx->minor, &client->creds); ++ client->name = new_name; ++ client->creds = ctx->client_creds; ++ ctx->client_creds = GSS_C_NO_CREDENTIAL; ++ client->updated = 1; ++ return GSS_S_COMPLETE; ++ } + + client->mech = NULL; + + while (supported_mechs[i]->name != NULL) { + if (supported_mechs[i]->oid.length == ctx->oid->length && + (memcmp(supported_mechs[i]->oid.elements, + ctx->oid->elements, ctx->oid->length) == 0)) + client->mech = supported_mechs[i]; + i++; + } + + if (client->mech == NULL) + return GSS_S_FAILURE; + ++ if (ctx->client_creds && ++ (ctx->major = gss_inquire_cred_by_mech(&ctx->minor, ++ ctx->client_creds, ctx->oid, &client->name, NULL, NULL, NULL))) { ++ ssh_gssapi_error(ctx); ++ return (ctx->major); ++ } ++ + if ((ctx->major = gss_display_name(&ctx->minor, ctx->client, + &client->displayname, NULL))) { + ssh_gssapi_error(ctx); + return (ctx->major); + } + + if ((ctx->major = gss_export_name(&ctx->minor, ctx->client, + &ename))) { +@@ -277,16 +361,18 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_g + return (ctx->major); + } + + if ((ctx->major = ssh_gssapi_parse_ename(ctx,&ename, + &client->exportedname))) { + return (ctx->major); + } + ++ gss_release_buffer(&ctx->minor, &ename); ++ + /* We can't copy this structure, so we just move the pointer to it */ + client->creds = ctx->client_creds; + ctx->client_creds = GSS_C_NO_CREDENTIAL; + return (ctx->major); + } + + /* As user - called on fatal/exit */ + void +@@ -324,44 +410,122 @@ ssh_gssapi_do_child(char ***envp, u_int + gssapi_client.store.envval); + child_set_env(envp, envsizep, gssapi_client.store.envvar, + gssapi_client.store.envval); + } + } + + /* Privileged */ + int +-ssh_gssapi_userok(char *user) ++ssh_gssapi_userok(char *user, struct passwd *pw) + { + OM_uint32 lmin; + + if (gssapi_client.exportedname.length == 0 || + gssapi_client.exportedname.value == NULL) { + debug("No suitable client data"); + return 0; + } + if (gssapi_client.mech && gssapi_client.mech->userok) +- if ((*gssapi_client.mech->userok)(&gssapi_client, user)) ++ if ((*gssapi_client.mech->userok)(&gssapi_client, user)) { ++ gssapi_client.used = 1; ++ gssapi_client.store.owner = pw; + return 1; +- else { ++ } else { + /* Destroy delegated credentials if userok fails */ + gss_release_buffer(&lmin, &gssapi_client.displayname); + gss_release_buffer(&lmin, &gssapi_client.exportedname); + gss_release_cred(&lmin, &gssapi_client.creds); + memset(&gssapi_client, 0, sizeof(ssh_gssapi_client)); + return 0; + } + else + debug("ssh_gssapi_userok: Unknown GSSAPI mechanism"); + return (0); + } + +-/* Privileged */ +-OM_uint32 +-ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) ++/* These bits are only used for rekeying. The unpriviledged child is running ++ * as the user, the monitor is root. ++ * ++ * In the child, we want to : ++ * *) Ask the monitor to store our credentials into the store we specify ++ * *) If it succeeds, maybe do a PAM update ++ */ ++ ++/* Stuff for PAM */ ++ ++#ifdef USE_PAM ++static int ssh_gssapi_simple_conv(int n, const struct pam_message **msg, ++ struct pam_response **resp, void *data) + { +- ctx->major = gss_verify_mic(&ctx->minor, ctx->context, +- gssbuf, gssmic, NULL); ++ return (PAM_CONV_ERR); ++} ++#endif + +- return (ctx->major); ++void ++ssh_gssapi_rekey_creds() { ++ int ok; ++ int ret; ++#ifdef USE_PAM ++ pam_handle_t *pamh = NULL; ++ struct pam_conv pamconv = {ssh_gssapi_simple_conv, NULL}; ++ char *envstr; ++#endif ++ ++ if (gssapi_client.store.filename == NULL && ++ gssapi_client.store.envval == NULL && ++ gssapi_client.store.envvar == NULL) ++ return; ++ ++ ok = PRIVSEP(ssh_gssapi_update_creds(&gssapi_client.store)); ++ ++ if (!ok) ++ return; ++ ++ debug("Rekeyed credentials stored successfully"); ++ ++ /* Actually managing to play with the ssh pam stack from here will ++ * be next to impossible. In any case, we may want different options ++ * for rekeying. So, use our own :) ++ */ ++#ifdef USE_PAM ++ if (!use_privsep) { ++ debug("Not even going to try and do PAM with privsep disabled"); ++ return; ++ } ++ ++ ret = pam_start("sshd-rekey", gssapi_client.store.owner->pw_name, ++ &pamconv, &pamh); ++ if (ret) ++ return; ++ ++ xasprintf(&envstr, "%s=%s", gssapi_client.store.envvar, ++ gssapi_client.store.envval); ++ ++ ret = pam_putenv(pamh, envstr); ++ if (!ret) ++ pam_setcred(pamh, PAM_REINITIALIZE_CRED); ++ pam_end(pamh, PAM_SUCCESS); ++#endif ++} ++ ++int ++ssh_gssapi_update_creds(ssh_gssapi_ccache *store) { ++ int ok = 0; ++ ++ /* Check we've got credentials to store */ ++ if (!gssapi_client.updated) ++ return 0; ++ ++ gssapi_client.updated = 0; ++ ++ temporarily_use_uid(gssapi_client.store.owner); ++ if (gssapi_client.mech && gssapi_client.mech->updatecreds) ++ ok = (*gssapi_client.mech->updatecreds)(store, &gssapi_client); ++ else ++ debug("No update function for this mechanism"); ++ ++ restore_uid(); ++ ++ return ok; + } + + #endif +diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c +--- a/openssh-6.2p2/kex.c ++++ b/openssh-6.2p2/kex.c +@@ -46,16 +46,24 @@ + #include "log.h" + #include "mac.h" + #include "match.h" + #include "dispatch.h" + #include "monitor.h" + #include "roaming.h" + #include "audit.h" + ++#ifdef GSSAPI ++#include "ssh-gss.h" ++#endif ++ ++#ifdef GSSAPI ++#include "ssh-gss.h" ++#endif ++ + #if OPENSSL_VERSION_NUMBER >= 0x00907000L + # if defined(HAVE_EVP_SHA256) + # define evp_ssh_sha256 EVP_sha256 + # else + extern const EVP_MD *evp_ssh_sha256(void); + # endif + #endif + +@@ -377,16 +385,30 @@ choose_kex(Kex *k, char *client, char *s + } else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) { + k->kex_type = KEX_DH_GEX_SHA256; + k->evp_md = evp_ssh_sha256(); + } else if (strncmp(k->name, KEX_ECDH_SHA2_STEM, + sizeof(KEX_ECDH_SHA2_STEM) - 1) == 0) { + k->kex_type = KEX_ECDH_SHA2; + k->evp_md = kex_ecdh_name_to_evpmd(k->name); + #endif ++#ifdef GSSAPI ++ } else if (strncmp(k->name, KEX_GSS_GEX_SHA1_ID, ++ sizeof(KEX_GSS_GEX_SHA1_ID) - 1) == 0) { ++ k->kex_type = KEX_GSS_GEX_SHA1; ++ k->evp_md = EVP_sha1(); ++ } else if (strncmp(k->name, KEX_GSS_GRP1_SHA1_ID, ++ sizeof(KEX_GSS_GRP1_SHA1_ID) - 1) == 0) { ++ k->kex_type = KEX_GSS_GRP1_SHA1; ++ k->evp_md = EVP_sha1(); ++ } else if (strncmp(k->name, KEX_GSS_GRP14_SHA1_ID, ++ sizeof(KEX_GSS_GRP14_SHA1_ID) - 1) == 0) { ++ k->kex_type = KEX_GSS_GRP14_SHA1; ++ k->evp_md = EVP_sha1(); ++#endif + } else + fatal("bad kex alg %s", k->name); + } + + static void + choose_hostkeyalg(Kex *k, char *client, char *server) + { + char *hostkeyalg = match_list(client, server, NULL); +diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h +--- a/openssh-6.2p2/kex.h ++++ b/openssh-6.2p2/kex.h +@@ -68,16 +68,19 @@ enum kex_modes { + }; + + enum kex_exchange { + KEX_DH_GRP1_SHA1, + KEX_DH_GRP14_SHA1, + KEX_DH_GEX_SHA1, + KEX_DH_GEX_SHA256, + KEX_ECDH_SHA2, ++ KEX_GSS_GRP1_SHA1, ++ KEX_GSS_GRP14_SHA1, ++ KEX_GSS_GEX_SHA1, + KEX_MAX + }; + + #define KEX_INIT_SENT 0x0001 + + typedef struct Kex Kex; + typedef struct Mac Mac; + typedef struct Comp Comp; +@@ -126,16 +129,22 @@ struct Kex { + int hostkey_type; + int kex_type; + int roaming; + Buffer my; + Buffer peer; + sig_atomic_t done; + int flags; + const EVP_MD *evp_md; ++#ifdef GSSAPI ++ int gss_deleg_creds; ++ int gss_trust_dns; ++ char *gss_host; ++ char *gss_client; ++#endif + char *client_version_string; + char *server_version_string; + int (*verify_host_key)(Key *); + Key *(*load_host_public_key)(int); + Key *(*load_host_private_key)(int); + int (*host_key_index)(Key *); + void (*kex[KEX_MAX])(Kex *); + }; +@@ -154,16 +163,21 @@ Newkeys *kex_get_newkeys(int); + void kexdh_client(Kex *); + void kexdh_server(Kex *); + void kexgex_client(Kex *); + void kexgex_server(Kex *); + void kexecdh_client(Kex *); + void kexecdh_server(Kex *); + + void newkeys_destroy(Newkeys *newkeys); ++ ++#ifdef GSSAPI ++void kexgss_client(Kex *); ++void kexgss_server(Kex *); ++#endif + + void + kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, + BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); + void + kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, + int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, + BIGNUM *, BIGNUM *, u_char **, u_int *); +diff --git a/openssh-6.2p2/kexgssc.c b/openssh-6.2p2/kexgssc.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/kexgssc.c +@@ -0,0 +1,334 @@ ++/* ++ * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "includes.h" ++ ++#ifdef GSSAPI ++ ++#include "includes.h" ++ ++#include ++#include ++ ++#include ++ ++#include "xmalloc.h" ++#include "buffer.h" ++#include "ssh2.h" ++#include "key.h" ++#include "cipher.h" ++#include "kex.h" ++#include "log.h" ++#include "packet.h" ++#include "dh.h" ++ ++#include "ssh-gss.h" ++ ++void ++kexgss_client(Kex *kex) { ++ gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER; ++ gss_buffer_desc recv_tok, gssbuf, msg_tok, *token_ptr; ++ Gssctxt *ctxt; ++ OM_uint32 maj_status, min_status, ret_flags; ++ u_int klen, kout, slen = 0, hashlen, strlen; ++ DH *dh; ++ BIGNUM *dh_server_pub = NULL; ++ BIGNUM *shared_secret = NULL; ++ BIGNUM *p = NULL; ++ BIGNUM *g = NULL; ++ u_char *kbuf, *hash; ++ u_char *serverhostkey = NULL; ++ u_char *empty = ""; ++ char *msg; ++ char *lang; ++ int type = 0; ++ int first = 1; ++ int nbits = 0, min = DH_GRP_MIN, max = DH_GRP_MAX; ++ ++ /* Initialise our GSSAPI world */ ++ ssh_gssapi_build_ctx(&ctxt); ++ if (ssh_gssapi_id_kex(ctxt, kex->name, kex->kex_type) ++ == GSS_C_NO_OID) ++ fatal("Couldn't identify host exchange"); ++ ++ if (ssh_gssapi_import_name(ctxt, kex->gss_host)) ++ fatal("Couldn't import hostname"); ++ ++ if (kex->gss_client && ++ ssh_gssapi_client_identity(ctxt, kex->gss_client)) ++ fatal("Couldn't acquire client credentials"); ++ ++ switch (kex->kex_type) { ++ case KEX_GSS_GRP1_SHA1: ++ dh = dh_new_group1(); ++ break; ++ case KEX_GSS_GRP14_SHA1: ++ dh = dh_new_group14(); ++ break; ++ case KEX_GSS_GEX_SHA1: ++ debug("Doing group exchange\n"); ++ nbits = dh_estimate(kex->we_need * 8); ++ packet_start(SSH2_MSG_KEXGSS_GROUPREQ); ++ packet_put_int(min); ++ packet_put_int(nbits); ++ packet_put_int(max); ++ ++ packet_send(); ++ ++ packet_read_expect(SSH2_MSG_KEXGSS_GROUP); ++ ++ if ((p = BN_new()) == NULL) ++ fatal("BN_new() failed"); ++ packet_get_bignum2(p); ++ if ((g = BN_new()) == NULL) ++ fatal("BN_new() failed"); ++ packet_get_bignum2(g); ++ packet_check_eom(); ++ ++ if (BN_num_bits(p) < min || BN_num_bits(p) > max) ++ fatal("GSSGRP_GEX group out of range: %d !< %d !< %d", ++ min, BN_num_bits(p), max); ++ ++ dh = dh_new_group(g, p); ++ break; ++ default: ++ fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); ++ } ++ ++ /* Step 1 - e is dh->pub_key */ ++ dh_gen_key(dh, kex->we_need * 8); ++ ++ /* This is f, we initialise it now to make life easier */ ++ dh_server_pub = BN_new(); ++ if (dh_server_pub == NULL) ++ fatal("dh_server_pub == NULL"); ++ ++ token_ptr = GSS_C_NO_BUFFER; ++ ++ do { ++ debug("Calling gss_init_sec_context"); ++ ++ maj_status = ssh_gssapi_init_ctx(ctxt, ++ kex->gss_deleg_creds, token_ptr, &send_tok, ++ &ret_flags); ++ ++ if (GSS_ERROR(maj_status)) { ++ if (send_tok.length != 0) { ++ packet_start(SSH2_MSG_KEXGSS_CONTINUE); ++ packet_put_string(send_tok.value, ++ send_tok.length); ++ } ++ fatal("gss_init_context failed"); ++ } ++ ++ /* If we've got an old receive buffer get rid of it */ ++ if (token_ptr != GSS_C_NO_BUFFER) ++ xfree(recv_tok.value); ++ ++ if (maj_status == GSS_S_COMPLETE) { ++ /* If mutual state flag is not true, kex fails */ ++ if (!(ret_flags & GSS_C_MUTUAL_FLAG)) ++ fatal("Mutual authentication failed"); ++ ++ /* If integ avail flag is not true kex fails */ ++ if (!(ret_flags & GSS_C_INTEG_FLAG)) ++ fatal("Integrity check failed"); ++ } ++ ++ /* ++ * If we have data to send, then the last message that we ++ * received cannot have been a 'complete'. ++ */ ++ if (send_tok.length != 0) { ++ if (first) { ++ packet_start(SSH2_MSG_KEXGSS_INIT); ++ packet_put_string(send_tok.value, ++ send_tok.length); ++ packet_put_bignum2(dh->pub_key); ++ first = 0; ++ } else { ++ packet_start(SSH2_MSG_KEXGSS_CONTINUE); ++ packet_put_string(send_tok.value, ++ send_tok.length); ++ } ++ packet_send(); ++ gss_release_buffer(&min_status, &send_tok); ++ ++ /* If we've sent them data, they should reply */ ++ do { ++ type = packet_read(); ++ if (type == SSH2_MSG_KEXGSS_HOSTKEY) { ++ debug("Received KEXGSS_HOSTKEY"); ++ if (serverhostkey) ++ fatal("Server host key received more than once"); ++ serverhostkey = ++ packet_get_string(&slen); ++ } ++ } while (type == SSH2_MSG_KEXGSS_HOSTKEY); ++ ++ switch (type) { ++ case SSH2_MSG_KEXGSS_CONTINUE: ++ debug("Received GSSAPI_CONTINUE"); ++ if (maj_status == GSS_S_COMPLETE) ++ fatal("GSSAPI Continue received from server when complete"); ++ recv_tok.value = packet_get_string(&strlen); ++ recv_tok.length = strlen; ++ break; ++ case SSH2_MSG_KEXGSS_COMPLETE: ++ debug("Received GSSAPI_COMPLETE"); ++ packet_get_bignum2(dh_server_pub); ++ msg_tok.value = packet_get_string(&strlen); ++ msg_tok.length = strlen; ++ ++ /* Is there a token included? */ ++ if (packet_get_char()) { ++ recv_tok.value= ++ packet_get_string(&strlen); ++ recv_tok.length = strlen; ++ /* If we're already complete - protocol error */ ++ if (maj_status == GSS_S_COMPLETE) ++ packet_disconnect("Protocol error: received token when complete"); ++ } else { ++ /* No token included */ ++ if (maj_status != GSS_S_COMPLETE) ++ packet_disconnect("Protocol error: did not receive final token"); ++ } ++ break; ++ case SSH2_MSG_KEXGSS_ERROR: ++ debug("Received Error"); ++ maj_status = packet_get_int(); ++ min_status = packet_get_int(); ++ msg = packet_get_string(NULL); ++ lang = packet_get_string(NULL); ++ fatal("GSSAPI Error: \n%.400s",msg); ++ default: ++ packet_disconnect("Protocol error: didn't expect packet type %d", ++ type); ++ } ++ token_ptr = &recv_tok; ++ } else { ++ /* No data, and not complete */ ++ if (maj_status != GSS_S_COMPLETE) ++ fatal("Not complete, and no token output"); ++ } ++ } while (maj_status & GSS_S_CONTINUE_NEEDED); ++ ++ /* ++ * We _must_ have received a COMPLETE message in reply from the ++ * server, which will have set dh_server_pub and msg_tok ++ */ ++ ++ if (type != SSH2_MSG_KEXGSS_COMPLETE) ++ fatal("Didn't receive a SSH2_MSG_KEXGSS_COMPLETE when I expected it"); ++ ++ /* Check f in range [1, p-1] */ ++ if (!dh_pub_is_valid(dh, dh_server_pub)) ++ packet_disconnect("bad server public DH value"); ++ ++ /* compute K=f^x mod p */ ++ klen = DH_size(dh); ++ kbuf = xmalloc(klen); ++ kout = DH_compute_key(kbuf, dh_server_pub, dh); ++ if (kout < 0) ++ fatal("DH_compute_key: failed"); ++ ++ shared_secret = BN_new(); ++ if (shared_secret == NULL) ++ fatal("kexgss_client: BN_new failed"); ++ ++ if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) ++ fatal("kexdh_client: BN_bin2bn failed"); ++ ++ memset(kbuf, 0, klen); ++ xfree(kbuf); ++ ++ switch (kex->kex_type) { ++ case KEX_GSS_GRP1_SHA1: ++ case KEX_GSS_GRP14_SHA1: ++ kex_dh_hash( kex->client_version_string, ++ kex->server_version_string, ++ buffer_ptr(&kex->my), buffer_len(&kex->my), ++ buffer_ptr(&kex->peer), buffer_len(&kex->peer), ++ (serverhostkey ? serverhostkey : empty), slen, ++ dh->pub_key, /* e */ ++ dh_server_pub, /* f */ ++ shared_secret, /* K */ ++ &hash, &hashlen ++ ); ++ break; ++ case KEX_GSS_GEX_SHA1: ++ kexgex_hash( ++ kex->evp_md, ++ kex->client_version_string, ++ kex->server_version_string, ++ buffer_ptr(&kex->my), buffer_len(&kex->my), ++ buffer_ptr(&kex->peer), buffer_len(&kex->peer), ++ (serverhostkey ? serverhostkey : empty), slen, ++ min, nbits, max, ++ dh->p, dh->g, ++ dh->pub_key, ++ dh_server_pub, ++ shared_secret, ++ &hash, &hashlen ++ ); ++ break; ++ default: ++ fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); ++ } ++ ++ gssbuf.value = hash; ++ gssbuf.length = hashlen; ++ ++ /* Verify that the hash matches the MIC we just got. */ ++ if (GSS_ERROR(ssh_gssapi_checkmic(ctxt, &gssbuf, &msg_tok))) ++ packet_disconnect("Hash's MIC didn't verify"); ++ ++ xfree(msg_tok.value); ++ ++ DH_free(dh); ++ if (serverhostkey) ++ xfree(serverhostkey); ++ BN_clear_free(dh_server_pub); ++ ++ /* save session id */ ++ if (kex->session_id == NULL) { ++ kex->session_id_len = hashlen; ++ kex->session_id = xmalloc(kex->session_id_len); ++ memcpy(kex->session_id, hash, kex->session_id_len); ++ } ++ ++ if (kex->gss_deleg_creds) ++ ssh_gssapi_credentials_updated(ctxt); ++ ++ if (gss_kex_context == NULL) ++ gss_kex_context = ctxt; ++ else ++ ssh_gssapi_delete_ctx(&ctxt); ++ ++ kex_derive_keys(kex, hash, hashlen, shared_secret); ++ BN_clear_free(shared_secret); ++ kex_finish(kex); ++} ++ ++#endif /* GSSAPI */ +diff --git a/openssh-6.2p2/kexgsss.c b/openssh-6.2p2/kexgsss.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/kexgsss.c +@@ -0,0 +1,288 @@ ++/* ++ * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "includes.h" ++ ++#ifdef GSSAPI ++ ++#include ++ ++#include ++#include ++ ++#include "xmalloc.h" ++#include "buffer.h" ++#include "ssh2.h" ++#include "key.h" ++#include "cipher.h" ++#include "kex.h" ++#include "log.h" ++#include "packet.h" ++#include "dh.h" ++#include "ssh-gss.h" ++#include "monitor_wrap.h" ++#include "servconf.h" ++ ++extern ServerOptions options; ++ ++void ++kexgss_server(Kex *kex) ++{ ++ OM_uint32 maj_status, min_status; ++ ++ /* ++ * Some GSSAPI implementations use the input value of ret_flags (an ++ * output variable) as a means of triggering mechanism specific ++ * features. Initializing it to zero avoids inadvertently ++ * activating this non-standard behaviour. ++ */ ++ ++ OM_uint32 ret_flags = 0; ++ gss_buffer_desc gssbuf, recv_tok, msg_tok; ++ gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER; ++ Gssctxt *ctxt = NULL; ++ u_int slen, klen, kout, hashlen; ++ u_char *kbuf, *hash; ++ DH *dh; ++ int min = -1, max = -1, nbits = -1; ++ BIGNUM *shared_secret = NULL; ++ BIGNUM *dh_client_pub = NULL; ++ int type = 0; ++ gss_OID oid; ++ char *mechs; ++ ++ /* Initialise GSSAPI */ ++ ++ /* If we're rekeying, privsep means that some of the private structures ++ * in the GSSAPI code are no longer available. This kludges them back ++ * into life ++ */ ++ if (!ssh_gssapi_oid_table_ok()) ++ if ((mechs = ssh_gssapi_server_mechanisms())) ++ xfree(mechs); ++ ++ debug2("%s: Identifying %s", __func__, kex->name); ++ oid = ssh_gssapi_id_kex(NULL, kex->name, kex->kex_type); ++ if (oid == GSS_C_NO_OID) ++ fatal("Unknown gssapi mechanism"); ++ ++ debug2("%s: Acquiring credentials", __func__); ++ ++ if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, oid)))) ++ fatal("Unable to acquire credentials for the server"); ++ ++ switch (kex->kex_type) { ++ case KEX_GSS_GRP1_SHA1: ++ dh = dh_new_group1(); ++ break; ++ case KEX_GSS_GRP14_SHA1: ++ dh = dh_new_group14(); ++ break; ++ case KEX_GSS_GEX_SHA1: ++ debug("Doing group exchange"); ++ packet_read_expect(SSH2_MSG_KEXGSS_GROUPREQ); ++ min = packet_get_int(); ++ nbits = packet_get_int(); ++ max = packet_get_int(); ++ min = MAX(DH_GRP_MIN, min); ++ max = MIN(DH_GRP_MAX, max); ++ packet_check_eom(); ++ if (max < min || nbits < min || max < nbits) ++ fatal("GSS_GEX, bad parameters: %d !< %d !< %d", ++ min, nbits, max); ++ dh = PRIVSEP(choose_dh(min, nbits, max)); ++ if (dh == NULL) ++ packet_disconnect("Protocol error: no matching group found"); ++ ++ packet_start(SSH2_MSG_KEXGSS_GROUP); ++ packet_put_bignum2(dh->p); ++ packet_put_bignum2(dh->g); ++ packet_send(); ++ ++ packet_write_wait(); ++ break; ++ default: ++ fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); ++ } ++ ++ dh_gen_key(dh, kex->we_need * 8); ++ ++ do { ++ debug("Wait SSH2_MSG_GSSAPI_INIT"); ++ type = packet_read(); ++ switch(type) { ++ case SSH2_MSG_KEXGSS_INIT: ++ if (dh_client_pub != NULL) ++ fatal("Received KEXGSS_INIT after initialising"); ++ recv_tok.value = packet_get_string(&slen); ++ recv_tok.length = slen; ++ ++ if ((dh_client_pub = BN_new()) == NULL) ++ fatal("dh_client_pub == NULL"); ++ ++ packet_get_bignum2(dh_client_pub); ++ ++ /* Send SSH_MSG_KEXGSS_HOSTKEY here, if we want */ ++ break; ++ case SSH2_MSG_KEXGSS_CONTINUE: ++ recv_tok.value = packet_get_string(&slen); ++ recv_tok.length = slen; ++ break; ++ default: ++ packet_disconnect( ++ "Protocol error: didn't expect packet type %d", ++ type); ++ } ++ ++ maj_status = PRIVSEP(ssh_gssapi_accept_ctx(ctxt, &recv_tok, ++ &send_tok, &ret_flags)); ++ ++ xfree(recv_tok.value); ++ ++ if (maj_status != GSS_S_COMPLETE && send_tok.length == 0) ++ fatal("Zero length token output when incomplete"); ++ ++ if (dh_client_pub == NULL) ++ fatal("No client public key"); ++ ++ if (maj_status & GSS_S_CONTINUE_NEEDED) { ++ debug("Sending GSSAPI_CONTINUE"); ++ packet_start(SSH2_MSG_KEXGSS_CONTINUE); ++ packet_put_string(send_tok.value, send_tok.length); ++ packet_send(); ++ gss_release_buffer(&min_status, &send_tok); ++ } ++ } while (maj_status & GSS_S_CONTINUE_NEEDED); ++ ++ if (GSS_ERROR(maj_status)) { ++ if (send_tok.length > 0) { ++ packet_start(SSH2_MSG_KEXGSS_CONTINUE); ++ packet_put_string(send_tok.value, send_tok.length); ++ packet_send(); ++ } ++ fatal("accept_ctx died"); ++ } ++ ++ if (!(ret_flags & GSS_C_MUTUAL_FLAG)) ++ fatal("Mutual Authentication flag wasn't set"); ++ ++ if (!(ret_flags & GSS_C_INTEG_FLAG)) ++ fatal("Integrity flag wasn't set"); ++ ++ if (!dh_pub_is_valid(dh, dh_client_pub)) ++ packet_disconnect("bad client public DH value"); ++ ++ klen = DH_size(dh); ++ kbuf = xmalloc(klen); ++ kout = DH_compute_key(kbuf, dh_client_pub, dh); ++ if (kout < 0) ++ fatal("DH_compute_key: failed"); ++ ++ shared_secret = BN_new(); ++ if (shared_secret == NULL) ++ fatal("kexgss_server: BN_new failed"); ++ ++ if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) ++ fatal("kexgss_server: BN_bin2bn failed"); ++ ++ memset(kbuf, 0, klen); ++ xfree(kbuf); ++ ++ switch (kex->kex_type) { ++ case KEX_GSS_GRP1_SHA1: ++ case KEX_GSS_GRP14_SHA1: ++ kex_dh_hash( ++ kex->client_version_string, kex->server_version_string, ++ buffer_ptr(&kex->peer), buffer_len(&kex->peer), ++ buffer_ptr(&kex->my), buffer_len(&kex->my), ++ NULL, 0, /* Change this if we start sending host keys */ ++ dh_client_pub, dh->pub_key, shared_secret, ++ &hash, &hashlen ++ ); ++ break; ++ case KEX_GSS_GEX_SHA1: ++ kexgex_hash( ++ kex->evp_md, ++ kex->client_version_string, kex->server_version_string, ++ buffer_ptr(&kex->peer), buffer_len(&kex->peer), ++ buffer_ptr(&kex->my), buffer_len(&kex->my), ++ NULL, 0, ++ min, nbits, max, ++ dh->p, dh->g, ++ dh_client_pub, ++ dh->pub_key, ++ shared_secret, ++ &hash, &hashlen ++ ); ++ break; ++ default: ++ fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); ++ } ++ ++ BN_clear_free(dh_client_pub); ++ ++ if (kex->session_id == NULL) { ++ kex->session_id_len = hashlen; ++ kex->session_id = xmalloc(kex->session_id_len); ++ memcpy(kex->session_id, hash, kex->session_id_len); ++ } ++ ++ gssbuf.value = hash; ++ gssbuf.length = hashlen; ++ ++ if (GSS_ERROR(PRIVSEP(ssh_gssapi_sign(ctxt,&gssbuf,&msg_tok)))) ++ fatal("Couldn't get MIC"); ++ ++ packet_start(SSH2_MSG_KEXGSS_COMPLETE); ++ packet_put_bignum2(dh->pub_key); ++ packet_put_string(msg_tok.value,msg_tok.length); ++ ++ if (send_tok.length != 0) { ++ packet_put_char(1); /* true */ ++ packet_put_string(send_tok.value, send_tok.length); ++ } else { ++ packet_put_char(0); /* false */ ++ } ++ packet_send(); ++ ++ gss_release_buffer(&min_status, &send_tok); ++ gss_release_buffer(&min_status, &msg_tok); ++ ++ if (gss_kex_context == NULL) ++ gss_kex_context = ctxt; ++ else ++ ssh_gssapi_delete_ctx(&ctxt); ++ ++ DH_free(dh); ++ ++ kex_derive_keys(kex, hash, hashlen, shared_secret); ++ BN_clear_free(shared_secret); ++ kex_finish(kex); ++ ++ /* If this was a rekey, then save out any delegated credentials we ++ * just exchanged. */ ++ if (options.gss_store_rekey) ++ ssh_gssapi_rekey_creds(); ++} ++#endif /* GSSAPI */ +diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c +--- a/openssh-6.2p2/key.c ++++ b/openssh-6.2p2/key.c +@@ -1038,16 +1038,18 @@ key_ssh_name_from_type_nid(int type, int + return "ecdsa-sha2-nistp384-cert-v01@openssh.com"; + case NID_secp521r1: + return "ecdsa-sha2-nistp521-cert-v01@openssh.com"; + default: + break; + } + break; + #endif /* OPENSSL_HAS_ECC */ ++ case KEY_NULL: ++ return "null"; + } + return "ssh-unknown"; + } + + const char * + key_ssh_name(const Key *k) + { + return key_ssh_name_from_type_nid(k->type, k->ecdsa_nid); +@@ -1343,16 +1345,18 @@ key_type_from_name(char *name) + } else if (strcmp(name, "ssh-dss-cert-v01@openssh.com") == 0) { + return KEY_DSA_CERT; + #ifdef OPENSSL_HAS_ECC + } else if (strcmp(name, "ecdsa-sha2-nistp256-cert-v01@openssh.com") == 0 || + strcmp(name, "ecdsa-sha2-nistp384-cert-v01@openssh.com") == 0 || + strcmp(name, "ecdsa-sha2-nistp521-cert-v01@openssh.com") == 0) { + return KEY_ECDSA_CERT; + #endif ++ } else if (strcmp(name, "null") == 0) { ++ return KEY_NULL; + } + + debug2("key_type_from_name: unknown key type '%s'", name); + return KEY_UNSPEC; + } + + int + key_ecdsa_nid_from_name(const char *name) +diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h +--- a/openssh-6.2p2/key.h ++++ b/openssh-6.2p2/key.h +@@ -39,16 +39,17 @@ enum types { + KEY_RSA, + KEY_DSA, + KEY_ECDSA, + KEY_RSA_CERT, + KEY_DSA_CERT, + KEY_ECDSA_CERT, + KEY_RSA_CERT_V00, + KEY_DSA_CERT_V00, ++ KEY_NULL, + KEY_UNSPEC + }; + enum fp_type { + SSH_FP_SHA1, + SSH_FP_MD5, + SSH_FP_SHA256 + }; + enum fp_rep { +diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +--- a/openssh-6.2p2/monitor.c ++++ b/openssh-6.2p2/monitor.c +@@ -178,16 +178,18 @@ int mm_answer_pam_respond(int, Buffer *) + int mm_answer_pam_free_ctx(int, Buffer *); + #endif + + #ifdef GSSAPI + int mm_answer_gss_setup_ctx(int, Buffer *); + int mm_answer_gss_accept_ctx(int, Buffer *); + int mm_answer_gss_userok(int, Buffer *); + int mm_answer_gss_checkmic(int, Buffer *); ++int mm_answer_gss_sign(int, Buffer *); ++int mm_answer_gss_updatecreds(int, Buffer *); + #endif + + #ifdef SSH_AUDIT_EVENTS + int mm_answer_audit_event(int, Buffer *); + int mm_answer_audit_command(int, Buffer *); + int mm_answer_audit_end_command(int, Buffer *); + int mm_answer_audit_unsupported_body(int, Buffer *); + int mm_answer_audit_kex_body(int, Buffer *); +@@ -259,28 +261,35 @@ struct mon_table mon_dispatch_proto20[] + #endif + {MONITOR_REQ_KEYALLOWED, MON_ISAUTH, mm_answer_keyallowed}, + {MONITOR_REQ_KEYVERIFY, MON_AUTH, mm_answer_keyverify}, + #ifdef GSSAPI + {MONITOR_REQ_GSSSETUP, MON_ISAUTH, mm_answer_gss_setup_ctx}, + {MONITOR_REQ_GSSSTEP, MON_ISAUTH, mm_answer_gss_accept_ctx}, + {MONITOR_REQ_GSSUSEROK, MON_AUTH, mm_answer_gss_userok}, + {MONITOR_REQ_GSSCHECKMIC, MON_ISAUTH, mm_answer_gss_checkmic}, ++ {MONITOR_REQ_GSSSIGN, MON_ONCE, mm_answer_gss_sign}, + #endif + #ifdef JPAKE + {MONITOR_REQ_JPAKE_GET_PWDATA, MON_ONCE, mm_answer_jpake_get_pwdata}, + {MONITOR_REQ_JPAKE_STEP1, MON_ISAUTH, mm_answer_jpake_step1}, + {MONITOR_REQ_JPAKE_STEP2, MON_ONCE, mm_answer_jpake_step2}, + {MONITOR_REQ_JPAKE_KEY_CONFIRM, MON_ONCE, mm_answer_jpake_key_confirm}, + {MONITOR_REQ_JPAKE_CHECK_CONFIRM, MON_AUTH, mm_answer_jpake_check_confirm}, + #endif + {0, 0, NULL} + }; + + struct mon_table mon_dispatch_postauth20[] = { ++#ifdef GSSAPI ++ {MONITOR_REQ_GSSSETUP, 0, mm_answer_gss_setup_ctx}, ++ {MONITOR_REQ_GSSSTEP, 0, mm_answer_gss_accept_ctx}, ++ {MONITOR_REQ_GSSSIGN, 0, mm_answer_gss_sign}, ++ {MONITOR_REQ_GSSUPCREDS, 0, mm_answer_gss_updatecreds}, ++#endif + {MONITOR_REQ_MODULI, 0, mm_answer_moduli}, + {MONITOR_REQ_SIGN, 0, mm_answer_sign}, + {MONITOR_REQ_PTY, 0, mm_answer_pty}, + {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, + {MONITOR_REQ_TERM, 0, mm_answer_term}, + #ifdef SSH_AUDIT_EVENTS + {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, + {MONITOR_REQ_AUDIT_COMMAND, MON_PERMIT, mm_answer_audit_command}, +@@ -393,16 +402,20 @@ monitor_child_preauth(Authctxt *_authctx + authctxt->loginmsg = &loginmsg; + + if (compat20) { + mon_dispatch = mon_dispatch_proto20; + + /* Permit requests for moduli and signatures */ + monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); ++#ifdef GSSAPI ++ /* and for the GSSAPI key exchange */ ++ monitor_permit(mon_dispatch, MONITOR_REQ_GSSSETUP, 1); ++#endif + } else { + mon_dispatch = mon_dispatch_proto15; + + monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); + } + + /* The first few requests do not require asynchronous access */ + while (!authenticated) { +@@ -508,16 +521,20 @@ monitor_child_postauth(struct monitor *p + + if (compat20) { + mon_dispatch = mon_dispatch_postauth20; + + /* Permit requests for moduli and signatures */ + monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); ++#ifdef GSSAPI ++ /* and for the GSSAPI key exchange */ ++ monitor_permit(mon_dispatch, MONITOR_REQ_GSSSETUP, 1); ++#endif + } else { + mon_dispatch = mon_dispatch_postauth15; + monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); + } + if (!no_pty_flag) { + monitor_permit(mon_dispatch, MONITOR_REQ_PTY, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_PTYCLEANUP, 1); + } +@@ -1912,16 +1929,23 @@ mm_get_kex(Buffer *m) + timingsafe_bcmp(kex->session_id, session_id2, session_id2_len) != 0) + fatal("mm_get_get: internal error: bad session id"); + kex->we_need = buffer_get_int(m); + kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; + kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server; + kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; + kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; + kex->kex[KEX_ECDH_SHA2] = kexecdh_server; ++#ifdef GSSAPI ++ if (options.gss_keyex) { ++ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; ++ kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_server; ++ kex->kex[KEX_GSS_GEX_SHA1] = kexgss_server; ++ } ++#endif + kex->server = 1; + kex->hostkey_type = buffer_get_int(m); + kex->kex_type = buffer_get_int(m); + blob = buffer_get_string(m, &bloblen); + buffer_init(&kex->my); + buffer_append(&kex->my, blob, bloblen); + xfree(blob); + blob = buffer_get_string(m, &bloblen); +@@ -2135,16 +2159,19 @@ monitor_reinit(struct monitor *mon) + #ifdef GSSAPI + int + mm_answer_gss_setup_ctx(int sock, Buffer *m) + { + gss_OID_desc goid; + OM_uint32 major; + u_int len; + ++ if (!options.gss_authentication && !options.gss_keyex) ++ fatal("In GSSAPI monitor when GSSAPI is disabled"); ++ + goid.elements = buffer_get_string(m, &len); + goid.length = len; + + major = ssh_gssapi_server_ctx(&gsscontext, &goid); + + xfree(goid.elements); + + buffer_clear(m); +@@ -2162,16 +2189,19 @@ int + mm_answer_gss_accept_ctx(int sock, Buffer *m) + { + gss_buffer_desc in; + gss_buffer_desc out = GSS_C_EMPTY_BUFFER; + OM_uint32 major, minor; + OM_uint32 flags = 0; /* GSI needs this */ + u_int len; + ++ if (!options.gss_authentication && !options.gss_keyex) ++ fatal("In GSSAPI monitor when GSSAPI is disabled"); ++ + in.value = buffer_get_string(m, &len); + in.length = len; + major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags); + xfree(in.value); + + buffer_clear(m); + buffer_put_int(m, major); + buffer_put_string(m, out.value, out.length); +@@ -2179,27 +2209,31 @@ mm_answer_gss_accept_ctx(int sock, Buffe + mm_request_send(sock, MONITOR_ANS_GSSSTEP, m); + + gss_release_buffer(&minor, &out); + + if (major == GSS_S_COMPLETE) { + monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0); + monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1); + monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1); ++ monitor_permit(mon_dispatch, MONITOR_REQ_GSSSIGN, 1); + } + return (0); + } + + int + mm_answer_gss_checkmic(int sock, Buffer *m) + { + gss_buffer_desc gssbuf, mic; + OM_uint32 ret; + u_int len; + ++ if (!options.gss_authentication && !options.gss_keyex) ++ fatal("In GSSAPI monitor when GSSAPI is disabled"); ++ + gssbuf.value = buffer_get_string(m, &len); + gssbuf.length = len; + mic.value = buffer_get_string(m, &len); + mic.length = len; + + ret = ssh_gssapi_checkmic(gsscontext, &gssbuf, &mic); + + xfree(gssbuf.value); +@@ -2216,29 +2250,101 @@ mm_answer_gss_checkmic(int sock, Buffer + return (0); + } + + int + mm_answer_gss_userok(int sock, Buffer *m) + { + int authenticated; + +- authenticated = authctxt->valid && ssh_gssapi_userok(authctxt->user); ++ if (!options.gss_authentication && !options.gss_keyex) ++ fatal("In GSSAPI monitor when GSSAPI is disabled"); ++ ++ authenticated = authctxt->valid && ++ ssh_gssapi_userok(authctxt->user, authctxt->pw); + + buffer_clear(m); + buffer_put_int(m, authenticated); + + debug3("%s: sending result %d", __func__, authenticated); + mm_request_send(sock, MONITOR_ANS_GSSUSEROK, m); + + auth_method = "gssapi-with-mic"; + + /* Monitor loop will terminate if authenticated */ + return (authenticated); + } ++ ++int ++mm_answer_gss_sign(int socket, Buffer *m) ++{ ++ gss_buffer_desc data; ++ gss_buffer_desc hash = GSS_C_EMPTY_BUFFER; ++ OM_uint32 major, minor; ++ u_int len; ++ ++ if (!options.gss_authentication && !options.gss_keyex) ++ fatal("In GSSAPI monitor when GSSAPI is disabled"); ++ ++ data.value = buffer_get_string(m, &len); ++ data.length = len; ++ if (data.length != 20) ++ fatal("%s: data length incorrect: %d", __func__, ++ (int) data.length); ++ ++ /* Save the session ID on the first time around */ ++ if (session_id2_len == 0) { ++ session_id2_len = data.length; ++ session_id2 = xmalloc(session_id2_len); ++ memcpy(session_id2, data.value, session_id2_len); ++ } ++ major = ssh_gssapi_sign(gsscontext, &data, &hash); ++ ++ xfree(data.value); ++ ++ buffer_clear(m); ++ buffer_put_int(m, major); ++ buffer_put_string(m, hash.value, hash.length); ++ ++ mm_request_send(socket, MONITOR_ANS_GSSSIGN, m); ++ ++ gss_release_buffer(&minor, &hash); ++ ++ /* Turn on getpwnam permissions */ ++ monitor_permit(mon_dispatch, MONITOR_REQ_PWNAM, 1); ++ ++ /* And credential updating, for when rekeying */ ++ monitor_permit(mon_dispatch, MONITOR_REQ_GSSUPCREDS, 1); ++ ++ return (0); ++} ++ ++int ++mm_answer_gss_updatecreds(int socket, Buffer *m) { ++ ssh_gssapi_ccache store; ++ int ok; ++ ++ store.filename = buffer_get_string(m, NULL); ++ store.envvar = buffer_get_string(m, NULL); ++ store.envval = buffer_get_string(m, NULL); ++ ++ ok = ssh_gssapi_update_creds(&store); ++ ++ xfree(store.filename); ++ xfree(store.envvar); ++ xfree(store.envval); ++ ++ buffer_clear(m); ++ buffer_put_int(m, ok); ++ ++ mm_request_send(socket, MONITOR_ANS_GSSUPCREDS, m); ++ ++ return(0); ++} ++ + #endif /* GSSAPI */ + + #ifdef JPAKE + int + mm_answer_jpake_step1(int sock, Buffer *m) + { + struct jpake_ctx *pctx; + u_char *x3_proof, *x4_proof; +diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h +--- a/openssh-6.2p2/monitor.h ++++ b/openssh-6.2p2/monitor.h +@@ -70,16 +70,19 @@ enum monitor_reqtype { + MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, + MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, + MONITOR_ANS_AUDIT_COMMAND = 114, MONITOR_REQ_AUDIT_END_COMMAND = 115, + MONITOR_REQ_AUDIT_UNSUPPORTED = 116, MONITOR_ANS_AUDIT_UNSUPPORTED = 117, + MONITOR_REQ_AUDIT_KEX = 118, MONITOR_ANS_AUDIT_KEX = 119, + MONITOR_REQ_AUDIT_SESSION_KEY_FREE = 120, MONITOR_ANS_AUDIT_SESSION_KEY_FREE = 121, + MONITOR_REQ_AUDIT_SERVER_KEY_FREE = 122, MONITOR_ANS_AUDIT_SERVER_KEY_FREE = 123, + ++ MONITOR_REQ_GSSSIGN = 201, MONITOR_ANS_GSSSIGN = 202, ++ MONITOR_REQ_GSSUPCREDS = 203, MONITOR_ANS_GSSUPCREDS = 204, ++ + }; + + struct mm_master; + struct monitor { + int m_recvfd; + int m_sendfd; + int m_log_recvfd; + int m_log_sendfd; +diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c +--- a/openssh-6.2p2/monitor_wrap.c ++++ b/openssh-6.2p2/monitor_wrap.c +@@ -1303,33 +1303,78 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss + &m); + + major = buffer_get_int(&m); + buffer_free(&m); + return(major); + } + + int +-mm_ssh_gssapi_userok(char *user) ++mm_ssh_gssapi_userok(char *user, struct passwd *pw) + { + Buffer m; + int authenticated = 0; + + buffer_init(&m); + + mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUSEROK, &m); + mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUSEROK, + &m); + + authenticated = buffer_get_int(&m); + + buffer_free(&m); + debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); + return (authenticated); + } ++ ++OM_uint32 ++mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash) ++{ ++ Buffer m; ++ OM_uint32 major; ++ u_int len; ++ ++ buffer_init(&m); ++ buffer_put_string(&m, data->value, data->length); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m); ++ ++ major = buffer_get_int(&m); ++ hash->value = buffer_get_string(&m, &len); ++ hash->length = len; ++ ++ buffer_free(&m); ++ ++ return(major); ++} ++ ++int ++mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store) ++{ ++ Buffer m; ++ int ok; ++ ++ buffer_init(&m); ++ ++ buffer_put_cstring(&m, store->filename ? store->filename : ""); ++ buffer_put_cstring(&m, store->envvar ? store->envvar : ""); ++ buffer_put_cstring(&m, store->envval ? store->envval : ""); ++ ++ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUPCREDS, &m); ++ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUPCREDS, &m); ++ ++ ok = buffer_get_int(&m); ++ ++ buffer_free(&m); ++ ++ return (ok); ++} ++ + #endif /* GSSAPI */ + + #ifdef JPAKE + void + mm_auth2_jpake_get_pwdata(Authctxt *authctxt, BIGNUM **s, + char **hash_scheme, char **salt) + { + Buffer m; +diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h +--- a/openssh-6.2p2/monitor_wrap.h ++++ b/openssh-6.2p2/monitor_wrap.h +@@ -54,18 +54,20 @@ int mm_user_key_verify(Key *, u_char *, + int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); + int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); + BIGNUM *mm_auth_rsa_generate_challenge(Key *); + + #ifdef GSSAPI + OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **, gss_OID); + OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *, + gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *); +-int mm_ssh_gssapi_userok(char *user); ++int mm_ssh_gssapi_userok(char *user, struct passwd *); + OM_uint32 mm_ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); ++OM_uint32 mm_ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); ++int mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *); + #endif + + #ifdef USE_PAM + void mm_start_pam(struct Authctxt *); + u_int mm_do_pam_account(void); + void *mm_sshpam_init_ctx(struct Authctxt *); + int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); + int mm_sshpam_respond(void *, u_int, char **); +diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c +--- a/openssh-6.2p2/readconf.c ++++ b/openssh-6.2p2/readconf.c +@@ -124,16 +124,18 @@ typedef enum { + oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, + oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, + oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, + oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, + oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, + oClearAllForwardings, oNoHostAuthenticationForLocalhost, + oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, + oAddressFamily, oGssAuthentication, oGssDelegateCreds, oGssEnableMITM, ++ oGssTrustDns, oGssKeyEx, oGssClientIdentity, oGssRenewalRekey, ++ oGssServerIdentity, + oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, + oSendEnv, oControlPath, oControlMaster, oControlPersist, + oHashKnownHosts, + oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, + oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, + oKexAlgorithms, oIPQoS, oRequestTTY, + oDeprecated, oUnsupported + } OpCodes; +@@ -164,22 +166,31 @@ static struct { + { "challengeresponseauthentication", oChallengeResponseAuthentication }, + { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ + { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ + { "kerberosauthentication", oUnsupported }, + { "kerberostgtpassing", oUnsupported }, + { "afstokenpassing", oUnsupported }, + #if defined(GSSAPI) + { "gssapiauthentication", oGssAuthentication }, ++ { "gssapikeyexchange", oGssKeyEx }, + { "gssapidelegatecredentials", oGssDelegateCreds }, + { "gssapienablemitmattack", oGssEnableMITM }, ++ { "gssapitrustdns", oGssTrustDns }, ++ { "gssapiclientidentity", oGssClientIdentity }, ++ { "gssapiserveridentity", oGssServerIdentity }, ++ { "gssapirenewalforcesrekey", oGssRenewalRekey }, + #else + { "gssapiauthentication", oUnsupported }, ++ { "gssapikeyexchange", oUnsupported }, + { "gssapidelegatecredentials", oUnsupported }, + { "gssapienablemitmattack", oUnsupported }, ++ { "gssapitrustdns", oUnsupported }, ++ { "gssapiclientidentity", oUnsupported }, ++ { "gssapirenewalforcesrekey", oUnsupported }, + #endif + { "fallbacktorsh", oDeprecated }, + { "usersh", oDeprecated }, + { "identityfile", oIdentityFile }, + { "identityfile2", oIdentityFile }, /* obsolete */ + { "identitiesonly", oIdentitiesOnly }, + { "hostname", oHostName }, + { "hostkeyalias", oHostKeyAlias }, +@@ -500,24 +511,44 @@ parse_flag: + case oChallengeResponseAuthentication: + intptr = &options->challenge_response_authentication; + goto parse_flag; + + case oGssAuthentication: + intptr = &options->gss_authentication; + goto parse_flag; + ++ case oGssKeyEx: ++ intptr = &options->gss_keyex; ++ goto parse_flag; ++ + case oGssDelegateCreds: + intptr = &options->gss_deleg_creds; + goto parse_flag; + + case oGssEnableMITM: + intptr = &options->gss_enable_mitm; + goto parse_flag; + ++ case oGssTrustDns: ++ intptr = &options->gss_trust_dns; ++ goto parse_flag; ++ ++ case oGssClientIdentity: ++ charptr = &options->gss_client_identity; ++ goto parse_string; ++ ++ case oGssServerIdentity: ++ charptr = &options->gss_server_identity; ++ goto parse_string; ++ ++ case oGssRenewalRekey: ++ intptr = &options->gss_renewal_rekey; ++ goto parse_flag; ++ + case oBatchMode: + intptr = &options->batch_mode; + goto parse_flag; + + case oCheckHostIP: + intptr = &options->check_host_ip; + goto parse_flag; + +@@ -1159,18 +1190,23 @@ initialize_options(Options * options) + options->exit_on_forward_failure = -1; + options->xauth_location = NULL; + options->gateway_ports = -1; + options->use_privileged_port = -1; + options->rsa_authentication = -1; + options->pubkey_authentication = -1; + options->challenge_response_authentication = -1; + options->gss_authentication = -1; ++ options->gss_keyex = -1; + options->gss_deleg_creds = -1; + options->gss_enable_mitm = -1; ++ options->gss_trust_dns = -1; ++ options->gss_renewal_rekey = -1; ++ options->gss_client_identity = NULL; ++ options->gss_server_identity = NULL; + options->password_authentication = -1; + options->kbd_interactive_authentication = -1; + options->kbd_interactive_devices = NULL; + options->rhosts_rsa_authentication = -1; + options->hostbased_authentication = -1; + options->batch_mode = -1; + options->check_host_ip = -1; + options->strict_host_key_checking = -1; +@@ -1260,20 +1296,26 @@ fill_default_options(Options * options) + if (options->rsa_authentication == -1) + options->rsa_authentication = 1; + if (options->pubkey_authentication == -1) + options->pubkey_authentication = 1; + if (options->challenge_response_authentication == -1) + options->challenge_response_authentication = 1; + if (options->gss_authentication == -1) + options->gss_authentication = 0; ++ if (options->gss_keyex == -1) ++ options->gss_keyex = 0; + if (options->gss_deleg_creds == -1) + options->gss_deleg_creds = 0; + if (options->gss_enable_mitm == -1) + options->gss_enable_mitm = 0; ++ if (options->gss_trust_dns == -1) ++ options->gss_trust_dns = 0; ++ if (options->gss_renewal_rekey == -1) ++ options->gss_renewal_rekey = 0; + if (options->password_authentication == -1) + options->password_authentication = 1; + if (options->kbd_interactive_authentication == -1) + options->kbd_interactive_authentication = 1; + if (options->rhosts_rsa_authentication == -1) + options->rhosts_rsa_authentication = 0; + if (options->hostbased_authentication == -1) + options->hostbased_authentication = 0; +diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h +--- a/openssh-6.2p2/readconf.h ++++ b/openssh-6.2p2/readconf.h +@@ -43,18 +43,23 @@ typedef struct { + int rhosts_rsa_authentication; /* Try rhosts with RSA + * authentication. */ + int rsa_authentication; /* Try RSA authentication. */ + int pubkey_authentication; /* Try ssh2 pubkey authentication. */ + int hostbased_authentication; /* ssh2's rhosts_rsa */ + int challenge_response_authentication; + /* Try S/Key or TIS, authentication. */ + int gss_authentication; /* Try GSS authentication */ ++ int gss_keyex; /* Try GSS key exchange */ + int gss_deleg_creds; /* Delegate GSS credentials */ + int gss_enable_mitm; /* Enable old style gssapi auth */ ++ int gss_trust_dns; /* Trust DNS for GSS canonicalization */ ++ int gss_renewal_rekey; /* Credential renewal forces rekey */ ++ char *gss_client_identity; /* Principal to initiate GSSAPI with */ ++ char *gss_server_identity; /* GSSAPI target principal */ + int password_authentication; /* Try password + * authentication. */ + int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ + char *kbd_interactive_devices; /* Keyboard-interactive auth devices. */ + int zero_knowledge_password_authentication; /* Try jpake */ + int batch_mode; /* Batch mode: do not ask for passwords. */ + int check_host_ip; /* Also keep track of keys for IP address */ + int strict_host_key_checking; /* Strict host key checking. */ +diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c +--- a/openssh-6.2p2/servconf.c ++++ b/openssh-6.2p2/servconf.c +@@ -98,18 +98,21 @@ initialize_server_options(ServerOptions + options->hostbased_uses_name_from_packet_only = -1; + options->rsa_authentication = -1; + options->pubkey_authentication = -1; + options->kerberos_authentication = -1; + options->kerberos_or_local_passwd = -1; + options->kerberos_ticket_cleanup = -1; + options->kerberos_get_afs_token = -1; + options->gss_authentication=-1; ++ options->gss_keyex = -1; + options->gss_cleanup_creds = -1; + options->gss_enable_mitm = -1; ++ options->gss_strict_acceptor = -1; ++ options->gss_store_rekey = -1; + options->password_authentication = -1; + options->kbd_interactive_authentication = -1; + options->challenge_response_authentication = -1; + options->permit_empty_passwd = -1; + options->permit_user_env = -1; + options->use_login = -1; + options->compression = -1; + options->allow_tcp_forwarding = -1; +@@ -232,20 +235,26 @@ fill_default_server_options(ServerOption + if (options->kerberos_or_local_passwd == -1) + options->kerberos_or_local_passwd = 1; + if (options->kerberos_ticket_cleanup == -1) + options->kerberos_ticket_cleanup = 1; + if (options->kerberos_get_afs_token == -1) + options->kerberos_get_afs_token = 0; + if (options->gss_authentication == -1) + options->gss_authentication = 0; ++ if (options->gss_keyex == -1) ++ options->gss_keyex = 0; + if (options->gss_cleanup_creds == -1) + options->gss_cleanup_creds = 1; + if (options->gss_enable_mitm == -1) + options->gss_enable_mitm = 0; ++ if (options->gss_strict_acceptor == -1) ++ options->gss_strict_acceptor = 1; ++ if (options->gss_store_rekey == -1) ++ options->gss_store_rekey = 0; + if (options->password_authentication == -1) + options->password_authentication = 1; + if (options->kbd_interactive_authentication == -1) + options->kbd_interactive_authentication = 0; + if (options->challenge_response_authentication == -1) + options->challenge_response_authentication = 1; + if (options->permit_empty_passwd == -1) + options->permit_empty_passwd = 0; +@@ -329,16 +338,17 @@ typedef enum { + sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, + sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, + sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, + sMaxStartups, sMaxAuthTries, sMaxSessions, + sBanner, sUseDNS, sHostbasedAuthentication, + sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, + sClientAliveCountMax, sAuthorizedKeysFile, + sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, sGssEnableMITM, ++ sGssStrictAcceptor, sGssKeyEx, sGssStoreRekey, + sMatch, sPermitOpen, sForceCommand, sChrootDirectory, + sUsePrivilegeSeparation, sAllowAgentForwarding, + sZeroKnowledgePasswordAuthentication, sHostCertificate, + sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, + sKexAlgorithms, sIPQoS, sVersionAddendum, + sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, + sAuthenticationMethods, + sDeprecated, sUnsupported +@@ -397,21 +407,31 @@ static struct { + { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL }, + #endif + { "kerberostgtpassing", sUnsupported, SSHCFG_GLOBAL }, + { "afstokenpassing", sUnsupported, SSHCFG_GLOBAL }, + #ifdef GSSAPI + { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, + { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, + { "gssapienablemitmattack", sGssEnableMITM }, ++ { "gssapicleanupcreds", sGssCleanupCreds, SSHCFG_GLOBAL }, ++ { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL }, ++ { "gssapikeyexchange", sGssKeyEx, SSHCFG_GLOBAL }, ++ { "gssapistorecredentialsonrekey", sGssStoreRekey, SSHCFG_GLOBAL }, + #else + { "gssapiauthentication", sUnsupported, SSHCFG_ALL }, + { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL }, + { "gssapienablemitmattack", sUnsupported }, ++ { "gssapicleanupcreds", sUnsupported, SSHCFG_GLOBAL }, ++ { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL }, ++ { "gssapikeyexchange", sUnsupported, SSHCFG_GLOBAL }, ++ { "gssapistorecredentialsonrekey", sUnsupported, SSHCFG_GLOBAL }, + #endif ++ { "gssusesessionccache", sUnsupported, SSHCFG_GLOBAL }, ++ { "gssapiusesessioncredcache", sUnsupported, SSHCFG_GLOBAL }, + { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, + { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, + { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, + { "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ + #ifdef JPAKE + { "zeroknowledgepasswordauthentication", sZeroKnowledgePasswordAuthentication, SSHCFG_ALL }, + #else + { "zeroknowledgepasswordauthentication", sUnsupported, SSHCFG_ALL }, +@@ -1057,24 +1077,36 @@ process_server_config_line(ServerOptions + case sKerberosGetAFSToken: + intptr = &options->kerberos_get_afs_token; + goto parse_flag; + + case sGssAuthentication: + intptr = &options->gss_authentication; + goto parse_flag; + ++ case sGssKeyEx: ++ intptr = &options->gss_keyex; ++ goto parse_flag; ++ + case sGssCleanupCreds: + intptr = &options->gss_cleanup_creds; + goto parse_flag; + + case sGssEnableMITM: + intptr = &options->gss_enable_mitm; + goto parse_flag; + ++ case sGssStrictAcceptor: ++ intptr = &options->gss_strict_acceptor; ++ goto parse_flag; ++ ++ case sGssStoreRekey: ++ intptr = &options->gss_store_rekey; ++ goto parse_flag; ++ + case sPasswordAuthentication: + intptr = &options->password_authentication; + goto parse_flag; + + case sZeroKnowledgePasswordAuthentication: + intptr = &options->zero_knowledge_password_authentication; + goto parse_flag; + +@@ -1939,17 +1971,20 @@ dump_config(ServerOptions *o) + dump_cfg_fmtint(sKerberosOrLocalPasswd, o->kerberos_or_local_passwd); + dump_cfg_fmtint(sKerberosTicketCleanup, o->kerberos_ticket_cleanup); + # ifdef USE_AFS + dump_cfg_fmtint(sKerberosGetAFSToken, o->kerberos_get_afs_token); + # endif + #endif + #ifdef GSSAPI + dump_cfg_fmtint(sGssAuthentication, o->gss_authentication); ++ dump_cfg_fmtint(sGssKeyEx, o->gss_keyex); + dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds); ++ dump_cfg_fmtint(sGssStrictAcceptor, o->gss_strict_acceptor); ++ dump_cfg_fmtint(sGssStoreRekey, o->gss_store_rekey); + #endif + #ifdef JPAKE + dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication, + o->zero_knowledge_password_authentication); + #endif + dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication); + dump_cfg_fmtint(sKbdInteractiveAuthentication, + o->kbd_interactive_authentication); +diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h +--- a/openssh-6.2p2/servconf.h ++++ b/openssh-6.2p2/servconf.h +@@ -105,18 +105,21 @@ typedef struct { + * authentication mechanism, + * such as SecurID or + * /etc/passwd */ + int kerberos_ticket_cleanup; /* If true, destroy ticket + * file on logout. */ + int kerberos_get_afs_token; /* If true, try to get AFS token if + * authenticated with Kerberos. */ + int gss_authentication; /* If true, permit GSSAPI authentication */ ++ int gss_keyex; /* If true, permit GSSAPI key exchange */ + int gss_cleanup_creds; /* If true, destroy cred cache on logout */ + int gss_enable_mitm; /* If true, enable old style GSSAPI */ ++ int gss_strict_acceptor; /* If true, restrict the GSSAPI acceptor name */ ++ int gss_store_rekey; + int password_authentication; /* If true, permit password + * authentication. */ + int kbd_interactive_authentication; /* If true, permit */ + int challenge_response_authentication; + int zero_knowledge_password_authentication; + /* If true, permit jpake auth */ + int permit_empty_passwd; /* If false, do not permit empty + * passwords. */ +diff --git a/openssh-6.2p2/ssh-gss.h b/openssh-6.2p2/ssh-gss.h +--- a/openssh-6.2p2/ssh-gss.h ++++ b/openssh-6.2p2/ssh-gss.h +@@ -1,11 +1,11 @@ + /* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ + /* +- * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. ++ * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the +@@ -56,53 +56,70 @@ + #define SSH2_MSG_USERAUTH_GSSAPI_TOKEN 61 + #define SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE 63 + #define SSH2_MSG_USERAUTH_GSSAPI_ERROR 64 + #define SSH2_MSG_USERAUTH_GSSAPI_ERRTOK 65 + #define SSH2_MSG_USERAUTH_GSSAPI_MIC 66 + + #define SSH_GSS_OIDTYPE 0x06 + ++#define SSH2_MSG_KEXGSS_INIT 30 ++#define SSH2_MSG_KEXGSS_CONTINUE 31 ++#define SSH2_MSG_KEXGSS_COMPLETE 32 ++#define SSH2_MSG_KEXGSS_HOSTKEY 33 ++#define SSH2_MSG_KEXGSS_ERROR 34 ++#define SSH2_MSG_KEXGSS_GROUPREQ 40 ++#define SSH2_MSG_KEXGSS_GROUP 41 ++#define KEX_GSS_GRP1_SHA1_ID "gss-group1-sha1-" ++#define KEX_GSS_GRP14_SHA1_ID "gss-group14-sha1-" ++#define KEX_GSS_GEX_SHA1_ID "gss-gex-sha1-" ++ + typedef struct { + char *filename; + char *envvar; + char *envval; ++ struct passwd *owner; + void *data; + } ssh_gssapi_ccache; + + typedef struct { + gss_buffer_desc displayname; + gss_buffer_desc exportedname; + gss_cred_id_t creds; ++ gss_name_t name; + struct ssh_gssapi_mech_struct *mech; + ssh_gssapi_ccache store; ++ int used; ++ int updated; + } ssh_gssapi_client; + + typedef struct ssh_gssapi_mech_struct { + char *enc_name; + char *name; + gss_OID_desc oid; + int (*dochild) (ssh_gssapi_client *); + int (*userok) (ssh_gssapi_client *, char *); + int (*localname) (ssh_gssapi_client *, char **); + void (*storecreds) (ssh_gssapi_client *); ++ int (*updatecreds) (ssh_gssapi_ccache *, ssh_gssapi_client *); + } ssh_gssapi_mech; + + typedef struct { + OM_uint32 major; /* both */ + OM_uint32 minor; /* both */ + gss_ctx_id_t context; /* both */ + gss_name_t name; /* both */ + gss_OID oid; /* client */ + gss_cred_id_t creds; /* server */ + gss_name_t client; /* server */ +- gss_cred_id_t client_creds; /* server */ ++ gss_cred_id_t client_creds; /* both */ + } Gssctxt; + + extern ssh_gssapi_mech *supported_mechs[]; ++extern Gssctxt *gss_kex_context; + + int ssh_gssapi_check_oid(Gssctxt *, void *, size_t); + void ssh_gssapi_set_oid_data(Gssctxt *, void *, size_t); + void ssh_gssapi_set_oid(Gssctxt *, gss_OID); + void ssh_gssapi_supported_oids(gss_OID_set *); + ssh_gssapi_mech *ssh_gssapi_get_ctype(Gssctxt *); + + OM_uint32 ssh_gssapi_import_name(Gssctxt *, const char *); +@@ -112,21 +129,35 @@ OM_uint32 ssh_gssapi_accept_ctx(Gssctxt + gss_buffer_desc *, gss_buffer_desc *, OM_uint32 *); + OM_uint32 ssh_gssapi_getclient(Gssctxt *, ssh_gssapi_client *); + void ssh_gssapi_error(Gssctxt *); + char *ssh_gssapi_last_error(Gssctxt *, OM_uint32 *, OM_uint32 *); + void ssh_gssapi_build_ctx(Gssctxt **); + void ssh_gssapi_delete_ctx(Gssctxt **); + OM_uint32 ssh_gssapi_sign(Gssctxt *, gss_buffer_t, gss_buffer_t); + void ssh_gssapi_buildmic(Buffer *, const char *, const char *, const char *); +-int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *); ++int ssh_gssapi_check_mechanism(Gssctxt **, gss_OID, const char *, const char *); ++OM_uint32 ssh_gssapi_client_identity(Gssctxt *, const char *); ++int ssh_gssapi_credentials_updated(Gssctxt *); + + /* In the server */ ++typedef int ssh_gssapi_check_fn(Gssctxt **, gss_OID, const char *, ++ const char *); ++char *ssh_gssapi_client_mechanisms(const char *, const char *); ++char *ssh_gssapi_kex_mechs(gss_OID_set, ssh_gssapi_check_fn *, const char *, ++ const char *); ++gss_OID ssh_gssapi_id_kex(Gssctxt *, char *, int); ++int ssh_gssapi_server_check_mech(Gssctxt **,gss_OID, const char *, ++ const char *); + OM_uint32 ssh_gssapi_server_ctx(Gssctxt **, gss_OID); +-int ssh_gssapi_userok(char *name); ++int ssh_gssapi_userok(char *name, struct passwd *); + OM_uint32 ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); + void ssh_gssapi_do_child(char ***, u_int *); + void ssh_gssapi_cleanup_creds(void); + void ssh_gssapi_storecreds(void); + ++char *ssh_gssapi_server_mechanisms(void); ++int ssh_gssapi_oid_table_ok(); ++ ++int ssh_gssapi_update_creds(ssh_gssapi_ccache *store); + #endif /* GSSAPI */ + + #endif /* _SSH_GSS_H */ +diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +--- a/openssh-6.2p2/ssh_config ++++ b/openssh-6.2p2/ssh_config +@@ -32,16 +32,18 @@ Host * + ForwardX11Trusted yes + + # RhostsRSAAuthentication no + # RSAAuthentication yes + # PasswordAuthentication yes + # HostbasedAuthentication no + # GSSAPIAuthentication no + # GSSAPIDelegateCredentials no ++# GSSAPIKeyExchange no ++# GSSAPITrustDNS no + # BatchMode no + # CheckHostIP yes + # AddressFamily any + # ConnectTimeout 0 + # StrictHostKeyChecking ask + # IdentityFile ~/.ssh/identity + # IdentityFile ~/.ssh/id_rsa + # IdentityFile ~/.ssh/id_dsa +diff --git a/openssh-6.2p2/ssh_config.5 b/openssh-6.2p2/ssh_config.5 +--- a/openssh-6.2p2/ssh_config.5 ++++ b/openssh-6.2p2/ssh_config.5 +@@ -525,21 +525,53 @@ host key database, separated by whitespa + The default is + .Pa /etc/ssh/ssh_known_hosts , + .Pa /etc/ssh/ssh_known_hosts2 . + .It Cm GSSAPIAuthentication + Specifies whether user authentication based on GSSAPI is allowed. + The default is + .Dq no . + Note that this option applies to protocol version 2 only. ++.It Cm GSSAPIKeyExchange ++Specifies whether key exchange based on GSSAPI may be used. When using ++GSSAPI key exchange the server need not have a host key. ++The default is ++.Dq no . ++Note that this option applies to protocol version 2 only. ++.It Cm GSSAPIClientIdentity ++If set, specifies the GSSAPI client identity that ssh should use when ++connecting to the server. The default is unset, which means that the default ++identity will be used. ++.It Cm GSSAPIServerIdentity ++If set, specifies the GSSAPI server identity that ssh should expect when ++connecting to the server. The default is unset, which means that the ++expected GSSAPI server identity will be determined from the target ++hostname. + .It Cm GSSAPIDelegateCredentials + Forward (delegate) credentials to the server. + The default is + .Dq no . +-Note that this option applies to protocol version 2 only. ++Note that this option applies to protocol version 2 connections using GSSAPI. ++.It Cm GSSAPIRenewalForcesRekey ++If set to ++.Dq yes ++then renewal of the client's GSSAPI credentials will force the rekeying of the ++ssh connection. With a compatible server, this can delegate the renewed ++credentials to a session on the server. ++The default is ++.Dq no . ++.It Cm GSSAPITrustDns ++Set to ++.Dq yes to indicate that the DNS is trusted to securely canonicalize ++the name of the host being connected to. If ++.Dq no, the hostname entered on the ++command line will be passed untouched to the GSSAPI library. ++The default is ++.Dq no . ++This option only applies to protocol version 2 connections using GSSAPI. + .It Cm HashKnownHosts + Indicates that + .Xr ssh 1 + should hash host names and addresses when they are added to + .Pa ~/.ssh/known_hosts . + These hashed names may be used normally by + .Xr ssh 1 + and +diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c +--- a/openssh-6.2p2/sshconnect2.c ++++ b/openssh-6.2p2/sshconnect2.c +@@ -155,19 +155,44 @@ order_hostkeyalgs(char *host, struct soc + return ret; + } + + void + ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) + { + Kex *kex; + ++#ifdef GSSAPI ++ char *orig = NULL, *gss = NULL; ++ char *gss_host = NULL; ++#endif ++ + xxx_host = host; + xxx_hostaddr = hostaddr; + ++#ifdef GSSAPI ++ if (options.gss_keyex) { ++ /* Add the GSSAPI mechanisms currently supported on this ++ * client to the key exchange algorithm proposal */ ++ orig = myproposal[PROPOSAL_KEX_ALGS]; ++ ++ if (options.gss_trust_dns) ++ gss_host = (char *)get_canonical_hostname(1); ++ else ++ gss_host = host; ++ ++ gss = ssh_gssapi_client_mechanisms(gss_host, options.gss_client_identity); ++ if (gss) { ++ debug("Offering GSSAPI proposal: %s", gss); ++ xasprintf(&myproposal[PROPOSAL_KEX_ALGS], ++ "%s,%s", gss, orig); ++ } ++ } ++#endif ++ + if (options.ciphers == (char *)-1) { + logit("No valid ciphers for protocol version 2 given, using defaults."); + options.ciphers = NULL; + } + if (options.ciphers != NULL) { + myproposal[PROPOSAL_ENC_ALGS_CTOS] = + myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers; + } +@@ -192,30 +217,61 @@ ssh_kex2(char *host, struct sockaddr *ho + else { + /* Prefer algorithms that we already have keys for */ + myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = + order_hostkeyalgs(host, hostaddr, port); + } + if (options.kex_algorithms != NULL) + myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + ++#ifdef GSSAPI ++ /* If we've got GSSAPI algorithms, then we also support the ++ * 'null' hostkey, as a last resort */ ++ if (options.gss_keyex && gss) { ++ orig = myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]; ++ xasprintf(&myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS], ++ "%s,null", orig); ++ xfree(gss); ++ } ++#endif ++ + if (options.rekey_limit) + packet_set_rekey_limit((u_int32_t)options.rekey_limit); + + /* start key exchange */ + kex = kex_setup(myproposal); + kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; + kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client; + kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; + kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; + kex->kex[KEX_ECDH_SHA2] = kexecdh_client; ++#ifdef GSSAPI ++ if (options.gss_keyex) { ++ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; ++ kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_client; ++ kex->kex[KEX_GSS_GEX_SHA1] = kexgss_client; ++ } ++#endif + kex->client_version_string=client_version_string; + kex->server_version_string=server_version_string; + kex->verify_host_key=&verify_host_key_callback; + ++#ifdef GSSAPI ++ if (options.gss_keyex) { ++ kex->gss_deleg_creds = options.gss_deleg_creds; ++ kex->gss_trust_dns = options.gss_trust_dns; ++ kex->gss_client = options.gss_client_identity; ++ if (options.gss_server_identity) { ++ kex->gss_host = options.gss_server_identity; ++ } else { ++ kex->gss_host = gss_host; ++ } ++ } ++#endif ++ + xxx_kex = kex; + + dispatch_run(DISPATCH_BLOCK, &kex->done, kex); + + if (options.use_roaming && !kex->roaming) { + debug("Roaming not allowed by server"); + options.use_roaming = 0; + } +@@ -301,31 +357,37 @@ void userauth_jpake_cleanup(Authctxt *); + + #ifdef GSSAPI + int userauth_gssapi(Authctxt *authctxt); + void input_gssapi_response(int type, u_int32_t, void *); + void input_gssapi_token(int type, u_int32_t, void *); + void input_gssapi_hash(int type, u_int32_t, void *); + void input_gssapi_error(int, u_int32_t, void *); + void input_gssapi_errtok(int, u_int32_t, void *); ++int userauth_gsskeyex(Authctxt *authctxt); + #endif + + void userauth(Authctxt *, char *); + + static int sign_and_send_pubkey(Authctxt *, Identity *); + static void pubkey_prepare(Authctxt *); + static void pubkey_cleanup(Authctxt *); + static Key *load_identity_file(char *, int); + + static Authmethod *authmethod_get(char *authlist); + static Authmethod *authmethod_lookup(const char *name); + static char *authmethods_get(void); + + Authmethod authmethods[] = { + #ifdef GSSAPI ++ {"gssapi-keyex", ++ userauth_gsskeyex, ++ NULL, ++ &options.gss_authentication, ++ NULL}, + {"gssapi-with-mic", + userauth_gssapi, + NULL, + &options.gss_authentication, + NULL}, + {"gssapi", + userauth_gssapi, + NULL, +@@ -627,29 +689,41 @@ done: + int + userauth_gssapi(Authctxt *authctxt) + { + Gssctxt *gssctxt = NULL; + static gss_OID_set gss_supported = NULL; + static u_int mech = 0; + OM_uint32 min; + int ok = 0; ++ const char *gss_host; ++ ++ if (options.gss_server_identity) ++ gss_host = options.gss_server_identity; ++ else if (options.gss_trust_dns) ++ gss_host = get_canonical_hostname(1); ++ else ++ gss_host = authctxt->host; + + /* Try one GSSAPI method at a time, rather than sending them all at + * once. */ + + if (gss_supported == NULL) +- gss_indicate_mechs(&min, &gss_supported); ++ if (GSS_ERROR(gss_indicate_mechs(&min, &gss_supported))) { ++ gss_supported = NULL; ++ return 0; ++ } + + /* Check to see if the mechanism is usable before we offer it */ + while (mech < gss_supported->count && !ok) { + /* My DER encoding requires length<128 */ + if (gss_supported->elements[mech].length < 128 && + ssh_gssapi_check_mechanism(&gssctxt, +- &gss_supported->elements[mech], authctxt->host)) { ++ &gss_supported->elements[mech], gss_host, ++ options.gss_client_identity)) { + ok = 1; /* Mechanism works */ + } else { + mech++; + } + } + + if (!ok) + return 0; +@@ -738,18 +812,18 @@ process_gssapi_token(void *ctxt, gss_buf + } + + /* ARGSUSED */ + void + input_gssapi_response(int type, u_int32_t plen, void *ctxt) + { + Authctxt *authctxt = ctxt; + Gssctxt *gssctxt; +- int oidlen; +- char *oidv; ++ u_int oidlen; ++ u_char *oidv; + + if (authctxt == NULL) + fatal("input_gssapi_response: no authentication context"); + gssctxt = authctxt->methoddata; + + /* Setup our OID */ + oidv = packet_get_string(&oidlen); + +@@ -849,16 +923,58 @@ input_gssapi_error(int type, u_int32_t p + lang=packet_get_string(NULL); + + packet_check_eom(); + + debug("Server GSSAPI Error:\n%s", msg); + xfree(msg); + xfree(lang); + } ++ ++int ++userauth_gsskeyex(Authctxt *authctxt) ++{ ++ Buffer b; ++ gss_buffer_desc gssbuf; ++ gss_buffer_desc mic = GSS_C_EMPTY_BUFFER; ++ OM_uint32 ms; ++ ++ static int attempt = 0; ++ if (attempt++ >= 1) ++ return (0); ++ ++ if (gss_kex_context == NULL) { ++ debug("No valid Key exchange context"); ++ return (0); ++ } ++ ++ ssh_gssapi_buildmic(&b, authctxt->server_user, authctxt->service, ++ "gssapi-keyex"); ++ ++ gssbuf.value = buffer_ptr(&b); ++ gssbuf.length = buffer_len(&b); ++ ++ if (GSS_ERROR(ssh_gssapi_sign(gss_kex_context, &gssbuf, &mic))) { ++ buffer_free(&b); ++ return (0); ++ } ++ ++ packet_start(SSH2_MSG_USERAUTH_REQUEST); ++ packet_put_cstring(authctxt->server_user); ++ packet_put_cstring(authctxt->service); ++ packet_put_cstring(authctxt->method->name); ++ packet_put_string(mic.value, mic.length); ++ packet_send(); ++ ++ buffer_free(&b); ++ gss_release_buffer(&ms, &mic); ++ ++ return (1); ++} ++ + #endif /* GSSAPI */ + + int + userauth_none(Authctxt *authctxt) + { + /* initial userauth request */ + packet_start(SSH2_MSG_USERAUTH_REQUEST); + packet_put_cstring(authctxt->server_user); +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -119,16 +119,24 @@ + #include "ssh-gss.h" + #endif + #include "monitor_wrap.h" + #include "roaming.h" + #include "audit.h" + #include "ssh-sandbox.h" + #include "version.h" + ++#ifdef USE_SECURITY_SESSION_API ++#include ++#endif ++ ++#ifdef USE_SECURITY_SESSION_API ++#include ++#endif ++ + #ifdef LIBWRAP + #include + #include + int allow_severity; + int deny_severity; + #endif /* LIBWRAP */ + + #ifndef O_NOCTTY +@@ -1715,20 +1723,23 @@ main(int ac, char **av) + } + debug("private host key: #%d type %d %s", i, key->type, + key_type(key)); + } + if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) { + logit("Disabling protocol version 1. Could not load host key"); + options.protocol &= ~SSH_PROTO_1; + } ++#ifndef GSSAPI ++ /* The GSSAPI key exchange can run without a host key */ + if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) { + logit("Disabling protocol version 2. Could not load host key"); + options.protocol &= ~SSH_PROTO_2; + } ++#endif + if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { + logit("sshd: no hostkeys available -- exiting."); + exit(1); + } + + /* + * Load certificates. They are stored in an array at identical + * indices to the public keys that they relate to. +@@ -1920,16 +1931,70 @@ main(int ac, char **av) + /* Accept a connection and return in a forked child */ + server_accept_loop(&sock_in, &sock_out, + &newsock, config_s); + } + + /* This is the child processing a new connection. */ + setproctitle("%s", "[accepted]"); + ++#ifdef USE_SECURITY_SESSION_API ++ /* ++ * Create a new security session for use by the new user login if ++ * the current session is the root session or we are not launched ++ * by inetd (eg: debugging mode or server mode). We do not ++ * necessarily need to create a session if we are launched from ++ * inetd because Panther xinetd will create a session for us. ++ * ++ * The only case where this logic will fail is if there is an ++ * inetd running in a non-root session which is not creating ++ * new sessions for us. Then all the users will end up in the ++ * same session (bad). ++ * ++ * When the client exits, the session will be destroyed for us ++ * automatically. ++ * ++ * We must create the session before any credentials are stored ++ * (including AFS pags, which happens a few lines below). ++ */ ++ { ++ OSStatus err = 0; ++ SecuritySessionId sid = 0; ++ SessionAttributeBits sattrs = 0; ++ ++ err = SessionGetInfo(callerSecuritySession, &sid, &sattrs); ++ if (err) ++ error("SessionGetInfo() failed with error %.8X", ++ (unsigned) err); ++ else ++ debug("Current Session ID is %.8X / Session Attributes are %.8X", ++ (unsigned) sid, (unsigned) sattrs); ++ ++ if (inetd_flag && !(sattrs & sessionIsRoot)) ++ debug("Running in inetd mode in a non-root session... " ++ "assuming inetd created the session for us."); ++ else { ++ debug("Creating new security session..."); ++ err = SessionCreate(0, sessionHasTTY | sessionIsRemote); ++ if (err) ++ error("SessionCreate() failed with error %.8X", ++ (unsigned) err); ++ ++ err = SessionGetInfo(callerSecuritySession, &sid, ++ &sattrs); ++ if (err) ++ error("SessionGetInfo() failed with error %.8X", ++ (unsigned) err); ++ else ++ debug("New Session ID is %.8X / Session Attributes are %.8X", ++ (unsigned) sid, (unsigned) sattrs); ++ } ++ } ++#endif ++ + /* + * Create a new session and process group since the 4.4BSD + * setlogin() affects the entire process group. We don't + * want the child to be able to affect the parent. + */ + #if !defined(SSHD_ACQUIRES_CTTY) + /* + * If setsid is called, on some platforms sshd will later acquire a +@@ -2046,16 +2111,70 @@ main(int ac, char **av) + fatal("libwrap refuse returns"); + } + } + #endif /* LIBWRAP */ + + /* Log the connection. */ + verbose("Connection from %.500s port %d", remote_ip, remote_port); + ++#ifdef USE_SECURITY_SESSION_API ++ /* ++ * Create a new security session for use by the new user login if ++ * the current session is the root session or we are not launched ++ * by inetd (eg: debugging mode or server mode). We do not ++ * necessarily need to create a session if we are launched from ++ * inetd because Panther xinetd will create a session for us. ++ * ++ * The only case where this logic will fail is if there is an ++ * inetd running in a non-root session which is not creating ++ * new sessions for us. Then all the users will end up in the ++ * same session (bad). ++ * ++ * When the client exits, the session will be destroyed for us ++ * automatically. ++ * ++ * We must create the session before any credentials are stored ++ * (including AFS pags, which happens a few lines below). ++ */ ++ { ++ OSStatus err = 0; ++ SecuritySessionId sid = 0; ++ SessionAttributeBits sattrs = 0; ++ ++ err = SessionGetInfo(callerSecuritySession, &sid, &sattrs); ++ if (err) ++ error("SessionGetInfo() failed with error %.8X", ++ (unsigned) err); ++ else ++ debug("Current Session ID is %.8X / Session Attributes are %.8X", ++ (unsigned) sid, (unsigned) sattrs); ++ ++ if (inetd_flag && !(sattrs & sessionIsRoot)) ++ debug("Running in inetd mode in a non-root session... " ++ "assuming inetd created the session for us."); ++ else { ++ debug("Creating new security session..."); ++ err = SessionCreate(0, sessionHasTTY | sessionIsRemote); ++ if (err) ++ error("SessionCreate() failed with error %.8X", ++ (unsigned) err); ++ ++ err = SessionGetInfo(callerSecuritySession, &sid, ++ &sattrs); ++ if (err) ++ error("SessionGetInfo() failed with error %.8X", ++ (unsigned) err); ++ else ++ debug("New Session ID is %.8X / Session Attributes are %.8X", ++ (unsigned) sid, (unsigned) sattrs); ++ } ++ } ++#endif ++ + /* + * We don't want to listen forever unless the other side + * successfully authenticates itself. So we set up an alarm which is + * cleared after successful authentication. A limit of zero + * indicates no limit. Note that we don't set the alarm in debugging + * mode; it is just annoying to have the server exit just when you + * are about to discover the bug. + */ +@@ -2435,23 +2554,114 @@ do_ssh2_kex(void) + myproposal[PROPOSAL_COMP_ALGS_CTOS] = + myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib@openssh.com"; + } + if (options.kex_algorithms != NULL) + myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + + myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types(); + ++#ifdef GSSAPI ++ { ++ char *orig; ++ char *gss = NULL; ++ char *newstr = NULL; ++ orig = myproposal[PROPOSAL_KEX_ALGS]; ++ ++ /* ++ * If we don't have a host key, then there's no point advertising ++ * the other key exchange algorithms ++ */ ++ ++ if (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]) == 0) ++ orig = NULL; ++ ++ if (options.gss_keyex) ++ gss = ssh_gssapi_server_mechanisms(); ++ else ++ gss = NULL; ++ ++ if (gss && orig) ++ xasprintf(&newstr, "%s,%s", gss, orig); ++ else if (gss) ++ newstr = gss; ++ else if (orig) ++ newstr = orig; ++ ++ /* ++ * If we've got GSSAPI mechanisms, then we've got the 'null' host ++ * key alg, but we can't tell people about it unless its the only ++ * host key algorithm we support ++ */ ++ if (gss && (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS])) == 0) ++ myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = "null"; ++ ++ if (newstr) ++ myproposal[PROPOSAL_KEX_ALGS] = newstr; ++ else ++ fatal("No supported key exchange algorithms"); ++ } ++#endif ++ ++#ifdef GSSAPI ++ { ++ char *orig; ++ char *gss = NULL; ++ char *newstr = NULL; ++ orig = myproposal[PROPOSAL_KEX_ALGS]; ++ ++ /* ++ * If we don't have a host key, then there's no point advertising ++ * the other key exchange algorithms ++ */ ++ ++ if (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]) == 0) ++ orig = NULL; ++ ++ if (options.gss_keyex) ++ gss = ssh_gssapi_server_mechanisms(); ++ else ++ gss = NULL; ++ ++ if (gss && orig) ++ xasprintf(&newstr, "%s,%s", gss, orig); ++ else if (gss) ++ newstr = gss; ++ else if (orig) ++ newstr = orig; ++ ++ /* ++ * If we've got GSSAPI mechanisms, then we've got the 'null' host ++ * key alg, but we can't tell people about it unless its the only ++ * host key algorithm we support ++ */ ++ if (gss && (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS])) == 0) ++ myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = "null"; ++ ++ if (newstr) ++ myproposal[PROPOSAL_KEX_ALGS] = newstr; ++ else ++ fatal("No supported key exchange algorithms"); ++ } ++#endif ++ + /* start key exchange */ + kex = kex_setup(myproposal); + kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; + kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server; + kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; + kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; + kex->kex[KEX_ECDH_SHA2] = kexecdh_server; ++#ifdef GSSAPI ++ if (options.gss_keyex) { ++ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; ++ kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_server; ++ kex->kex[KEX_GSS_GEX_SHA1] = kexgss_server; ++ } ++#endif + kex->server = 1; + kex->client_version_string=client_version_string; + kex->server_version_string=server_version_string; + kex->load_host_public_key=&get_hostkey_public_by_type; + kex->load_host_private_key=&get_hostkey_private_by_type; + kex->host_key_index=&get_hostkey_index; + + xxx_kex = kex; +diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config +--- a/openssh-6.2p2/sshd_config ++++ b/openssh-6.2p2/sshd_config +@@ -75,16 +75,18 @@ PasswordAuthentication no + #KerberosAuthentication no + #KerberosOrLocalPasswd yes + #KerberosTicketCleanup yes + #KerberosGetAFSToken no + + # GSSAPI options + #GSSAPIAuthentication no + #GSSAPICleanupCredentials yes ++#GSSAPIStrictAcceptorCheck yes ++#GSSAPIKeyExchange no + + # Set this to 'yes' to enable support for the deprecated 'gssapi' authentication + # mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included + # in this release. The use of 'gssapi' is deprecated due to the presence of + # potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. + #GSSAPIEnableMITMAttack no + + +diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 +--- a/openssh-6.2p2/sshd_config.5 ++++ b/openssh-6.2p2/sshd_config.5 +@@ -475,22 +475,50 @@ to force remote port forwardings to bind + to allow the client to select the address to which the forwarding is bound. + The default is + .Dq no . + .It Cm GSSAPIAuthentication + Specifies whether user authentication based on GSSAPI is allowed. + The default is + .Dq no . + Note that this option applies to protocol version 2 only. ++.It Cm GSSAPIKeyExchange ++Specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange ++doesn't rely on ssh keys to verify host identity. ++The default is ++.Dq no . ++Note that this option applies to protocol version 2 only. + .It Cm GSSAPICleanupCredentials + Specifies whether to automatically destroy the user's credentials cache + on logout. + The default is + .Dq yes . + Note that this option applies to protocol version 2 only. ++.It Cm GSSAPIStrictAcceptorCheck ++Determines whether to be strict about the identity of the GSSAPI acceptor ++a client authenticates against. If ++.Dq yes ++then the client must authenticate against the ++.Pa host ++service on the current hostname. If ++.Dq no ++then the client may authenticate against any service key stored in the ++machine's default store. This facility is provided to assist with operation ++on multi homed machines. ++The default is ++.Dq yes . ++Note that this option applies only to protocol version 2 GSSAPI connections, ++and setting it to ++.Dq no ++may only work with recent Kerberos GSSAPI libraries. ++.It Cm GSSAPIStoreCredentialsOnRekey ++Controls whether the user's GSSAPI credentials should be updated following a ++successful connection rekeying. This option can be used to accepted renewed ++or updated credentials from a compatible client. The default is ++.Dq no . + .It Cm HostbasedAuthentication + Specifies whether rhosts or /etc/hosts.equiv authentication together + with successful public key client host authentication is allowed + (host-based authentication). + This option is similar to + .Cm RhostsRSAAuthentication + and applies to protocol version 2 only. + The default is diff --git a/openssh-6.2p2-gssapimitm.patch b/openssh-6.2p2-gssapimitm.patch new file mode 100644 index 0000000..1c0a996 --- /dev/null +++ b/openssh-6.2p2-gssapimitm.patch @@ -0,0 +1,430 @@ +# The patch below adds support for the deprecated 'gssapi' authentication +# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included +# in this release. The use of 'gssapi' is deprecated due to the presence of +# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not +# susceptible to. +# +# To use the patch apply it to a OpenSSH 3.8p1 source tree. After compiling, +# backwards compatibility may be obtained by supplying the +# 'GssapiEnableMitmAttack yes' option to either the client or server. +# +# It should be noted that this patch is being made available purely as a means +# of easing the process of moving to OpenSSH 3.8p1. Any new installations are +# recommended to use the 'gssapi-with-mic' mechanism. Existing installations +# are encouraged to upgrade as soon as possible. + +diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c +--- a/openssh-6.2p2/auth2-gss.c ++++ b/openssh-6.2p2/auth2-gss.c +@@ -174,16 +174,25 @@ input_gssapi_token(int type, u_int32_t p + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); + if (flags & GSS_C_INTEG_FLAG) + dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, + &input_gssapi_mic); + else + dispatch_set( + SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, + &input_gssapi_exchange_complete); ++ ++ /* ++ * Old style 'gssapi' didn't have the GSSAPI_MIC ++ * and went straight to sending exchange_complete ++ */ ++ if (options.gss_enable_mitm) ++ dispatch_set( ++ SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, ++ &input_gssapi_exchange_complete); + } + } + + gss_release_buffer(&min_status, &send_tok); + } + + static void + input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) +@@ -295,9 +304,15 @@ input_gssapi_mic(int type, u_int32_t ple + } + + Authmethod method_gssapi = { + "gssapi-with-mic", + userauth_gssapi, + &options.gss_authentication + }; + ++Authmethod method_gssapi_old = { ++ "gssapi", ++ userauth_gssapi, ++ &options.gss_enable_mitm ++}; ++ + #endif /* GSSAPI */ +diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c +--- a/openssh-6.2p2/auth2.c ++++ b/openssh-6.2p2/auth2.c +@@ -65,26 +65,28 @@ extern Buffer loginmsg; + + extern Authmethod method_none; + extern Authmethod method_pubkey; + extern Authmethod method_passwd; + extern Authmethod method_kbdint; + extern Authmethod method_hostbased; + #ifdef GSSAPI + extern Authmethod method_gssapi; ++extern Authmethod method_gssapi_old; + #endif + #ifdef JPAKE + extern Authmethod method_jpake; + #endif + + Authmethod *authmethods[] = { + &method_none, + &method_pubkey, + #ifdef GSSAPI + &method_gssapi, ++ &method_gssapi_old, + #endif + #ifdef JPAKE + &method_jpake, + #endif + &method_passwd, + &method_kbdint, + &method_hostbased, + NULL +diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c +--- a/openssh-6.2p2/readconf.c ++++ b/openssh-6.2p2/readconf.c +@@ -123,17 +123,17 @@ typedef enum { + oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, + oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, + oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, + oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, + oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, + oHostKeyAlgorithms, oBindAddress, oPKCS11Provider, + oClearAllForwardings, oNoHostAuthenticationForLocalhost, + oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, +- oAddressFamily, oGssAuthentication, oGssDelegateCreds, ++ oAddressFamily, oGssAuthentication, oGssDelegateCreds, oGssEnableMITM, + oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, + oSendEnv, oControlPath, oControlMaster, oControlPersist, + oHashKnownHosts, + oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, + oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, + oKexAlgorithms, oIPQoS, oRequestTTY, + oDeprecated, oUnsupported + } OpCodes; +@@ -165,19 +165,21 @@ static struct { + { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ + { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ + { "kerberosauthentication", oUnsupported }, + { "kerberostgtpassing", oUnsupported }, + { "afstokenpassing", oUnsupported }, + #if defined(GSSAPI) + { "gssapiauthentication", oGssAuthentication }, + { "gssapidelegatecredentials", oGssDelegateCreds }, ++ { "gssapienablemitmattack", oGssEnableMITM }, + #else + { "gssapiauthentication", oUnsupported }, + { "gssapidelegatecredentials", oUnsupported }, ++ { "gssapienablemitmattack", oUnsupported }, + #endif + { "fallbacktorsh", oDeprecated }, + { "usersh", oDeprecated }, + { "identityfile", oIdentityFile }, + { "identityfile2", oIdentityFile }, /* obsolete */ + { "identitiesonly", oIdentitiesOnly }, + { "hostname", oHostName }, + { "hostkeyalias", oHostKeyAlias }, +@@ -501,16 +503,20 @@ parse_flag: + + case oGssAuthentication: + intptr = &options->gss_authentication; + goto parse_flag; + + case oGssDelegateCreds: + intptr = &options->gss_deleg_creds; + goto parse_flag; ++ ++ case oGssEnableMITM: ++ intptr = &options->gss_enable_mitm; ++ goto parse_flag; + + case oBatchMode: + intptr = &options->batch_mode; + goto parse_flag; + + case oCheckHostIP: + intptr = &options->check_host_ip; + goto parse_flag; +@@ -1154,16 +1160,17 @@ initialize_options(Options * options) + options->xauth_location = NULL; + options->gateway_ports = -1; + options->use_privileged_port = -1; + options->rsa_authentication = -1; + options->pubkey_authentication = -1; + options->challenge_response_authentication = -1; + options->gss_authentication = -1; + options->gss_deleg_creds = -1; ++ options->gss_enable_mitm = -1; + options->password_authentication = -1; + options->kbd_interactive_authentication = -1; + options->kbd_interactive_devices = NULL; + options->rhosts_rsa_authentication = -1; + options->hostbased_authentication = -1; + options->batch_mode = -1; + options->check_host_ip = -1; + options->strict_host_key_checking = -1; +@@ -1255,16 +1262,18 @@ fill_default_options(Options * options) + if (options->pubkey_authentication == -1) + options->pubkey_authentication = 1; + if (options->challenge_response_authentication == -1) + options->challenge_response_authentication = 1; + if (options->gss_authentication == -1) + options->gss_authentication = 0; + if (options->gss_deleg_creds == -1) + options->gss_deleg_creds = 0; ++ if (options->gss_enable_mitm == -1) ++ options->gss_enable_mitm = 0; + if (options->password_authentication == -1) + options->password_authentication = 1; + if (options->kbd_interactive_authentication == -1) + options->kbd_interactive_authentication = 1; + if (options->rhosts_rsa_authentication == -1) + options->rhosts_rsa_authentication = 0; + if (options->hostbased_authentication == -1) + options->hostbased_authentication = 0; +diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h +--- a/openssh-6.2p2/readconf.h ++++ b/openssh-6.2p2/readconf.h +@@ -44,16 +44,17 @@ typedef struct { + * authentication. */ + int rsa_authentication; /* Try RSA authentication. */ + int pubkey_authentication; /* Try ssh2 pubkey authentication. */ + int hostbased_authentication; /* ssh2's rhosts_rsa */ + int challenge_response_authentication; + /* Try S/Key or TIS, authentication. */ + int gss_authentication; /* Try GSS authentication */ + int gss_deleg_creds; /* Delegate GSS credentials */ ++ int gss_enable_mitm; /* Enable old style gssapi auth */ + int password_authentication; /* Try password + * authentication. */ + int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ + char *kbd_interactive_devices; /* Keyboard-interactive auth devices. */ + int zero_knowledge_password_authentication; /* Try jpake */ + int batch_mode; /* Batch mode: do not ask for passwords. */ + int check_host_ip; /* Also keep track of keys for IP address */ + int strict_host_key_checking; /* Strict host key checking. */ +diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c +--- a/openssh-6.2p2/servconf.c ++++ b/openssh-6.2p2/servconf.c +@@ -98,16 +98,17 @@ initialize_server_options(ServerOptions + options->rsa_authentication = -1; + options->pubkey_authentication = -1; + options->kerberos_authentication = -1; + options->kerberos_or_local_passwd = -1; + options->kerberos_ticket_cleanup = -1; + options->kerberos_get_afs_token = -1; + options->gss_authentication=-1; + options->gss_cleanup_creds = -1; ++ options->gss_enable_mitm = -1; + options->password_authentication = -1; + options->kbd_interactive_authentication = -1; + options->challenge_response_authentication = -1; + options->permit_empty_passwd = -1; + options->permit_user_env = -1; + options->use_login = -1; + options->compression = -1; + options->allow_tcp_forwarding = -1; +@@ -230,16 +231,18 @@ fill_default_server_options(ServerOption + if (options->kerberos_ticket_cleanup == -1) + options->kerberos_ticket_cleanup = 1; + if (options->kerberos_get_afs_token == -1) + options->kerberos_get_afs_token = 0; + if (options->gss_authentication == -1) + options->gss_authentication = 0; + if (options->gss_cleanup_creds == -1) + options->gss_cleanup_creds = 1; ++ if (options->gss_enable_mitm == -1) ++ options->gss_enable_mitm = 0; + if (options->password_authentication == -1) + options->password_authentication = 1; + if (options->kbd_interactive_authentication == -1) + options->kbd_interactive_authentication = 0; + if (options->challenge_response_authentication == -1) + options->challenge_response_authentication = 1; + if (options->permit_empty_passwd == -1) + options->permit_empty_passwd = 0; +@@ -322,17 +325,17 @@ typedef enum { + sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, + sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, + sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, + sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, + sMaxStartups, sMaxAuthTries, sMaxSessions, + sBanner, sUseDNS, sHostbasedAuthentication, + sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, + sClientAliveCountMax, sAuthorizedKeysFile, +- sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, ++ sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel, sGssEnableMITM, + sMatch, sPermitOpen, sForceCommand, sChrootDirectory, + sUsePrivilegeSeparation, sAllowAgentForwarding, + sZeroKnowledgePasswordAuthentication, sHostCertificate, + sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, + sKexAlgorithms, sIPQoS, sVersionAddendum, + sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, + sAuthenticationMethods, + sDeprecated, sUnsupported +@@ -388,19 +391,21 @@ static struct { + { "kerberosticketcleanup", sUnsupported, SSHCFG_GLOBAL }, + { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL }, + #endif + { "kerberostgtpassing", sUnsupported, SSHCFG_GLOBAL }, + { "afstokenpassing", sUnsupported, SSHCFG_GLOBAL }, + #ifdef GSSAPI + { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, + { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, ++ { "gssapienablemitmattack", sGssEnableMITM }, + #else + { "gssapiauthentication", sUnsupported, SSHCFG_ALL }, + { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL }, ++ { "gssapienablemitmattack", sUnsupported }, + #endif + { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, + { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, + { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, + { "skeyauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, /* alias */ + #ifdef JPAKE + { "zeroknowledgepasswordauthentication", sZeroKnowledgePasswordAuthentication, SSHCFG_ALL }, + #else +@@ -1048,16 +1053,20 @@ process_server_config_line(ServerOptions + case sGssAuthentication: + intptr = &options->gss_authentication; + goto parse_flag; + + case sGssCleanupCreds: + intptr = &options->gss_cleanup_creds; + goto parse_flag; + ++ case sGssEnableMITM: ++ intptr = &options->gss_enable_mitm; ++ goto parse_flag; ++ + case sPasswordAuthentication: + intptr = &options->password_authentication; + goto parse_flag; + + case sZeroKnowledgePasswordAuthentication: + intptr = &options->zero_knowledge_password_authentication; + goto parse_flag; + +diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h +--- a/openssh-6.2p2/servconf.h ++++ b/openssh-6.2p2/servconf.h +@@ -106,16 +106,17 @@ typedef struct { + * such as SecurID or + * /etc/passwd */ + int kerberos_ticket_cleanup; /* If true, destroy ticket + * file on logout. */ + int kerberos_get_afs_token; /* If true, try to get AFS token if + * authenticated with Kerberos. */ + int gss_authentication; /* If true, permit GSSAPI authentication */ + int gss_cleanup_creds; /* If true, destroy cred cache on logout */ ++ int gss_enable_mitm; /* If true, enable old style GSSAPI */ + int password_authentication; /* If true, permit password + * authentication. */ + int kbd_interactive_authentication; /* If true, permit */ + int challenge_response_authentication; + int zero_knowledge_password_authentication; + /* If true, permit jpake auth */ + int permit_empty_passwd; /* If false, do not permit empty + * passwords. */ +diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +--- a/openssh-6.2p2/ssh_config ++++ b/openssh-6.2p2/ssh_config +@@ -51,8 +51,15 @@ ForwardX11Trusted yes + # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc + # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 + # EscapeChar ~ + # Tunnel no + # TunnelDevice any:any + # PermitLocalCommand no + # VisualHostKey no + # ProxyCommand ssh -q -W %h:%p gateway.example.com ++ ++# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication ++# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included ++# in this release. The use of 'gssapi' is deprecated due to the presence of ++# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. ++# GSSAPIEnableMITMAttack no ++ +diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c +--- a/openssh-6.2p2/sshconnect2.c ++++ b/openssh-6.2p2/sshconnect2.c +@@ -321,16 +321,21 @@ static char *authmethods_get(void); + + Authmethod authmethods[] = { + #ifdef GSSAPI + {"gssapi-with-mic", + userauth_gssapi, + NULL, + &options.gss_authentication, + NULL}, ++ {"gssapi", ++ userauth_gssapi, ++ NULL, ++ &options.gss_enable_mitm, ++ NULL}, + #endif + {"hostbased", + userauth_hostbased, + NULL, + &options.hostbased_authentication, + NULL}, + {"publickey", + userauth_pubkey, +@@ -698,17 +703,19 @@ process_gssapi_token(void *ctxt, gss_buf + + packet_put_string(send_tok.value, send_tok.length); + packet_send(); + gss_release_buffer(&ms, &send_tok); + } + + if (status == GSS_S_COMPLETE) { + /* send either complete or MIC, depending on mechanism */ +- if (!(flags & GSS_C_INTEG_FLAG)) { ++ ++ if (strcmp(authctxt->method->name,"gssapi") == 0 || ++ (!(flags & GSS_C_INTEG_FLAG))) { + packet_start(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE); + packet_send(); + } else { + ssh_gssapi_buildmic(&b, authctxt->server_user, + authctxt->service, "gssapi-with-mic"); + + gssbuf.value = buffer_ptr(&b); + gssbuf.length = buffer_len(&b); +diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config +--- a/openssh-6.2p2/sshd_config ++++ b/openssh-6.2p2/sshd_config +@@ -76,16 +76,23 @@ PasswordAuthentication no + #KerberosOrLocalPasswd yes + #KerberosTicketCleanup yes + #KerberosGetAFSToken no + + # GSSAPI options + #GSSAPIAuthentication no + #GSSAPICleanupCredentials yes + ++# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication ++# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included ++# in this release. The use of 'gssapi' is deprecated due to the presence of ++# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. ++#GSSAPIEnableMITMAttack no ++ ++ + # Set this to 'yes' to enable PAM authentication, account processing, + # and session processing. If this is enabled, PAM authentication will + # be allowed through the ChallengeResponseAuthentication and + # PasswordAuthentication. Depending on your PAM configuration, + # PAM authentication via ChallengeResponseAuthentication may bypass + # the setting of "PermitRootLogin without-password". + # If you just want the PAM account and session checks to run without + # PAM authentication, then enable this but set PasswordAuthentication diff --git a/openssh-6.2p2-host_ident.patch b/openssh-6.2p2-host_ident.patch new file mode 100644 index 0000000..9cd3005 --- /dev/null +++ b/openssh-6.2p2-host_ident.patch @@ -0,0 +1,28 @@ +# identify hashed hosts in known_hosts and suggest command line for their +# removal + +diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c +--- a/openssh-6.2p2/sshconnect.c ++++ b/openssh-6.2p2/sshconnect.c +@@ -987,16 +987,21 @@ check_host_key(char *hostname, struct so + ip_found->file, ip_found->line); + } + /* The host key has changed. */ + warn_changed_key(host_key); + error("Add correct host key in %.100s to get rid of this message.", + user_hostfiles[0]); + error("Offending %s key in %s:%lu", key_type(host_found->key), + host_found->file, host_found->line); ++ error("You can use following command to remove all keys for this IP:"); ++ if (host_found->file) ++ error("ssh-keygen -R %s -f %s", hostname, host_found->file); ++ else ++ error("ssh-keygen -R %s", hostname); + + /* + * If strict host key checking is in use, the user will have + * to edit the key manually and we can only abort. + */ + if (options.strict_host_key_checking) { + error("%s host key for %.200s has changed and you have " + "requested strict checking.", type, host); diff --git a/openssh-6.2p2-key-converter.patch b/openssh-6.2p2-key-converter.patch new file mode 100644 index 0000000..b9c5c85 --- /dev/null +++ b/openssh-6.2p2-key-converter.patch @@ -0,0 +1,534 @@ +# SSHv1 to SSHv2 RSA keys converter + +diff --git a/openssh-6.2p2/converter/Makefile b/openssh-6.2p2/converter/Makefile +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/converter/Makefile +@@ -0,0 +1,17 @@ ++ ++bindir=/usr/bin ++mandir=/usr/share/man ++ ++all : ssh-keyconverter ++ ++ssh-keyconverter.o: ssh-keyconverter.c ../key.h ../authfile.h ../misc.h ../xmalloc.h ++ gcc $(RPM_OPT_FLAGS) -c -I../ $< -o $@ ++ ++ssh-keyconverter: ssh-keyconverter.o ../libssh.a ../openbsd-compat/libopenbsd-compat.a ++ gcc $< -Wl,--no-as-needed $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ -lcrypto -lssh -lopenbsd-compat -lssh -lopenbsd-compat -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ ++ ++install: ssh-keyconverter ssh-keyconverter.1 ++ if [ ! -d $(DESTDIR)$(bindir) ]; then install -d -m 755 $(DESTDIR)$(bindir); fi ++ install -m 755 ssh-keyconverter $(DESTDIR)$(bindir) ++ if [ ! -d $(DESTDIR)$(mandir)/man1 ]; then install -d -m 755 $(DESTDIR)$(mandir)/man1; fi ++ install -m 644 ssh-keyconverter.1 $(DESTDIR)$(mandir)/man1 +diff --git a/openssh-6.2p2/converter/ssh-keyconverter.1 b/openssh-6.2p2/converter/ssh-keyconverter.1 +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/converter/ssh-keyconverter.1 +@@ -0,0 +1,155 @@ ++.\" Manpage for ssh-keyconverter ++.\" ++.Dd February 2, 2002 ++.Dt SSH-KEYCONVER 1 ++.Os ++.Sh NAME ++.Nm ssh-keyconvert ++.Nd convert ssh v1 keys and authorization files ++.Sh SYNOPSIS ++.Nm ssh-keyconvert ++.Op Fl k ++.Op Fl o Ar output_file ++.Ar identity_file ... ++.Nm ssh-keyconvert ++.Op Fl a ++.Op Fl o Ar output_file ++.Ar authorization_file ... ++.Sh DESCRIPTION ++.Nm ++converts RSA public and private keys used for public key based ++user authentication with protocol version 1 to the format ++used with protocol version 2. ++.Pp ++When using RSA user authentication with SSH protocol version 1, ++the client uses the private key from ++.Pa $HOME/.ssh/identity ++to provide its identity to the server. The server grants or denies ++access based on whether the public part of this key is listed in ++.Pa $HOME/.ssh/authorized_keys . ++.Pp ++SSH protocol version 2 supports both DSA and RSA keys, but the ++way RSA keys are stored are differently. On the client, the default ++file name is ++.Pa .ssh/id_rsa ++rather than ++.Pa .ssh/identity , ++and the file's format is different as well. On the server, the ++public porting of the key can still be stored in ++.Pa .ssh/authorized_keys , ++but the key notation has changed as well. ++Therefore, when switching from protocol version 1 ++to version 2, you either have to create a new identity key using ++.Xr ssh-keygen 1 ++and add that key to the server's ++.Pa authorized_keys ++file, or you need to convert your keys using ++.Nm ssh-keyconvert . ++.Pp ++By default, ++.Nm ++will try to guess the type of file that is to be converted. ++If it fails to guess correctly, you can tell if what type of ++conversion to perform by specifying the ++.Fl k ++option to convert the private key, or the ++.Fl a ++option to convert an authorisation file. ++.Pp ++When converting your private keys stored in ++.Pa .ssh/identity , ++.Nm ++will read the private key, prompting you for the pass phrase ++if the key is protected by a pass phrase. If the ++.Fl o ++option is given, it will write the private key to the specified ++file, using version 2 syntax. If the key was protected by a ++pass phrase, it will use the same pass phrase to protect the new ++file. ++It will also write the public portion of the key to a second file, ++using the specified file name with ++.Dq .pub ++appended. ++If the ++.Fl o ++option was not given, private and public key will be written to ++.Pa id_rsa ++and ++.Pa id_rsa.pub , ++respectively, relative to the directory of the input key file. ++.Pp ++If the destination file already exists, ++.Nm ++will prompt the user for confirmation before overwriting the ++file, unless the ++.Fl f ++option is given. ++.Pp ++When converting your ++.Pa authorized_keys ++file, ++.Nm ++will ignore any keys in SSH version 2 format. Any public keys ++in version 1 format will be converted and appended to the output file ++using the new syntax. If the ++.Fl o ++option is given, keys are appended to the specified file. If it ++is not given, ++.Nm ++will append all keys to the input file. ++.Pp ++Note that ++.Nm ++does not check for duplicate keys, so if you run it on ++.Pa .ssh/authorized_keys ++more several times, the converted keys will show up several times. ++.Sh OPTIONS ++.Bl -tag -width Ds ++.It Fl k ++Convert private key file(s). The default is to guess the ++type of file that should be converted. ++.It Fl a ++Convert ++.Pa authorized_keys ++file(s). The default is to guess the ++type of file that should be converted. ++.It Fl o Ar outfile ++Specify the name of the output file. ++When converting an authorization file, all public keys will ++be appended to this file. ++For private key conversion, the private and public components of ++the key will be stored in ++.Pa outfile ++and ++.Pa outfile.pub , ++respectively. ++Note that since every key must be stored in a separate file, you ++cannot use this option when you specify several input files. ++.It Fl f ++When converting a key file, and the output file already exists, ++.Nm ++will ask the user whether to overwrite the file. Using this option ++forces overwriting. ++.El ++.Sh AUTHORS ++OpenSSH is a derivative of the original and free ++ssh 1.2.12 release by Tatu Ylonen. ++Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, ++Theo de Raadt and Dug Song ++removed many bugs, re-added newer features and ++created OpenSSH. ++.Nm ++was contributed by Olaf Kirch. ++.Sh SEE ALSO ++.Xr ssh 1 , ++.Xr ssh-add 1 , ++.Xr ssh-agent 1 , ++.Xr sshd 8 ++.Rs ++.%A J. Galbraith ++.%A R. Thayer ++.%T "SECSH Public Key File Format" ++.%N draft-ietf-secsh-publickeyfile-01.txt ++.%D March 2001 ++.%O work in progress material ++.Re +diff --git a/openssh-6.2p2/converter/ssh-keyconverter.c b/openssh-6.2p2/converter/ssh-keyconverter.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/converter/ssh-keyconverter.c +@@ -0,0 +1,345 @@ ++/* ++ * SSH v1 to v2 RSA key converter. ++ * ++ * Instead of a manpage: ++ * ++ * ssh-keyconverter ~/.ssh/identity ++ * will put the old RSA key in ~/.ssh/id_rsa and id_rsa.pub ++ * If a "-o foofah" is given, the keys will be written to ++ * foofah and foofah.pub, respectively. ++ * ++ * ssh-keyconverter ~/.ssh/authorized_keys ++ * will convert all old RSA keys and add them to the ++ * input file. The -o foofah option will direct ++ * output to a different file. ++ * (Note that it's harmless to specify the same file ++ * as input and output, as ssh-keyconverter will ignore ++ * any v2 keys, and output is always appended, never ++ * replacing the original file). ++ * ++ * To compile: ++ * ++ * gcc -g -Wall -o ssh-keyconverter converter.c \ ++ * -L. -Lopenbsd-compat/ -lssh -lopenbsd-compat -lssh \ ++ * -lpam -ldl -lwrap -lutil -lz -lnsl \ ++ * -Wl,-Bstatic -lcrypto -Wl,-dy ++ * ++ * Enjoy. --okir ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include "key.h" ++#include "authfile.h" ++#include "misc.h" ++#include "xmalloc.h" ++ ++#define TYPE_KEY 0 ++#define TYPE_AUTHKEYS 1 ++ ++#define PASSPHRASE_ATTEMPTS 3 ++ ++static int opt_verbose = 0; ++static int opt_force = 0; ++ ++static void convert(int, const char *, const char *); ++static void convert_private_key(const char *, const char *); ++static void convert_authorized_keys(const char *, const char *); ++static int fileok(const char *, char *, size_t); ++static int guess_type(const char *); ++ ++int ++main(int argc, char **argv) ++{ ++ int opt_type = -1; ++ char *opt_outfile = NULL; ++ int c; ++ ++ while ((c = getopt(argc, argv, "afko:")) != -1) { ++ switch (c) { ++ case 'a': ++ opt_type = TYPE_AUTHKEYS; ++ break; ++ case 'f': ++ opt_force = 1; ++ break; ++ case 'k': ++ opt_type = TYPE_KEY; ++ break; ++ case 'o': ++ opt_outfile = optarg; ++ break; ++ case 'v': ++ opt_verbose++; ++ break; ++ default: ++ fprintf(stderr, ++ "usage: ssh-keyconvert [-a | -k] " ++ "[-o filename] [-v] ...\n"); ++ exit(1); ++ } ++ } ++ ++ /* Warning, nanny code follows */ ++#if 0 ++ if (opt_outfile && (argc - optind) > 1 && opt_type != TYPE_AUTHKEY) { ++ fprintf(stderr, ++ "Output file ambiguous: more than two " ++ "input files given. Abort.\n"); ++ exit(1); ++ } ++#endif ++ ++ if (optind == argc) { ++ fprintf(stderr, ++ "Missing input file(s).\n"); ++ exit(1); ++ } ++ ++ for (; optind < argc; optind++) { ++ char *name = argv[optind]; ++ int type; ++ ++ if ((type = opt_type) < 0) ++ type = guess_type(name); ++ convert(type, name, opt_outfile); ++ } ++ ++ return 0; ++} ++ ++static void ++convert(int type, const char *iname, const char *oname) ++{ ++ if (type == TYPE_KEY) { ++ convert_private_key(iname, oname); ++ } else if (type == TYPE_AUTHKEYS) { ++ convert_authorized_keys(iname, oname); ++ } else { ++ fprintf(stderr, ++ "Conversion type not yet implemented.\n"); ++ exit(1); ++ } ++} ++ ++static void ++convert_private_key(const char *iname, const char *oname) ++{ ++ char prompt[1024], privname[PATH_MAX], pubname[PATH_MAX]; ++ char *comment = NULL, *passphrase; ++ Key *key = NULL, *pk = NULL; ++ int i; ++ FILE *pf = NULL; ++ ++ passphrase = xstrdup(""); ++ snprintf(prompt, sizeof(prompt), ++ "Enter passphrase for key '%.100s': ",iname); ++ for (i = 0; !key && i < PASSPHRASE_ATTEMPTS; i++) { ++ if (i) { ++ /* Zap old pass phrase */ ++ memset(passphrase, 0, strlen(passphrase)); ++ xfree(passphrase); ++ ++ /* Get a pass phrase from the user */ ++ passphrase = read_passphrase(prompt, 0); ++ } ++ key = key_load_private(iname, passphrase, &comment); ++ if (!key && i) ++ printf("Bad passphrase, please try again.\n"); ++ } ++ ++ if (oname != NULL) { ++ strcpy(privname, oname); ++ } else { ++ const char *s; ++ ++ if ((s = strrchr(iname, '/')) != NULL) { ++ int n = s + 1 - iname; ++ ++ strncpy(privname, iname, n); ++ privname[n++] = '\0'; ++ } ++ strcat(privname, "id_rsa"); ++ } ++ ++ if (!fileok("private", privname, sizeof(privname))) ++ goto out; ++ ++ sprintf(pubname, "%s.pub", privname); ++ if (!fileok("public", pubname, sizeof(pubname))) ++ goto out; ++ ++ /* "convert" from RSA1 to RSA */ ++ key->type = KEY_RSA; ++ pk = key_from_private(key); ++ ++ /* Now write the key in earnest */ ++ if (!key_save_private(key, privname, passphrase, comment)) { ++ fprintf(stderr, ++ "Failed to save private key to %s: %m.\n", privname); ++ goto out; ++ } ++ ++ if (!(pf = fopen(pubname, "w"))) { ++ fprintf(stderr, ++ "Failed to save public key to %s: %m.\n", pubname); ++ goto out; ++ } ++ if (!key_write(pk, pf)) { ++ fprintf(stderr, ++ "Failed to save public key to %s: %m.\n", pubname); ++ goto out; ++ } ++ if (comment) ++ fprintf(pf, " %s\n", comment); ++ ++out: ++ memset(passphrase, 0, strlen(passphrase)); ++ xfree(passphrase); ++ if (key) ++ key_free(key); ++ if (pk) ++ key_free(pk); ++ if (pf) ++ fclose(pf); ++} ++ ++static void ++convert_authorized_keys(const char *iname, const char *oname) ++{ ++ char line[1024]; ++ FILE *ifp, *ofp; ++ Key *key; ++ ++ if (!(ifp = fopen(iname, "r"))) { ++ perror(iname); ++ exit(1); ++ } ++ ++ if (oname == NULL) ++ oname = iname; ++ ++ if (!strcmp(oname, "-")) { ++ ofp = stdout; ++ } else { ++ if ((ofp = fopen(oname, "a")) == NULL) { ++ perror(oname); ++ exit(1); ++ } ++ } ++ setlinebuf(ofp); ++ ++#define whitespace(c) ((c) == ' ' || (c) == '\t') ++ while (fgets(line, sizeof(line), ifp) != NULL) { ++ char *cp = line, *options = NULL; ++ ++ while (whitespace(*cp)) ++ cp++; ++ if (!*cp || *cp == '\n' || *cp == '#') ++ continue; ++ ++ key = key_new(KEY_RSA1); ++ if (key_read(key, &cp) != 1) { ++ /* Skip options, if any */ ++ int quoted = 0; ++ ++ options = cp; ++ for (; *cp && (quoted || !whitespace(*cp)); cp++) { ++ if (cp[0] == '\\' && cp[1] == '"') ++ ++cp; ++ else if (*cp == '"') ++ quoted = !quoted; ++ } ++ if (quoted) ++ goto next; ++ *cp++ = '\0'; ++ while (whitespace(*cp)) ++ cp++; ++ if (key_read(key, &cp) != 1) ++ goto next; ++ } ++ ++ if (options) ++ fprintf(ofp, "%s ", options); ++ /* "convert" from RSA1 to RSA */ ++ key->type = KEY_RSA; ++ key_write(key, ofp); ++ fputs(cp, ofp); ++ key_free(key); ++ ++ next: ++ ; ++ } ++} ++ ++/* if file exists, ask user whether to overwrite it */ ++static int ++fileok(const char *what, char *filename, size_t size) ++{ ++ char buffer[PATH_MAX]; ++ int n; ++ ++checkagain: ++ if (access(filename, F_OK) < 0) ++ return 1; ++ printf("%s key file %s already exists.\n", what, filename); ++ if (opt_force) { ++ printf("Overwriting because of -f option...\n"); ++ return 1; ++ } ++ ++tryagain: ++ printf("Please enter a different filename, " ++ "or return to overwrite: "); ++ fflush(stdout); ++ ++ n = read(0, buffer, sizeof(buffer)-1); ++ if (n <= 0) ++ printf("\n"); ++ if (n < 0) { ++ perror("read failed"); ++ exit(1); ++ } ++ if (n == 0) { ++ fprintf(stderr, "EOF from standard input. Bye.\n"); ++ exit(1); ++ } ++ buffer[n] = '\0'; ++ while (n && buffer[n-1] == '\n') ++ buffer[--n] = '\0'; ++ if (n == 0) ++ return 1; ++ if (n >= size) { ++ fprintf(stderr, "Filename too long.\n"); ++ goto tryagain; ++ } ++ strcpy(filename, buffer); ++ goto checkagain; ++} ++ ++/* ++ * Guess the type of file to be converted. ++ * XXX: should look at the file; v1 key files ++ * start with "SSH PRIVATE KEY FILE" ++ */ ++static int ++guess_type(const char *name) ++{ ++ printf("%s... ", name); ++ if (strstr(name, "identity")) { ++ printf("looks like a key file\n"); ++ return TYPE_KEY; ++ } ++ if (strstr(name, "authorized_keys")) { ++ printf("looks like an authorized_keys file\n"); ++ return TYPE_AUTHKEYS; ++ } ++ ++ if (opt_verbose) ++ printf("unable to identify."); ++ fprintf(stderr, "Please specify the file type for %s. Abort.\n", name); ++ exit(1); ++} diff --git a/openssh-6.2p2-lastlog.patch b/openssh-6.2p2-lastlog.patch new file mode 100644 index 0000000..75de9c4 --- /dev/null +++ b/openssh-6.2p2-lastlog.patch @@ -0,0 +1,24 @@ +# set uid for functions that use it to seek in lastlog and wtmp files +# bnc#18024 (was suse #3024) + +diff --git a/openssh-6.2p2/sshlogin.c b/openssh-6.2p2/sshlogin.c +--- a/openssh-6.2p2/sshlogin.c ++++ b/openssh-6.2p2/sshlogin.c +@@ -128,16 +128,17 @@ record_login(pid_t pid, const char *tty, + { + struct logininfo *li; + + /* save previous login details before writing new */ + store_lastlog_message(user, uid); + + li = login_alloc_entry(pid, user, host, tty); + login_set_addr(li, addr, addrlen); ++ li->uid = uid; + login_login(li); + login_free_entry(li); + } + + #ifdef LOGIN_NEEDS_UTMPX + void + record_utmp_only(pid_t pid, const char *ttyname, const char *user, + const char *host, struct sockaddr *addr, socklen_t addrlen) diff --git a/openssh-6.2p2-ldap.patch b/openssh-6.2p2-ldap.patch new file mode 100644 index 0000000..27e1334 --- /dev/null +++ b/openssh-6.2p2-ldap.patch @@ -0,0 +1,2805 @@ +# Helper app for retrieving keys from a LDAP server +# by Jan F. Chadima +# +# patch for openbsd-compat/base64.* introduces preprocessor macro +# USE_INTERNAL_B64 intended to enforce using ssh supplied functions. +# (The additional -lldap/-llber introduced in the patch cause configure to +# discover the base64 functions in glibc (libresolv) and not to build the +# internal versions. ssh-keyconverter consequently fails to link as it lacks +# the proper flags, and libopenbsd-compat doesn't contain the b64_* functions) + +diff --git a/openssh-6.2p2/HOWTO.ldap-keys b/openssh-6.2p2/HOWTO.ldap-keys +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/HOWTO.ldap-keys +@@ -0,0 +1,108 @@ ++ ++HOW TO START ++ ++1) configure LDAP server ++ * Use LDAP server documentation ++2) add appropriate LDAP schema ++ * For OpenLDAP or SunONE Use attached schema, otherwise you have to create ++ it. ++ * LDAP user entry ++ User entry: ++ - attached to the 'ldapPublicKey' objectclass ++ - attached to the 'posixAccount' objectclass ++ - with a filled 'sshPublicKey' attribute ++3) insert users into LDAP ++ * Use LDAP Tree management tool as useful ++ * Entry in the LDAP server must respect 'posixAccount' and 'ldapPublicKey' ++ which are defined in core.schema and the additionnal lpk.schema. ++ * Example: ++ dn: uid=captain,ou=commanders,dc=enterprise,dc=universe ++ objectclass: top ++ objectclass: person ++ objectclass: organizationalPerson ++ objectclass: posixAccount ++ objectclass: ldapPublicKey ++ description: Jonathan Archer ++ userPassword: Porthos ++ cn: onathan Archer ++ sn: onathan Archer ++ uid: captain ++ uidNumber: 1001 ++ gidNumber: 1001 ++ homeDirectory: /home/captain ++ sshPublicKey: ssh-rss AAAAB3.... =captain@universe ++ sshPublicKey: command="kill -9 1" ssh-rss AAAAM5... ++4) on the ssh side set in sshd_config ++ * Set up the backend ++ AuthorizedKeysCommand "@LIBEXECDIR@/ssh-ldap-wrapper" ++ AuthorizedKeysCommandRunAs ++ * Do not forget to set ++ PubkeyAuthentication yes ++ * Swith off unnecessary auth methods ++5) confugure ldap.conf ++ * Default ldap.conf is placed in /etc/ssh ++ * The configuration style is the same as other ldap based aplications ++6) if necessary edit ssh-ldap-wrapper ++ * There is a possibility to change ldap.conf location ++ * There are some debug options ++ * Example ++ @LIBEXECDIR@/ssh-ldap-wrapper -s -f /etc/ldap.conf -w -d >> /tmp/ldapdebuglog.txt ++ ++HOW TO MIGRATE FROM LPK ++ ++1) goto HOW TO START 4) .... the ldap schema is the same ++ ++2) convert the group requests to the appropriate LDAP requests ++ ++HOW TO SOLVE PROBLEMS ++ ++1) use debug in sshd ++ * /usr/sbin/sshd -d -d -d -d ++2) use debug in ssh-ldap-helper ++ * ssh-ldap-helper -d -d -d -d -s ++3) use tcpdump ... other ldap client etc. ++ ++ADVANTAGES ++ ++1) Blocking an user account can be done directly from LDAP (if sshd is using ++ PubkeyAuthentication + AuthorizedKeysCommand with ldap only). ++ ++DISADVANTAGES ++ ++1) LDAP must be well configured, getting the public key of some user is not ++ a problem, but if anonymous LDAP allows write to users dn, somebody could ++ replace some user's public key by his own and impersonate some of your users ++ in all your server farm -- be VERY CAREFUL. ++2) With incomplete PKI the MITM attack when sshd is requesting the public key, ++ could lead to a compromise of your servers allowing login as the ++ impersonated user. ++3) If LDAP server is down there may be no fallback on passwd auth. ++ ++MISC. ++ ++1) todo ++ * Possibility to reuse the ssh-ldap-helper. ++ * Tune the LDAP part to accept all possible LDAP configurations. ++ ++2) differences from original lpk ++ * No LDAP code in sshd. ++ * Support for various LDAP platforms and configurations. ++ * LDAP is configured in separate ldap.conf file. ++ ++3) docs/link ++ * http://pacsec.jp/core05/psj05-barisani-en.pdf ++ * http://fritz.potsdam.edu/projects/openssh-lpk/ ++ * http://fritz.potsdam.edu/projects/sshgate/ ++ * http://dev.inversepath.com/trac/openssh-lpk ++ * http://lam.sf.net/ ++ ( http://lam.sourceforge.net/documentation/supportedSchemas.htm ) ++ ++4) contributors/ideas/greets ++ - Eric AUGE ++ - Andrea Barisani ++ - Falk Siemonsmeier. ++ - Jacob Rief. ++ - Michael Durchgraf. ++ - frederic peters. ++ - Finlay dobbie. ++ - Stefan Fisher. +diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in +--- a/openssh-6.2p2/Makefile.in ++++ b/openssh-6.2p2/Makefile.in +@@ -20,16 +20,18 @@ srcdir=@srcdir@ + top_srcdir=@top_srcdir@ + + DESTDIR= + VPATH=@srcdir@ + SSH_PROGRAM=@bindir@/ssh + ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass + SFTP_SERVER=$(libexecdir)/sftp-server + SSH_KEYSIGN=$(libexecdir)/ssh-keysign ++SSH_LDAP_HELPER=$(libexecdir)/ssh-ldap-helper ++SSH_LDAP_WRAPPER=$(libexecdir)/ssh-ldap-wrapper + SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper + PRIVSEP_PATH=@PRIVSEP_PATH@ + SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ + STRIP_OPT=@STRIP_OPT@ + + PATHS= -DSSHDIR=\"$(sysconfdir)\" \ + -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ + -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ +@@ -56,17 +58,19 @@ INSTALL=@INSTALL@ + PERL=@PERL@ + SED=@SED@ + ENT=@ENT@ + XAUTH_PATH=@XAUTH_PATH@ + LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ + EXEEXT=@EXEEXT@ + MANFMT=@MANFMT@ + +-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) ++INSTALL_SSH_LDAP_HELPER=@INSTALL_SSH_LDAP_HELPER@ ++ ++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-ldap-helper$(EXEEXT) + + LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \ + canohost.o channels.o cipher.o cipher-aes.o \ + cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ + compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ + log.o match.o md-sha256.o moduli.o nchan.o packet.o \ + readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ + atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ +@@ -90,18 +94,18 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw + auth-krb5.o \ + auth2-gss.o gss-serv.o gss-serv-krb5.o \ + loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ + sftp-server.o sftp-common.o \ + roaming_common.o roaming_serv.o \ + sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ + sandbox-seccomp-filter.o + +-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 +-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 ++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 ssh-ldap-helper.8.out ssh-ldap.conf.5.out ++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 ssh-ldap-helper.8 ssh-ldap.conf.5 + MANTYPE = @MANTYPE@ + + CONFIGFILES=sshd_config.out ssh_config.out moduli.out + CONFIGFILES_IN=sshd_config ssh_config moduli + + PATHSUBS = \ + -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ + -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ +@@ -162,16 +166,19 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss + $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) + + ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o + $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) + + ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o + $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) + ++ssh-ldap-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ldapconf.o ldapbody.o ldapmisc.o ldap-helper.o ++ $(LD) -o $@ ldapconf.o ldapbody.o ldapmisc.o ldap-helper.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ++ + sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o + $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) + + sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o + $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) + + # test driver for the loginrec code - not built by default + logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o +@@ -263,30 +270,38 @@ install-files: + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT) + $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) ++ if test ! -z "$(INSTALL_SSH_LDAP_HELPER)" ; then \ ++ $(INSTALL) -m 0755 $(STRIP_OPT) ssh-ldap-helper $(DESTDIR)$(SSH_LDAP_HELPER) ; \ ++ $(INSTALL) -m 0755 ssh-ldap-wrapper $(DESTDIR)$(SSH_LDAP_WRAPPER) ; \ ++ fi + $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 + $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 + $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 + $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 + $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 + $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 + $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5 + $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 + $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 + $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 + $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 + $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 + $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 + $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 ++ if test ! -z "$(INSTALL_SSH_LDAP_HELPER)" ; then \ ++ $(INSTALL) -m 644 ssh-ldap-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-ldap-helper.8 ; \ ++ $(INSTALL) -m 644 ssh-ldap.conf.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh-ldap.conf.5 ; \ ++ fi + -rm -f $(DESTDIR)$(bindir)/slogin + ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 + ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 + + install-sysconf: + if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ +@@ -306,16 +321,23 @@ install-sysconf: + echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ + mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ + else \ + $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \ + fi ; \ + else \ + echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \ + fi ++ if test ! -z "$(INSTALL_SSH_LDAP_HELPER)" ; then \ ++ if [ ! -f $(DESTDIR)$(sysconfdir)/ldap.conf ]; then \ ++ $(INSTALL) -m 644 ldap.conf $(DESTDIR)$(sysconfdir)/ldap.conf; \ ++ else \ ++ echo "$(DESTDIR)$(sysconfdir)/ldap.conf already exists, install will not overwrite"; \ ++ fi ; \ ++ fi + + host-key: ssh-keygen$(EXEEXT) + @if [ -z "$(DESTDIR)" ] ; then \ + if [ -f "$(sysconfdir)/ssh_host_key" ] ; then \ + echo "$(sysconfdir)/ssh_host_key already exists, skipping." ; \ + else \ + ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \ + fi ; \ +@@ -363,27 +385,30 @@ uninstall: + -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) + -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) + -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) + -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) + -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) + -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) + -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) + -rm -f $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) ++ -rm -f $(DESTDIR)$(SSH_LDAP_HELPER)$(EXEEXT) ++ -rm -f $(DESTDIR)$(SSH_LDAP_WRAPPER)$(EXEEXT) + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 ++ -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-ldap-helper.8 + -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 + + regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c + [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \ + $(CC) $(CPPFLAGS) -o $@ $? \ + $(LDFLAGS) -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) + + tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) +diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac +--- a/openssh-6.2p2/configure.ac ++++ b/openssh-6.2p2/configure.ac +@@ -1504,16 +1504,116 @@ AC_ARG_WITH([audit], + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unknown audit module $withval]) + ;; + esac ] + ) + ++# Check whether user wants LDAP support ++LDAP_MSG="no" ++INSTALL_SSH_LDAP_HELPER="" ++AC_ARG_WITH(ldap, ++ [ --with-ldap[[=PATH]] Enable LDAP pubkey support (optionally in PATH)], ++ [ ++ if test "x$withval" != "xno" ; then ++ ++ INSTALL_SSH_LDAP_HELPER="yes" ++ CPPFLAGS="$CPPFLAGS -DLDAP_DEPRECATED" ++ ++ if test "x$withval" != "xyes" ; then ++ CPPFLAGS="$CPPFLAGS -I${withval}/include" ++ LDFLAGS="$LDFLAGS -L${withval}/lib" ++ fi ++ ++ AC_DEFINE([WITH_LDAP_PUBKEY], 1, [Enable LDAP pubkey support]) ++ LDAP_MSG="yes" ++ ++ AC_CHECK_HEADERS(lber.h) ++ AC_CHECK_HEADERS(ldap.h, , AC_MSG_ERROR(could not locate )) ++ AC_CHECK_HEADERS(ldap_ssl.h) ++ ++ AC_ARG_WITH(ldap-lib, ++ [ --with-ldap-lib=type select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]]) ++ ++ if test -z "$with_ldap_lib"; then ++ with_ldap_lib=auto ++ fi ++ ++ if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then ++ AC_CHECK_LIB(lber, main, LIBS="-llber $LIBS" found_ldap_lib=yes) ++ AC_CHECK_LIB(ldap, main, LIBS="-lldap $LIBS" found_ldap_lib=yes) ++ fi ++ ++ if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then ++ AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes) ++ fi ++ ++ if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then ++ AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes) ++ if test -z "$found_ldap_lib"; then ++ AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes) ++ fi ++ if test -z "$found_ldap_lib"; then ++ AC_CHECK_LIB(ldap41, main, LIBS="-lldap41 $LIBS" found_ldap_lib=yes) ++ fi ++ if test -z "$found_ldap_lib"; then ++ AC_CHECK_LIB(ldap40, main, LIBS="-lldap40 $LIBS" found_ldap_lib=yes) ++ fi ++ fi ++ ++ if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then ++ AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes) ++ fi ++ ++ if test -z "$found_ldap_lib"; then ++ AC_MSG_ERROR(could not locate a valid LDAP library) ++ fi ++ ++ AC_MSG_CHECKING([for working LDAP support]) ++ AC_TRY_COMPILE( ++ [#include ++ #include ], ++ [(void)ldap_init(0, 0);], ++ [AC_MSG_RESULT(yes)], ++ [ ++ AC_MSG_RESULT(no) ++ AC_MSG_ERROR([** Incomplete or missing ldap libraries **]) ++ ]) ++ AC_CHECK_FUNCS( \ ++ ldap_init \ ++ ldap_get_lderrno \ ++ ldap_set_lderrno \ ++ ldap_parse_result \ ++ ldap_memfree \ ++ ldap_controls_free \ ++ ldap_set_option \ ++ ldap_get_option \ ++ ldapssl_init \ ++ ldap_start_tls_s \ ++ ldap_pvt_tls_set_option \ ++ ldap_initialize \ ++ ) ++ AC_CHECK_FUNCS(ldap_set_rebind_proc, ++ AC_MSG_CHECKING([number arguments of ldap_set_rebind_proc]) ++ AC_TRY_COMPILE( ++ [#include ++ #include ], ++ [ldap_set_rebind_proc(0, 0, 0);], ++ [ac_cv_ldap_set_rebind_proc=3], ++ [ac_cv_ldap_set_rebind_proc=2]) ++ AC_MSG_RESULT($ac_cv_ldap_set_rebind_proc) ++ AC_DEFINE(LDAP_SET_REBIND_PROC_ARGS, $ac_cv_ldap_set_rebind_proc, [number arguments of ldap_set_rebind_proc]) ++ ) ++ fi ++ ] ++) ++AC_SUBST(INSTALL_SSH_LDAP_HELPER) ++ + dnl Checks for library functions. Please keep in alphabetical order + AC_CHECK_FUNCS([ \ + arc4random \ + arc4random_buf \ + arc4random_uniform \ + asprintf \ + b64_ntop \ + __b64_ntop \ +diff --git a/openssh-6.2p2/ldap-helper.c b/openssh-6.2p2/ldap-helper.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldap-helper.c +@@ -0,0 +1,155 @@ ++/* $OpenBSD: ssh-pka-ldap.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "ldapincludes.h" ++#include "log.h" ++#include "misc.h" ++#include "xmalloc.h" ++#include "ldapconf.h" ++#include "ldapbody.h" ++#include ++#include ++ ++static int config_debug = 0; ++int config_exclusive_config_file = 0; ++static char *config_file_name = "/etc/ssh/ldap.conf"; ++static char *config_single_user = NULL; ++static int config_verbose = SYSLOG_LEVEL_VERBOSE; ++int config_warning_config_file = 0; ++extern char *__progname; ++ ++static void ++usage(void) ++{ ++ fprintf(stderr, "usage: %s [options]\n", ++ __progname); ++ fprintf(stderr, "Options:\n"); ++ fprintf(stderr, " -d Output the log messages to stderr.\n"); ++ fprintf(stderr, " -e Check the config file for unknown commands.\n"); ++ fprintf(stderr, " -f file Use alternate config file (default is /etc/ssh/ldap.conf).\n"); ++ fprintf(stderr, " -s user Do not demonize, send the user's key to stdout.\n"); ++ fprintf(stderr, " -v Increase verbosity of the debug output (implies -d).\n"); ++ fprintf(stderr, " -w Warn on unknown commands in the config file.\n"); ++ exit(1); ++} ++ ++/* ++ * Main program for the ssh pka ldap agent. ++ */ ++ ++int ++main(int ac, char **av) ++{ ++ int opt; ++ FILE *outfile = NULL; ++ ++ __progname = ssh_get_progname(av[0]); ++ ++ log_init(__progname, SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); ++ ++ /* ++ * Initialize option structure to indicate that no values have been ++ * set. ++ */ ++ initialize_options(); ++ ++ /* Parse command-line arguments. */ ++ while ((opt = getopt(ac, av, "def:s:vw")) != -1) { ++ switch (opt) { ++ case 'd': ++ config_debug = 1; ++ break; ++ ++ case 'e': ++ config_exclusive_config_file = 1; ++ config_warning_config_file = 1; ++ break; ++ ++ case 'f': ++ config_file_name = optarg; ++ break; ++ ++ case 's': ++ config_single_user = optarg; ++ outfile = fdopen (dup (fileno (stdout)), "w"); ++ break; ++ ++ case 'v': ++ config_debug = 1; ++ if (config_verbose < SYSLOG_LEVEL_DEBUG3) ++ config_verbose++; ++ break; ++ ++ case 'w': ++ config_warning_config_file = 1; ++ break; ++ ++ case '?': ++ default: ++ usage(); ++ break; ++ } ++ } ++ ++ /* Initialize loging */ ++ log_init(__progname, config_verbose, SYSLOG_FACILITY_AUTH, config_debug); ++ ++ if (ac != optind) ++ fatal ("illegal extra parameter %s", av[1]); ++ ++ /* Ensure that fds 0 and 2 are open or directed to /dev/null */ ++ if (config_debug == 0) ++ sanitise_stdfd(); ++ ++ /* Read config file */ ++ read_config_file(config_file_name); ++ fill_default_options(); ++ if (config_verbose == SYSLOG_LEVEL_DEBUG3) { ++ debug3 ("=== Configuration ==="); ++ dump_config(); ++ debug3 ("=== *** ==="); ++ } ++ ++ ldap_checkconfig(); ++ ldap_do_connect(); ++ ++ if (config_single_user) { ++ process_user (config_single_user, outfile); ++ } else { ++ usage(); ++ fatal ("Not yet implemented"); ++/* TODO ++ * open unix socket a run the loop on it ++ */ ++ } ++ ++ ldap_do_close(); ++ return 0; ++} ++ ++/* Ugly hack */ ++void *buffer_get_string(Buffer *b, u_int *l) { return NULL; } ++void buffer_put_string(Buffer *b, const void *f, u_int l) {} ++ +diff --git a/openssh-6.2p2/ldap-helper.h b/openssh-6.2p2/ldap-helper.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldap-helper.h +@@ -0,0 +1,32 @@ ++/* $OpenBSD: ldap-helper.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LDAP_HELPER_H ++#define LDAP_HELPER_H ++ ++extern int config_exclusive_config_file; ++extern int config_warning_config_file; ++ ++#endif /* LDAP_HELPER_H */ +diff --git a/openssh-6.2p2/ldap.conf b/openssh-6.2p2/ldap.conf +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldap.conf +@@ -0,0 +1,88 @@ ++# $Id: openssh-5.5p1-ldap.patch,v 1.3 2010/07/07 13:48:36 jfch2222 Exp $ ++# ++# This is the example configuration file for the OpenSSH ++# LDAP backend ++# ++# see ssh-ldap.conf(5) ++# ++ ++# URI with your LDAP server name. This allows to use ++# Unix Domain Sockets to connect to a local LDAP Server. ++#uri ldap://127.0.0.1/ ++#uri ldaps://127.0.0.1/ ++#uri ldapi://%2fvar%2frun%2fldapi_sock/ ++# Note: %2f encodes the '/' used as directory separator ++ ++# Another way to specify your LDAP server is to provide an ++# host name and the port of our LDAP server. Host name ++# must be resolvable without using LDAP. ++# Multiple hosts may be specified, each separated by a ++# space. How long nss_ldap takes to failover depends on ++# whether your LDAP client library supports configurable ++# network or connect timeouts (see bind_timelimit). ++#host 127.0.0.1 ++ ++# The port. ++# Optional: default is 389. ++#port 389 ++ ++# The distinguished name to bind to the server with. ++# Optional: default is to bind anonymously. ++#binddn cn=openssh_keys,dc=example,dc=org ++ ++# The credentials to bind with. ++# Optional: default is no credential. ++#bindpw TopSecret ++ ++# The distinguished name of the search base. ++#base dc=example,dc=org ++ ++# The LDAP version to use (defaults to 3 ++# if supported by client library) ++#ldap_version 3 ++ ++# The search scope. ++#scope sub ++#scope one ++#scope base ++ ++# Search timelimit ++#timelimit 30 ++ ++# Bind/connect timelimit ++#bind_timelimit 30 ++ ++# Reconnect policy: hard (default) will retry connecting to ++# the software with exponential backoff, soft will fail ++# immediately. ++#bind_policy hard ++ ++# SSL setup, may be implied by URI also. ++#ssl no ++#ssl on ++#ssl start_tls ++ ++# OpenLDAP SSL options ++# Require and verify server certificate (yes/no) ++# Default is to use libldap's default behavior, which can be configured in ++# /etc/openldap/ldap.conf using the TLS_REQCERT setting. The default for ++# OpenLDAP 2.0 and earlier is "no", for 2.1 and later is "yes". ++#tls_checkpeer hard ++ ++# CA certificates for server certificate verification ++# At least one of these are required if tls_checkpeer is "yes" ++#tls_cacertfile /etc/ssl/ca.cert ++#tls_cacertdir /etc/pki/tls/certs ++ ++# Seed the PRNG if /dev/urandom is not provided ++#tls_randfile /var/run/egd-pool ++ ++# SSL cipher suite ++# See man ciphers for syntax ++#tls_ciphers TLSv1 ++ ++# Client certificate and key ++# Use these, if your server requires client authentication. ++#tls_cert ++#tls_key ++ +diff --git a/openssh-6.2p2/ldapbody.c b/openssh-6.2p2/ldapbody.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapbody.c +@@ -0,0 +1,494 @@ ++/* $OpenBSD: ldapbody.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "ldapincludes.h" ++#include "log.h" ++#include "xmalloc.h" ++#include "ldapconf.h" ++#include "ldapmisc.h" ++#include "ldapbody.h" ++#include ++#include ++ ++#define LDAPSEARCH_FORMAT "(&(objectclass=posixAccount)(objectclass=ldapPublicKey)(uid=%s)%s)" ++#define PUBKEYATTR "sshPublicKey" ++#define LDAP_LOGFILE "%s/ldap.%d" ++ ++static FILE *logfile = NULL; ++static LDAP *ld; ++ ++static char *attrs[] = { ++ PUBKEYATTR, ++ NULL ++}; ++ ++void ++ldap_checkconfig (void) ++{ ++#ifdef HAVE_LDAP_INITIALIZE ++ if (options.host == NULL && options.uri == NULL) ++#else ++ if (options.host == NULL) ++#endif ++ fatal ("missing \"host\" in config file"); ++} ++ ++#if defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000) ++static int ++_rebind_proc (LDAP * ld, LDAP_CONST char *url, int request, ber_int_t msgid) ++{ ++ struct timeval timeout; ++ int rc; ++#if defined(HAVE_LDAP_PARSE_RESULT) && defined(HAVE_LDAP_CONTROLS_FREE) ++ LDAPMessage *result; ++#endif /* HAVE_LDAP_PARSE_RESULT && HAVE_LDAP_CONTROLS_FREE */ ++ ++ debug2 ("Doing LDAP rebind to %s", options.binddn); ++ if (options.ssl == SSL_START_TLS) { ++ if ((rc = ldap_start_tls_s (ld, NULL, NULL)) != LDAP_SUCCESS) { ++ error ("ldap_starttls_s: %s", ldap_err2string (rc)); ++ return LDAP_OPERATIONS_ERROR; ++ } ++ } ++ ++#if !defined(HAVE_LDAP_PARSE_RESULT) || !defined(HAVE_LDAP_CONTROLS_FREE) ++ return ldap_simple_bind_s (ld, options.binddn, options.bindpw); ++#else ++ if (ldap_simple_bind(ld, options.binddn, options.bindpw) < 0) ++ fatal ("ldap_simple_bind %s", ldap_err2string (ldap_get_lderrno (ld, 0, 0))); ++ ++ timeout.tv_sec = options.bind_timelimit; ++ timeout.tv_usec = 0; ++ result = NULL; ++ if ((rc = ldap_result (ld, msgid, FALSE, &timeout, &result)) < 1) { ++ error ("ldap_result %s", ldap_err2string (ldap_get_lderrno (ld, 0, 0))); ++ ldap_msgfree (result); ++ return LDAP_OPERATIONS_ERROR; ++ } ++ debug3 ("LDAP rebind to %s succesfull", options.binddn); ++ return rc; ++#endif ++} ++#else ++ ++static int ++_rebind_proc (LDAP * ld, char **whop, char **credp, int *methodp, int freeit) ++{ ++ if (freeit) ++ return LDAP_SUCCESS; ++ ++ *whop = strdup (options.binddn); ++ *credp = strdup (options.bindpw); ++ *methodp = LDAP_AUTH_SIMPLE; ++ debug2 ("Doing LDAP rebind for %s", *whop); ++ return LDAP_SUCCESS; ++} ++#endif ++ ++void ++ldap_do_connect(void) ++{ ++ int rc, msgid, ld_errno = 0; ++ struct timeval timeout; ++#if defined(HAVE_LDAP_PARSE_RESULT) && defined(HAVE_LDAP_CONTROLS_FREE) ++ int parserc; ++ LDAPMessage *result; ++ LDAPControl **controls; ++ int reconnect = 0; ++#endif /* HAVE_LDAP_PARSE_RESULT && HAVE_LDAP_CONTROLS_FREE */ ++ ++ debug ("LDAP do connect"); ++ ++retry: ++ if (reconnect) { ++ debug3 ("Reconnecting with ld_errno %d", ld_errno); ++ if (options.bind_policy == 0 || ++ (ld_errno != LDAP_SERVER_DOWN && ld_errno != LDAP_TIMEOUT) || ++ reconnect > 5) ++ fatal ("Cannot connect to LDAP server"); ++ ++ if (reconnect > 1) ++ sleep (reconnect - 1); ++ ++ if (ld != NULL) { ++ ldap_unbind (ld); ++ ld = NULL; ++ } ++ logit("reconnecting to LDAP server..."); ++ } ++ ++ if (ld == NULL) { ++ int rc; ++ struct timeval tv; ++ ++#ifdef HAVE_LDAP_SET_OPTION ++ if (options.debug > 0) { ++#ifdef LBER_OPT_LOG_PRINT_FILE ++ if (options.logdir) { ++ char *logfilename; ++ int logfilenamelen; ++ ++ logfilenamelen = strlen (LDAP_LOGFILE) + strlen ("000000") + strlen (options.logdir); ++ logfilename = xmalloc (logfilenamelen); ++ snprintf (logfilename, logfilenamelen, LDAP_LOGFILE, options.logdir, (int) getpid ()); ++ logfilename[logfilenamelen - 1] = 0; ++ if ((logfile = fopen (logfilename, "a")) == NULL) ++ fatal ("cannot append to %s: %s", logfilename, strerror (errno)); ++ debug3 ("LDAP debug into %s", logfilename); ++ xfree (logfilename); ++ ber_set_option (NULL, LBER_OPT_LOG_PRINT_FILE, logfile); ++ } ++#endif ++ if (options.debug) { ++#ifdef LBER_OPT_DEBUG_LEVEL ++ ber_set_option (NULL, LBER_OPT_DEBUG_LEVEL, &options.debug); ++#endif /* LBER_OPT_DEBUG_LEVEL */ ++#ifdef LDAP_OPT_DEBUG_LEVEL ++ ldap_set_option (NULL, LDAP_OPT_DEBUG_LEVEL, &options.debug); ++#endif /* LDAP_OPT_DEBUG_LEVEL */ ++ debug3 ("Set LDAP debug to %d", options.debug); ++ } ++ } ++#endif /* HAVE_LDAP_SET_OPTION */ ++ ++ ld = NULL; ++#ifdef HAVE_LDAPSSL_INIT ++ if (options.host != NULL) { ++ if (options.ssl_on == SSL_LDAPS) { ++ if ((rc = ldapssl_client_init (options.sslpath, NULL)) != LDAP_SUCCESS) ++ fatal ("ldapssl_client_init %s", ldap_err2string (rc)); ++ debug3 ("LDAPssl client init"); ++ } ++ ++ if (options.ssl_on != SSL_OFF) { ++ if ((ld = ldapssl_init (options.host, options.port, TRUE)) == NULL) ++ fatal ("ldapssl_init failed"); ++ debug3 ("LDAPssl init"); ++ } ++ } ++#endif /* HAVE_LDAPSSL_INIT */ ++ ++ /* continue with opening */ ++ if (ld == NULL) { ++#if defined (HAVE_LDAP_START_TLS_S) || (defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)) ++ /* Some global TLS-specific options need to be set before we create our ++ * session context, so we set them here. */ ++ ++#ifdef LDAP_OPT_X_TLS_RANDOM_FILE ++ /* rand file */ ++ if (options.tls_randfile != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_RANDOM_FILE, ++ options.tls_randfile)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_RANDOM_FILE): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS random file %s", options.tls_randfile); ++ } ++#endif /* LDAP_OPT_X_TLS_RANDOM_FILE */ ++ ++ /* ca cert file */ ++ if (options.tls_cacertfile != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CACERTFILE, ++ options.tls_cacertfile)) != LDAP_SUCCESS) ++ error ("ldap_set_option(LDAP_OPT_X_TLS_CACERTFILE): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS CA cert file %s ", options.tls_cacertfile); ++ } ++ ++ /* ca cert directory */ ++ if (options.tls_cacertdir != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CACERTDIR, ++ options.tls_cacertdir)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_CACERTDIR): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS CA cert dir %s ", options.tls_cacertdir); ++ } ++ ++ /* require cert? */ ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, ++ &options.tls_checkpeer)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_REQUIRE_CERT): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS check peer to %d ", options.tls_checkpeer); ++ ++ /* set cipher suite, certificate and private key: */ ++ if (options.tls_ciphers != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CIPHER_SUITE, ++ options.tls_ciphers)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_CIPHER_SUITE): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS ciphers to %s ", options.tls_ciphers); ++ } ++ ++ /* cert file */ ++ if (options.tls_cert != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_CERTFILE, ++ options.tls_cert)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_CERTFILE): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS cert file %s ", options.tls_cert); ++ } ++ ++ /* key file */ ++ if (options.tls_key != NULL) { ++ if ((rc = ldap_set_option (NULL, LDAP_OPT_X_TLS_KEYFILE, ++ options.tls_key)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS_KEYFILE): %s", ++ ldap_err2string (rc)); ++ debug3 ("Set TLS key file %s ", options.tls_key); ++ } ++#endif ++#ifdef HAVE_LDAP_INITIALIZE ++ if (options.uri != NULL) { ++ if ((rc = ldap_initialize (&ld, options.uri)) != LDAP_SUCCESS) ++ fatal ("ldap_initialize %s", ldap_err2string (rc)); ++ debug3 ("LDAP initialize %s", options.uri); ++ } ++ } ++#endif /* HAVE_LDAP_INTITIALIZE */ ++ ++ /* continue with opening */ ++ if ((ld == NULL) && (options.host != NULL)) { ++#ifdef HAVE_LDAP_INIT ++ if ((ld = ldap_init (options.host, options.port)) == NULL) ++ fatal ("ldap_init failed"); ++ debug3 ("LDAP init %s:%d", options.host, options.port); ++#else ++ if ((ld = ldap_open (options.host, options.port)) == NULL) ++ fatal ("ldap_open failed"); ++ debug3 ("LDAP open %s:%d", options.host, options.port); ++#endif /* HAVE_LDAP_INIT */ ++ } ++ ++ if (ld == NULL) ++ fatal ("no way to open ldap"); ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) ++ if (options.ssl == SSL_LDAPS) { ++ if ((rc = ldap_set_option (ld, LDAP_OPT_X_TLS, &options.tls_checkpeer)) != LDAP_SUCCESS) ++ fatal ("ldap_set_option(LDAP_OPT_X_TLS) %s", ldap_err2string (rc)); ++ debug3 ("LDAP set LDAP_OPT_X_TLS_%d", options.tls_checkpeer); ++ } ++#endif /* LDAP_OPT_X_TLS */ ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_PROTOCOL_VERSION) ++ (void) ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, ++ &options.ldap_version); ++#else ++ ld->ld_version = options.ldap_version; ++#endif ++ debug3 ("LDAP set version to %d", options.ldap_version); ++ ++#if LDAP_SET_REBIND_PROC_ARGS == 3 ++ ldap_set_rebind_proc (ld, _rebind_proc, NULL); ++#elif LDAP_SET_REBIND_PROC_ARGS == 2 ++ ldap_set_rebind_proc (ld, _rebind_proc); ++#else ++#warning unknown LDAP_SET_REBIND_PROC_ARGS ++#endif ++ debug3 ("LDAP set rebind proc"); ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_DEREF) ++ (void) ldap_set_option (ld, LDAP_OPT_DEREF, &options.deref); ++#else ++ ld->ld_deref = options.deref; ++#endif ++ debug3 ("LDAP set deref to %d", options.deref); ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_TIMELIMIT) ++ (void) ldap_set_option (ld, LDAP_OPT_TIMELIMIT, ++ &options.timelimit); ++#else ++ ld->ld_timelimit = options.timelimit; ++#endif ++ debug3 ("LDAP set timelimit to %d", options.timelimit); ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_X_OPT_CONNECT_TIMEOUT) ++ /* ++ * This is a new option in the Netscape SDK which sets ++ * the TCP connect timeout. For want of a better value, ++ * we use the bind_timelimit to control this. ++ */ ++ timeout = options.bind_timelimit * 1000; ++ (void) ldap_set_option (ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout); ++ debug3 ("LDAP set opt connect timeout to %d", timeout); ++#endif ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_NETWORK_TIMEOUT) ++ tv.tv_sec = options.bind_timelimit; ++ tv.tv_usec = 0; ++ (void) ldap_set_option (ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); ++ debug3 ("LDAP set opt network timeout to %ld.0", tv.tv_sec); ++#endif ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_REFERRALS) ++ (void) ldap_set_option (ld, LDAP_OPT_REFERRALS, ++ options.referrals ? LDAP_OPT_ON : LDAP_OPT_OFF); ++ debug3 ("LDAP set referrals to %d", options.referrals); ++#endif ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_RESTART) ++ (void) ldap_set_option (ld, LDAP_OPT_RESTART, ++ options.restart ? LDAP_OPT_ON : LDAP_OPT_OFF); ++ debug3 ("LDAP set restart to %d", options.restart); ++#endif ++ ++#ifdef HAVE_LDAP_START_TLS_S ++ if (options.ssl == SSL_START_TLS) { ++ int version; ++ ++ if (ldap_get_option (ld, LDAP_OPT_PROTOCOL_VERSION, &version) ++ == LDAP_SUCCESS) { ++ if (version < LDAP_VERSION3) { ++ version = LDAP_VERSION3; ++ (void) ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, ++ &version); ++ debug3 ("LDAP set version to %d", version); ++ } ++ } ++ ++ if ((rc = ldap_start_tls_s (ld, NULL, NULL)) != LDAP_SUCCESS) ++ fatal ("ldap_starttls_s: %s", ldap_err2string (rc)); ++ debug3 ("LDAP start TLS"); ++ } ++#endif /* HAVE_LDAP_START_TLS_S */ ++ } ++ ++ if ((msgid = ldap_simple_bind (ld, options.binddn, ++ options.bindpw)) == -1) { ++ ld_errno = ldap_get_lderrno (ld, 0, 0); ++ ++ error ("ldap_simple_bind %s", ldap_err2string (ld_errno)); ++ reconnect++; ++ goto retry; ++ } ++ debug3 ("LDAP simple bind (%s)", options.binddn); ++ ++ timeout.tv_sec = options.bind_timelimit; ++ timeout.tv_usec = 0; ++ if ((rc = ldap_result (ld, msgid, FALSE, &timeout, &result)) < 1) { ++ ld_errno = ldap_get_lderrno (ld, 0, 0); ++ ++ error ("ldap_result %s", ldap_err2string (ld_errno)); ++ reconnect++; ++ goto retry; ++ } ++ debug3 ("LDAP result in time"); ++ ++#if defined(HAVE_LDAP_PARSE_RESULT) && defined(HAVE_LDAP_CONTROLS_FREE) ++ controls = NULL; ++ if ((parserc = ldap_parse_result (ld, result, &rc, 0, 0, 0, &controls, TRUE)) != LDAP_SUCCESS) ++ fatal ("ldap_parse_result %s", ldap_err2string (parserc)); ++ debug3 ("LDAP parse result OK"); ++ ++ if (controls != NULL) { ++ ldap_controls_free (controls); ++ } ++#else ++ rc = ldap_result2error (session->ld, result, TRUE); ++#endif ++ if (rc != LDAP_SUCCESS) ++ fatal ("error trying to bind as user \"%s\" (%s)", ++ options.binddn, ldap_err2string (rc)); ++ ++ debug2 ("LDAP do connect OK"); ++} ++ ++void ++process_user (const char *user, FILE *output) ++{ ++ LDAPMessage *res, *e; ++ char *buffer; ++ int bufflen, rc, i; ++ struct timeval timeout; ++ ++ debug ("LDAP process user"); ++ ++ /* quick check for attempts to be evil */ ++ if ((strchr(user, '(') != NULL) || (strchr(user, ')') != NULL) || ++ (strchr(user, '*') != NULL) || (strchr(user, '\\') != NULL)) { ++ logit ("illegal user name %s not processed", user); ++ return; ++ } ++ ++ /* build filter for LDAP request */ ++ bufflen = strlen (LDAPSEARCH_FORMAT) + strlen (user); ++ if (options.ssh_filter != NULL) ++ bufflen += strlen (options.ssh_filter); ++ buffer = xmalloc (bufflen); ++ snprintf(buffer, bufflen, LDAPSEARCH_FORMAT, user, (options.ssh_filter != NULL) ? options.ssh_filter : NULL); ++ buffer[bufflen - 1] = 0; ++ ++ debug3 ("LDAP search scope = %d %s", options.scope, buffer); ++ ++ timeout.tv_sec = options.timelimit; ++ timeout.tv_usec = 0; ++ if ((rc = ldap_search_st(ld, options.base, options.scope, buffer, attrs, 0, &timeout, &res)) != LDAP_SUCCESS) { ++ error ("ldap_search_st(): %s", ldap_err2string (rc)); ++ xfree (buffer); ++ return; ++ } ++ ++ /* free */ ++ xfree (buffer); ++ ++ for (e = ldap_first_entry(ld, res); e != NULL; e = ldap_next_entry(ld, e)) { ++ int num; ++ struct berval **keys; ++ ++ keys = ldap_get_values_len(ld, e, PUBKEYATTR); ++ num = ldap_count_values_len(keys); ++ for (i = 0 ; i < num ; i++) { ++ char *cp; //, *options = NULL; ++ ++ for (cp = keys[i]->bv_val; *cp == ' ' || *cp == '\t'; cp++); ++ if (!*cp || *cp == '\n' || *cp == '#') ++ continue; ++ ++ /* We have found the desired key. */ ++ fprintf (output, "%s\n", keys[i]->bv_val); ++ } ++ ++ ldap_value_free_len(keys); ++ } ++ ++ ldap_msgfree(res); ++ debug2 ("LDAP process user finished"); ++} ++ ++void ++ldap_do_close(void) ++{ ++ int rc; ++ ++ debug ("LDAP do close"); ++ if ((rc = ldap_unbind_ext(ld, NULL, NULL)) != LDAP_SUCCESS) ++ fatal ("ldap_unbind_ext: %s", ++ ldap_err2string (rc)); ++ ++ ld = NULL; ++ debug2 ("LDAP do close OK"); ++ return; ++} ++ +diff --git a/openssh-6.2p2/ldapbody.h b/openssh-6.2p2/ldapbody.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapbody.h +@@ -0,0 +1,37 @@ ++/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LDAPBODY_H ++#define LDAPBODY_H ++ ++#include ++ ++void ldap_checkconfig(void); ++void ldap_do_connect(void); ++void process_user(const char *, FILE *); ++void ldap_do_close(void); ++ ++#endif /* LDAPBODY_H */ ++ +diff --git a/openssh-6.2p2/ldapconf.c b/openssh-6.2p2/ldapconf.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapconf.c +@@ -0,0 +1,682 @@ ++/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "ldapincludes.h" ++#include "ldap-helper.h" ++#include "log.h" ++#include "misc.h" ++#include "xmalloc.h" ++#include "ldapconf.h" ++#include ++#include ++ ++/* Keyword tokens. */ ++ ++typedef enum { ++ lBadOption, ++ lHost, lURI, lBase, lBindDN, lBindPW, lRootBindDN, ++ lScope, lDeref, lPort, lTimeLimit, lBind_TimeLimit, ++ lLdap_Version, lBind_Policy, lSSLPath, lSSL, lReferrals, ++ lRestart, lTLS_CheckPeer, lTLS_CaCertFile, ++ lTLS_CaCertDir, lTLS_Ciphers, lTLS_Cert, lTLS_Key, ++ lTLS_RandFile, lLogDir, lDebug, lSSH_Filter, ++ lDeprecated, lUnsupported ++} OpCodes; ++ ++/* Textual representations of the tokens. */ ++ ++static struct { ++ const char *name; ++ OpCodes opcode; ++} keywords[] = { ++ { "URI", lURI }, ++ { "Base", lBase }, ++ { "BindDN", lBindDN }, ++ { "BindPW", lBindPW }, ++ { "RootBindDN", lRootBindDN }, ++ { "Host", lHost }, ++ { "Port", lPort }, ++ { "Scope", lScope }, ++ { "Deref", lDeref }, ++ { "TimeLimit", lTimeLimit }, ++ { "TimeOut", lTimeLimit }, ++ { "Bind_Timelimit", lBind_TimeLimit }, ++ { "Network_TimeOut", lBind_TimeLimit }, ++/* ++ * Todo ++ * SIZELIMIT ++ */ ++ { "Ldap_Version", lLdap_Version }, ++ { "Version", lLdap_Version }, ++ { "Bind_Policy", lBind_Policy }, ++ { "SSLPath", lSSLPath }, ++ { "SSL", lSSL }, ++ { "Referrals", lReferrals }, ++ { "Restart", lRestart }, ++ { "TLS_CheckPeer", lTLS_CheckPeer }, ++ { "TLS_ReqCert", lTLS_CheckPeer }, ++ { "TLS_CaCertFile", lTLS_CaCertFile }, ++ { "TLS_CaCert", lTLS_CaCertFile }, ++ { "TLS_CaCertDir", lTLS_CaCertDir }, ++ { "TLS_Ciphers", lTLS_Ciphers }, ++ { "TLS_Cipher_Suite", lTLS_Ciphers }, ++ { "TLS_Cert", lTLS_Cert }, ++ { "TLS_Certificate", lTLS_Cert }, ++ { "TLS_Key", lTLS_Key }, ++ { "TLS_RandFile", lTLS_RandFile }, ++/* ++ * Todo ++ * TLS_CRLCHECK ++ * TLS_CRLFILE ++ */ ++ { "LogDir", lLogDir }, ++ { "Debug", lDebug }, ++ { "SSH_Filter", lSSH_Filter }, ++ { NULL, lBadOption } ++}; ++ ++/* Configuration ptions. */ ++ ++Options options; ++ ++/* ++ * Returns the number of the token pointed to by cp or oBadOption. ++ */ ++ ++static OpCodes ++parse_token(const char *cp, const char *filename, int linenum) ++{ ++ u_int i; ++ ++ for (i = 0; keywords[i].name; i++) ++ if (strcasecmp(cp, keywords[i].name) == 0) ++ return keywords[i].opcode; ++ ++ if (config_warning_config_file) ++ logit("%s: line %d: Bad configuration option: %s", ++ filename, linenum, cp); ++ return lBadOption; ++} ++ ++/* ++ * Processes a single option line as used in the configuration files. This ++ * only sets those values that have not already been set. ++ */ ++#define WHITESPACE " \t\r\n" ++ ++static int ++process_config_line(char *line, const char *filename, int linenum) ++{ ++ char *s, **charptr, **xstringptr, *endofnumber, *keyword, *arg; ++ char *rootbinddn = NULL; ++ int opcode, *intptr, value; ++ size_t len; ++ ++ /* Strip trailing whitespace */ ++ for (len = strlen(line) - 1; len > 0; len--) { ++ if (strchr(WHITESPACE, line[len]) == NULL) ++ break; ++ line[len] = '\0'; ++ } ++ ++ s = line; ++ /* Get the keyword. (Each line is supposed to begin with a keyword). */ ++ if ((keyword = strdelim(&s)) == NULL) ++ return 0; ++ /* Ignore leading whitespace. */ ++ if (*keyword == '\0') ++ keyword = strdelim(&s); ++ if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#') ++ return 0; ++ ++ opcode = parse_token(keyword, filename, linenum); ++ ++ switch (opcode) { ++ case lBadOption: ++ /* don't panic, but count bad options */ ++ return -1; ++ /* NOTREACHED */ ++ ++ case lHost: ++ xstringptr = &options.host; ++parse_xstring: ++ if (!s || *s == '\0') ++ fatal("%s line %d: missing dn",filename,linenum); ++ if (*xstringptr == NULL) ++ *xstringptr = xstrdup(s); ++ return 0; ++ ++ case lURI: ++ xstringptr = &options.uri; ++ goto parse_xstring; ++ ++ case lBase: ++ xstringptr = &options.base; ++ goto parse_xstring; ++ ++ case lBindDN: ++ xstringptr = &options.binddn; ++ goto parse_xstring; ++ ++ case lBindPW: ++ charptr = &options.bindpw; ++parse_string: ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing argument.", filename, linenum); ++ if (*charptr == NULL) ++ *charptr = xstrdup(arg); ++ break; ++ ++ case lRootBindDN: ++ xstringptr = &rootbinddn; ++ goto parse_xstring; ++ ++ case lScope: ++ intptr = &options.scope; ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing sub/one/base argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (strcasecmp (arg, "sub") == 0 || strcasecmp (arg, "subtree") == 0) ++ value = LDAP_SCOPE_SUBTREE; ++ else if (strcasecmp (arg, "one") == 0) ++ value = LDAP_SCOPE_ONELEVEL; ++ else if (strcasecmp (arg, "base") == 0) ++ value = LDAP_SCOPE_BASE; ++ else ++ fatal("%.200s line %d: Bad sub/one/base argument.", filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lDeref: ++ intptr = &options.scope; ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing never/searching/finding/always argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (!strcasecmp (arg, "never")) ++ value = LDAP_DEREF_NEVER; ++ else if (!strcasecmp (arg, "searching")) ++ value = LDAP_DEREF_SEARCHING; ++ else if (!strcasecmp (arg, "finding")) ++ value = LDAP_DEREF_FINDING; ++ else if (!strcasecmp (arg, "always")) ++ value = LDAP_DEREF_ALWAYS; ++ else ++ fatal("%.200s line %d: Bad never/searching/finding/always argument.", filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lPort: ++ intptr = &options.port; ++parse_int: ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing argument.", filename, linenum); ++ if (arg[0] < '0' || arg[0] > '9') ++ fatal("%.200s line %d: Bad number.", filename, linenum); ++ ++ /* Octal, decimal, or hex format? */ ++ value = strtol(arg, &endofnumber, 0); ++ if (arg == endofnumber) ++ fatal("%.200s line %d: Bad number.", filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lTimeLimit: ++ intptr = &options.timelimit; ++parse_time: ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%s line %d: missing time value.", ++ filename, linenum); ++ if ((value = convtime(arg)) == -1) ++ fatal("%s line %d: invalid time value.", ++ filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lBind_TimeLimit: ++ intptr = &options.bind_timelimit; ++ goto parse_time; ++ ++ case lLdap_Version: ++ intptr = &options.ldap_version; ++ goto parse_int; ++ ++ case lBind_Policy: ++ intptr = &options.bind_policy; ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing soft/hard argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (strcasecmp(arg, "hard") == 0 || strcasecmp(arg, "hard_open") == 0 || strcasecmp(arg, "hard_init") == 0) ++ value = 1; ++ else if (strcasecmp(arg, "soft") == 0) ++ value = 0; ++ else ++ fatal("%.200s line %d: Bad soft/hard argument.", filename, linenum); ++ if (*intptr == -1) ++ break; ++ ++ case lSSLPath: ++ charptr = &options.sslpath; ++ goto parse_string; ++ ++ case lSSL: ++ intptr = &options.ssl; ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing yes/no/start_tls argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (strcasecmp(arg, "yes") == 0 || strcasecmp(arg, "true") == 0 || strcasecmp(arg, "on") == 0) ++ value = SSL_LDAPS; ++ else if (strcasecmp(arg, "no") == 0 || strcasecmp(arg, "false") == 0 || strcasecmp(arg, "off") == 0) ++ value = SSL_OFF; ++ else if (!strcasecmp (arg, "start_tls")) ++ value = SSL_START_TLS; ++ else ++ fatal("%.200s line %d: Bad yes/no/start_tls argument.", filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lReferrals: ++ intptr = &options.referrals; ++parse_flag: ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing yes/no argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (strcasecmp(arg, "yes") == 0 || strcasecmp(arg, "true") == 0 || strcasecmp(arg, "on") == 0) ++ value = 1; ++ else if (strcasecmp(arg, "no") == 0 || strcasecmp(arg, "false") == 0 || strcasecmp(arg, "off") == 0) ++ value = 0; ++ else ++ fatal("%.200s line %d: Bad yes/no argument.", filename, linenum); ++ if (*intptr == -1) ++ *intptr = value; ++ break; ++ ++ case lRestart: ++ intptr = &options.restart; ++ goto parse_flag; ++ ++ case lTLS_CheckPeer: ++ intptr = &options.tls_checkpeer; ++ arg = strdelim(&s); ++ if (!arg || *arg == '\0') ++ fatal("%.200s line %d: Missing never/hard/demand/alow/try argument.", filename, linenum); ++ value = 0; /* To avoid compiler warning... */ ++ if (strcasecmp(arg, "never") == 0 || strcasecmp(arg, "no") == 0 || strcasecmp(arg, "false") == 0 || strcasecmp(arg, "off") == 0) ++ value = LDAP_OPT_X_TLS_NEVER; ++ else if (strcasecmp(arg, "hard") == 0 || strcasecmp(arg, "yes") == 0 || strcasecmp(arg, "true") == 0 || strcasecmp(arg, "on") == 0) ++ value = LDAP_OPT_X_TLS_HARD; ++ else if (strcasecmp(arg, "demand") == 0) ++ value = LDAP_OPT_X_TLS_DEMAND; ++ else if (strcasecmp(arg, "allow") == 0) ++ value = LDAP_OPT_X_TLS_ALLOW; ++ else if (strcasecmp(arg, "try") == 0) ++ value = LDAP_OPT_X_TLS_TRY; ++ else ++ fatal("%.200s line %d: Bad never/hard/demand/alow/try argument.", filename, linenum); ++ if (*intptr == -1) ++ break; ++ ++ case lTLS_CaCertFile: ++ charptr = &options.tls_cacertfile; ++ goto parse_string; ++ ++ case lTLS_CaCertDir: ++ charptr = &options.tls_cacertdir; ++ goto parse_string; ++ ++ case lTLS_Ciphers: ++ xstringptr = &options.tls_ciphers; ++ goto parse_xstring; ++ ++ case lTLS_Cert: ++ charptr = &options.tls_cert; ++ goto parse_string; ++ ++ case lTLS_Key: ++ charptr = &options.tls_key; ++ goto parse_string; ++ ++ case lTLS_RandFile: ++ charptr = &options.tls_randfile; ++ goto parse_string; ++ ++ case lLogDir: ++ charptr = &options.logdir; ++ goto parse_string; ++ ++ case lDebug: ++ intptr = &options.debug; ++ goto parse_int; ++ ++ case lSSH_Filter: ++ xstringptr = &options.ssh_filter; ++ goto parse_xstring; ++ ++ case lDeprecated: ++ debug("%s line %d: Deprecated option \"%s\"", ++ filename, linenum, keyword); ++ return 0; ++ ++ case lUnsupported: ++ error("%s line %d: Unsupported option \"%s\"", ++ filename, linenum, keyword); ++ return 0; ++ ++ default: ++ fatal("process_config_line: Unimplemented opcode %d", opcode); ++ } ++ ++ /* Check that there is no garbage at end of line. */ ++ if ((arg = strdelim(&s)) != NULL && *arg != '\0') { ++ fatal("%.200s line %d: garbage at end of line; \"%.200s\".", ++ filename, linenum, arg); ++ } ++ return 0; ++} ++ ++/* ++ * Reads the config file and modifies the options accordingly. Options ++ * should already be initialized before this call. This never returns if ++ * there is an error. If the file does not exist, this returns 0. ++ */ ++ ++void ++read_config_file(const char *filename) ++{ ++ FILE *f; ++ char line[1024]; ++ int active, linenum; ++ int bad_options = 0; ++ struct stat sb; ++ ++ if ((f = fopen(filename, "r")) == NULL) ++ fatal("fopen %s: %s", filename, strerror(errno)); ++ ++ if (fstat(fileno(f), &sb) == -1) ++ fatal("fstat %s: %s", filename, strerror(errno)); ++ if (((sb.st_uid != 0 && sb.st_uid != getuid()) || ++ (sb.st_mode & 022) != 0)) ++ fatal("Bad owner or permissions on %s", filename); ++ ++ debug("Reading configuration data %.200s", filename); ++ ++ /* ++ * Mark that we are now processing the options. This flag is turned ++ * on/off by Host specifications. ++ */ ++ active = 1; ++ linenum = 0; ++ while (fgets(line, sizeof(line), f)) { ++ /* Update line number counter. */ ++ linenum++; ++ if (process_config_line(line, filename, linenum) != 0) ++ bad_options++; ++ } ++ fclose(f); ++ if ((bad_options > 0) && config_exclusive_config_file) ++ fatal("%s: terminating, %d bad configuration options", ++ filename, bad_options); ++} ++ ++/* ++ * Initializes options to special values that indicate that they have not yet ++ * been set. Read_config_file will only set options with this value. Options ++ * are processed in the following order: command line, user config file, ++ * system config file. Last, fill_default_options is called. ++ */ ++ ++void ++initialize_options(void) ++{ ++ memset(&options, 'X', sizeof(options)); ++ options.host = NULL; ++ options.uri = NULL; ++ options.base = NULL; ++ options.binddn = NULL; ++ options.bindpw = NULL; ++ options.scope = -1; ++ options.deref = -1; ++ options.port = -1; ++ options.timelimit = -1; ++ options.bind_timelimit = -1; ++ options.ldap_version = -1; ++ options.bind_policy = -1; ++ options.sslpath = NULL; ++ options.ssl = -1; ++ options.referrals = -1; ++ options.restart = -1; ++ options.tls_checkpeer = -1; ++ options.tls_cacertfile = NULL; ++ options.tls_cacertdir = NULL; ++ options.tls_ciphers = NULL; ++ options.tls_cert = NULL; ++ options.tls_key = NULL; ++ options.tls_randfile = NULL; ++ options.logdir = NULL; ++ options.debug = -1; ++ options.ssh_filter = NULL; ++} ++ ++/* ++ * Called after processing other sources of option data, this fills those ++ * options for which no value has been specified with their default values. ++ */ ++ ++void ++fill_default_options(void) ++{ ++ if (options.uri != NULL) { ++ LDAPURLDesc *ludp; ++ ++ if (ldap_url_parse(options.uri, &ludp) == LDAP_SUCCESS) { ++ if (options.ssl == -1) { ++ if (strcmp (ludp->lud_scheme, "ldap") == 0) ++ options.ssl = 2; ++ if (strcmp (ludp->lud_scheme, "ldapi") == 0) ++ options.ssl = 0; ++ else if (strcmp (ludp->lud_scheme, "ldaps") == 0) ++ options.ssl = 1; ++ } ++ if (options.host == NULL) ++ options.host = xstrdup (ludp->lud_host); ++ if (options.port == -1) ++ options.port = ludp->lud_port; ++ ++ ldap_free_urldesc (ludp); ++ } ++ } ++ if (options.ssl == -1) ++ options.ssl = SSL_START_TLS; ++ if (options.port == -1) ++ options.port = (options.ssl == 0) ? 389 : 636; ++ if (options.uri == NULL) { ++ int len; ++#define MAXURILEN 4096 ++ ++ options.uri = xmalloc (MAXURILEN); ++ len = snprintf (options.uri, MAXURILEN, "ldap%s://%s:%d", ++ (options.ssl == 0) ? "" : "s", options.host, options.port); ++ options.uri[MAXURILEN - 1] = 0; ++ options.uri = xrealloc (options.uri, len + 1, 1); ++ } ++ if (options.binddn == NULL) ++ options.binddn = ""; ++ if (options.bindpw == NULL) ++ options.bindpw = ""; ++ if (options.scope == -1) ++ options.scope = LDAP_SCOPE_SUBTREE; ++ if (options.deref == -1) ++ options.deref = LDAP_DEREF_NEVER; ++ if (options.timelimit == -1) ++ options.timelimit = 10; ++ if (options.bind_timelimit == -1) ++ options.bind_timelimit = 10; ++ if (options.ldap_version == -1) ++ options.ldap_version = 3; ++ if (options.bind_policy == -1) ++ options.bind_policy = 1; ++ if (options.referrals == -1) ++ options.referrals = 1; ++ if (options.restart == -1) ++ options.restart = 1; ++ if (options.tls_checkpeer == -1) ++ options.tls_checkpeer = LDAP_OPT_X_TLS_HARD; ++ if (options.debug == -1) ++ options.debug = 0; ++ if (options.ssh_filter == NULL) ++ options.ssh_filter = ""; ++} ++ ++static const char * ++lookup_opcode_name(OpCodes code) ++{ ++ u_int i; ++ ++ for (i = 0; keywords[i].name != NULL; i++) ++ if (keywords[i].opcode == code) ++ return(keywords[i].name); ++ return "UNKNOWN"; ++} ++ ++static void ++dump_cfg_string(OpCodes code, const char *val) ++{ ++ if (val == NULL) ++ debug3("%s ", lookup_opcode_name(code)); ++ else ++ debug3("%s %s", lookup_opcode_name(code), val); ++} ++ ++static void ++dump_cfg_int(OpCodes code, int val) ++{ ++ if (val == -1) ++ debug3("%s ", lookup_opcode_name(code)); ++ else ++ debug3("%s %d", lookup_opcode_name(code), val); ++} ++ ++struct names { ++ int value; ++ char *name; ++}; ++ ++static void ++dump_cfg_namedint(OpCodes code, int val, struct names *names) ++{ ++ u_int i; ++ ++ if (val == -1) ++ debug3("%s ", lookup_opcode_name(code)); ++ else { ++ for (i = 0; names[i].value != -1; i++) ++ if (names[i].value == val) { ++ debug3("%s %s", lookup_opcode_name(code), names[i].name); ++ return; ++ } ++ debug3("%s unknown: %d", lookup_opcode_name(code), val); ++ } ++} ++ ++static struct names _yesnotls[] = { ++ { 0, "No" }, ++ { 1, "Yes" }, ++ { 2, "Start_TLS" }, ++ { -1, NULL }}; ++ ++static struct names _scope[] = { ++ { LDAP_SCOPE_BASE, "Base" }, ++ { LDAP_SCOPE_ONELEVEL, "One" }, ++ { LDAP_SCOPE_SUBTREE, "Sub"}, ++ { -1, NULL }}; ++ ++static struct names _deref[] = { ++ { LDAP_DEREF_NEVER, "Never" }, ++ { LDAP_DEREF_SEARCHING, "Searching" }, ++ { LDAP_DEREF_FINDING, "Finding" }, ++ { LDAP_DEREF_ALWAYS, "Always" }, ++ { -1, NULL }}; ++ ++static struct names _yesno[] = { ++ { 0, "No" }, ++ { 1, "Yes" }, ++ { -1, NULL }}; ++ ++static struct names _bindpolicy[] = { ++ { 0, "Soft" }, ++ { 1, "Hard" }, ++ { -1, NULL }}; ++ ++static struct names _checkpeer[] = { ++ { LDAP_OPT_X_TLS_NEVER, "Never" }, ++ { LDAP_OPT_X_TLS_HARD, "Hard" }, ++ { LDAP_OPT_X_TLS_DEMAND, "Demand" }, ++ { LDAP_OPT_X_TLS_ALLOW, "Allow" }, ++ { LDAP_OPT_X_TLS_TRY, "TRY" }, ++ { -1, NULL }}; ++ ++void ++dump_config(void) ++{ ++ dump_cfg_string(lURI, options.uri); ++ dump_cfg_string(lHost, options.host); ++ dump_cfg_int(lPort, options.port); ++ dump_cfg_namedint(lSSL, options.ssl, _yesnotls); ++ dump_cfg_int(lLdap_Version, options.ldap_version); ++ dump_cfg_int(lTimeLimit, options.timelimit); ++ dump_cfg_int(lBind_TimeLimit, options.bind_timelimit); ++ dump_cfg_string(lBase, options.base); ++ dump_cfg_string(lBindDN, options.binddn); ++ dump_cfg_string(lBindPW, options.bindpw); ++ dump_cfg_namedint(lScope, options.scope, _scope); ++ dump_cfg_namedint(lDeref, options.deref, _deref); ++ dump_cfg_namedint(lReferrals, options.referrals, _yesno); ++ dump_cfg_namedint(lRestart, options.restart, _yesno); ++ dump_cfg_namedint(lBind_Policy, options.bind_policy, _bindpolicy); ++ dump_cfg_string(lSSLPath, options.sslpath); ++ dump_cfg_namedint(lTLS_CheckPeer, options.tls_checkpeer, _checkpeer); ++ dump_cfg_string(lTLS_CaCertFile, options.tls_cacertfile); ++ dump_cfg_string(lTLS_CaCertDir, options.tls_cacertdir); ++ dump_cfg_string(lTLS_Ciphers, options.tls_ciphers); ++ dump_cfg_string(lTLS_Cert, options.tls_cert); ++ dump_cfg_string(lTLS_Key, options.tls_key); ++ dump_cfg_string(lTLS_RandFile, options.tls_randfile); ++ dump_cfg_string(lLogDir, options.logdir); ++ dump_cfg_int(lDebug, options.debug); ++ dump_cfg_string(lSSH_Filter, options.ssh_filter); ++} ++ +diff --git a/openssh-6.2p2/ldapconf.h b/openssh-6.2p2/ldapconf.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapconf.h +@@ -0,0 +1,71 @@ ++/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LDAPCONF_H ++#define LDAPCONF_H ++ ++#define SSL_OFF 0 ++#define SSL_LDAPS 1 ++#define SSL_START_TLS 2 ++ ++/* Data structure for representing option data. */ ++ ++typedef struct { ++ char *host; ++ char *uri; ++ char *base; ++ char *binddn; ++ char *bindpw; ++ int scope; ++ int deref; ++ int port; ++ int timelimit; ++ int bind_timelimit; ++ int ldap_version; ++ int bind_policy; ++ char *sslpath; ++ int ssl; ++ int referrals; ++ int restart; ++ int tls_checkpeer; ++ char *tls_cacertfile; ++ char *tls_cacertdir; ++ char *tls_ciphers; ++ char *tls_cert; ++ char *tls_key; ++ char *tls_randfile; ++ char *logdir; ++ int debug; ++ char *ssh_filter; ++} Options; ++ ++extern Options options; ++ ++void read_config_file(const char *); ++void initialize_options(void); ++void fill_default_options(void); ++void dump_config(void); ++ ++#endif /* LDAPCONF_H */ +diff --git a/openssh-6.2p2/ldapincludes.h b/openssh-6.2p2/ldapincludes.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapincludes.h +@@ -0,0 +1,41 @@ ++/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LDAPINCLUDES_H ++#define LDAPINCLUDES_H ++ ++#include "includes.h" ++ ++#ifdef HAVE_LBER_H ++#include ++#endif ++#ifdef HAVE_LDAP_H ++#include ++#endif ++#ifdef HAVE_LDAP_SSL_H ++#include ++#endif ++ ++#endif /* LDAPINCLUDES_H */ +diff --git a/openssh-6.2p2/ldapmisc.c b/openssh-6.2p2/ldapmisc.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapmisc.c +@@ -0,0 +1,79 @@ ++ ++#include "ldapincludes.h" ++#include "ldapmisc.h" ++ ++#ifndef HAVE_LDAP_GET_LDERRNO ++int ++ldap_get_lderrno (LDAP * ld, char **m, char **s) ++{ ++#ifdef HAVE_LDAP_GET_OPTION ++ int rc; ++#endif ++ int lderrno; ++ ++#if defined(HAVE_LDAP_GET_OPTION) && defined(LDAP_OPT_ERROR_NUMBER) ++ if ((rc = ldap_get_option (ld, LDAP_OPT_ERROR_NUMBER, &lderrno)) != LDAP_SUCCESS) ++ return rc; ++#else ++ lderrno = ld->ld_errno; ++#endif ++ ++ if (s != NULL) { ++#if defined(HAVE_LDAP_GET_OPTION) && defined(LDAP_OPT_ERROR_STRING) ++ if ((rc = ldap_get_option (ld, LDAP_OPT_ERROR_STRING, s)) != LDAP_SUCCESS) ++ return rc; ++#else ++ *s = ld->ld_error; ++#endif ++ } ++ ++ if (m != NULL) { ++#if defined(HAVE_LDAP_GET_OPTION) && defined(LDAP_OPT_MATCHED_DN) ++ if ((rc = ldap_get_option (ld, LDAP_OPT_MATCHED_DN, m)) != LDAP_SUCCESS) ++ return rc; ++#else ++ *m = ld->ld_matched; ++#endif ++ } ++ ++ return lderrno; ++} ++#endif ++ ++#ifndef HAVE_LDAP_SET_LDERRNO ++int ++ldap_set_lderrno (LDAP * ld, int lderrno, const char *m, const char *s) ++{ ++#ifdef HAVE_LDAP_SET_OPTION ++ int rc; ++#endif ++ ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_ERROR_NUMBER) ++ if ((rc = ldap_set_option (ld, LDAP_OPT_ERROR_NUMBER, &lderrno)) != LDAP_SUCCESS) ++ return rc; ++#else ++ ld->ld_errno = lderrno; ++#endif ++ ++ if (s != NULL) { ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_ERROR_STRING) ++ if ((rc = ldap_set_option (ld, LDAP_OPT_ERROR_STRING, s)) != LDAP_SUCCESS) ++ return rc; ++#else ++ ld->ld_error = s; ++#endif ++ } ++ ++ if (m != NULL) { ++#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_MATCHED_DN) ++ if ((rc = ldap_set_option (ld, LDAP_OPT_MATCHED_DN, m)) != LDAP_SUCCESS) ++ return rc; ++#else ++ ld->ld_matched = m; ++#endif ++ } ++ ++ return LDAP_SUCCESS; ++} ++#endif ++ +diff --git a/openssh-6.2p2/ldapmisc.h b/openssh-6.2p2/ldapmisc.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ldapmisc.h +@@ -0,0 +1,35 @@ ++/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ ++/* ++ * Copyright (c) 2009 Jan F. Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LDAPMISC_H ++#define LDAPMISC_H ++ ++#include "ldapincludes.h" ++ ++int ldap_get_lderrno (LDAP *, char **, char **); ++int ldap_set_lderrno (LDAP *, int, const char *, const char *); ++ ++#endif /* LDAPMISC_H */ ++ +diff --git a/openssh-6.2p2/openbsd-compat/base64.c b/openssh-6.2p2/openbsd-compat/base64.c +--- a/openssh-6.2p2/openbsd-compat/base64.c ++++ b/openssh-6.2p2/openbsd-compat/base64.c +@@ -41,17 +41,17 @@ + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN + * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + + /* OPENBSD ORIGINAL: lib/libc/net/base64.c */ + + #include "includes.h" + +-#if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON)) ++#if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON)) || defined(USE_INTERNAL_B64) + + #include + #include + #include + #include + #include + + #include +@@ -124,17 +124,17 @@ static const char Pad64 = '='; + (2) the final quantum of encoding input is exactly 8 bits; + here, the final unit of encoded output will be two + characters followed by two "=" padding characters, or + (3) the final quantum of encoding input is exactly 16 bits; + here, the final unit of encoded output will be three + characters followed by one "=" padding character. + */ + +-#if !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP) ++#if !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP) || defined(USE_INTERNAL_B64) + int + b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) + { + size_t datalength = 0; + u_char input[3]; + u_char output[4]; + u_int i; + +@@ -180,17 +180,17 @@ b64_ntop(u_char const *src, size_t srcle + } + if (datalength >= targsize) + return (-1); + target[datalength] = '\0'; /* Returned value doesn't count \0. */ + return (datalength); + } + #endif /* !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP) */ + +-#if !defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON) ++#if !defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON) || defined(USE_INTERNAL_B64) + + /* skips all whitespace anywhere. + converts characters, four at a time, starting at (or after) + src from base - 64 numbers into three 8 bit bytes in the target area. + it returns the number of data bytes stored at the target, or -1 on error. + */ + + int +diff --git a/openssh-6.2p2/openbsd-compat/base64.h b/openssh-6.2p2/openbsd-compat/base64.h +--- a/openssh-6.2p2/openbsd-compat/base64.h ++++ b/openssh-6.2p2/openbsd-compat/base64.h +@@ -42,24 +42,24 @@ + * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + + #ifndef _BSD_BASE64_H + #define _BSD_BASE64_H + + #include "includes.h" + +-#ifndef HAVE___B64_NTOP +-# ifndef HAVE_B64_NTOP ++#if !defined(HAVE___B64_NTOP) || defined(USE_INTERNAL_B64) ++# if !defined(HAVE_B64_NTOP) || defined(USE_INTERNAL_B64) + int b64_ntop(u_char const *src, size_t srclength, char *target, + size_t targsize); + # endif /* !HAVE_B64_NTOP */ + # define __b64_ntop(a,b,c,d) b64_ntop(a,b,c,d) + #endif /* HAVE___B64_NTOP */ + +-#ifndef HAVE___B64_PTON +-# ifndef HAVE_B64_PTON ++#if !defined(HAVE___B64_PTON) || defined(USE_INTERNAL_B64) ++# if !defined(HAVE_B64_PTON) || defined(USE_INTERNAL_B64) + int b64_pton(char const *src, u_char *target, size_t targsize); + # endif /* !HAVE_B64_PTON */ + # define __b64_pton(a,b,c) b64_pton(a,b,c) + #endif /* HAVE___B64_PTON */ + + #endif /* _BSD_BASE64_H */ +diff --git a/openssh-6.2p2/openssh-lpk-openldap.schema b/openssh-6.2p2/openssh-lpk-openldap.schema +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/openssh-lpk-openldap.schema +@@ -0,0 +1,21 @@ ++# ++# LDAP Public Key Patch schema for use with openssh-ldappubkey ++# useful with PKA-LDAP also ++# ++# Author: Eric AUGE ++# ++# Based on the proposal of : Mark Ruijter ++# ++ ++ ++# octetString SYNTAX ++attributetype ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' ++ DESC 'MANDATORY: OpenSSH Public key' ++ EQUALITY octetStringMatch ++ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) ++ ++# printableString SYNTAX yes|no ++objectclass ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY ++ DESC 'MANDATORY: OpenSSH LPK objectclass' ++ MUST ( sshPublicKey $ uid ) ++ ) +diff --git a/openssh-6.2p2/openssh-lpk-sun.schema b/openssh-6.2p2/openssh-lpk-sun.schema +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/openssh-lpk-sun.schema +@@ -0,0 +1,23 @@ ++# ++# LDAP Public Key Patch schema for use with openssh-ldappubkey ++# useful with PKA-LDAP also ++# ++# Author: Eric AUGE ++# ++# Schema for Sun Directory Server. ++# Based on the original schema, modified by Stefan Fischer. ++# ++ ++dn: cn=schema ++ ++# octetString SYNTAX ++attributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' ++ DESC 'MANDATORY: OpenSSH Public key' ++ EQUALITY octetStringMatch ++ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) ++ ++# printableString SYNTAX yes|no ++objectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY ++ DESC 'MANDATORY: OpenSSH LPK objectclass' ++ MUST ( sshPublicKey $ uid ) ++ ) +diff --git a/openssh-6.2p2/ssh-ldap-helper.8 b/openssh-6.2p2/ssh-ldap-helper.8 +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ssh-ldap-helper.8 +@@ -0,0 +1,79 @@ ++.\" $OpenBSD: ssh-ldap-helper.8,v 1.1 2010/02/10 23:20:38 markus Exp $ ++.\" ++.\" Copyright (c) 2010 Jan F. Chadima. All rights reserved. ++.\" ++.\" Permission to use, copy, modify, and distribute this software for any ++.\" purpose with or without fee is hereby granted, provided that the above ++.\" copyright notice and this permission notice appear in all copies. ++.\" ++.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++.\" ++.Dd $Mdocdate: April 29 2010 $ ++.Dt SSH-LDAP-HELPER 8 ++.Os ++.Sh NAME ++.Nm ssh-ldap-helper ++.Nd sshd helper program for ldap support ++.Sh SYNOPSIS ++.Nm ssh-ldap-helper ++.Op Fl devw ++.Op Fl f Ar file ++.Op Fl s Ar user ++.Sh DESCRIPTION ++.Nm ++is used by ++.Xr sshd 1 ++to access keys provided by an LDAP. ++.Nm ++is disabled by default and can only be enabled in the ++sshd configuration file ++.Pa /etc/ssh/sshd_config ++by setting ++.Cm AuthorizedKeysCommand ++to ++.Dq @LIBEXECDIR@/ssh-ldap-wrapper . ++.Pp ++.Nm ++is not intended to be invoked by the user, but from ++.Xr sshd 8 via ++.Xr ssh-ldap-wrapper . ++.Pp ++The options are as follows: ++.Bl -tag -width Ds ++.It Fl d ++Set the debug mode; ++.Nm ++prints all logs to stderr instead of syslog. ++.It Fl e ++Implies \-w; ++.Nm ++halts if it encounters an unknown item in the ldap.conf file. ++.It Fl f ++.Nm ++uses this file as the ldap configuration file instead of /etc/ssh/ldap.conf (default). ++.It Fl s ++.Nm ++prints out the user's keys to stdout and exits. ++.It Fl v ++Implies \-d; ++increases verbosity. ++.It Fl w ++.Nm ++writes warnings about unknown items in the ldap.conf configuration file. ++.El ++.Sh SEE ALSO ++.Xr sshd 8 , ++.Xr sshd_config 5 , ++.Xr ssh-ldap.conf 5 , ++.Sh HISTORY ++.Nm ++first appeared in ++OpenSSH 5.5 + PKA-LDAP . ++.Sh AUTHORS ++.An Jan F. Chadima Aq jchadima@redhat.com +diff --git a/openssh-6.2p2/ssh-ldap-wrapper b/openssh-6.2p2/ssh-ldap-wrapper +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ssh-ldap-wrapper +@@ -0,0 +1,4 @@ ++#!/bin/sh ++ ++exec @LIBEXECDIR@/ssh-ldap-helper -s "$1" ++ +diff --git a/openssh-6.2p2/ssh-ldap.conf.5 b/openssh-6.2p2/ssh-ldap.conf.5 +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/ssh-ldap.conf.5 +@@ -0,0 +1,376 @@ ++.\" $OpenBSD: ssh-ldap.conf.5,v 1.1 2010/02/10 23:20:38 markus Exp $ ++.\" ++.\" Copyright (c) 2010 Jan F. Chadima. All rights reserved. ++.\" ++.\" Permission to use, copy, modify, and distribute this software for any ++.\" purpose with or without fee is hereby granted, provided that the above ++.\" copyright notice and this permission notice appear in all copies. ++.\" ++.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++.\" ++.Dd $Mdocdate: may 12 2010 $ ++.Dt SSH-LDAP.CONF 5 ++.Os ++.Sh NAME ++.Nm ssh-ldap.conf ++.Nd configuration file for ssh-ldap-helper ++.Sh SYNOPSIS ++.Nm /etc/ssh/ldap.conf ++.Sh DESCRIPTION ++.Xr ssh-ldap-helper 8 ++reads configuration data from ++.Pa /etc/ssh/ldap.conf ++(or the file specified with ++.Fl f ++on the command line). ++The file contains keyword-argument pairs, one per line. ++Lines starting with ++.Ql # ++and empty lines are interpreted as comments. ++.Pp ++The value starts with the first non-blank character after ++the keyword's name, and terminates at the end of the line, ++or at the last sequence of blanks before the end of the line. ++Quoting values that contain blanks ++may be incorrect, as the quotes would become part of the value. ++The possible keywords and their meanings are as follows (note that ++keywords are case-insensitive, and arguments, on a case by case basis, may be case-sensitive). ++.Bl -tag -width Ds ++.It Cm URI ++The argument(s) are in the form ++.Pa ldap[si]://[name[:port]] ++and specify the URI(s) of an LDAP server(s) to which the ++.Xr ssh-ldap-helper 8 ++should connect. The URI scheme may be any of ++.Dq ldap , ++.Dq ldaps ++or ++.Dq ldapi , ++which refer to LDAP over TCP, LDAP over SSL (TLS) and LDAP ++over IPC (UNIX domain sockets), respectively. ++Each server's name can be specified as a ++domain-style name or an IP address literal. Optionally, the ++server's name can followed by a ':' and the port number the LDAP ++server is listening on. If no port number is provided, the default ++port for the scheme is used (389 for ldap://, 636 for ldaps://). ++For LDAP over IPC, name is the name of the socket, and no port ++is required, nor allowed; note that directory separators must be ++URL-encoded, like any other characters that are special to URLs; ++A space separated list of URIs may be provided. ++There is no default. ++.It Cm Base ++Specifies the default base Distinguished Name (DN) to use when performing ldap operations. ++The base must be specified as a DN in LDAP format. ++There is no default. ++.It Cm BindDN ++Specifies the default BIND DN to use when connecting to the ldap server. ++The bind DN must be specified as a Distinguished Name in LDAP format. ++There is no default. ++.It Cm BindPW ++Specifies the default password to use when connecting to the ldap server via ++.Cm BindDN . ++There is no default. ++.It Cm RootBindDN ++Intentionaly does nothing. Recognized for compatibility reasons. ++.It Cm Host ++The argument(s) specifies the name(s) of an LDAP server(s) to which the ++.Xr ssh-ldap-helper 8 ++should connect. Each server's name can be specified as a ++domain-style name or an IP address and optionally followed by a ':' and ++the port number the ldap server is listening on. A space-separated ++list of hosts may be provided. ++There is no default. ++.Cm Host ++is deprecated in favor of ++.Cm URI . ++.It Cm Port ++Specifies the default port used when connecting to LDAP servers(s). ++The port may be specified as a number. ++The default port is 389 for ldap:// or 636 for ldaps:// respectively. ++.Cm Port ++is deprecated in favor of ++.Cm URI . ++.It Cm Scope ++Specifies the starting point of an LDAP search and the depth from the base DN to which the search should descend. ++There are three options (values) that can be assigned to the ++.Cm Scope parameter: ++.Dq base , ++.Dq one ++and ++.Dq subtree . ++Alias for the subtree is ++.Dq sub . ++The value ++.Dq base ++is used to indicate searching only the entry at the base DN, resulting in only that entry being returned (keeping in mind that it also has to meet the search filter criteria!). ++The value ++.Dq one ++is used to indicate searching all entries one level under the base DN, but not including the base DN and not including any entries under that one level under the base DN. ++The value ++.Dq subtree ++is used to indicate searching of all entries at all levels under and including the specified base DN. ++The default is ++.Dq subtree . ++.It Cm Deref ++Specifies how alias dereferencing is done when performing a search. There are four ++possible values that can be assigned to the ++.Cm Deref ++parameter: ++.Dq never , ++.Dq searching , ++.Dq finding , ++and ++.Dq always . ++The value ++.Dq never ++means that the aliases are never dereferenced. ++The value ++.Dq searching ++means that the aliases are dereferenced in subordinates of the base object, but ++not in locating the base object of the search. ++The value ++.Dq finding ++means that the aliases are only dereferenced when locating the base object of the search. ++The value ++.Dq always ++means that the aliases are dereferenced both in searching and in locating the base object ++of the search. ++The default is ++.Dq never . ++.It Cm TimeLimit ++Specifies a time limit (in seconds) to use when performing searches. ++The number should be a non-negative integer. A ++.Cm TimeLimit ++of zero (0) specifies that the search time is unlimited. Please note that the server ++may still apply any server-side limit on the duration of a search operation. ++The default value is 10. ++.It Cm TimeOut ++Is an aliast to ++.Cm TimeLimit . ++.It Cm Bind_TimeLimit ++Specifies the timeout (in seconds) after which the poll(2)/select(2) ++following a connect(2) returns in case of no activity. ++The default value is 10. ++.It Cm Network_TimeOut ++Is an alias to ++.Cm Bind_TimeLimit . ++.It Cm Ldap_Version ++Specifies what version of the LDAP protocol should be used. ++The allowed values are 2 or 3. The default is 3. ++.It Cm Version ++Is an alias to ++.Cm Ldap_Version . ++.It Cm Bind_Policy ++Specifies the policy to use for reconnecting to an unavailable LDAP server. There are 2 available values: ++.Dq hard ++and ++.Dq soft. ++.Dq hard has 2 aliases ++.Dq hard_open ++and ++.Dq hard_init . ++The value ++.Dq hard ++means that reconects that the ++.Xr ssh-ldap-helper 8 ++tries to reconnect to the LDAP server 5 times before failure. There is exponential backoff before retrying. ++The value ++.Dq soft ++means that ++.Xr ssh-ldap-helper 8 ++fails immediately when it cannot connect to the LDAP seerver. ++The deault is ++.Dq hard . ++.It Cm SSLPath ++Specifies the path to the X.509 certificate database. ++There is no default. ++.It Cm SSL ++Specifies whether to use SSL/TLS or not. ++There are three allowed values: ++.Dq yes , ++.Dq no ++and ++.Dq start_tls ++Both ++.Dq true ++and ++.Dq on ++are the aliases for ++.Dq yes . ++.Dq false ++and ++.Dq off ++are the aliases for ++.Dq no . ++If ++.Dq start_tls ++is specified then StartTLS is used rather than raw LDAP over SSL. ++The default for ldap:// is ++.Dq start_tls , ++for ldaps:// ++.Dq yes ++and ++.Dq no ++for the ldapi:// . ++In case of host based configuration the default is ++.Dq start_tls . ++.It Cm Referrals ++Specifies if the client should automatically follow referrals returned ++by LDAP servers. ++The value can be or ++.Dq yes ++or ++.Dq no . ++.Dq true ++and ++.Dq on ++are the aliases for ++.Dq yes . ++.Dq false ++and ++.Dq off ++are the aliases for ++.Dq no . ++The default is yes. ++.It Cm Restart ++Specifies whether the LDAP client library should restart the select(2) system call when interrupted. ++The value can be or ++.Dq yes ++or ++.Dq no . ++.Dq true ++and ++.Dq on ++are the aliases for ++.Dq yes . ++.Dq false ++and ++.Dq off ++are the aliases for ++.Dq no . ++The default is yes. ++.It Cm TLS_CheckPeer ++Specifies what checks to perform on server certificates in a TLS session, ++if any. The value ++can be specified as one of the following keywords: ++.Dq never , ++.Dq hard , ++.Dq demand , ++.Dq allow ++and ++.Dq try . ++.Dq true , ++.Dq on ++and ++.Dq yes ++are aliases for ++.Dq hard . ++.Dq false , ++.Dq off ++and ++.Dq no ++are the aliases for ++.Dq never . ++The value ++.Dq never ++means that the client will not request or check any server certificate. ++The value ++.Dq allow ++means that the server certificate is requested. If no certificate is provided, ++the session proceeds normally. If a bad certificate is provided, it will ++be ignored and the session proceeds normally. ++The value ++.Dq try ++means that the server certificate is requested. If no certificate is provided, ++the session proceeds normally. If a bad certificate is provided, ++the session is immediately terminated. ++The value ++.Dq demand ++means that the server certificate is requested. If no ++certificate is provided, or a bad certificate is provided, the session ++is immediately terminated. ++The value ++.Dq hard ++is the same as ++.Dq demand . ++It requires an SSL connection. In the case of the plain conection the ++session is immediately terminated. ++The default is ++.Dq hard . ++.It Cm TLS_ReqCert ++Is an alias for ++.Cm TLS_CheckPeer . ++.It Cm TLS_CACertFile ++Specifies the file that contains certificates for all of the Certificate ++Authorities the client will recognize. ++There is no default. ++.It Cm TLS_CACert ++Is an alias for ++.Cm TLS_CACertFile . ++.It Cm TLS_CACertDIR ++Specifies the path of a directory that contains Certificate Authority ++certificates in separate individual files. The ++.Cm TLS_CACert ++is always used before ++.Cm TLS_CACertDir . ++The specified directory must be managed with the OpenSSL c_rehash utility. ++There is no default. ++.It Cm TLS_Ciphers ++Specifies acceptable cipher suite and preference order. ++The value should be a cipher specification for OpenSSL, ++e.g., ++.Dq HIGH:MEDIUM:+SSLv2 . ++The default is ++.Dq ALL . ++.It Cm TLS_Cipher_Suite ++Is an alias for ++.Cm TLS_Ciphers . ++.It Cm TLS_Cert ++Specifies the file that contains the client certificate. ++There is no default. ++.It Cm TLS_Certificate ++Is an alias for ++.Cm TLS_Cert . ++.It Cm TLS_Key ++Specifies the file that contains the private key that matches the certificate ++stored in the ++.Cm TLS_Cert ++file. Currently, the private key must not be protected with a password, so ++it is of critical importance that the key file is protected carefully. ++There is no default. ++.It Cm TLS_RandFile ++Specifies the file to obtain random bits from when /dev/[u]random is ++not available. Generally set to the name of the EGD/PRNGD socket. ++The environment variable RANDFILE can also be used to specify the filename. ++There is no default. ++.It Cm LogDir ++Specifies the directory used for logging by the LDAP client library. ++There is no default. ++.It Cm Debug ++Specifies the debug level used for logging by the LDAP client library. ++There is no default. ++.It Cm SSH_Filter ++Specifies the user filter applied on the LDAP serch. ++The default is no filter. ++.El ++.Sh FILES ++.Bl -tag -width Ds ++.It Pa /etc/ssh/ldap.conf ++Ldap configuration file for ++.Xr ssh-ldap-helper 8 . ++.El ++.Sh "SEE ALSO" ++.Xr ldap.conf 5 , ++.Xr ssh-ldap-helper 8 ++.Sh HISTORY ++.Nm ++first appeared in ++OpenSSH 5.5 + PKA-LDAP . ++.Sh AUTHORS ++.An Jan F. Chadima Aq jchadima@redhat.com diff --git a/openssh-6.2p2-login_options.patch b/openssh-6.2p2-login_options.patch new file mode 100644 index 0000000..1c0005c --- /dev/null +++ b/openssh-6.2p2-login_options.patch @@ -0,0 +1,28 @@ +# login-pam cannot handle the option terminator "--" as login from util-linux +# (this is correct behaviour considering its man-page), hence use option which +# selects the compile-time branch in the code which doesn't use the terminator +# +# bnc#833605 + +diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac +--- a/openssh-6.2p2/configure.ac ++++ b/openssh-6.2p2/configure.ac +@@ -666,16 +666,18 @@ main() { if (NSVersionOfRunTimeLibrary(" + AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) + AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) + AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) + ;; + *-*-linux*) + no_dev_ptmx=1 + check_for_libcrypt_later=1 + check_for_openpty_ctty_bug=1 ++ AC_DEFINE([LOGIN_NO_ENDOPT], [1], ++ [Define if your login program cannot handle end of options ("--")]) + AC_DEFINE([PAM_TTY_KLUDGE], [1], + [Work around problematic Linux PAM modules handling of PAM_TTY]) + AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], + [String used in /etc/passwd to denote locked account]) + AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) + AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], + [Define to whatever link() returns for "not supported" + if it doesn't return EOPNOTSUPP.]) diff --git a/openssh-6.2p2-no_fork-no_pid_file.patch b/openssh-6.2p2-no_fork-no_pid_file.patch new file mode 100644 index 0000000..13df9b1 --- /dev/null +++ b/openssh-6.2p2-no_fork-no_pid_file.patch @@ -0,0 +1,24 @@ +# Do not write a PID file when not daemonizing (e.g. when running from systemd) + +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -1911,17 +1911,17 @@ main(int ac, char **av) + signal(SIGCHLD, main_sigchld_handler); + signal(SIGTERM, sigterm_handler); + signal(SIGQUIT, sigterm_handler); + + /* + * Write out the pid file after the sigterm handler + * is setup and the listen sockets are bound + */ +- if (!debug_flag) { ++ if (!(debug_flag || no_daemon_flag)) { + FILE *f = fopen(options.pid_file, "w"); + + if (f == NULL) { + error("Couldn't create pid file \"%s\": %s", + options.pid_file, strerror(errno)); + } else { + fprintf(f, "%ld\n", (long) getpid()); + fclose(f); diff --git a/openssh-6.2p2-pam-check-locks.patch b/openssh-6.2p2-pam-check-locks.patch new file mode 100644 index 0000000..3c1bf00 --- /dev/null +++ b/openssh-6.2p2-pam-check-locks.patch @@ -0,0 +1,226 @@ +# new option UsePAMCheckLocks to enforce checking for locked accounts while +# UsePAM is used +# bnc#708678, FATE#312033 + +diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c +--- a/openssh-6.2p2/auth.c ++++ b/openssh-6.2p2/auth.c +@@ -102,17 +102,17 @@ allowed_user(struct passwd * pw) + struct spwd *spw = NULL; + #endif + + /* Shouldn't be called if pw is NULL, but better safe than sorry... */ + if (!pw || !pw->pw_name) + return 0; + + #ifdef USE_SHADOW +- if (!options.use_pam) ++ if (!options.use_pam || options.use_pam_check_locks) + spw = getspnam(pw->pw_name); + #ifdef HAS_SHADOW_EXPIRE + if (!options.use_pam && spw != NULL && auth_shadow_acctexpired(spw)) + return 0; + #endif /* HAS_SHADOW_EXPIRE */ + #endif /* USE_SHADOW */ + + /* grab passwd field for locked account check */ +@@ -122,17 +122,17 @@ allowed_user(struct passwd * pw) + #ifdef USE_LIBIAF + passwd = get_iaf_password(pw); + #else + passwd = spw->sp_pwdp; + #endif /* USE_LIBIAF */ + #endif + + /* check for locked account */ +- if (!options.use_pam && passwd && *passwd) { ++ if ((!options.use_pam || options.use_pam_check_locks) && passwd && *passwd) { + int locked = 0; + + #ifdef LOCKED_PASSWD_STRING + if (strcmp(passwd, LOCKED_PASSWD_STRING) == 0) + locked = 1; + #endif + #ifdef LOCKED_PASSWD_PREFIX + if (strncmp(passwd, LOCKED_PASSWD_PREFIX, +diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c +--- a/openssh-6.2p2/servconf.c ++++ b/openssh-6.2p2/servconf.c +@@ -62,16 +62,17 @@ extern Buffer cfg; + + void + initialize_server_options(ServerOptions *options) + { + memset(options, 0, sizeof(*options)); + + /* Portable-specific options */ + options->use_pam = -1; ++ options->use_pam_check_locks = -1; + + /* Standard Options */ + options->num_ports = 0; + options->ports_from_cmdline = 0; + options->listen_addrs = NULL; + options->address_family = -1; + options->num_host_key_files = 0; + options->num_host_cert_files = 0; +@@ -150,16 +151,18 @@ initialize_server_options(ServerOptions + } + + void + fill_default_server_options(ServerOptions *options) + { + /* Portable-specific options */ + if (options->use_pam == -1) + options->use_pam = 0; ++ if (options->use_pam_check_locks == -1) ++ options->use_pam_check_locks = 0; + + /* Standard Options */ + if (options->protocol == SSH_PROTO_UNKNOWN) + options->protocol = SSH_PROTO_2; + if (options->num_host_key_files == 0) { + /* fill default hostkeys for protocols */ + if (options->protocol & SSH_PROTO_1) + options->host_key_files[options->num_host_key_files++] = +@@ -304,17 +307,17 @@ fill_default_server_options(ServerOption + #endif + + } + + /* Keyword tokens. */ + typedef enum { + sBadOption, /* == unknown option */ + /* Portable-specific options */ +- sUsePAM, ++ sUsePAM, sUsePAMChecklocks, + /* Standard Options */ + sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, + sPermitRootLogin, sLogFacility, sLogLevel, + sRhostsRSAAuthentication, sRSAAuthentication, + sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup, + sKerberosGetAFSToken, + sKerberosTgtPassing, sChallengeResponseAuthentication, + sPasswordAuthentication, sKbdInteractiveAuthentication, +@@ -349,18 +352,20 @@ typedef enum { + static struct { + const char *name; + ServerOpCodes opcode; + u_int flags; + } keywords[] = { + /* Portable-specific options */ + #ifdef USE_PAM + { "usepam", sUsePAM, SSHCFG_GLOBAL }, ++ { "usepamchecklocks", sUsePAMChecklocks, SSHCFG_GLOBAL }, + #else + { "usepam", sUnsupported, SSHCFG_GLOBAL }, ++ { "usepamchecklocks", sUnsupported, SSHCFG_GLOBAL }, + #endif + { "pamauthenticationviakbdint", sDeprecated, SSHCFG_GLOBAL }, + /* Standard Options */ + { "port", sPort, SSHCFG_GLOBAL }, + { "hostkey", sHostKeyFile, SSHCFG_GLOBAL }, + { "hostdsakey", sHostKeyFile, SSHCFG_GLOBAL }, /* alias */ + { "pidfile", sPidFile, SSHCFG_GLOBAL }, + { "serverkeybits", sServerKeyBits, SSHCFG_GLOBAL }, +@@ -844,16 +849,19 @@ process_server_config_line(ServerOptions + } + } + + switch (opcode) { + /* Portable-specific options */ + case sUsePAM: + intptr = &options->use_pam; + goto parse_flag; ++ case sUsePAMChecklocks: ++ intptr = &options->use_pam_check_locks; ++ goto parse_flag; + + /* Standard Options */ + case sBadOption: + return -1; + case sPort: + /* ignore ports from configfile if cmdline specifies ports */ + if (options->ports_from_cmdline) + return 0; +diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h +--- a/openssh-6.2p2/servconf.h ++++ b/openssh-6.2p2/servconf.h +@@ -160,16 +160,17 @@ typedef struct { + */ + + u_int num_authkeys_files; /* Files containing public keys */ + char *authorized_keys_files[MAX_AUTHKEYS_FILES]; + + char *adm_forced_command; + + int use_pam; /* Enable auth via PAM */ ++ int use_pam_check_locks; /* internally check for locked accounts even when using PAM */ + + int permit_tun; + + int num_permitted_opens; + + char *chroot_directory; + char *revoked_keys_file; + char *trusted_user_ca_keys; +diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 +--- a/openssh-6.2p2/sshd_config.0 ++++ b/openssh-6.2p2/sshd_config.0 +@@ -673,16 +673,24 @@ DESCRIPTION + + Because PAM challenge-response authentication usually serves an + equivalent role to password authentication, you should disable + either PasswordAuthentication or ChallengeResponseAuthentication. + + If UsePAM is enabled, you will not be able to run sshd(8) as a + non-root user. The default is ``no''. + ++ UsePAMCheckLocks ++ When set to ``yes'', the checks whether the account has been ++ locked with `passwd -l' are performed even when PAM authentication ++ is enabled via UsePAM. This is to ensure that it is not possible ++ to log in with e.g. a public key (in such a case PAM is used only ++ to set up the session and some PAM modules will not check whether ++ the account is locked in this scenario). The default is ``no''. ++ + UsePrivilegeSeparation + Specifies whether sshd(8) separates privileges by creating an + unprivileged child process to deal with incoming network traffic. + After successful authentication, another process will be created + that has the privilege of the authenticated user. The goal of + privilege separation is to prevent privilege escalation by + containing any corruption within the unprivileged processes. The + default is ``yes''. If UsePrivilegeSeparation is set to +diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 +--- a/openssh-6.2p2/sshd_config.5 ++++ b/openssh-6.2p2/sshd_config.5 +@@ -1141,16 +1141,28 @@ or + .Pp + If + .Cm UsePAM + is enabled, you will not be able to run + .Xr sshd 8 + as a non-root user. + The default is + .Dq no . ++.It Cm UsePAMCheckLocks ++When set to ++.Dq yes ++, the checks whether the account has been locked with ++.Pa passwd -l ++are performed even when PAM authentication is enabled via ++.Cm UsePAM . ++This is to ensure that it is not possible to log in with e.g. a ++public key (in such a case PAM is used only to set up the session and some PAM ++modules will not check whether the account is locked in this scenario). The ++default is ++.Dq no . + .It Cm UsePrivilegeSeparation + Specifies whether + .Xr sshd 8 + separates privileges by creating an unprivileged child process + to deal with incoming network traffic. + After successful authentication, another process will be created that has + the privilege of the authenticated user. + The goal of privilege separation is to prevent privilege diff --git a/openssh-6.2p2-pam-fix2.patch b/openssh-6.2p2-pam-fix2.patch new file mode 100644 index 0000000..bcb5b6c --- /dev/null +++ b/openssh-6.2p2-pam-fix2.patch @@ -0,0 +1,44 @@ +# force PAM in defaullt install (this was removed from upstream in 3.8p1) +# bnc#46749 + +diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config +--- a/openssh-6.2p2/sshd_config ++++ b/openssh-6.2p2/sshd_config +@@ -60,17 +60,17 @@ AuthorizedKeysFile .ssh/authorized_keys + #HostbasedAuthentication no + # Change to yes if you don't trust ~/.ssh/known_hosts for + # RhostsRSAAuthentication and HostbasedAuthentication + #IgnoreUserKnownHosts no + # Don't read the user's ~/.rhosts and ~/.shosts files + #IgnoreRhosts yes + + # To disable tunneled clear text passwords, change to no here! +-#PasswordAuthentication yes ++PasswordAuthentication no + #PermitEmptyPasswords no + + # Change to no to disable s/key passwords + #ChallengeResponseAuthentication yes + + # Kerberos options + #KerberosAuthentication no + #KerberosOrLocalPasswd yes +@@ -85,17 +85,17 @@ AuthorizedKeysFile .ssh/authorized_keys + # and session processing. If this is enabled, PAM authentication will + # be allowed through the ChallengeResponseAuthentication and + # PasswordAuthentication. Depending on your PAM configuration, + # PAM authentication via ChallengeResponseAuthentication may bypass + # the setting of "PermitRootLogin without-password". + # If you just want the PAM account and session checks to run without + # PAM authentication, then enable this but set PasswordAuthentication + # and ChallengeResponseAuthentication to 'no'. +-#UsePAM no ++UsePAM yes + + #AllowAgentForwarding yes + #AllowTcpForwarding yes + #GatewayPorts no + X11Forwarding yes + #X11DisplayOffset 10 + #X11UseLocalhost yes + #PrintMotd yes diff --git a/openssh-6.2p2-pam-fix3.patch b/openssh-6.2p2-pam-fix3.patch new file mode 100644 index 0000000..59ff8ad --- /dev/null +++ b/openssh-6.2p2-pam-fix3.patch @@ -0,0 +1,26 @@ +# posix threads are generally not supported nor safe +# (see upstream log from 2005-05-24) + +diff --git a/openssh-6.2p2/auth-pam.c b/openssh-6.2p2/auth-pam.c +--- a/openssh-6.2p2/auth-pam.c ++++ b/openssh-6.2p2/auth-pam.c +@@ -781,17 +781,19 @@ sshpam_query(void *ctx, char **name, cha + } + if (type == PAM_SUCCESS) { + if (!sshpam_authctxt->valid || + (sshpam_authctxt->pw->pw_uid == 0 && + options.permit_root_login != PERMIT_YES)) + fatal("Internal error: PAM auth " + "succeeded when it should have " + "failed"); ++#ifndef UNSUPPORTED_POSIX_THREADS_HACK + import_environments(&buffer); ++#endif + *num = 0; + **echo_on = 0; + ctxt->pam_done = 1; + xfree(msg); + return (0); + } + error("PAM: %s for %s%.100s from %.100s", msg, + sshpam_authctxt->valid ? "" : "illegal user ", diff --git a/openssh-6.2p2-pts.patch b/openssh-6.2p2-pts.patch new file mode 100644 index 0000000..eb4573b --- /dev/null +++ b/openssh-6.2p2-pts.patch @@ -0,0 +1,46 @@ +# use same lines naming as utempter (prevents problems with using different +# formats in ?tmp? files) + +diff --git a/openssh-6.2p2/loginrec.c b/openssh-6.2p2/loginrec.c +--- a/openssh-6.2p2/loginrec.c ++++ b/openssh-6.2p2/loginrec.c +@@ -535,17 +535,17 @@ getlast_entry(struct logininfo *li) + /* + * 'line' string utility functions + * + * These functions process the 'line' string into one of three forms: + * + * 1. The full filename (including '/dev') + * 2. The stripped name (excluding '/dev') + * 3. The abbreviated name (e.g. /dev/ttyp00 -> yp00 +- * /dev/pts/1 -> ts/1 ) ++ * /dev/pts/1 -> /1 ) + * + * Form 3 is used on some systems to identify a .tmp.? entry when + * attempting to remove it. Typically both addition and removal is + * performed by one application - say, sshd - so as long as the choice + * uniquely identifies a terminal it's ok. + */ + + +@@ -596,16 +596,20 @@ line_abbrevname(char *dst, const char *s + /* Always skip prefix if present */ + if (strncmp(src, "/dev/", 5) == 0) + src += 5; + + #ifdef WITH_ABBREV_NO_TTY + if (strncmp(src, "tty", 3) == 0) + src += 3; + #endif ++ if (strncmp(src, "pts/", 4) == 0) { ++ src += 3; ++ if (strlen(src) > 4) src++; ++ } + + len = strlen(src); + + if (len > 0) { + if (((int)len - dstsize) > 0) + src += ((int)len - dstsize); + + /* note: _don't_ change this to strlcpy */ diff --git a/openssh-6.2p2-saveargv-fix.patch b/openssh-6.2p2-saveargv-fix.patch new file mode 100644 index 0000000..44133d0 --- /dev/null +++ b/openssh-6.2p2-saveargv-fix.patch @@ -0,0 +1,46 @@ +# related to bnc#49845, upstream bug #529 + +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -303,16 +303,17 @@ sighup_handler(int sig) + + /* + * Called from the main program after receiving SIGHUP. + * Restarts the server. + */ + static void + sighup_restart(void) + { ++ int i; + logit("Received SIGHUP; restarting."); + close_listen_socks(); + close_startup_pipes(); + alarm(0); /* alarm timer persists across exec */ + signal(SIGHUP, SIG_IGN); /* will be restored after exec */ + execv(saved_argv[0], saved_argv); + logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], + strerror(errno)); +@@ -1355,17 +1356,21 @@ main(int ac, char **av) + saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); + for (i = 0; i < ac; i++) + saved_argv[i] = xstrdup(av[i]); + saved_argv[i] = NULL; + + #ifndef HAVE_SETPROCTITLE + /* Prepare for later setproctitle emulation */ + compat_init_setproctitle(ac, av); +- av = saved_argv; ++ ++ av = xmalloc(sizeof(*saved_argv) * (saved_argc + 1)); ++ for (i = 0; i < saved_argc; i++) ++ av[i] = xstrdup(saved_argv[i]); ++ av[i] = NULL; + #endif + + if (geteuid() == 0 && setgroups(0, NULL) == -1) + debug("setgroups(): %.200s", strerror(errno)); + + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ + sanitise_stdfd(); + diff --git a/openssh-6.2p2-seed-prng.patch b/openssh-6.2p2-seed-prng.patch new file mode 100644 index 0000000..5ecfd5a --- /dev/null +++ b/openssh-6.2p2-seed-prng.patch @@ -0,0 +1,542 @@ +# extended support for (re-)seeding the OpenSSL PRNG from /dev/random +# bnc#703221, FATE#312172 + +diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c +--- a/openssh-6.2p2/audit-bsm.c ++++ b/openssh-6.2p2/audit-bsm.c +@@ -504,9 +504,15 @@ audit_destroy_sensitive_data(const char + /* not implemented */ + } + + void + audit_generate_ephemeral_server_key(const char *fp) + { + /* not implemented */ + } ++ ++void ++audit_linux_prng_seed(long bytes, const char *rf) ++{ ++ /* not implemented */ ++} + #endif /* BSM */ +diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +--- a/openssh-6.2p2/audit-linux.c ++++ b/openssh-6.2p2/audit-linux.c +@@ -398,9 +398,31 @@ audit_generate_ephemeral_server_key(cons + } + audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, + buf, NULL, 0, NULL, 1); + audit_close(audit_fd); + /* do not abort if the error is EPERM and sshd is run as non root user */ + if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) + error("cannot write into audit"); + } ++ ++void ++audit_linux_prng_seed(long bytes, const char *rf) ++{ ++ char buf[AUDIT_LOG_SIZE]; ++ int audit_fd, audit_ok; ++ ++ snprintf(buf, sizeof(buf), "op=prng_seed kind=server bytes=%li source=%s ", bytes, rf); ++ audit_fd = audit_open(); ++ if (audit_fd < 0) { ++ if (errno != EINVAL && errno != EPROTONOSUPPORT && ++ errno != EAFNOSUPPORT) ++ error("cannot open audit"); ++ return; ++ } ++ audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_PARAM_CHANGE_USER, ++ buf, NULL, 0, NULL, 1); ++ audit_close(audit_fd); ++ /* do not abort if the error is EPERM and sshd is run as non root user */ ++ if ((audit_ok < 0) && ((audit_ok != -1) || (getuid() == 0))) ++ error("cannot write into audit"); ++} + #endif /* USE_LINUX_AUDIT */ +diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +--- a/openssh-6.2p2/audit.c ++++ b/openssh-6.2p2/audit.c +@@ -304,10 +304,16 @@ audit_destroy_sensitive_data(const char + /* + * This will be called on generation of the ephemeral server key + */ + void + audit_generate_ephemeral_server_key(const char *) + { + debug("audit create ephemeral server key euid %d fingerprint %s", geteuid(), fp); + } ++ ++void ++audit_linux_prng_seed(long bytes, const char *rf) ++{ ++ debug("audit PRNG seed euid %d bytes %li source %s", geteuid(), bytes, rf); ++} + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ + #endif /* SSH_AUDIT_EVENTS */ +diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +--- a/openssh-6.2p2/audit.h ++++ b/openssh-6.2p2/audit.h +@@ -63,10 +63,11 @@ void audit_key(int, int *, const Key *); + void audit_unsupported(int); + void audit_kex(int, char *, char *, char *); + void audit_unsupported_body(int); + void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); + void audit_session_key_free(int ctos); + void audit_session_key_free_body(int ctos, pid_t, uid_t); + void audit_destroy_sensitive_data(const char *, pid_t, uid_t); + void audit_generate_ephemeral_server_key(const char *); ++void audit_linux_prng_seed(long, const char *); + + #endif /* _SSH_AUDIT_H */ +diff --git a/openssh-6.2p2/entropy.c b/openssh-6.2p2/entropy.c +--- a/openssh-6.2p2/entropy.c ++++ b/openssh-6.2p2/entropy.c +@@ -45,16 +45,17 @@ + + #include "ssh.h" + #include "misc.h" + #include "xmalloc.h" + #include "atomicio.h" + #include "pathnames.h" + #include "log.h" + #include "buffer.h" ++#include "openbsd-compat/port-linux.h" + + /* + * Portable OpenSSH PRNG seeding: + * If OpenSSL has not "internally seeded" itself (e.g. pulled data from + * /dev/random), then collect RANDOM_SEED_SIZE bytes of randomness from + * PRNGd. + */ + #ifndef OPENSSL_PRNG_ONLY +@@ -229,11 +230,14 @@ seed_rng(void) + } + + if (seed_from_prngd(buf, sizeof(buf)) == -1) + fatal("Could not obtain seed from PRNGd"); + RAND_add(buf, sizeof(buf), sizeof(buf)); + memset(buf, '\0', sizeof(buf)); + + #endif /* OPENSSL_PRNG_ONLY */ ++ ++ linux_seed(); ++ + if (RAND_status() != 1) + fatal("PRNG is not seeded"); + } +diff --git a/openssh-6.2p2/openbsd-compat/Makefile.in b/openssh-6.2p2/openbsd-compat/Makefile.in +--- a/openssh-6.2p2/openbsd-compat/Makefile.in ++++ b/openssh-6.2p2/openbsd-compat/Makefile.in +@@ -15,17 +15,17 @@ AR=@AR@ + RANLIB=@RANLIB@ + INSTALL=@INSTALL@ + LDFLAGS=-L. @LDFLAGS@ + + OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o + + COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o + +-PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o ++PORTS=port-aix.o port-irix.o port-linux.o port-linux-prng.o port-solaris.o port-tun.o port-uw.o + + .c.o: + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + + all: libopenbsd-compat.a + + $(COMPAT): ../config.h + $(OPENBSD): ../config.h +diff --git a/openssh-6.2p2/openbsd-compat/port-linux-prng.c b/openssh-6.2p2/openbsd-compat/port-linux-prng.c +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/openbsd-compat/port-linux-prng.c +@@ -0,0 +1,79 @@ ++/* ++ * Copyright (c) 2011 Jan F. Chadima ++ * (c) 2011 Petr Cerny ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++/* ++ * Linux-specific portability code - prng support ++ */ ++ ++#include "includes.h" ++#include "defines.h" ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "log.h" ++#include "port-linux.h" ++#include "audit.h" ++ ++#define RNG_BYTES_DEFAULT 6L ++#define RNG_ENV_VAR "SSH_USE_STRONG_RNG" ++ ++long rand_bytes = 0; ++char *rand_file = NULL; ++ ++static void ++linux_seed_init(void) ++{ ++ long elen = 0; ++ char *env = getenv(RNG_ENV_VAR); ++ ++ if (env) { ++ errno = 0; ++ elen = strtol(env, NULL, 10); ++ if (errno) { ++ debug("bogus value in the %s environment variable, using default %li\n", ++ RNG_ENV_VAR, RNG_BYTES_DEFAULT); ++ } ++ } ++ ++ if (elen) ++ rand_file = "/dev/random"; ++ else ++ rand_file = "/dev/urandom"; ++ ++ rand_bytes = MAX(elen, RNG_BYTES_DEFAULT); ++} ++ ++void ++linux_seed(void) ++{ ++ long len; ++ if (!rand_file) ++ linux_seed_init(); ++ ++ errno = 0; ++ len = RAND_load_file(rand_file, rand_bytes); ++ if (len != rand_bytes) { ++ if (errno) ++ fatal ("cannot read from %s, %s", random, strerror(errno)); ++ else ++ fatal ("EOF reading %s", random); ++ } ++} +diff --git a/openssh-6.2p2/openbsd-compat/port-linux.h b/openssh-6.2p2/openbsd-compat/port-linux.h +--- a/openssh-6.2p2/openbsd-compat/port-linux.h ++++ b/openssh-6.2p2/openbsd-compat/port-linux.h +@@ -14,16 +14,20 @@ + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + + #ifndef _PORT_LINUX_H + #define _PORT_LINUX_H + ++extern long rand_bytes; ++extern char *rand_file; ++void linux_seed(void); ++ + #ifdef WITH_SELINUX + int ssh_selinux_enabled(void); + void ssh_selinux_setup_pty(char *, const char *); + void ssh_selinux_setup_exec_context(char *); + void ssh_selinux_change_context(const char *); + void ssh_selinux_setfscreatecon(const char *); + #endif + +diff --git a/openssh-6.2p2/ssh-add.1 b/openssh-6.2p2/ssh-add.1 +--- a/openssh-6.2p2/ssh-add.1 ++++ b/openssh-6.2p2/ssh-add.1 +@@ -155,16 +155,30 @@ or related script. + (Note that on some machines it + may be necessary to redirect the input from + .Pa /dev/null + to make this work.) + .It Ev SSH_AUTH_SOCK + Identifies the path of a + .Ux Ns -domain + socket used to communicate with the agent. ++.It Ev SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .El + .Sh FILES + .Bl -tag -width Ds + .It Pa ~/.ssh/identity + Contains the protocol version 1 RSA authentication identity of the user. + .It Pa ~/.ssh/id_dsa + Contains the protocol version 2 DSA authentication identity of the user. + .It Pa ~/.ssh/id_ecdsa +diff --git a/openssh-6.2p2/ssh-agent.1 b/openssh-6.2p2/ssh-agent.1 +--- a/openssh-6.2p2/ssh-agent.1 ++++ b/openssh-6.2p2/ssh-agent.1 +@@ -193,16 +193,33 @@ Contains the protocol version 2 ECDSA au + .It Pa ~/.ssh/id_rsa + Contains the protocol version 2 RSA authentication identity of the user. + .It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.\*(Ltppid\*(Gt + .Ux Ns -domain + sockets used to contain the connection to the authentication agent. + These sockets should only be readable by the owner. + The sockets should get automatically removed when the agent exits. + .El ++.Sh ENVIRONMENT ++.Bl -tag -width Ds -compact ++.Pp ++.It Pa SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .Sh SEE ALSO + .Xr ssh 1 , + .Xr ssh-add 1 , + .Xr ssh-keygen 1 , + .Xr sshd 8 + .Sh AUTHORS + OpenSSH is a derivative of the original and free + ssh 1.2.12 release by Tatu Ylonen. +diff --git a/openssh-6.2p2/ssh-keygen.1 b/openssh-6.2p2/ssh-keygen.1 +--- a/openssh-6.2p2/ssh-keygen.1 ++++ b/openssh-6.2p2/ssh-keygen.1 +@@ -801,16 +801,33 @@ on all machines + where the user wishes to log in using public key authentication. + There is no need to keep the contents of this file secret. + .Pp + .It Pa /etc/moduli + Contains Diffie-Hellman groups used for DH-GEX. + The file format is described in + .Xr moduli 5 . + .El ++.Sh ENVIRONMENT ++.Bl -tag -width Ds -compact ++.Pp ++.It Pa SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .Sh SEE ALSO + .Xr ssh 1 , + .Xr ssh-add 1 , + .Xr ssh-agent 1 , + .Xr moduli 5 , + .Xr sshd 8 + .Rs + .%R RFC 4716 +diff --git a/openssh-6.2p2/ssh-keysign.8 b/openssh-6.2p2/ssh-keysign.8 +--- a/openssh-6.2p2/ssh-keysign.8 ++++ b/openssh-6.2p2/ssh-keysign.8 +@@ -73,16 +73,33 @@ Since they are readable only by root, + must be set-uid root if host-based authentication is used. + .Pp + .It Pa /etc/ssh/ssh_host_dsa_key-cert.pub + .It Pa /etc/ssh/ssh_host_ecdsa_key-cert.pub + .It Pa /etc/ssh/ssh_host_rsa_key-cert.pub + If these files exist they are assumed to contain public certificate + information corresponding with the private keys above. + .El ++.Sh ENVIRONMENT ++.Bl -tag -width Ds -compact ++.Pp ++.It Pa SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .Sh SEE ALSO + .Xr ssh 1 , + .Xr ssh-keygen 1 , + .Xr ssh_config 5 , + .Xr sshd 8 + .Sh HISTORY + .Nm + first appeared in +diff --git a/openssh-6.2p2/ssh.1 b/openssh-6.2p2/ssh.1 +--- a/openssh-6.2p2/ssh.1 ++++ b/openssh-6.2p2/ssh.1 +@@ -1272,16 +1272,30 @@ reads + and adds lines of the format + .Dq VARNAME=value + to the environment if the file exists and users are allowed to + change their environment. + For more information, see the + .Cm PermitUserEnvironment + option in + .Xr sshd_config 5 . ++.It Ev SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .Sh FILES + .Bl -tag -width Ds -compact + .It Pa ~/.rhosts + This file is used for host-based authentication (see above). + On some machines this file may need to be + world-readable if the user's home directory is on an NFS partition, + because + .Xr sshd 8 +diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 +--- a/openssh-6.2p2/sshd.8 ++++ b/openssh-6.2p2/sshd.8 +@@ -940,16 +940,33 @@ and not group or world-writable. + .It Pa /var/run/sshd.pid + Contains the process ID of the + .Nm + listening for connections (if there are several daemons running + concurrently for different ports, this contains the process ID of the one + started last). + The content of this file is not sensitive; it can be world-readable. + .El ++.Sh ENVIRONMENT ++.Bl -tag -width Ds -compact ++.Pp ++.It Pa SSH_USE_STRONG_RNG ++The reseeding of the OpenSSL random generator is usually done from ++.Cm /dev/urandom . ++If the ++.Cm SSH_USE_STRONG_RNG ++environment variable is set to value other than ++.Cm 0 ++the OpenSSL random generator is reseeded from ++.Cm /dev/random . ++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. ++Minimum is 6 bytes. ++This setting is not recommended on the computers without the hardware ++random generator because insufficient entropy causes the connection to ++be blocked until enough entropy is available. + .Sh SEE ALSO + .Xr scp 1 , + .Xr sftp 1 , + .Xr ssh 1 , + .Xr ssh-add 1 , + .Xr ssh-agent 1 , + .Xr ssh-keygen 1 , + .Xr ssh-keyscan 1 , +diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c +--- a/openssh-6.2p2/sshd.c ++++ b/openssh-6.2p2/sshd.c +@@ -50,16 +50,18 @@ + #ifdef HAVE_SYS_STAT_H + # include + #endif + #ifdef HAVE_SYS_TIME_H + # include + #endif + #include "openbsd-compat/sys-tree.h" + #include "openbsd-compat/sys-queue.h" ++#include "openbsd-compat/port-linux.h" ++ + #include + + #include + #include + #include + #ifdef HAVE_PATHS_H + #include + #endif +@@ -209,16 +211,23 @@ struct { + Key **host_keys; /* all private host keys */ + Key **host_certificates; /* all public host certificates */ + int have_ssh1_key; + int have_ssh2_key; + u_char ssh1_cookie[SSH_SESSION_KEY_LENGTH]; + } sensitive_data; + + /* ++ * Every RESEED_AFTERth connection triggers call to linux_seed() to re-seed the ++ * random pool. ++ */ ++#define RESEED_AFTER 100 ++static int re_seeding_counter = RESEED_AFTER; ++ ++/* + * Flag indicating whether the RSA server key needs to be regenerated. + * Is set in the SIGALRM handler and cleared when the key is regenerated. + */ + static volatile sig_atomic_t key_do_regen = 0; + + /* This is set to true when a signal is received. */ + static volatile sig_atomic_t received_sighup = 0; + static volatile sig_atomic_t received_sigterm = 0; +@@ -1275,16 +1284,21 @@ server_accept_loop(int *sock_in, int *so + for (j = 0; j < options.max_startups; j++) + if (startup_pipes[j] == -1) { + startup_pipes[j] = startup_p[0]; + if (maxfd < startup_p[0]) + maxfd = startup_p[0]; + startups++; + break; + } ++ if(!(--re_seeding_counter)) { ++ re_seeding_counter = RESEED_AFTER; ++ linux_seed(); ++ audit_linux_prng_seed(rand_bytes, rand_file); ++ } + + /* + * Got connection. Fork a child to handle it, unless + * we are in debugging mode. + */ + if (debug_flag) { + /* + * In debugging mode. Close the listening diff --git a/openssh-5.9p1-send_locale.diff b/openssh-6.2p2-send_locale.patch similarity index 52% rename from openssh-5.9p1-send_locale.diff rename to openssh-6.2p2-send_locale.patch index 615fe4b..65dc913 100644 --- a/openssh-5.9p1-send_locale.diff +++ b/openssh-6.2p2-send_locale.patch @@ -1,23 +1,32 @@ -Index: ssh_config -=================================================================== ---- ssh_config.orig -+++ ssh_config -@@ -63,6 +63,9 @@ ForwardX11Trusted yes +# send locales in default configuration +# bnc#65747 + +diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +--- a/openssh-6.2p2/ssh_config ++++ b/openssh-6.2p2/ssh_config +@@ -58,8 +58,13 @@ ForwardX11Trusted yes + # ProxyCommand ssh -q -W %h:%p gateway.example.com + + # Set this to 'yes' to enable support for the deprecated 'gssapi' authentication + # mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included + # in this release. The use of 'gssapi' is deprecated due to the presence of # potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. # GSSAPIEnableMITMAttack no -->>>>>>> +# This enables sending locale enviroment variables LC_* LANG, see ssh_config(5). +SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES +SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT +SendEnv LC_IDENTIFICATION LC_ALL - # VisualHostKey no - # ProxyCommand ssh -q -W %h:%p gateway.example.com -Index: sshd_config -=================================================================== ---- sshd_config.orig -+++ sshd_config -@@ -117,6 +117,11 @@ X11Forwarding yes ++ +diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config +--- a/openssh-6.2p2/sshd_config ++++ b/openssh-6.2p2/sshd_config +@@ -122,13 +122,18 @@ UsePrivilegeSeparation sandbox # Defaul + #VersionAddendum none + + # no default banner path + #Banner none + # override default of no subsystems Subsystem sftp /usr/libexec/sftp-server @@ -29,3 +38,5 @@ Index: sshd_config # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no + # AllowTcpForwarding no + # ForceCommand cvs server diff --git a/openssh-5.9p1-homechroot.patch b/openssh-6.2p2-sftp_homechroot.patch similarity index 55% rename from openssh-5.9p1-homechroot.patch rename to openssh-6.2p2-sftp_homechroot.patch index b0457a1..c1afabc 100644 --- a/openssh-5.9p1-homechroot.patch +++ b/openssh-6.2p2-sftp_homechroot.patch @@ -1,45 +1,14 @@ -Index: chrootenv.h -=================================================================== ---- /dev/null -+++ chrootenv.h -@@ -0,0 +1,32 @@ -+/* $OpenBSD: session.h,v 1.30 2008/05/08 12:21:16 djm Exp $ */ -+ -+/* -+ * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+#ifndef CHROOTENV_H -+#define CHROOTENV_H -+ -+extern int chroot_no_tree; -+ -+#endif -+ -Index: session.c -=================================================================== ---- session.c.orig -+++ session.c -@@ -120,6 +120,8 @@ void do_child(Session *, const char *); +# run sftp sessions inside a chroot + +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -119,16 +119,18 @@ int do_exec(Session *, const char *); + void do_login(Session *, const char *); + #ifdef LOGIN_NEEDS_UTMPX + static void do_pre_login(Session *s); + #endif + void do_child(Session *, const char *); void do_motd(void); int check_quietlogin(Session *, const char *); @@ -48,7 +17,17 @@ Index: session.c static void do_authenticated1(Authctxt *); static void do_authenticated2(Authctxt *); -@@ -808,6 +810,11 @@ do_exec(Session *s, const char *command) + static int session_pty_req(Session *); + + /* import */ + extern ServerOptions options; + extern char *__progname; +@@ -818,16 +820,21 @@ do_exec(Session *s, const char *command) + if (IS_INTERNAL_SFTP(command)) { + s->is_subsystem = s->is_subsystem ? + SUBSYSTEM_INT_SFTP : SUBSYSTEM_INT_SFTP_ERROR; + } else if (s->is_subsystem) + s->is_subsystem = SUBSYSTEM_EXT; debug("Forced command (key option) '%.900s'", command); } @@ -58,9 +37,19 @@ Index: session.c + } + #ifdef SSH_AUDIT_EVENTS + if (s->command != NULL || s->command_handle != -1) + fatal("do_exec: command already set"); if (command != NULL) - PRIVSEP(audit_run_command(command)); -@@ -1421,6 +1428,63 @@ do_nologin(struct passwd *pw) + s->command = xstrdup(command); + else if (s->ttyfd == -1) { + char *shell = s->pw->pw_shell; + +@@ -1435,67 +1442,132 @@ do_nologin(struct passwd *pw) + while (fgets(buf, sizeof(buf), f)) + fputs(buf, stderr); + fclose(f); + } + exit(254); } /* @@ -85,7 +74,7 @@ Index: session.c + strerror (errno)); + if (!s) { + pclose (f); -+ fatal ("cannot found filesystem with the chroot directory"); ++ fatal ("cannot find filesystem with the chroot directory"); + } + (void) strtok (buf, " "); + on = strtok (NULL, " "); @@ -116,7 +105,7 @@ Index: session.c + return; + } + } -+ fatal ("chroot into directory without nodev or nosuid"); ++ fatal ("chroot into directory without nodev and either noexec or nosuid"); + } +} + @@ -124,7 +113,9 @@ Index: session.c * Chroot into a directory after checking it for safety: all path components * must be root-owned directories with strict permissions. */ -@@ -1430,6 +1494,7 @@ safely_chroot(const char *path, uid_t ui + static void + safely_chroot(const char *path, uid_t uid) + { const char *cp; char component[MAXPATHLEN]; struct stat st; @@ -132,7 +123,11 @@ Index: session.c if (*path != '/') fatal("chroot path does not begin at root"); -@@ -1441,7 +1506,7 @@ safely_chroot(const char *path, uid_t ui + if (strlen(path) >= sizeof(component)) + fatal("chroot path too long"); + + /* + * Descend the path, checking that each component is a * root-owned directory with strict permissions. */ for (cp = path; cp != NULL;) { @@ -141,7 +136,12 @@ Index: session.c strlcpy(component, path, sizeof(component)); else { cp++; -@@ -1454,14 +1519,20 @@ safely_chroot(const char *path, uid_t ui + memcpy(component, path, cp - path); + component[cp - path] = '\0'; + } + + debug3("%s: checking '%s'", __func__, component); + if (stat(component, &st) != 0) fatal("%s: stat(\"%s\"): %s", __func__, component, strerror(errno)); @@ -155,51 +155,92 @@ Index: session.c cp == NULL ? "" : "component ", component); + } + setenv ("TZ", "/etc/localtime", 0); -+ tzset (); ++ tzset(); + if (st.st_uid) { -+ test_nosuid (path, st.st_dev); ++ test_nosuid(path, st.st_dev); + ++chroot_no_tree; } if (chdir(path) == -1) -@@ -1472,6 +1543,10 @@ safely_chroot(const char *path, uid_t ui + fatal("Unable to chdir to chroot path \"%s\": " + "%s", path, strerror(errno)); + if (chroot(path) == -1) + fatal("chroot(\"%s\"): %s", path, strerror(errno)); if (chdir("/") == -1) fatal("%s: chdir(/) after chroot: %s", __func__, strerror(errno)); -+ -+ if (access ("/etc/localtime", R_OK) < 0) -+ ++chroot_no_tree; + verbose("Changed root directory to \"%s\"", path); } -Index: sftp.c -=================================================================== ---- sftp.c.orig -+++ sftp.c -@@ -106,6 +106,8 @@ int remote_glob(struct sftp_conn *, cons - - extern char *__progname; - -+int chroot_no_tree = 0; + /* Set login name, uid, gid, and groups. */ + void + do_setusercontext(struct passwd *pw) + { + char *chroot_path, *tmp; +diff --git a/openssh-6.2p2/sftp-chrootenv.h b/openssh-6.2p2/sftp-chrootenv.h +new file mode 100644 +--- /dev/null ++++ b/openssh-6.2p2/sftp-chrootenv.h +@@ -0,0 +1,30 @@ ++/* ++ * Copyright (c) 2009 Jan F Chadima. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++#ifndef CHROOTENV_H ++#define CHROOTENV_H + - /* Separators for interactive commands */ - #define WHITESPACE " \t\r\n" ++extern int chroot_no_tree; ++ ++#endif ++ +diff --git a/openssh-6.2p2/sftp-common.c b/openssh-6.2p2/sftp-common.c +--- a/openssh-6.2p2/sftp-common.c ++++ b/openssh-6.2p2/sftp-common.c +@@ -41,16 +41,17 @@ + #endif -Index: sftp-common.c -=================================================================== ---- sftp-common.c.orig -+++ sftp-common.c -@@ -43,6 +43,7 @@ #include "xmalloc.h" #include "buffer.h" #include "log.h" -+#include "chrootenv.h" #include "sftp.h" #include "sftp-common.h" -@@ -196,13 +197,13 @@ ls_file(const char *name, const struct s ++#include "sftp-chrootenv.h" + + /* Clear contents of attributes structure */ + void + attrib_clear(Attrib *a) + { + a->flags = 0; + a->size = 0; + a->uid = 0; +@@ -191,23 +192,23 @@ ls_file(const char *name, const struct s + { + int ulen, glen, sz = 0; + struct tm *ltime = localtime(&st->st_mtime); + char *user, *group; + char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char sbuf[FMT_SCALED_STRSIZE]; strmode(st->st_mode, mode); @@ -215,11 +256,20 @@ Index: sftp-common.c group = group_from_gid(st->st_gid, 0); } else { snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid); -Index: sftp-server-main.c -=================================================================== ---- sftp-server-main.c.orig -+++ sftp-server-main.c -@@ -22,11 +22,14 @@ + group = gbuf; + } + if (ltime != NULL) { + if (time(NULL) - st->st_mtime < (365*24*60*60)/2) + sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime); +diff --git a/openssh-6.2p2/sftp-server-main.c b/openssh-6.2p2/sftp-server-main.c +--- a/openssh-6.2p2/sftp-server-main.c ++++ b/openssh-6.2p2/sftp-server-main.c +@@ -17,21 +17,24 @@ + + #include "includes.h" + + #include + #include #include #include #include @@ -229,16 +279,47 @@ Index: sftp-server-main.c #include "sftp.h" #include "misc.h" -+int chroot_no_tree = 0; ++int chroot_no_tree = 0; + void cleanup_exit(int i) { -Index: sshd_config.0 -=================================================================== ---- sshd_config.0.orig -+++ sshd_config.0 -@@ -143,6 +143,14 @@ DESCRIPTION + sftp_server_cleanup_exit(i); + } + + int + main(int argc, char **argv) +diff --git a/openssh-6.2p2/sftp.c b/openssh-6.2p2/sftp.c +--- a/openssh-6.2p2/sftp.c ++++ b/openssh-6.2p2/sftp.c +@@ -97,16 +97,18 @@ struct complete_ctx { + char **remote_pathp; + }; + + int remote_glob(struct sftp_conn *, const char *, int, + int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ + + extern char *__progname; + ++int chroot_no_tree = 0; ++ + /* Separators for interactive commands */ + #define WHITESPACE " \t\r\n" + + /* ls flags */ + #define LS_LONG_VIEW 0x0001 /* Full view ala ls -l */ + #define LS_SHORT_VIEW 0x0002 /* Single row view ala ls -1 */ + #define LS_NUMERIC_VIEW 0x0004 /* Long view with numeric uid/gid */ + #define LS_NAME_SORT 0x0008 /* Sort by name (default) */ +diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 +--- a/openssh-6.2p2/sshd_config.0 ++++ b/openssh-6.2p2/sshd_config.0 +@@ -181,16 +181,24 @@ DESCRIPTION + session this requires at least a shell, typically sh(1), and + basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), + stderr(4), arandom(4) and tty(4) devices. For file transfer + sessions using ``sftp'', no additional configuration of the + environment is necessary if the in-process sftp server is used, though sessions which use logging do require /dev/log inside the chroot directory (see sftp-server(8) for details). @@ -253,11 +334,20 @@ Index: sshd_config.0 The default is not to chroot(2). Ciphers -Index: sshd_config.5 -=================================================================== ---- sshd_config.5.orig -+++ sshd_config.5 -@@ -268,6 +268,17 @@ inside the chroot directory (see + Specifies the ciphers allowed for protocol version 2. Multiple + ciphers must be comma-separated. The supported ciphers are + ``3des-cbc'', ``aes128-cbc'', ``aes192-cbc'', ``aes256-cbc'', + ``aes128-ctr'', ``aes192-ctr'', ``aes256-ctr'', + ``aes128-gcm@openssh.com'', ``aes256-gcm@openssh.com'', +diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 +--- a/openssh-6.2p2/sshd_config.5 ++++ b/openssh-6.2p2/sshd_config.5 +@@ -317,16 +317,27 @@ For file transfer sessions using + no additional configuration of the environment is necessary if the + in-process sftp server is used, + though sessions which use logging do require + .Pa /dev/log + inside the chroot directory (see .Xr sftp-server 8 for details). .Pp @@ -275,3 +365,8 @@ Index: sshd_config.5 The default is not to .Xr chroot 2 . .It Cm Ciphers + Specifies the ciphers allowed for protocol version 2. + Multiple ciphers must be comma-separated. + The supported ciphers are + .Dq 3des-cbc , + .Dq aes128-cbc , diff --git a/openssh-5.9p1-xauth.diff b/openssh-6.2p2-xauth.patch similarity index 64% rename from openssh-5.9p1-xauth.diff rename to openssh-6.2p2-xauth.patch index bb4c5c6..35dbb82 100644 --- a/openssh-5.9p1-xauth.diff +++ b/openssh-6.2p2-xauth.patch @@ -1,8 +1,15 @@ -Index: session.c -=================================================================== ---- session.c.orig -+++ session.c -@@ -2463,8 +2463,40 @@ void +# try to remove xauth cookies on logout +# bnc#98815 + +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -2473,18 +2473,50 @@ session_exit_message(Session *s, int sta + if (c->ostate != CHAN_OUTPUT_CLOSED) + chan_write_failed(c); + } + + void session_close(Session *s) { u_int i; @@ -10,7 +17,7 @@ Index: session.c debug("session_close: session %d pid %ld", s->self, (long)s->pid); + -+ do_xauth = s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; ++ do_xauth = (s->display != NULL) && (s->auth_proto != NULL) && (s->auth_data != NULL); + if (do_xauth && options.xauth_location != NULL) { + pid_t pid; + FILE *f; @@ -43,3 +50,8 @@ Index: session.c if (s->ttyfd != -1) session_pty_cleanup(s); if (s->term) + xfree(s->term); + if (s->display) + xfree(s->display); + if (s->x11_chanids) + xfree(s->x11_chanids); diff --git a/openssh-6.2p2-xauthlocalhostname.patch b/openssh-6.2p2-xauthlocalhostname.patch new file mode 100644 index 0000000..8412af7 --- /dev/null +++ b/openssh-6.2p2-xauthlocalhostname.patch @@ -0,0 +1,141 @@ +# handle hostname changes when forwarding X +# bnc#98627 + +diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +--- a/openssh-6.2p2/session.c ++++ b/openssh-6.2p2/session.c +@@ -1118,17 +1118,17 @@ copy_environment(char **source, char *** + debug3("Copy environment: %s=%s", var_name, var_val); + child_set_env(env, envsize, var_name, var_val); + + xfree(var_name); + } + } + + static char ** +-do_setup_env(Session *s, const char *shell) ++do_setup_env(Session *s, const char *shell, int *env_size) + { + char buf[256]; + u_int i, envsize; + char **env, *laddr; + struct passwd *pw = s->pw; + #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) + char *path = NULL; + #endif +@@ -1305,25 +1305,27 @@ do_setup_env(Session *s, const char *she + read_environment_file(&env, &envsize, buf); + } + if (debug_flag) { + /* dump the environment */ + fprintf(stderr, "Environment:\n"); + for (i = 0; env[i]; i++) + fprintf(stderr, " %.200s\n", env[i]); + } ++ ++ *env_size = envsize; + return env; + } + + /* + * Run $HOME/.ssh/rc, /etc/ssh/sshrc, or xauth (whichever is found + * first in this order). + */ + static void +-do_rc_files(Session *s, const char *shell) ++do_rc_files(Session *s, const char *shell, char **env, int *env_size) + { + FILE *f = NULL; + char cmd[1024]; + int do_xauth; + struct stat st; + + do_xauth = + s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; +@@ -1367,22 +1369,30 @@ do_rc_files(Session *s, const char *shel + "%.500s add %.100s %.100s %.100s\n", + options.xauth_location, s->auth_display, + s->auth_proto, s->auth_data); + } + snprintf(cmd, sizeof cmd, "%s -q -", + options.xauth_location); + f = popen(cmd, "w"); + if (f) { ++ char hostname[MAXHOSTNAMELEN]; ++ + fprintf(f, "remove %s\n", + s->auth_display); + fprintf(f, "add %s %s %s\n", + s->auth_display, s->auth_proto, + s->auth_data); + pclose(f); ++ if (gethostname(hostname,sizeof(hostname)) >= 0) ++ child_set_env(&env,env_size,"XAUTHLOCALHOSTNAME", ++ hostname); ++ else ++ debug("Cannot set up XAUTHLOCALHOSTNAME %s\n", ++ strerror(errno)); + } else { + fprintf(stderr, "Could not run %s\n", + cmd); + } + } + } + + static void +@@ -1618,16 +1628,17 @@ child_close_fds(void) + * ids, and executing the command or shell. + */ + #define ARGV_MAX 10 + void + do_child(Session *s, const char *command) + { + extern char **environ; + char **env; ++ int env_size; + char *argv[ARGV_MAX]; + const char *shell, *shell0, *hostname = NULL; + struct passwd *pw = s->pw; + int r = 0; + + /* remove hostkey from the child's memory */ + destroy_sensitive_data(); + +@@ -1684,17 +1695,17 @@ do_child(Session *s, const char *command + * legal, and means /bin/sh. + */ + shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; + + /* + * Make sure $SHELL points to the shell from the password file, + * even if shell is overridden from login.conf + */ +- env = do_setup_env(s, shell); ++ env = do_setup_env(s, shell, &env_size); + + #ifdef HAVE_LOGIN_CAP + shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); + #endif + + /* we have to stash the hostname before we close our socket. */ + if (options.use_login) + hostname = get_remote_name_or_ip(utmp_len, +@@ -1753,17 +1764,17 @@ do_child(Session *s, const char *command + strerror(errno)); + if (r) + exit(1); + } + + closefrom(STDERR_FILENO + 1); + + if (!options.use_login) +- do_rc_files(s, shell); ++ do_rc_files(s, shell, env, &env_size); + + /* restore SIGPIPE for child */ + signal(SIGPIPE, SIG_DFL); + + if (s->is_subsystem == SUBSYSTEM_INT_SFTP_ERROR) { + printf("This service allows sftp connections only.\n"); + fflush(NULL); + exit(1); diff --git a/openssh-askpass-gnome.changes b/openssh-askpass-gnome.changes index a983ec3..e7cf1bd 100644 --- a/openssh-askpass-gnome.changes +++ b/openssh-askpass-gnome.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com + +- spec file cleanup (don't pointelssly build whole OpenSSH) + ------------------------------------------------------------------- Sat Aug 3 18:12:20 UTC 2013 - crrodriguez@opensuse.org diff --git a/openssh-askpass-gnome.spec b/openssh-askpass-gnome.spec index 1559a88..aff9335 100644 --- a/openssh-askpass-gnome.spec +++ b/openssh-askpass-gnome.spec @@ -35,14 +35,6 @@ Group: Productivity/Networking/SSH Url: http://www.openssh.com/ %define _name openssh Source: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz -Patch: %{_name}-5.9p1-sshd_config.diff -Patch1: %{_name}-5.9p1-pam-fix2.diff -Patch2: %{_name}-5.9p1-saveargv-fix.diff -Patch3: %{_name}-5.9p1-pam-fix3.diff -Patch4: %{_name}-5.9p1-gssapimitm.patch -Patch5: %{_name}-5.9p1-eal3.diff -Patch6: %{_name}-5.9p1-engines.diff -Patch7: %{_name}-5.9p1-blocksigalrm.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -52,35 +44,14 @@ GNOME-based passphrase dialog for OpenSSH. %prep %setup -q -n %{_name}-%{version} -%patch -%patch1 -%patch2 -%patch3 -%patch4 -%patch5 -p1 -%patch6 -p1 -%patch7 %build -aclocal -autoheader -autoconf -%configure \ - --sysconfdir=%{_sysconfdir}/ssh \ - --libexecdir=%{_libexecdir}/ssh \ - --with-tcp-wrappers \ - --with-pam \ - --with-kerberos5=/usr \ - --with-privsep-path=/var/lib/empty \ - --disable-strip \ - --target=%{_target_cpu}-suse-linux cd contrib make %{?_smp_mflags} gnome-ssh-askpass2 -mv gnome-ssh-askpass2 gnome-ssh-askpass %install install -d -m 755 %{buildroot}%{_libexecdir}/ssh/ -install contrib/gnome-ssh-askpass %{buildroot}%{_libexecdir}/ssh/gnome-ssh-askpass +install contrib/gnome-ssh-askpass2 %{buildroot}%{_libexecdir}/ssh/gnome-ssh-askpass %files %defattr(-,root,root) diff --git a/openssh-nocrazyabicheck.patch b/openssh-nocrazyabicheck.patch deleted file mode 100644 index bd1afa4..0000000 --- a/openssh-nocrazyabicheck.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- entropy.c.orig -+++ entropy.c -@@ -216,12 +216,13 @@ seed_rng(void) - * allow 1.0.1 to work with 1.0.0). Going backwards is only allowed - * within a patch series. - */ -+#if 0 - u_long version_mask = SSLeay() >= 0x1000000f ? ~0xffff0L : ~0xff0L; - if (((SSLeay() ^ OPENSSL_VERSION_NUMBER) & version_mask) || - (SSLeay() >> 12) < (OPENSSL_VERSION_NUMBER >> 12)) - fatal("OpenSSL version mismatch. Built against %lx, you " - "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay()); -- -+#endif - #ifndef OPENSSL_PRNG_ONLY - if (RAND_status() == 1) { - debug3("RNG is ready, skipping seeding"); diff --git a/openssh-nodaemon-nopid.patch b/openssh-nodaemon-nopid.patch deleted file mode 100644 index 7d341e6..0000000 --- a/openssh-nodaemon-nopid.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sshd.c.orig -+++ sshd.c -@@ -1840,7 +1840,7 @@ main(int ac, char **av) - * Write out the pid file after the sigterm handler - * is setup and the listen sockets are bound - */ -- if (!debug_flag) { -+ if (!(debug_flag || no_daemon_flag)) { - FILE *f = fopen(options.pid_file, "w"); - - if (f == NULL) { diff --git a/openssh.changes b/openssh.changes index 699164d..d5da5cb 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com + +- spec file and patch cleanup + * removing obsoleted auditing patch + (openssh-%{version}-audit.patch) +- added patches from SLE + * GSSAPI key exchange + * FIPS enablement (currently disabled) + * small bugfixes +- split the LDAP helper into a separate package: openssh-akc-ldap + ------------------------------------------------------------------- Tue Sep 10 21:15:59 UTC 2013 - crrodriguez@opensuse.org diff --git a/openssh.spec b/openssh.spec index cc7481c..44db526 100644 --- a/openssh.spec +++ b/openssh.spec @@ -16,27 +16,79 @@ # +%if 0%{suse_version} >= 1100 +%define has_fw_dir 1 +%define needs_xorg_libs 0 +%else +%define has_fw_dir 0 +%define needs_xorg_libs 1 +%endif + +%if 0%{suse_version} >= 1110 +%define has_libselinux 1 +%else +%define has_libselinux 0 +%endif + +%if 0%{?suse_version} >= 1130 +%define needs_all_dirs 1 +%else +%define needs_all_dirs 0 +%endif + +%if 0%{?suse_version} >= 1140 +%define needs_libedit 1 +%else +%define needs_libedit 0 +%endif + +%if 0%{?suse_version} > 1140 +%define has_systemd 1 +%define has_krb_mini 1 +%else +%define has_systemd 0 +%define has_krb_mini 0 +%endif + +%define _fwdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d +%define _fwdefdir %{_fwdir}/services +%define _appdefdir %( grep "configdirspec=" $( which xmkmf ) | sed -r 's,^[^=]+=.*-I(.*)/config.*$,\\1/app-defaults,' ) +%{!?_initddir:%global _initddir %{_initrddir}} + Name: openssh -%define _fwdefdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services -%define _appdefdir %{_prefix}/share/X11/app-defaults BuildRequires: audit-devel BuildRequires: autoconf BuildRequires: groff +%if %{has_krb_mini} BuildRequires: krb5-mini-devel +%else +BuildRequires: krb5-devel +%endif +%if %{needs_libedit} BuildRequires: libedit-devel -%if 0%{suse_version} > 1100 +%endif +%if %{has_libselinux} BuildRequires: libselinux-devel %endif +BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pam-devel +%if %{has_systemd} +BuildRequires: systemd +%{?systemd_requires} +%endif BuildRequires: tcpd-devel +BuildRequires: xorg-x11-devel +%if %{needs_xorg_libs} +BuildRequires: xorg-x11-libs +%endif Requires: /bin/netstat PreReq: pwdutils %{insserv_prereq} %{fillup_prereq} coreutils Conflicts: nonfreessh Recommends: xauth +Recommends: %{name}-akc-ldap Version: 6.2p2 Release: 0 -%define xversion 1.2.4.1 Summary: Secure Shell Client and Server (Remote Login Program) License: BSD-3-Clause and MIT Group: Productivity/Networking/SSH @@ -44,43 +96,49 @@ Url: http://www.openssh.com/ Source: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz Source1: sshd.init Source2: sshd.pamd -Source4: README.SuSE -Source5: converter.tar.bz2 -Source6: README.kerberos -Source7: ssh.reg -Source8: ssh-askpass -Source9: sshd.fw -Source10: sysconfig.ssh -Source11: sshd-gen-keys-start -Source12: sshd.service -Patch: %{name}-5.9p1-sshd_config.diff -Patch2: %{name}-5.9p1-pam-fix2.diff -Patch3: %{name}-5.9p1-saveargv-fix.diff -Patch4: %{name}-5.9p1-pam-fix3.diff -Patch5: %{name}-5.9p1-gssapimitm.patch -Patch6: %{name}-5.9p1-eal3.diff -Patch7: %{name}-5.9p1-engines.diff -Patch8: %{name}-5.9p1-blocksigalrm.diff -Patch9: %{name}-5.9p1-send_locale.diff -Patch10: %{name}-5.9p1-xauthlocalhostname.diff -Patch12: %{name}-5.9p1-xauth.diff -Patch14: %{name}-5.9p1-default-protocol.diff -Patch15: %{name}-5.9p1-audit.patch -Patch16: %{name}-5.9p1-pts.diff -Patch17: %{name}-5.9p1-homechroot.patch -Patch18: %{name}-5.9p1-sshconfig-knownhostschanges.diff -Patch19: %{name}-5.9p1-host_ident.diff -Patch20: converter-linking.patch -Patch21: openssh-nocrazyabicheck.patch -Patch22: openssh-nodaemon-nopid.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} > 1140 -BuildRequires: pkgconfig(systemd) -%{?systemd_requires} -%define has_systemd 1 -%endif +Source3: README.SuSE +Source4: README.kerberos +Source5: ssh.reg +Source6: ssh-askpass +Source7: sshd.fw +Source8: sysconfig.ssh +Source9: sshd-gen-keys-start +Source10: sshd.service +Patch1: %{name}-%{version}-key-converter.patch +Patch2: %{name}-%{version}-X11-forwarding.patch +Patch3: %{name}-%{version}-lastlog.patch +Patch4: %{name}-%{version}-pam-fix2.patch +Patch5: %{name}-%{version}-saveargv-fix.patch +Patch6: %{name}-%{version}-pam-fix3.patch +Patch7: %{name}-%{version}-gssapimitm.patch +Patch8: %{name}-%{version}-eal3.patch +Patch9: %{name}-%{version}-blocksigalrm.patch +Patch10: %{name}-%{version}-send_locale.patch +Patch11: %{name}-%{version}-xauthlocalhostname.patch +Patch12: %{name}-%{version}-xauth.patch +Patch13: %{name}-%{version}-default-protocol.patch +Patch14: %{name}-%{version}-pts.patch +Patch15: %{name}-%{version}-pam-check-locks.patch +Patch16: %{name}-%{version}-fingerprint_hash.patch +Patch17: %{name}-%{version}-audit1-remove_duplicit_audit.patch +Patch18: %{name}-%{version}-audit2-better_audit_of_user_actions.patch +Patch19: %{name}-%{version}-audit3-key_auth_usage.patch +Patch20: %{name}-%{version}-audit4-kex_results.patch +Patch21: %{name}-%{version}-audit5-session_key_destruction.patch +Patch22: %{name}-%{version}-audit6-server_key_destruction.patch +Patch23: %{name}-%{version}-audit7-libaudit_compat.patch +Patch24: %{name}-%{version}-audit8-libaudit_dns_timeouts.patch +Patch25: %{name}-%{version}-seed-prng.patch +Patch26: %{name}-%{version}-ldap.patch +Patch27: %{name}-%{version}-fips.patch +Patch28: %{name}-%{version}-gssapi_key_exchange.patch +Patch29: %{name}-%{version}-login_options.patch +Patch30: %{name}-%{version}-disable-openssl-abi-check.patch +Patch31: %{name}-%{version}-no_fork-no_pid_file.patch +Patch32: %{name}-%{version}-host_ident.patch +Patch33: %{name}-%{version}-sftp_homechroot.patch -%{!?_initddir:%global _initddir %{_initrddir}} +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description SSH (Secure Shell) is a program for logging into and executing commands @@ -91,118 +149,165 @@ hosts over an insecure network. xorg-x11 (X Window System) connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. + +%package akc-ldap +Summary: OpenSSH AuthorizedKeysCommand helper for LDAP +Group: Productivity/Networking/SSH +Requires: openldap2 +Requires: openssh + +%description akc-ldap +Helper application for OpenSSH which retrieves authorized keys from +a LDAP server. + + %prep -%setup -q -a 5 -%patch -%patch2 -%patch3 -%patch4 -%patch5 -%patch6 -p1 -%patch7 -p1 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -p1 -%patch16 -%patch17 -%patch18 -%patch19 -p1 -%patch20 -%patch21 -%patch22 -cp -v %{SOURCE4} . -cp -v %{SOURCE6} . +%setup -q +%patch1 -p2 +%patch2 -p2 +%patch3 -p2 +%patch4 -p2 +%patch5 -p2 +%patch6 -p2 +%patch7 -p2 +%patch8 -p2 +%patch9 -p2 +%patch10 -p2 +%patch11 -p2 +%patch12 -p2 +%patch13 -p2 +%patch14 -p2 +%patch15 -p2 +%patch16 -p2 +%patch17 -p2 +%patch18 -p2 +%patch19 -p2 +%patch20 -p2 +%patch21 -p2 +%patch22 -p2 +%patch23 -p2 +%patch24 -p2 +%patch25 -p2 +%patch26 -p2 +#patch27 -p2 +%patch28 -p2 +%patch29 -p2 +%patch30 -p2 +%patch31 -p2 +%patch32 -p2 +%patch33 -p2 +cp %{SOURCE3} %{SOURCE4} . %build +# set libexec dir in the LDAP patch +sed -i.libexec 's,@LIBEXECDIR@,%{_libexecdir}/ssh,' \ + $( grep -Rl @LIBEXECDIR@ \ + $( grep "^+++" %{PATCH26} | sed -r 's@^.+/([^/\t ]+).*$@\1@' ) + ) + autoreconf -fiv %ifarch s390 s390x %sparc PIEFLAGS="-fPIE" %else PIEFLAGS="-fpie" %endif -export CFLAGS="%{optflags} $PIEFLAGS -fstack-protector" -export CXXFLAGS="%{optflags} $PIEFLAGS -fstack-protector" -export LDFLAGS="-pie" +CFLAGS="%{optflags} $PIEFLAGS -fstack-protector" +CXXFLAGS="%{optflags} $PIEFLAGS -fstack-protector" +LDFLAGS="-pie -Wl,--as-needed" +#CPPFLAGS="%{optflags} -DUSE_INTERNAL_B64" +export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS %configure \ -%if 0%{?has_systemd} - --with-pid-dir=/run \ -%endif - --with-ssl-engine \ -%if 0%{suse_version} >= 1140 - --with-libedit \ -%endif + --prefix=%{_prefix} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ --sysconfdir=%{_sysconfdir}/ssh \ --libexecdir=%{_libexecdir}/ssh \ --with-tcp-wrappers \ -%if 0%{suse_version} > 1100 +%if %{has_libselinux} --with-selinux \ %endif +%if %{has_systemd} + --with-pid-dir=/run \ +%endif + --with-ssl-engine \ --with-pam \ - --with-kerberos5=/usr \ + --with-kerberos5=%{_prefix} \ --with-privsep-path=/var/lib/empty \ --with-sandbox=rlimit \ +%ifnarch s390 s390x + --with-opensc \ +%endif --disable-strip \ - --with-linux-audit \ - --with-xauth=%{_prefix}/bin/xauth \ - --target=%{_target_cpu}-suse-linux -# --with-afs=/usr \ + --with-audit=linux \ + --with-ldap \ + --with-xauth=%{_bindir}/xauth \ +%if %{needs_libedit} + --with-libedit \ +%endif + --target=%{_target_cpu}-suse-linux \ + +### configure end make %{?_smp_mflags} -(cd converter; make %{?_smp_mflags}) + +make %{?_smp_mflags} -C converter %install -make DESTDIR=%{buildroot}/ install +make install DESTDIR=%{buildroot} +make install DESTDIR=%{buildroot} -C converter install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d install -d -m 755 %{buildroot}/var/lib/sshd -install -m 644 %{S:2} %{buildroot}%{_sysconfdir}/pam.d/sshd +install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sshd install -d -m 755 %{buildroot}%{_sysconfdir}/slp.reg.d/ -install -m 644 %{S:7} %{buildroot}%{_sysconfdir}/slp.reg.d/ +install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/slp.reg.d/ install -d -m 755 %{buildroot}%{_initddir} -install -m 755 %{S:1} %{buildroot}%{_initddir}/sshd +install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/sshd ln -vs ../..%{_initddir}/sshd %{buildroot}%{_sbindir}/rcsshd install -d -m 755 %{buildroot}/var/adm/fillup-templates -install -m 644 %{S:10} %{buildroot}/var/adm/fillup-templates +install -m 644 %{SOURCE8} %{buildroot}/var/adm/fillup-templates # install shell script to automate the process of adding your public key to a remote machine install -m 755 contrib/ssh-copy-id %{buildroot}%{_bindir} install -m 644 contrib/ssh-copy-id.1 %{buildroot}%{_mandir}/man1 -sed -e "s,@LIBEXEC@,%{_libexecdir},g" < %{S:8} > %{buildroot}%{_libexecdir}/ssh/ssh-askpass -( cd converter; make install DESTDIR=%{buildroot} ) -rm -f %{buildroot}%{_datadir}/Ssh.bin sed -i -e s@/usr/libexec@%{_libexecdir}@g %{buildroot}%{_sysconfdir}/ssh/sshd_config + +%if %{has_fw_dir} #install firewall definitions format is described here: #%{_datadir}/SuSEfirewall2/services/TEMPLATE mkdir -p %{buildroot}%{_fwdefdir} -install -m 644 %{S:9} %{buildroot}%{_fwdefdir}/sshd -%if 0%{?has_systemd} -install -D -m 0755 %{SOURCE11} %{buildroot}%{_sbindir}/sshd-gen-keys-start -install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/sshd.service +install -m 644 %{SOURCE7} %{buildroot}%{_fwdefdir}/sshd +%endif + +# askpass wrapper +sed -e "s,@LIBEXECDIR@,%{_libexecdir},g" < %{SOURCE6} > %{buildroot}%{_libexecdir}/ssh/ssh-askpass +rm -f %{buildroot}%{_datadir}/Ssh.bin + +%if %{has_systemd} +install -D -m 0755 %{SOURCE9} %{buildroot}%{_sbindir}/sshd-gen-keys-start +install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service %endif %pre getent group sshd >/dev/null || %{_sbindir}/groupadd -r sshd getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd -s /bin/false -c "SSH daemon" sshd -%if 0%{?has_systemd} +%if %{has_systemd} %service_add_pre sshd.service %endif %post %{fillup_and_insserv -n ssh sshd} -%if 0%{?has_systemd} +%if %{has_systemd} %service_add_post sshd.service %endif %preun %stop_on_removal sshd -%if 0%{?has_systemd} +%if %{has_systemd} %service_del_preun sshd.service %endif %postun %restart_on_update sshd %{insserv_cleanup} -%if 0%{?has_systemd} +%if %{has_systemd} %service_del_postun sshd.service %endif @@ -212,40 +317,39 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %doc README.SuSE README.kerberos ChangeLog OVERVIEW README TODO LICENCE CREDITS %attr(0755,root,root) %dir %{_sysconfdir}/ssh %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/moduli -%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config -%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config -%attr(0644,root,root) %config %{_sysconfdir}/pam.d/sshd +%verify(not mode) %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config +%verify(not mode) %attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config +%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd %attr(0755,root,root) %config %{_initddir}/sshd -%attr(0755,root,root) %{_bindir}/ssh -%{_bindir}/scp -%{_bindir}/sftp -%{_bindir}/slogin -%{_bindir}/ssh-* -%{_sbindir}/* -%attr(444,root,root) %doc %{_mandir}/man1/scp.1.gz -%attr(444,root,root) %doc %{_mandir}/man1/ssh-keygen.1.gz -%attr(444,root,root) %doc %{_mandir}/man1/ssh-keyconverter.1.gz -%attr(444,root,root) %doc %{_mandir}/man1/ssh.1.gz -%attr(444,root,root) %doc %{_mandir}/man1/slogin.1.gz -%attr(444,root,root) %doc %{_mandir}/man1/ssh-agent.1* -%attr(444,root,root) %doc %{_mandir}/man1/ssh-add.1* -%attr(444,root,root) %doc %{_mandir}/man1/ssh-keyscan.1* -%attr(444,root,root) %doc %{_mandir}/man1/sftp.1* -%attr(444,root,root) %doc %{_mandir}/man1/ssh-copy-id.1* -%attr(444,root,root) %doc %{_mandir}/man5/* -%attr(444,root,root) %doc %{_mandir}/man8/* +%attr(0755,root,root) %{_bindir}/* +%attr(0755,root,root) %{_sbindir}/* %attr(0755,root,root) %dir %{_libexecdir}/ssh -%attr(0755,root,root) %{_libexecdir}/ssh/sftp-server -%attr(0755,root,root) %{_libexecdir}/ssh/ssh-keysign -%attr(0755,root,root) %{_libexecdir}/ssh/ssh-pkcs11-helper -%attr(0755,root,root) %{_libexecdir}/ssh/ssh-askpass +%exclude %{_libexecdir}/ssh/ssh-ldap* +%attr(0755,root,root) %{_libexecdir}/ssh/* +%attr(0444,root,root) %doc %{_mandir}/man1/* +%attr(0444,root,root) %doc %{_mandir}/man5/* +%attr(0444,root,root) %doc %{_mandir}/man8/* %dir %{_sysconfdir}/slp.reg.d %config %{_sysconfdir}/slp.reg.d/ssh.reg /var/adm/fillup-templates/sysconfig.ssh -%config %{_fwdefdir}/sshd -%if 0%{?has_systemd} +%if %{has_systemd} %{_sbindir}/sshd-gen-keys-start %{_unitdir}/sshd.service %endif +%if %{has_fw_dir} +%if %{needs_all_dirs} +%dir %{_fwdir} +%dir %{_fwdefdir} +%endif +%config %{_fwdefdir}/sshd +%endif + +%files akc-ldap +%defattr(-,root,root) +%attr(0755,root,root) %dir %{_sysconfdir}/ssh +%verify(not mode) %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ldap.conf +%attr(0755,root,root) %dir %{_libexecdir}/ssh +%attr(0755,root,root) %{_libexecdir}/ssh/ssh-ldap* +%doc HOWTO.ldap-keys openssh-lpk-openldap.schema openssh-lpk-sun.schema %changelog diff --git a/ssh-askpass b/ssh-askpass index 54553c7..5d8616e 100644 --- a/ssh-askpass +++ b/ssh-askpass @@ -24,9 +24,9 @@ if [ -z "$SESSION" ] ; then fi fi -GNOME_SSH_ASKPASS="@LIBEXEC@/ssh/gnome-ssh-askpass" -KDE_SSH_ASKPASS="@LIBEXEC@/ssh/ksshaskpass" -X11_SSH_ASKPASS="@LIBEXEC@/ssh/x11-ssh-askpass" +GNOME_SSH_ASKPASS="@LIBEXECDIR@/ssh/gnome-ssh-askpass" +KDE_SSH_ASKPASS="@LIBEXECDIR@/ssh/ksshaskpass" +X11_SSH_ASKPASS="@LIBEXECDIR@/ssh/x11-ssh-askpass" case "$SESSION" in gnome) diff --git a/sshd-gen-keys-start b/sshd-gen-keys-start index ee5b24e..a4f8535 100644 --- a/sshd-gen-keys-start +++ b/sshd-gen-keys-start @@ -1,21 +1,5 @@ -#!/bin/bash - - if ! grep -q '^[[:space:]]*HostKey[[:space:]]' /etc/ssh/sshd_config; then - if ! test -f /etc/ssh/ssh_host_key ; then - echo Generating /etc/ssh/ssh_host_key. - ssh-keygen -t rsa1 -b 2048 -f /etc/ssh/ssh_host_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_dsa_key ; then - echo Generating /etc/ssh/ssh_host_dsa_key. - ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_rsa_key ; then - echo Generating /etc/ssh/ssh_host_rsa_key. - ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_ecdsa_key ; then - echo Generating /etc/ssh/ssh_host_ecdsa_key. - ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N '' - fi - fi - +#!/bin/sh +if ! grep -q '^[[:space:]]*HostKey[[:space:]]' /etc/ssh/sshd_config; then + echo "Checking for missing server keys in /etc/ssh" + ssh-keygen -A +fi diff --git a/sshd.init b/sshd.init index 7b174b2..71057ab 100644 --- a/sshd.init +++ b/sshd.init @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany. +# Copyright (c) 1995-2013 SuSE GmbH Nuernberg, Germany. # # Author: Jiri Smid # @@ -13,10 +13,10 @@ # Provides: sshd # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs +# Should-Start: haveged auditd # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start the sshd daemon -# Short-Description: Start the sshd daemon ### END INIT INFO SSHD_BIN=/usr/sbin/sshd @@ -39,48 +39,60 @@ SSHD_PIDFILE=/var/run/sshd.init.pid # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status +function soft_stop () { + echo -n "Shutting down the listening SSH daemon" + killproc -p $SSHD_PIDFILE -TERM $SSHD_BIN +} + +function force_stop () { + echo -n "Shutting down SSH daemon *with all active connections*" + trap '' TERM + killall sshd 2>/dev/null + trap - TERM +} + # First reset status of this service rc_reset case "$1" in start) - if ! grep -q '^[[:space:]]*HostKey[[:space:]]' /etc/ssh/sshd_config; then - if ! test -f /etc/ssh/ssh_host_key ; then - echo Generating /etc/ssh/ssh_host_key. - ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_dsa_key ; then - echo Generating /etc/ssh/ssh_host_dsa_key. - ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_rsa_key ; then - echo Generating /etc/ssh/ssh_host_rsa_key. - ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' - fi - if ! test -f /etc/ssh/ssh_host_ecdsa_key ; then - echo Generating /etc/ssh/ssh_host_ecdsa_key. - ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N '' - fi - fi - echo -n "Starting SSH daemon" - ## Start daemon with startproc(8). If this fails - ## the echo return value is set appropriate. + ssh-keygen -A + echo -n "Starting SSH daemon" + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + startproc -f -p $SSHD_PIDFILE $SSHD_BIN $SSHD_OPTS -o "PidFile=$SSHD_PIDFILE" - startproc -f $SSHD_BIN $SSHD_OPTS -o "PidFile=$SSHD_PIDFILE" - - # Remember status and be verbose - rc_status -v - ;; + # Remember status and be verbose + rc_status -v + ;; stop) - echo -n "Shutting down SSH daemon" - ## Stop daemon with killproc(8) and if this fails - ## set echo the echo return value. + # If we're shutting down, kill active sshd connections so they're not + # left hanging. + runlevel=$(set -- $(runlevel); eval "echo \$$#") + if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then + force_stop + else + soft_stop + fi + + # Remember status and be verbose + rc_status -v + ;; + soft-stop) + ## Stop the listener daemon process with killproc(8) and if this + ## fails set echo the echo return value. + soft_stop - killproc -p $SSHD_PIDFILE -TERM $SSHD_BIN + # Remember status and be verbose + rc_status -v + ;; + force-stop) + ## stop all running ssh + force_stop - # Remember status and be verbose - rc_status -v - ;; + # Remember status and be verbose + rc_status -v + ;; try-restart) ## Stop the service and if this succeeds (i.e. the ## service was running before), start it again. @@ -90,27 +102,27 @@ case "$1" in rc_status ;; restart) - ## Stop the service and regardless of whether it was - ## running or not, start it again. - $0 stop + ## Stop the service without closing live connections + ## and start it again regardless of whether it was + ## running or not + $0 soft-stop $0 start # Remember status and be quiet rc_status ;; force-reload|reload) - ## Signal the daemon to reload its config. Most daemons - ## do this on signal 1 (SIGHUP). + ## Signal the daemon to reload its config. Most daemons + ## do this on signal 1 (SIGHUP). + echo -n "Reload service sshd" - echo -n "Reload service sshd" - - killproc -p $SSHD_PIDFILE -HUP $SSHD_BIN + killproc -p $SSHD_PIDFILE -HUP $SSHD_BIN rc_status -v ;; status) - echo -n "Checking for service sshd " + echo -n "Checking for service sshd " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. @@ -120,19 +132,19 @@ case "$1" in # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running - checkproc -p $SSHD_PIDFILE $SSHD_BIN + checkproc -p $SSHD_PIDFILE $SSHD_BIN - rc_status -v - ;; + rc_status -v + ;; probe) - ## Optional: Probe for the necessity of a reload, - ## give out the argument which is required for a reload. + ## Optional: Probe for the necessity of a reload, + ## give out the argument which is required for a reload. test /etc/ssh/sshd_config -nt $SSHD_PIDFILE && echo reload - ;; + ;; *) - echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" - exit 1 - ;; + echo "Usage: $0 {start|stop|soft-stop|force-stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; esac rc_exit diff --git a/sshd.pamd b/sshd.pamd index 6ad6712..f27032c 100644 --- a/sshd.pamd +++ b/sshd.pamd @@ -1,9 +1,9 @@ #%PAM-1.0 -auth requisite pam_nologin.so -auth include common-auth -account requisite pam_nologin.so -account include common-account -password include common-password -session required pam_loginuid.so -session include common-session +auth requisite pam_nologin.so +auth include common-auth +account requisite pam_nologin.so +account include common-account +password include common-password +session required pam_loginuid.so +session include common-session session optional pam_lastlog.so silent noupdate showfailed From 673551b2c952cba09790aca8d27351dd738d88d4a6c11af99489c794201cedc5 Mon Sep 17 00:00:00 2001 From: Petr Cerny Date: Thu, 19 Sep 2013 13:51:33 +0000 Subject: [PATCH 2/9] Accepting request 199729 from home:pcerny:factory - spec file and patch cleanup - patches from SLE11 - init script is moved into documentation for openSUSE 12.3+ OBS-URL: https://build.opensuse.org/request/show/199729 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=56 --- openssh.changes | 34 ++++++++++++++++++++++++++++------ openssh.spec | 20 ++++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/openssh.changes b/openssh.changes index d5da5cb..c7120e0 100644 --- a/openssh.changes +++ b/openssh.changes @@ -2,13 +2,35 @@ Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com - spec file and patch cleanup - * removing obsoleted auditing patch - (openssh-%{version}-audit.patch) -- added patches from SLE - * GSSAPI key exchange + * key converter is now in the -key-converter.patch + * openssh-nodaemon-nopid.patch is -no_fork-no_pid_file.patch + * openssh-nocrazyabicheck.patch is + -disable-openssl-abi-check.patch + * removing obsolete -engines.diff patch +- patches from SLE11 + * use auditing infrastructure extending upstream hooks + (-auditX-*.patch) instead of the single old patch + (-audit.patch) * FIPS enablement (currently disabled) - * small bugfixes -- split the LDAP helper into a separate package: openssh-akc-ldap + (-fingerprint_hash.patch, -fips.patch) + * GSSAPI key exchange + (bnc#784689, fate#313068, -gssapi_key_exchange.patch) + * SysV init script update - 'stop' now terminates all sshd + processes and closes all connections, 'soft-stop' only + terminates the listener process (keeps active sessions intact) + (fate#314243) + * helper application for retrieving users' public keys from + an LDAP server (bnc#683733, fate#302144, -ldap.patch) + - subpackage openssh-akc-ldap + * several bugfixes: + - login invocation + (bnc#833605, -login_options.patch) + - disable locked accounts when using PAM + (bnc#708678, fate#312033, -pam-check-locks.patch) + - fix wtmp handling + (bnc#18024, -lastlog.patch) +- init script is moved into documentation for openSUSE 12.3+ + (as it confused systemd) ------------------------------------------------------------------- Tue Sep 10 21:15:59 UTC 2013 - crrodriguez@opensuse.org diff --git a/openssh.spec b/openssh.spec index 44db526..c5d3617 100644 --- a/openssh.spec +++ b/openssh.spec @@ -50,6 +50,12 @@ %define has_krb_mini 0 %endif +%if 0%{?suse_version} >= 1230 +%define init_script_allowed 0 +%else +%define init_script_allowed 1 +%endif + %define _fwdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d %define _fwdefdir %{_fwdir}/services %define _appdefdir %( grep "configdirspec=" $( which xmkmf ) | sed -r 's,^[^=]+=.*-I(.*)/config.*$,\\1/app-defaults,' ) @@ -260,8 +266,12 @@ install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sshd install -d -m 755 %{buildroot}%{_sysconfdir}/slp.reg.d/ install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/slp.reg.d/ install -d -m 755 %{buildroot}%{_initddir} +%if %{init_script_allowed} install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/sshd ln -vs ../..%{_initddir}/sshd %{buildroot}%{_sbindir}/rcsshd +%else +install -m 755 %{SOURCE1} . +%endif install -d -m 755 %{buildroot}/var/adm/fillup-templates install -m 644 %{SOURCE8} %{buildroot}/var/adm/fillup-templates # install shell script to automate the process of adding your public key to a remote machine @@ -293,20 +303,26 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %endif %post +%if %{init_script_allowed} %{fillup_and_insserv -n ssh sshd} +%endif %if %{has_systemd} %service_add_post sshd.service %endif %preun +%if %{init_script_allowed} %stop_on_removal sshd +%endif %if %{has_systemd} %service_del_preun sshd.service %endif %postun +%if %{init_script_allowed} %restart_on_update sshd %{insserv_cleanup} +%endif %if %{has_systemd} %service_del_postun sshd.service %endif @@ -320,7 +336,11 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %verify(not mode) %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config %verify(not mode) %attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd +%if %{init_script_allowed} %attr(0755,root,root) %config %{_initddir}/sshd +%else +%doc sshd.init +%endif %attr(0755,root,root) %{_bindir}/* %attr(0755,root,root) %{_sbindir}/* %attr(0755,root,root) %dir %{_libexecdir}/ssh From 6fccab223a1e6da47efea22b2017076aa7a1c80dfdae86358e50c596305071fe Mon Sep 17 00:00:00 2001 From: Petr Cerny Date: Mon, 7 Oct 2013 08:32:48 +0000 Subject: [PATCH 3/9] Accepting request 202452 from home:pcerny:factory - fix server crashes when using AES-GCM - removed superfluous build dependency on X OBS-URL: https://build.opensuse.org/request/show/202452 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=57 --- openssh-6.2p2-audit5-session_key_destruction.patch | 10 ++++++---- openssh-6.2p2-fingerprint_hash.patch | 2 +- openssh-6.2p2-gssapi_key_exchange.patch | 2 +- openssh.changes | 6 ++++++ openssh.spec | 4 ---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/openssh-6.2p2-audit5-session_key_destruction.patch b/openssh-6.2p2-audit5-session_key_destruction.patch index 4e67c5a..9b767c0 100644 --- a/openssh-6.2p2-audit5-session_key_destruction.patch +++ b/openssh-6.2p2-audit5-session_key_destruction.patch @@ -650,7 +650,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c packet_set_protocol_flags(u_int protocol_flags) { active_state->remote_protocol_flags = protocol_flags; -@@ -722,16 +733,33 @@ packet_send1(void) +@@ -722,16 +733,35 @@ packet_send1(void) /* * Note that the packet is now only buffered in output. It won't be @@ -668,7 +668,9 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c + xfree(newkeys->enc.name); + + mac_clear(&newkeys->mac); -+ xfree(newkeys->mac.name); ++ /* MAC may happen to be empty - if the GCM mode of AES is used */ ++ if (newkeys->mac.name) ++ xfree(newkeys->mac.name); + + xfree(newkeys->comp.name); + @@ -684,7 +686,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c Comp *comp; CipherContext *cc; u_int64_t *max_blocks; -@@ -747,31 +775,19 @@ set_newkeys(int mode) +@@ -747,31 +777,19 @@ set_newkeys(int mode) } else { cc = &active_state->receive_context; crypt_type = CIPHER_DECRYPT; @@ -718,7 +720,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c mac = &active_state->newkeys[mode]->mac; comp = &active_state->newkeys[mode]->comp; if (cipher_authlen(enc->cipher) == 0 && mac_init(mac) == 0) -@@ -1967,54 +1983,93 @@ packet_get_output(void) +@@ -1967,54 +1985,93 @@ packet_get_output(void) } void * diff --git a/openssh-6.2p2-fingerprint_hash.patch b/openssh-6.2p2-fingerprint_hash.patch index 41f07e8..57e4dad 100644 --- a/openssh-6.2p2-fingerprint_hash.patch +++ b/openssh-6.2p2-fingerprint_hash.patch @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 3d1c0ed188101c45a132baae0b78f93a1d0e6160 +# Parent 2e71c896d924778e46e68e0c9be9a8b13e428f2f # select fingerprint hash algorithms based on the environment variable # SSH_FP_TYPE_ENVVAR and append it to hex and randomart fingerprints diff --git a/openssh-6.2p2-gssapi_key_exchange.patch b/openssh-6.2p2-gssapi_key_exchange.patch index b172ef3..f329b0a 100644 --- a/openssh-6.2p2-gssapi_key_exchange.patch +++ b/openssh-6.2p2-gssapi_key_exchange.patch @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 4c530768d07db136fcc679119220a02eb28b0127 +# Parent a72dad36a987a441e9c92807b1d654e43ddee409 diff --git a/openssh-6.2p2/ChangeLog.gssapi b/openssh-6.2p2/ChangeLog.gssapi new file mode 100644 diff --git a/openssh.changes b/openssh.changes index c7120e0..9aed0d7 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 4 17:50:32 UTC 2013 - pcerny@suse.com + +- fix server crashes when using AES-GCM +- removed superfluous build dependency on X + ------------------------------------------------------------------- Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com diff --git a/openssh.spec b/openssh.spec index c5d3617..a6843c6 100644 --- a/openssh.spec +++ b/openssh.spec @@ -84,10 +84,6 @@ BuildRequires: systemd %{?systemd_requires} %endif BuildRequires: tcpd-devel -BuildRequires: xorg-x11-devel -%if %{needs_xorg_libs} -BuildRequires: xorg-x11-libs -%endif Requires: /bin/netstat PreReq: pwdutils %{insserv_prereq} %{fillup_prereq} coreutils Conflicts: nonfreessh From 712ccf339570909e42a8b770e73b6c9ae955576eaf5ef3f212d5150b700c9120 Mon Sep 17 00:00:00 2001 From: Petr Cerny Date: Fri, 31 Jan 2014 12:18:41 +0000 Subject: [PATCH 4/9] Accepting request 220466 from home:pcerny:factory - Update of the underlying OpenSSH to 6.4p1 - Update to 6.4p1 Features since 6.2p2: * ssh-agent(1) support in sshd(8); allows encrypted hostkeys, or hostkeys on smartcards. * ssh(1)/sshd(8): allow optional time-based rekeying via a second argument to the existing RekeyLimit option. RekeyLimit is now supported in sshd_config as well as on the client. * sshd(8): standardise logging of information during user authentication. * The presented key/cert and the remote username (if available) is now logged in the authentication success/failure message on the same log line as the local username, remote host/port and protocol in use. Certificates contents and the key fingerprint of the signing CA are logged too. * ssh(1) ability to query what cryptographic algorithms are supported in the binary. * ssh(1): ProxyCommand=- for cases where stdin and stdout already point to the proxy. * ssh(1): allow IdentityFile=none * ssh(1)/sshd(8): -E option to append debugging logs to a specified file instead of stderr or syslog. * sftp(1): support resuming partial downloads with the "reget" command and on the sftp commandline or on the "get" commandline with the "-a" (append) option. * ssh(1): "IgnoreUnknown" configuration option to selectively suppress errors arising from unknown configuration directives. * sshd(8): support for submethods to be appended to required authentication methods listed via AuthenticationMethods. OBS-URL: https://build.opensuse.org/request/show/220466 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=58 --- openssh-6.2p2.tar.gz | 3 - ...atch => openssh-6.4p1-X11-forwarding.patch | 14 +- ...h-6.4p1-audit1-remove_duplicit_audit.patch | 8 +- ...-audit2-better_audit_of_user_actions.patch | 115 ++++---- ... openssh-6.4p1-audit3-key_auth_usage.patch | 138 +++++----- ... => openssh-6.4p1-audit4-kex_results.patch | 126 ++++----- ...6.4p1-audit5-session_key_destruction.patch | 204 +++++++------- ...-6.4p1-audit6-server_key_destruction.patch | 116 ++++---- ...openssh-6.4p1-audit7-libaudit_compat.patch | 10 +- ...h-6.4p1-audit8-libaudit_dns_timeouts.patch | 6 +- ....patch => openssh-6.4p1-blocksigalrm.patch | 16 +- ...ch => openssh-6.4p1-default-protocol.patch | 6 +- ...nssh-6.4p1-disable-openssl-abi-check.patch | 6 +- ...2p2-eal3.patch => openssh-6.4p1-eal3.patch | 20 +- ...ch => openssh-6.4p1-fingerprint_hash.patch | 256 +++++++++++------- ...2p2-fips.patch => openssh-6.4p1-fips.patch | 86 +++--- ...=> openssh-6.4p1-gssapi_key_exchange.patch | 228 ++++++++-------- ...tm.patch => openssh-6.4p1-gssapimitm.patch | 99 +++---- ...nt.patch => openssh-6.4p1-host_ident.patch | 8 +- ...patch => openssh-6.4p1-key-converter.patch | 20 +- ...stlog.patch => openssh-6.4p1-lastlog.patch | 6 +- ...2p2-ldap.patch => openssh-6.4p1-ldap.patch | 114 ++++---- ...patch => openssh-6.4p1-login_options.patch | 8 +- ...=> openssh-6.4p1-no_fork-no_pid_file.patch | 8 +- ...tch => openssh-6.4p1-pam-check-locks.patch | 52 ++-- ...fix2.patch => openssh-6.4p1-pam-fix2.patch | 10 +- ...fix3.patch => openssh-6.4p1-pam-fix3.patch | 10 +- ...6.2p2-pts.patch => openssh-6.4p1-pts.patch | 6 +- ....patch => openssh-6.4p1-saveargv-fix.patch | 10 +- ...rng.patch => openssh-6.4p1-seed-prng.patch | 102 +++---- ...e.patch => openssh-6.4p1-send_locale.patch | 17 +- ...tch => openssh-6.4p1-sftp_homechroot.patch | 48 ++-- ...2-xauth.patch => openssh-6.4p1-xauth.patch | 20 +- ... => openssh-6.4p1-xauthlocalhostname.patch | 14 +- openssh-6.4p1.tar.gz | 3 + openssh-askpass-gnome.changes | 5 + openssh-askpass-gnome.spec | 4 +- openssh.changes | 82 ++++++ openssh.spec | 101 +++---- 39 files changed, 1129 insertions(+), 976 deletions(-) delete mode 100644 openssh-6.2p2.tar.gz rename openssh-6.2p2-X11-forwarding.patch => openssh-6.4p1-X11-forwarding.patch (85%) rename openssh-6.2p2-audit1-remove_duplicit_audit.patch => openssh-6.4p1-audit1-remove_duplicit_audit.patch (84%) rename openssh-6.2p2-audit2-better_audit_of_user_actions.patch => openssh-6.4p1-audit2-better_audit_of_user_actions.patch (90%) rename openssh-6.2p2-audit3-key_auth_usage.patch => openssh-6.4p1-audit3-key_auth_usage.patch (85%) rename openssh-6.2p2-audit4-kex_results.patch => openssh-6.4p1-audit4-kex_results.patch (89%) rename openssh-6.2p2-audit5-session_key_destruction.patch => openssh-6.4p1-audit5-session_key_destruction.patch (86%) rename openssh-6.2p2-audit6-server_key_destruction.patch => openssh-6.4p1-audit6-server_key_destruction.patch (89%) rename openssh-6.2p2-audit7-libaudit_compat.patch => openssh-6.4p1-audit7-libaudit_compat.patch (92%) rename openssh-6.2p2-audit8-libaudit_dns_timeouts.patch => openssh-6.4p1-audit8-libaudit_dns_timeouts.patch (92%) rename openssh-6.2p2-blocksigalrm.patch => openssh-6.4p1-blocksigalrm.patch (83%) rename openssh-6.2p2-default-protocol.patch => openssh-6.4p1-default-protocol.patch (83%) rename openssh-6.2p2-disable-openssl-abi-check.patch => openssh-6.4p1-disable-openssl-abi-check.patch (89%) rename openssh-6.2p2-eal3.patch => openssh-6.4p1-eal3.patch (82%) rename openssh-6.2p2-fingerprint_hash.patch => openssh-6.4p1-fingerprint_hash.patch (76%) rename openssh-6.2p2-fips.patch => openssh-6.4p1-fips.patch (94%) rename openssh-6.2p2-gssapi_key_exchange.patch => openssh-6.4p1-gssapi_key_exchange.patch (96%) rename openssh-6.2p2-gssapimitm.patch => openssh-6.4p1-gssapimitm.patch (86%) rename openssh-6.2p2-host_ident.patch => openssh-6.4p1-host_ident.patch (82%) rename openssh-6.2p2-key-converter.patch => openssh-6.4p1-key-converter.patch (94%) rename openssh-6.2p2-lastlog.patch => openssh-6.4p1-lastlog.patch (82%) rename openssh-6.2p2-ldap.patch => openssh-6.4p1-ldap.patch (96%) rename openssh-6.2p2-login_options.patch => openssh-6.4p1-login_options.patch (84%) rename openssh-6.2p2-no_fork-no_pid_file.patch => openssh-6.4p1-no_fork-no_pid_file.patch (79%) rename openssh-6.2p2-pam-check-locks.patch => openssh-6.4p1-pam-check-locks.patch (84%) rename openssh-6.2p2-pam-fix2.patch => openssh-6.4p1-pam-fix2.patch (84%) rename openssh-6.2p2-pam-fix3.patch => openssh-6.4p1-pam-fix3.patch (75%) rename openssh-6.2p2-pts.patch => openssh-6.4p1-pts.patch (91%) rename openssh-6.2p2-saveargv-fix.patch => openssh-6.4p1-saveargv-fix.patch (84%) rename openssh-6.2p2-seed-prng.patch => openssh-6.4p1-seed-prng.patch (85%) rename openssh-6.2p2-send_locale.patch => openssh-6.4p1-send_locale.patch (77%) rename openssh-6.2p2-sftp_homechroot.patch => openssh-6.4p1-sftp_homechroot.patch (90%) rename openssh-6.2p2-xauth.patch => openssh-6.4p1-xauth.patch (78%) rename openssh-6.2p2-xauthlocalhostname.patch => openssh-6.4p1-xauthlocalhostname.patch (91%) create mode 100644 openssh-6.4p1.tar.gz diff --git a/openssh-6.2p2.tar.gz b/openssh-6.2p2.tar.gz deleted file mode 100644 index 2159c85..0000000 --- a/openssh-6.2p2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b -size 1182922 diff --git a/openssh-6.2p2-X11-forwarding.patch b/openssh-6.4p1-X11-forwarding.patch similarity index 85% rename from openssh-6.2p2-X11-forwarding.patch rename to openssh-6.4p1-X11-forwarding.patch index 1f3f946..f2914fa 100644 --- a/openssh-6.2p2-X11-forwarding.patch +++ b/openssh-6.4p1-X11-forwarding.patch @@ -2,9 +2,9 @@ # configuration # bnc#50836 (was suse #35836) -diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config ---- a/openssh-6.2p2/ssh_config -+++ b/openssh-6.2p2/ssh_config +diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +--- a/openssh-6.4p1/ssh_config ++++ b/openssh-6.4p1/ssh_config @@ -12,19 +12,30 @@ # Any configuration value is only changed the first time it is set. # Thus, host-specific definitions should be at the beginning of the @@ -37,10 +37,10 @@ diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config # GSSAPIDelegateCredentials no # BatchMode no # CheckHostIP yes -diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config ---- a/openssh-6.2p2/sshd_config -+++ b/openssh-6.2p2/sshd_config -@@ -90,17 +90,17 @@ AuthorizedKeysFile .ssh/authorized_keys +diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +--- a/openssh-6.4p1/sshd_config ++++ b/openssh-6.4p1/sshd_config +@@ -93,17 +93,17 @@ AuthorizedKeysFile .ssh/authorized_keys # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. diff --git a/openssh-6.2p2-audit1-remove_duplicit_audit.patch b/openssh-6.4p1-audit1-remove_duplicit_audit.patch similarity index 84% rename from openssh-6.2p2-audit1-remove_duplicit_audit.patch rename to openssh-6.4p1-audit1-remove_duplicit_audit.patch index 72398cf..891a91b 100644 --- a/openssh-6.2p2-audit1-remove_duplicit_audit.patch +++ b/openssh-6.4p1-audit1-remove_duplicit_audit.patch @@ -8,10 +8,10 @@ # # PRIVSEP(getpwnamallow()) a few lines above already did this. -diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c ---- a/openssh-6.2p2/auth2.c -+++ b/openssh-6.2p2/auth2.c -@@ -239,19 +239,16 @@ input_userauth_request(int type, u_int32 +diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c +--- a/openssh-6.4p1/auth2.c ++++ b/openssh-6.4p1/auth2.c +@@ -242,19 +242,16 @@ input_userauth_request(int type, u_int32 authctxt->pw = PRIVSEP(getpwnamallow(user)); authctxt->user = xstrdup(user); if (authctxt->pw && strcmp(service, "ssh-connection")==0) { diff --git a/openssh-6.2p2-audit2-better_audit_of_user_actions.patch b/openssh-6.4p1-audit2-better_audit_of_user_actions.patch similarity index 90% rename from openssh-6.2p2-audit2-better_audit_of_user_actions.patch rename to openssh-6.4p1-audit2-better_audit_of_user_actions.patch index 27d6798..d95521e 100644 --- a/openssh-6.2p2-audit2-better_audit_of_user_actions.patch +++ b/openssh-6.4p1-audit2-better_audit_of_user_actions.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2011 # by jchadima@redhat.com -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -370,20 +370,33 @@ audit_connection_from(const char *host, /* this is used on IPv4-only machines */ tid->port = (dev_t)port; @@ -42,9 +42,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c /* not implemented */ } -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -30,97 +30,210 @@ #include "includes.h" #if defined(USE_LINUX_AUDIT) @@ -276,9 +276,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c } #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -135,16 +135,27 @@ audit_connection_from(const char *host, void audit_event(ssh_audit_event_t event) @@ -344,9 +344,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -44,14 +44,16 @@ enum ssh_audit_event_type { SSH_CONNECTION_CLOSE, /* closed after attempting auth or session */ SSH_CONNECTION_ABANDON, /* closed without completing auth */ @@ -365,10 +365,10 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ssh_audit_event_t audit_classify_auth(const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c -@@ -180,16 +180,17 @@ int mm_answer_gss_setup_ctx(int, Buffer +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c +@@ -181,16 +181,17 @@ int mm_answer_gss_setup_ctx(int, Buffer int mm_answer_gss_accept_ctx(int, Buffer *); int mm_answer_gss_userok(int, Buffer *); int mm_answer_gss_checkmic(int, Buffer *); @@ -386,7 +386,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ /* local state for key verify */ -@@ -267,16 +268,17 @@ struct mon_table mon_dispatch_postauth20 +@@ -268,16 +269,17 @@ struct mon_table mon_dispatch_postauth20 {MONITOR_REQ_MODULI, 0, mm_answer_moduli}, {MONITOR_REQ_SIGN, 0, mm_answer_sign}, {MONITOR_REQ_PTY, 0, mm_answer_pty}, @@ -404,7 +404,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, -@@ -309,16 +311,17 @@ struct mon_table mon_dispatch_proto15[] +@@ -310,16 +312,17 @@ struct mon_table mon_dispatch_proto15[] struct mon_table mon_dispatch_postauth15[] = { {MONITOR_REQ_PTY, MON_ONCE, mm_answer_pty}, @@ -422,7 +422,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -1427,16 +1430,22 @@ mm_record_login(Session *s, struct passw +@@ -1442,16 +1445,22 @@ mm_record_login(Session *s, struct passw static void mm_session_close(Session *s) { @@ -445,7 +445,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c { extern struct monitor *pmonitor; Session *s; -@@ -1749,21 +1758,54 @@ mm_answer_audit_event(int socket, Buffer +@@ -1764,21 +1773,53 @@ mm_answer_audit_event(int socket, Buffer return (0); } @@ -458,7 +458,6 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c debug3("%s entering", __func__); cmd = buffer_get_string(m, &len); -+ /* sanity check command, if so how? */ - audit_run_command(cmd); + s = session_new(); @@ -493,7 +492,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + fatal("%s: invalid handle", __func__); + mm_session_close(s); + - xfree(cmd); + free(cmd); return (0); } #endif /* SSH_AUDIT_EVENTS */ @@ -501,9 +500,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c void monitor_apply_keystate(struct monitor *pmonitor) { -diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h ---- a/openssh-6.2p2/monitor.h -+++ b/openssh-6.2p2/monitor.h +diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h +--- a/openssh-6.4p1/monitor.h ++++ b/openssh-6.4p1/monitor.h @@ -64,16 +64,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_START = 100, @@ -522,10 +521,10 @@ diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c -@@ -1184,27 +1184,48 @@ mm_audit_event(ssh_audit_event_t event) +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c +@@ -1186,27 +1186,48 @@ mm_audit_event(ssh_audit_event_t event) buffer_init(&m); buffer_put_int(&m, event); @@ -575,9 +574,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID goid) { -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -69,17 +69,18 @@ void *mm_sshpam_init_ctx(struct Authctxt int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); int mm_sshpam_respond(void *, u_int, char **); @@ -598,9 +597,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c @@ -740,16 +740,24 @@ do_exec_pty(Session *s, const char *comm cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); #endif @@ -658,7 +657,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c original_command = NULL; -@@ -1862,16 +1874,17 @@ session_unused(int id) +@@ -1875,16 +1887,17 @@ session_unused(int id) bzero(&sessions[id], sizeof(*sessions)); sessions[id].self = id; sessions[id].used = 0; @@ -676,7 +675,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c session_new(void) { Session *s, *tmp; -@@ -1944,16 +1957,29 @@ session_open(Authctxt *authctxt, int cha +@@ -1957,16 +1970,29 @@ session_open(Authctxt *authctxt, int cha if (s->pw == NULL || !authctxt->valid) fatal("no user for session %d", s->self); debug("session_open: session %d: link with channel %d", s->self, chanid); @@ -706,7 +705,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c if (s->used && s->ttyfd != -1 && strcmp(s->tty, tty) == 0) { debug("session_by_tty: session %d tty %s", i, tty); return s; -@@ -2469,16 +2495,40 @@ session_exit_message(Session *s, int sta +@@ -2473,16 +2499,40 @@ session_exit_message(Session *s, int sta * interested in data we write. * Note that we must not call 'chan_read_failed', since there could * be some more data waiting in the pipe. @@ -721,7 +720,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +{ + if (s->command != NULL) { + audit_end_command(s->command_handle, s->command); -+ xfree(s->command); ++ free(s->command); + s->command = NULL; + s->command_handle = -1; + } @@ -732,7 +731,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c +{ + if (s->command != NULL) { + PRIVSEP(audit_end_command(s->command_handle, s->command)); -+ xfree(s->command); ++ free(s->command); + s->command = NULL; + s->command_handle = -1; + } @@ -747,7 +746,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c debug("session_close: session %d pid %ld", s->self, (long)s->pid); -@@ -2509,16 +2559,20 @@ session_close(Session *s) +@@ -2513,16 +2563,20 @@ session_close(Session *s) int status; waitpid(pid, &status, 0); @@ -760,15 +759,15 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c + if (s->command) + session_end_command(s); +#endif - if (s->term) - xfree(s->term); - if (s->display) - xfree(s->display); - if (s->x11_chanids) - xfree(s->x11_chanids); - if (s->auth_display) - xfree(s->auth_display); -@@ -2728,16 +2782,25 @@ session_setup_x11fwd(Session *s) + free(s->term); + free(s->display); + free(s->x11_chanids); + free(s->auth_display); + free(s->auth_data); + free(s->auth_proto); + if (s->env != NULL) { + for (i = 0; i < s->num_env; i++) { +@@ -2726,16 +2780,25 @@ session_setup_x11fwd(Session *s) } static void @@ -794,7 +793,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c debug("do_cleanup"); /* no cleanup if we're in the child for login shell */ -@@ -2776,10 +2839,10 @@ do_cleanup(Authctxt *authctxt) +@@ -2774,10 +2837,10 @@ do_cleanup(Authctxt *authctxt) /* remove agent socket */ auth_sock_cleanup_proc(authctxt->pw); @@ -806,9 +805,9 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c - session_destroy_all(session_pty_cleanup2); + session_destroy_all(do_cleanup_one_session); } -diff --git a/openssh-6.2p2/session.h b/openssh-6.2p2/session.h ---- a/openssh-6.2p2/session.h -+++ b/openssh-6.2p2/session.h +diff --git a/openssh-6.4p1/session.h b/openssh-6.4p1/session.h +--- a/openssh-6.4p1/session.h ++++ b/openssh-6.4p1/session.h @@ -55,29 +55,37 @@ struct Session { int chanid; int *x11_chanids; @@ -847,10 +846,10 @@ diff --git a/openssh-6.2p2/session.h b/openssh-6.2p2/session.h const char *value); #endif -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -2404,13 +2404,14 @@ cleanup_exit(int i) +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -2487,13 +2487,14 @@ cleanup_exit(int i) if (kill(pmonitor->m_pid, SIGKILL) != 0 && errno != ESRCH) error("%s: kill(%d): %s", __func__, diff --git a/openssh-6.2p2-audit3-key_auth_usage.patch b/openssh-6.4p1-audit3-key_auth_usage.patch similarity index 85% rename from openssh-6.2p2-audit3-key_auth_usage.patch rename to openssh-6.4p1-audit3-key_auth_usage.patch index 5aae675..0b04782 100644 --- a/openssh-6.2p2-audit3-key_auth_usage.patch +++ b/openssh-6.4p1-audit3-key_auth_usage.patch @@ -5,9 +5,9 @@ # (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1975) # by jchadima@redhat.com -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -401,16 +401,22 @@ audit_session_open(struct logininfo *li) } @@ -31,9 +31,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c const char *user = the_authctxt ? the_authctxt->user : "(unknown user)"; if (cannot_audit(0)) -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -36,16 +36,18 @@ #include "log.h" #include "audit.h" @@ -101,9 +101,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c audit_connection_from(const char *host, int port) { /* not implemented */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -31,16 +31,17 @@ #ifdef SSH_AUDIT_EVENTS @@ -144,7 +144,7 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c + crypto_name = key_ssh_name(key); + if (audit_keyusage(host_user, crypto_name, key_size(key), fp, *rv) == 0) + *rv = 0; -+ xfree(fp); ++ free(fp); +} + # ifndef CUSTOM_SSH_AUDIT_EVENTS @@ -178,9 +178,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -23,16 +23,17 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -212,9 +212,9 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +void audit_key(int, int *, const Key *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c ---- a/openssh-6.2p2/auth-rsa.c -+++ b/openssh-6.2p2/auth-rsa.c +diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c +--- a/openssh-6.4p1/auth-rsa.c ++++ b/openssh-6.4p1/auth-rsa.c @@ -87,17 +87,20 @@ auth_rsa_generate_challenge(Key *key) return challenge; } @@ -259,7 +259,7 @@ diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c } - /* Correct answer. */ - return (1); -+ xfree(fp); ++ free(fp); +#endif + + return rv; @@ -271,10 +271,10 @@ diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c * our challenge; returns zero if the client gives a wrong answer. */ -diff --git a/openssh-6.2p2/auth.h b/openssh-6.2p2/auth.h ---- a/openssh-6.2p2/auth.h -+++ b/openssh-6.2p2/auth.h -@@ -176,31 +176,33 @@ int allowed_user(struct passwd *); +diff --git a/openssh-6.4p1/auth.h b/openssh-6.4p1/auth.h +--- a/openssh-6.4p1/auth.h ++++ b/openssh-6.4p1/auth.h +@@ -182,16 +182,17 @@ int allowed_user(struct passwd *); struct passwd * getpwnamallow(const char *user); char *get_challenge(Authctxt *); @@ -292,13 +292,15 @@ diff --git a/openssh-6.2p2/auth.h b/openssh-6.2p2/auth.h HostStatus check_key_in_hostfiles(struct passwd *, Key *, const char *, const char *, const char *); - +@@ -199,16 +200,17 @@ check_key_in_hostfiles(struct passwd *, /* hostkey handling */ Key *get_hostkey_by_index(int); + Key *get_hostkey_public_by_index(int); Key *get_hostkey_public_by_type(int); Key *get_hostkey_private_by_type(int); int get_hostkey_index(Key *); int ssh1_session_key(BIGNUM *); + void sshd_hostkey_sign(Key *, Key *, u_char **, u_int *, u_char *, u_int); +int hostbased_key_verify(const Key *, const u_char *, u_int, const u_char *, u_int); /* debug messages during authentication */ @@ -308,15 +310,15 @@ diff --git a/openssh-6.2p2/auth.h b/openssh-6.2p2/auth.h struct passwd *fakepw(void); -diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c ---- a/openssh-6.2p2/auth2-hostbased.c -+++ b/openssh-6.2p2/auth2-hostbased.c -@@ -114,33 +114,45 @@ userauth_hostbased(Authctxt *authctxt) - buffer_put_cstring(&b, chost); - buffer_put_cstring(&b, cuser); - #ifdef DEBUG_PK - buffer_dump(&b); +diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c +--- a/openssh-6.4p1/auth2-hostbased.c ++++ b/openssh-6.4p1/auth2-hostbased.c +@@ -118,33 +118,45 @@ userauth_hostbased(Authctxt *authctxt) #endif + + pubkey_auth_info(authctxt, key, + "client user \"%.100s\", client host \"%.100s\"", cuser, chost); + /* test for allowed key and correct signature */ authenticated = 0; if (PRIVSEP(hostbased_key_allowed(authctxt->pw, cuser, chost, key)) && @@ -330,11 +332,11 @@ diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c debug2("userauth_hostbased: authenticated %d", authenticated); if (key != NULL) key_free(key); - xfree(pkalg); - xfree(pkblob); - xfree(cuser); - xfree(chost); - xfree(sig); + free(pkalg); + free(pkblob); + free(cuser); + free(chost); + free(sig); return authenticated; } @@ -358,15 +360,15 @@ diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c const char *resolvedname, *ipaddr, *lookup, *reason; HostStatus host_status; int len; -diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c ---- a/openssh-6.2p2/auth2-pubkey.c -+++ b/openssh-6.2p2/auth2-pubkey.c -@@ -141,17 +141,17 @@ userauth_pubkey(Authctxt *authctxt) - } - buffer_put_string(&b, pkblob, blen); +diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c +--- a/openssh-6.4p1/auth2-pubkey.c ++++ b/openssh-6.4p1/auth2-pubkey.c +@@ -147,17 +147,17 @@ userauth_pubkey(Authctxt *authctxt) #ifdef DEBUG_PK buffer_dump(&b); #endif + pubkey_auth_info(authctxt, key, NULL); + /* test for correct signature */ authenticated = 0; if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && @@ -375,17 +377,17 @@ diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c buffer_len(&b))) == 1) authenticated = 1; buffer_free(&b); - xfree(sig); + free(sig); } else { debug("test whether pkalg/pkblob are acceptable"); packet_check_eom(); -@@ -178,16 +178,28 @@ done: +@@ -184,16 +184,28 @@ done: debug2("userauth_pubkey: authenticated %d pkalg %s", authenticated, pkalg); if (key != NULL) key_free(key); - xfree(pkalg); - xfree(pkblob); + free(pkalg); + free(pkblob); return authenticated; } @@ -401,18 +403,18 @@ diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c + return rv; +} + - static int - match_principals_option(const char *principal_list, struct KeyCert *cert) + void + pubkey_auth_info(Authctxt *authctxt, const Key *key, const char *fmt, ...) { - char *result; - u_int i; + char *fp, *extra; + va_list ap; + int i; - /* XXX percent_expand() sequences for authorized_principals? */ - -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c -@@ -1347,26 +1347,30 @@ monitor_valid_hostbasedblob(u_char *data + extra = NULL; +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c +@@ -1362,26 +1362,30 @@ monitor_valid_hostbasedblob(u_char *data } int @@ -443,7 +445,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c switch (key_blobtype) { case MM_USERKEY: valid_data = monitor_valid_userblob(data, datalen); -@@ -1377,17 +1381,27 @@ mm_answer_keyverify(int sock, Buffer *m) +@@ -1392,17 +1396,27 @@ mm_answer_keyverify(int sock, Buffer *m) break; default: valid_data = 0; @@ -468,14 +470,14 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c __func__, key, (verified == 1) ? "verified" : "unverified"); key_free(key); - xfree(blob); - xfree(signature); - xfree(data); + free(blob); + free(signature); + free(data); -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c -@@ -426,30 +426,31 @@ mm_key_allowed(enum mm_keytype type, cha +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c +@@ -428,30 +428,31 @@ mm_key_allowed(enum mm_keytype type, cha /* * This key verify needs to send the key type along, because the @@ -503,12 +505,12 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c buffer_put_string(&m, blob, len); buffer_put_string(&m, sig, siglen); buffer_put_string(&m, data, datalen); - xfree(blob); + free(blob); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m); debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __func__); -@@ -457,16 +458,29 @@ mm_key_verify(Key *key, u_char *sig, u_i +@@ -459,16 +460,29 @@ mm_key_verify(Key *key, u_char *sig, u_i verified = buffer_get_int(&m); @@ -538,9 +540,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c u_int len; Newkeys *newkey = NULL; Enc *enc; -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -44,17 +44,18 @@ int mm_key_sign(Key *, u_char **, u_int void mm_inform_authserv(char *, char *); struct passwd *mm_getpwnamallow(const char *); diff --git a/openssh-6.2p2-audit4-kex_results.patch b/openssh-6.4p1-audit4-kex_results.patch similarity index 89% rename from openssh-6.2p2-audit4-kex_results.patch rename to openssh-6.4p1-audit4-kex_results.patch index 172894b..bb3adcd 100644 --- a/openssh-6.2p2-audit4-kex_results.patch +++ b/openssh-6.4p1-audit4-kex_results.patch @@ -5,9 +5,9 @@ # (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1976) # by jchadima@redhat.com -diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in ---- a/openssh-6.2p2/Makefile.in -+++ b/openssh-6.2p2/Makefile.in +diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in +--- a/openssh-6.4p1/Makefile.in ++++ b/openssh-6.4p1/Makefile.in @@ -68,17 +68,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ @@ -27,9 +27,9 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ audit.o audit-bsm.o audit-linux.o platform.o \ sshpty.o sshlogin.o servconf.o serverloop.o \ -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -468,9 +468,21 @@ audit_event(ssh_audit_event_t event) case SSH_AUTH_FAIL_KBDINT: bsm_audit_bad_login("interactive password entry"); @@ -52,9 +52,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -35,16 +35,18 @@ #include "log.h" @@ -95,7 +95,7 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c + snprintf(buf, sizeof(buf), "op=unsupported-%s direction=? cipher=? ksize=? rport=%d laddr=%s lport=%d ", + name[what], get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), + get_local_port()); -+ xfree(s); ++ free(s); + audit_fd = audit_open(); + if (audit_fd < 0) + /* no problem, the next instruction will be fatal() */ @@ -121,7 +121,7 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c + direction[ctos], enc, cipher ? 8 * cipher->key_len : 0, + (intmax_t)pid, (intmax_t)uid, + get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), get_local_port()); -+ xfree(s); ++ free(s); + audit_fd = audit_open(); + if (audit_fd < 0) { + if (errno == EINVAL || errno == EPROTONOSUPPORT || @@ -140,9 +140,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +} + #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -23,24 +23,27 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -177,7 +177,7 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c crypto_name = key_ssh_name(key); if (audit_keyusage(host_user, crypto_name, key_size(key), fp, *rv) == 0) *rv = 0; - xfree(fp); + free(fp); } +void @@ -232,9 +232,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -53,10 +53,14 @@ void audit_event(ssh_audit_event_t); void audit_count_session_open(void); void audit_session_open(struct logininfo *); @@ -250,10 +250,10 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/auditstub.c b/openssh-6.2p2/auditstub.c +diff --git a/openssh-6.4p1/auditstub.c b/openssh-6.4p1/auditstub.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/auditstub.c ++++ b/openssh-6.4p1/auditstub.c @@ -0,0 +1,39 @@ +/* $Id: auditstub.c,v 1.1 jfch Exp $ */ + @@ -294,10 +294,10 @@ new file mode 100644 +{ +} + -diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c ---- a/openssh-6.2p2/cipher.c -+++ b/openssh-6.2p2/cipher.c -@@ -50,27 +50,17 @@ +diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c +--- a/openssh-6.4p1/cipher.c ++++ b/openssh-6.4p1/cipher.c +@@ -50,29 +50,17 @@ /* compatibility with old or broken OpenSSL versions */ #include "openbsd-compat/openssl-compat.h" @@ -316,7 +316,9 @@ diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c - u_int discard_len; - u_int cbc_mode; - const EVP_CIPHER *(*evptype)(void); --} ciphers[] = { +-}; +- +-static const struct Cipher ciphers[] = { +struct Cipher ciphers[] = { { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null }, { "des", SSH_CIPHER_DES, 8, 8, 0, 0, 0, 1, EVP_des_cbc }, @@ -326,9 +328,9 @@ diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc }, { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc }, -diff --git a/openssh-6.2p2/cipher.h b/openssh-6.2p2/cipher.h ---- a/openssh-6.2p2/cipher.h -+++ b/openssh-6.2p2/cipher.h +diff --git a/openssh-6.4p1/cipher.h b/openssh-6.4p1/cipher.h +--- a/openssh-6.4p1/cipher.h ++++ b/openssh-6.4p1/cipher.h @@ -56,17 +56,28 @@ #define SSH_CIPHER_MAX 31 @@ -355,13 +357,13 @@ diff --git a/openssh-6.2p2/cipher.h b/openssh-6.2p2/cipher.h int plaintext; int encrypt; EVP_CIPHER_CTX evp; - Cipher *cipher; + const Cipher *cipher; }; u_int cipher_mask_ssh1(int); -diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c ---- a/openssh-6.2p2/kex.c -+++ b/openssh-6.2p2/kex.c +diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c +--- a/openssh-6.4p1/kex.c ++++ b/openssh-6.4p1/kex.c @@ -44,16 +44,17 @@ #include "key.h" #include "kex.h" @@ -380,7 +382,7 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c extern const EVP_MD *evp_ssh_sha256(void); # endif #endif -@@ -291,53 +292,65 @@ kex_kexinit_finish(Kex *kex) +@@ -336,53 +337,65 @@ kex_kexinit_finish(Kex *kex) fatal("Unsupported key exchange %d", kex->kex_type); } } @@ -449,7 +451,7 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c comp->type = COMP_NONE; } else { fatal("unsupported comp %s", name); -@@ -455,16 +468,19 @@ kex_choose_conf(Kex *kex) +@@ -487,16 +500,19 @@ kex_choose_conf(Kex *kex) if (authlen == 0) choose_mac(&newkeys->mac, cprop[nmac], sprop[nmac]); choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); @@ -469,11 +471,10 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c for (mode = 0; mode < MODE_MAX; mode++) { newkeys = kex->newkeys[mode]; if (need < newkeys->enc.key_len) -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c -@@ -92,16 +92,17 @@ - #endif +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c +@@ -93,16 +93,17 @@ #include "monitor_wrap.h" #include "monitor_fdpass.h" #include "misc.h" @@ -481,6 +482,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c #include "ssh2.h" #include "jpake.h" #include "roaming.h" + #include "authfd.h" +#include "audit.h" #ifdef GSSAPI @@ -490,7 +492,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Imports */ extern ServerOptions options; extern u_int utmp_len; -@@ -181,16 +182,18 @@ int mm_answer_gss_accept_ctx(int, Buffer +@@ -182,16 +183,18 @@ int mm_answer_gss_accept_ctx(int, Buffer int mm_answer_gss_userok(int, Buffer *); int mm_answer_gss_checkmic(int, Buffer *); #endif @@ -509,7 +511,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ /* local state for key verify */ -@@ -232,16 +235,18 @@ struct mon_table mon_dispatch_proto20[] +@@ -233,16 +236,18 @@ struct mon_table mon_dispatch_proto20[] {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, @@ -528,7 +530,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c #ifdef SKEY {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, -@@ -269,16 +274,18 @@ struct mon_table mon_dispatch_postauth20 +@@ -270,16 +275,18 @@ struct mon_table mon_dispatch_postauth20 {MONITOR_REQ_SIGN, 0, mm_answer_sign}, {MONITOR_REQ_PTY, 0, mm_answer_pty}, {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, @@ -547,7 +549,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, -@@ -300,28 +307,32 @@ struct mon_table mon_dispatch_proto15[] +@@ -301,28 +308,32 @@ struct mon_table mon_dispatch_proto15[] {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, @@ -580,7 +582,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -2391,8 +2402,52 @@ mm_answer_jpake_check_confirm(int sock, +@@ -2410,8 +2421,52 @@ mm_answer_jpake_check_confirm(int sock, monitor_permit(mon_dispatch, MONITOR_REQ_JPAKE_STEP1, 1); @@ -623,9 +625,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + + audit_kex_body(ctos, cipher, mac, compress, pid, uid); + -+ xfree(cipher); -+ xfree(mac); -+ xfree(compress); ++ free(cipher); ++ free(mac); ++ free(compress); + buffer_clear(m); + + mm_request_send(sock, MONITOR_ANS_AUDIT_KEX, m); @@ -633,9 +635,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c +} + +#endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h ---- a/openssh-6.2p2/monitor.h -+++ b/openssh-6.2p2/monitor.h +diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h +--- a/openssh-6.4p1/monitor.h ++++ b/openssh-6.4p1/monitor.h @@ -65,16 +65,18 @@ enum monitor_reqtype { MONITOR_REQ_PAM_START = 100, MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, @@ -655,10 +657,10 @@ diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c -@@ -1481,8 +1481,46 @@ mm_jpake_check_confirm(const BIGNUM *k, +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c +@@ -1483,8 +1483,46 @@ mm_jpake_check_confirm(const BIGNUM *k, success = buffer_get_int(&m); buffer_free(&m); @@ -705,9 +707,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c + buffer_free(&m); +} +#endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -72,16 +72,18 @@ int mm_sshpam_respond(void *, u_int, cha void mm_sshpam_free_ctx(void *); #endif @@ -727,10 +729,10 @@ diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -113,16 +113,17 @@ +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -114,16 +114,17 @@ #include "session.h" #include "monitor_mm.h" #include "monitor.h" @@ -748,7 +750,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c #include int allow_severity; int deny_severity; -@@ -2236,16 +2237,20 @@ do_ssh1_kex(void) +@@ -2297,16 +2298,20 @@ do_ssh1_kex(void) packet_disconnect("Warning: client selects unsupported cipher."); /* Get check bytes from the packet. These must match those we diff --git a/openssh-6.2p2-audit5-session_key_destruction.patch b/openssh-6.4p1-audit5-session_key_destruction.patch similarity index 86% rename from openssh-6.2p2-audit5-session_key_destruction.patch rename to openssh-6.4p1-audit5-session_key_destruction.patch index 9b767c0..e8eb05a 100644 --- a/openssh-6.2p2-audit5-session_key_destruction.patch +++ b/openssh-6.4p1-audit5-session_key_destruction.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2014 # by jchadima@redhat.com -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -480,9 +480,15 @@ audit_unsupported_body(int what) /* not implemented */ } @@ -23,9 +23,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -289,24 +289,25 @@ audit_unsupported_body(int what) /* no problem, the next instruction will be fatal() */ return; @@ -52,7 +52,7 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c direction[ctos], enc, cipher ? 8 * cipher->key_len : 0, (intmax_t)pid, (intmax_t)uid, get_remote_port(), (s = get_local_ipaddr(packet_get_connection_in())), get_local_port()); - xfree(s); + free(s); @@ -322,9 +323,37 @@ audit_kex_body(int ctos, char *enc, char buf, NULL, get_remote_ipaddr(), NULL, 1); audit_close(audit_fd); @@ -74,7 +74,7 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c + get_remote_port(), + (s = get_local_ipaddr(packet_get_connection_in())), + get_local_port()); -+ xfree(s); ++ free(s); + audit_fd = audit_open(); + if (audit_fd < 0) { + if (errno != EINVAL && errno != EPROTONOSUPPORT && @@ -91,9 +91,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c +} + #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -138,16 +138,22 @@ audit_unsupported(int what) } @@ -138,9 +138,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -57,10 +57,12 @@ int audit_run_command(const char *); void audit_end_command(int, const char *); ssh_audit_event_t audit_classify_auth(const char *); @@ -154,9 +154,9 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +void audit_session_key_free_body(int ctos, pid_t, uid_t); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/auditstub.c b/openssh-6.2p2/auditstub.c ---- a/openssh-6.2p2/auditstub.c -+++ b/openssh-6.2p2/auditstub.c +diff --git a/openssh-6.4p1/auditstub.c b/openssh-6.4p1/auditstub.c +--- a/openssh-6.4p1/auditstub.c ++++ b/openssh-6.4p1/auditstub.c @@ -22,18 +22,29 @@ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT @@ -187,10 +187,10 @@ diff --git a/openssh-6.2p2/auditstub.c b/openssh-6.2p2/auditstub.c +audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) +{ +} -diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c ---- a/openssh-6.2p2/kex.c -+++ b/openssh-6.2p2/kex.c -@@ -635,8 +635,39 @@ dump_digest(char *msg, u_char *digest, i +diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c +--- a/openssh-6.4p1/kex.c ++++ b/openssh-6.4p1/kex.c +@@ -667,8 +667,39 @@ dump_digest(char *msg, u_char *digest, i if (i%32 == 31) fprintf(stderr, "\n"); else if (i%8 == 7) @@ -208,12 +208,12 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c + + if (enc->key) { + memset(enc->key, 0, enc->key_len); -+ xfree(enc->key); ++ free(enc->key); + } + + if (enc->iv) { + memset(enc->iv, 0, enc->block_size); -+ xfree(enc->iv); ++ free(enc->iv); + } + + memset(enc, 0, sizeof(*enc)); @@ -230,10 +230,10 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c + memset(&newkeys->comp, 0, sizeof(newkeys->comp)); +} + -diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h ---- a/openssh-6.2p2/kex.h -+++ b/openssh-6.2p2/kex.h -@@ -153,16 +153,18 @@ Newkeys *kex_get_newkeys(int); +diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h +--- a/openssh-6.4p1/kex.h ++++ b/openssh-6.4p1/kex.h +@@ -157,16 +157,18 @@ Newkeys *kex_get_newkeys(int); void kexdh_client(Kex *); void kexdh_server(Kex *); @@ -252,10 +252,10 @@ diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); #ifdef OPENSSL_HAS_ECC -diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c ---- a/openssh-6.2p2/mac.c -+++ b/openssh-6.2p2/mac.c -@@ -194,16 +194,30 @@ mac_clear(Mac *mac) +diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c +--- a/openssh-6.4p1/mac.c ++++ b/openssh-6.4p1/mac.c +@@ -219,16 +219,30 @@ mac_clear(Mac *mac) if (mac->umac_ctx != NULL) umac128_delete(mac->umac_ctx); } else if (mac->evp_md != NULL) @@ -272,7 +272,7 @@ diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c + + if (mac->key) { + memset(mac->key, 0, mac->key_len); -+ xfree(mac->key); ++ free(mac->key); + } + + memset(mac, 0, sizeof(*mac)); @@ -286,23 +286,23 @@ diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c char *maclist, *cp, *p; if (names == NULL || strcmp(names, "") == 0) -diff --git a/openssh-6.2p2/mac.h b/openssh-6.2p2/mac.h ---- a/openssh-6.2p2/mac.h -+++ b/openssh-6.2p2/mac.h -@@ -23,8 +23,9 @@ - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +diff --git a/openssh-6.4p1/mac.h b/openssh-6.4p1/mac.h +--- a/openssh-6.4p1/mac.h ++++ b/openssh-6.4p1/mac.h +@@ -24,8 +24,9 @@ */ int mac_valid(const char *); + char *mac_alg_list(void); int mac_setup(Mac *, char *); int mac_init(Mac *); u_char *mac_compute(Mac *, u_int32_t, u_char *, int); void mac_clear(Mac *); +void mac_destroy(Mac *); -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c -@@ -184,16 +184,17 @@ int mm_answer_gss_checkmic(int, Buffer * +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c +@@ -185,16 +185,17 @@ int mm_answer_gss_checkmic(int, Buffer * #endif #ifdef SSH_AUDIT_EVENTS @@ -320,7 +320,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ /* local state for key verify */ -@@ -237,16 +238,17 @@ struct mon_table mon_dispatch_proto20[] +@@ -238,16 +239,17 @@ struct mon_table mon_dispatch_proto20[] {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, @@ -338,7 +338,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c #ifdef SKEY {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, -@@ -276,16 +278,17 @@ struct mon_table mon_dispatch_postauth20 +@@ -277,16 +279,17 @@ struct mon_table mon_dispatch_postauth20 {MONITOR_REQ_PTYCLEANUP, 0, mm_answer_pty_cleanup}, {MONITOR_REQ_TERM, 0, mm_answer_term}, #ifdef SSH_AUDIT_EVENTS @@ -356,7 +356,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, -@@ -309,30 +312,32 @@ struct mon_table mon_dispatch_proto15[] +@@ -310,30 +313,32 @@ struct mon_table mon_dispatch_proto15[] {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, @@ -389,7 +389,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -1951,21 +1956,23 @@ mm_get_keystate(struct monitor *pmonitor +@@ -1970,21 +1975,23 @@ mm_get_keystate(struct monitor *pmonitor goto skip; } else { /* Get the Kex for rekeying */ @@ -399,13 +399,13 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c blob = buffer_get_string(&m, &bloblen); current_keys[MODE_OUT] = mm_newkeys_from_blob(blob, bloblen); + memset(blob, 0, bloblen); - xfree(blob); + free(blob); debug3("%s: Waiting for second key", __func__); blob = buffer_get_string(&m, &bloblen); current_keys[MODE_IN] = mm_newkeys_from_blob(blob, bloblen); + memset(blob, 0, bloblen); - xfree(blob); + free(blob); /* Now get sequence numbers for the packets */ seqnr = buffer_get_int(&m); @@ -413,7 +413,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c packets = buffer_get_int(&m); bytes = buffer_get_int64(&m); packet_set_state(MODE_OUT, seqnr, blocks, packets, bytes); -@@ -2001,16 +2008,31 @@ mm_get_keystate(struct monitor *pmonitor +@@ -2020,16 +2027,31 @@ mm_get_keystate(struct monitor *pmonitor /* Roaming */ if (compat20) { @@ -445,9 +445,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) { size_t len = (size_t) size * ncount; -@@ -2445,9 +2467,27 @@ mm_answer_audit_kex_body(int sock, Buffe - xfree(mac); - xfree(compress); +@@ -2464,9 +2486,27 @@ mm_answer_audit_kex_body(int sock, Buffe + free(mac); + free(compress); buffer_clear(m); mm_request_send(sock, MONITOR_ANS_AUDIT_KEX, m); @@ -473,9 +473,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + return 0; +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h ---- a/openssh-6.2p2/monitor.h -+++ b/openssh-6.2p2/monitor.h +diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h +--- a/openssh-6.4p1/monitor.h ++++ b/openssh-6.4p1/monitor.h @@ -67,16 +67,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105, MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, @@ -494,10 +494,10 @@ diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c -@@ -649,22 +649,24 @@ mm_send_keystate(struct monitor *monitor +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c +@@ -651,22 +651,24 @@ mm_send_keystate(struct monitor *monitor __func__, packet_get_newkeys(MODE_OUT), packet_get_newkeys(MODE_IN)); @@ -507,14 +507,14 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c buffer_put_string(&m, blob, bloblen); + memset(blob, 0, bloblen); - xfree(blob); + free(blob); if (!mm_newkeys_to_blob(MODE_IN, &blob, &bloblen)) fatal("%s: conversion of newkeys failed", __func__); buffer_put_string(&m, blob, bloblen); + memset(blob, 0, bloblen); - xfree(blob); + free(blob); packet_get_state(MODE_OUT, &seqnr, &blocks, &packets, &bytes); buffer_put_int(&m, seqnr); @@ -522,7 +522,7 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c buffer_put_int(&m, packets); buffer_put_int64(&m, bytes); packet_get_state(MODE_IN, &seqnr, &blocks, &packets, &bytes); -@@ -1518,9 +1520,24 @@ mm_audit_kex_body(int ctos, char *cipher +@@ -1520,9 +1522,24 @@ mm_audit_kex_body(int ctos, char *cipher buffer_put_int64(&m, uid); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_KEX, &m); @@ -547,9 +547,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c + buffer_free(&m); +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -74,16 +74,17 @@ void mm_sshpam_free_ctx(void *); #ifdef SSH_AUDIT_EVENTS @@ -568,16 +568,16 @@ diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c ---- a/openssh-6.2p2/packet.c -+++ b/openssh-6.2p2/packet.c -@@ -55,16 +55,17 @@ - #include +diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c +--- a/openssh-6.4p1/packet.c ++++ b/openssh-6.4p1/packet.c +@@ -56,16 +56,17 @@ #include #include #include #include #include + #include #include "xmalloc.h" +#include "audit.h" @@ -589,7 +589,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c #include "channels.h" #include "compat.h" #include "ssh1.h" -@@ -463,41 +464,51 @@ packet_get_connection_in(void) +@@ -469,41 +470,51 @@ packet_get_connection_in(void) /* Returns the descriptor used for writing. */ int @@ -650,7 +650,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c packet_set_protocol_flags(u_int protocol_flags) { active_state->remote_protocol_flags = protocol_flags; -@@ -722,16 +733,35 @@ packet_send1(void) +@@ -728,16 +739,35 @@ packet_send1(void) /* * Note that the packet is now only buffered in output. It won't be @@ -665,17 +665,17 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c + if (newkeys == NULL) + return; + -+ xfree(newkeys->enc.name); ++ free(newkeys->enc.name); + + mac_clear(&newkeys->mac); + /* MAC may happen to be empty - if the GCM mode of AES is used */ + if (newkeys->mac.name) -+ xfree(newkeys->mac.name); ++ free(newkeys->mac.name); + -+ xfree(newkeys->comp.name); ++ free(newkeys->comp.name); + + newkeys_destroy(newkeys); -+ xfree(newkeys); ++ free(newkeys); +} + void @@ -686,7 +686,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c Comp *comp; CipherContext *cc; u_int64_t *max_blocks; -@@ -747,31 +777,19 @@ set_newkeys(int mode) +@@ -753,31 +783,19 @@ set_newkeys(int mode) } else { cc = &active_state->receive_context; crypt_type = CIPHER_DECRYPT; @@ -704,13 +704,13 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c - memset(enc->iv, 0, enc->iv_len); - memset(enc->key, 0, enc->key_len); - memset(mac->key, 0, mac->key_len); -- xfree(enc->name); -- xfree(enc->iv); -- xfree(enc->key); -- xfree(mac->name); -- xfree(mac->key); -- xfree(comp->name); -- xfree(active_state->newkeys[mode]); +- free(enc->name); +- free(enc->iv); +- free(enc->key); +- free(mac->name); +- free(mac->key); +- free(comp->name); +- free(active_state->newkeys[mode]); + newkeys_destroy_and_free(active_state->newkeys[mode]); } active_state->newkeys[mode] = kex_get_newkeys(mode); @@ -720,7 +720,7 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c mac = &active_state->newkeys[mode]->mac; comp = &active_state->newkeys[mode]->comp; if (cipher_authlen(enc->cipher) == 0 && mac_init(mac) == 0) -@@ -1967,54 +1985,93 @@ packet_get_output(void) +@@ -1995,54 +2013,93 @@ packet_get_output(void) } void * @@ -819,15 +819,15 @@ diff --git a/openssh-6.2p2/packet.c b/openssh-6.2p2/packet.c + backup_state->connection_in = -1; + backup_state->connection_out = -1; + packet_destroy_state(backup_state); -+ xfree(backup_state); ++ free(backup_state); + backup_state = NULL; } + -diff --git a/openssh-6.2p2/packet.h b/openssh-6.2p2/packet.h ---- a/openssh-6.2p2/packet.h -+++ b/openssh-6.2p2/packet.h -@@ -118,9 +118,10 @@ int packet_need_rekeying(void); - void packet_set_rekey_limit(u_int32_t); +diff --git a/openssh-6.4p1/packet.h b/openssh-6.4p1/packet.h +--- a/openssh-6.4p1/packet.h ++++ b/openssh-6.4p1/packet.h +@@ -119,9 +119,10 @@ void packet_set_rekey_limits(u_int32_t, + time_t packet_get_rekey_timeout(void); void packet_backup_state(void); void packet_restore_state(void); @@ -837,10 +837,10 @@ diff --git a/openssh-6.2p2/packet.h b/openssh-6.2p2/packet.h +void packet_destroy_all(int, int); #endif /* PACKET_H */ -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c -@@ -1648,16 +1648,19 @@ do_child(Session *s, const char *command +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c +@@ -1661,16 +1661,19 @@ do_child(Session *s, const char *command int env_size; char *argv[ARGV_MAX]; const char *shell, *shell0, *hostname = NULL; @@ -860,10 +860,10 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c do_pwchange(s); exit(1); } -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -695,16 +695,18 @@ privsep_preauth(Authctxt *authctxt) +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -703,16 +703,18 @@ privsep_preauth(Authctxt *authctxt) setproctitle("%s", "[net]"); if (box != NULL) ssh_sandbox_child(box); @@ -882,7 +882,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c #ifdef DISABLE_FD_PASSING if (1) { #else -@@ -719,16 +721,20 @@ privsep_postauth(Authctxt *authctxt) +@@ -727,16 +729,20 @@ privsep_postauth(Authctxt *authctxt) monitor_reinit(pmonitor); pmonitor->m_pid = fork(); @@ -903,7 +903,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c /* child */ -@@ -2028,16 +2034,17 @@ main(int ac, char **av) +@@ -2089,16 +2095,17 @@ main(int ac, char **av) do_authentication(authctxt); } /* @@ -921,7 +921,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c * Cancel the alarm we set to limit the time taken for * authentication. */ -@@ -2080,16 +2087,18 @@ main(int ac, char **av) +@@ -2141,16 +2148,18 @@ main(int ac, char **av) packet_set_timeout(options.client_alive_interval, options.client_alive_count_max); @@ -940,7 +940,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c verbose("Closing connection to %.500s port %d", remote_ip, remote_port); #ifdef USE_PAM -@@ -2397,26 +2406,38 @@ do_ssh2_kex(void) +@@ -2480,26 +2489,38 @@ do_ssh2_kex(void) #endif debug("KEX done"); } diff --git a/openssh-6.2p2-audit6-server_key_destruction.patch b/openssh-6.4p1-audit6-server_key_destruction.patch similarity index 89% rename from openssh-6.2p2-audit6-server_key_destruction.patch rename to openssh-6.4p1-audit6-server_key_destruction.patch index 26e1bba..09d9742 100644 --- a/openssh-6.2p2-audit6-server_key_destruction.patch +++ b/openssh-6.4p1-audit6-server_key_destruction.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2015 # by jchadima@redhat.com -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -486,9 +486,27 @@ audit_kex_body(int ctos, char *enc, char /* not implemented */ } @@ -35,9 +35,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -351,9 +351,55 @@ audit_session_key_free_body(int ctos, pi audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, buf, NULL, get_remote_ipaddr(), NULL, 1); @@ -94,9 +94,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c + error("cannot write into audit"); +} #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -285,10 +285,29 @@ audit_kex_body(int ctos, char *enc, char * This will be called on succesfull session key discard */ @@ -127,9 +127,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -43,26 +43,30 @@ enum ssh_audit_event_type { SSH_INVALID_USER, SSH_NOLOGIN, /* denied by /etc/nologin, not implemented */ @@ -161,10 +161,10 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +void audit_generate_ephemeral_server_key(const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c ---- a/openssh-6.2p2/key.c -+++ b/openssh-6.2p2/key.c -@@ -1841,16 +1841,40 @@ key_demote(const Key *k) +diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c +--- a/openssh-6.4p1/key.c ++++ b/openssh-6.4p1/key.c +@@ -1805,16 +1805,40 @@ key_demote(const Key *k) fatal("key_free: bad key type %d", k->type); break; } @@ -205,9 +205,9 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c case KEY_RSA_CERT_V00: case KEY_DSA_CERT_V00: case KEY_RSA_CERT: -diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h ---- a/openssh-6.2p2/key.h -+++ b/openssh-6.2p2/key.h +diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h +--- a/openssh-6.4p1/key.h ++++ b/openssh-6.4p1/key.h @@ -106,16 +106,17 @@ int key_read(Key *, char **); u_int key_size(const Key *); enum fp_type key_fp_type_select(void); @@ -226,10 +226,10 @@ diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h int key_cert_check_authority(const Key *, int, int, const char *, const char **); int key_cert_is_legacy(const Key *); -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c -@@ -109,16 +109,18 @@ extern u_int utmp_len; +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c +@@ -110,16 +110,18 @@ extern u_int utmp_len; extern Newkeys *current_keys[]; extern z_stream incoming_stream; extern z_stream outgoing_stream; @@ -248,7 +248,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c u_char *keyin; u_int keyinlen; u_char *keyout; -@@ -185,16 +187,17 @@ int mm_answer_gss_checkmic(int, Buffer * +@@ -186,16 +188,17 @@ int mm_answer_gss_checkmic(int, Buffer * #ifdef SSH_AUDIT_EVENTS int mm_answer_audit_event(int, Buffer *); @@ -266,7 +266,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c static BIGNUM *ssh1_challenge = NULL; /* used for ssh1 rsa auth */ /* local state for key verify */ -@@ -239,16 +242,17 @@ struct mon_table mon_dispatch_proto20[] +@@ -240,16 +243,17 @@ struct mon_table mon_dispatch_proto20[] {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, #endif @@ -284,7 +284,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c #ifdef SKEY {MONITOR_REQ_SKEYQUERY, MON_ISAUTH, mm_answer_skeyquery}, {MONITOR_REQ_SKEYRESPOND, MON_AUTH, mm_answer_skeyrespond}, -@@ -279,16 +283,17 @@ struct mon_table mon_dispatch_postauth20 +@@ -280,16 +284,17 @@ struct mon_table mon_dispatch_postauth20 {MONITOR_REQ_TERM, 0, mm_answer_term}, #ifdef SSH_AUDIT_EVENTS {MONITOR_REQ_AUDIT_EVENT, MON_PERMIT, mm_answer_audit_event}, @@ -302,7 +302,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_SESSKEY, MON_ONCE, mm_answer_sesskey}, {MONITOR_REQ_SESSID, MON_ONCE, mm_answer_sessid}, -@@ -313,31 +318,33 @@ struct mon_table mon_dispatch_proto15[] +@@ -314,31 +319,33 @@ struct mon_table mon_dispatch_proto15[] {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond}, {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx}, #endif @@ -336,7 +336,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -1746,16 +1753,18 @@ mm_answer_term(int sock, Buffer *req) +@@ -1761,16 +1768,18 @@ mm_answer_term(int sock, Buffer *req) /* The child is terminating */ session_destroy_all(&mm_session_close); @@ -355,7 +355,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c /* Terminate process */ exit(res); -@@ -2485,9 +2494,30 @@ mm_answer_audit_session_key_free_body(in +@@ -2504,9 +2513,30 @@ mm_answer_audit_session_key_free_body(in audit_session_key_free_body(ctos, pid, uid); @@ -379,16 +379,16 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + + audit_destroy_sensitive_data(fp, pid, uid); + -+ xfree(fp); ++ free(fp); + buffer_clear(m); + + mm_request_send(sock, MONITOR_ANS_AUDIT_SERVER_KEY_FREE, m); + return 0; +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h ---- a/openssh-6.2p2/monitor.h -+++ b/openssh-6.2p2/monitor.h +diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h +--- a/openssh-6.4p1/monitor.h ++++ b/openssh-6.4p1/monitor.h @@ -68,16 +68,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, @@ -407,10 +407,10 @@ diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c -@@ -1535,9 +1535,25 @@ mm_audit_session_key_free_body(int ctos, +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c +@@ -1537,9 +1537,25 @@ mm_audit_session_key_free_body(int ctos, buffer_put_int(&m, ctos); buffer_put_int64(&m, pid); buffer_put_int64(&m, uid); @@ -436,9 +436,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c + buffer_free(&m); +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -75,16 +75,17 @@ void mm_sshpam_free_ctx(void *); #ifdef SSH_AUDIT_EVENTS #include "audit.h" @@ -457,10 +457,10 @@ diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c -@@ -131,17 +131,17 @@ static int session_pty_req(Session *); +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c +@@ -132,17 +132,17 @@ static int session_pty_req(Session *); /* import */ extern ServerOptions options; @@ -479,7 +479,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c /* data */ static int sessions_first_unused = -1; static int sessions_nalloc = 0; -@@ -1647,17 +1647,17 @@ do_child(Session *s, const char *command +@@ -1660,17 +1660,17 @@ do_child(Session *s, const char *command char **env; int env_size; char *argv[ARGV_MAX]; @@ -498,10 +498,10 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c if (s->authctxt->force_pwchange) { do_setusercontext(pw); child_close_fds(); -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -250,17 +250,17 @@ Buffer cfg; +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -256,17 +256,17 @@ Buffer cfg; /* message to be displayed after login */ Buffer loginmsg; @@ -520,7 +520,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c /* * Close all listening sockets */ -@@ -269,16 +269,25 @@ close_listen_socks(void) +@@ -275,16 +275,25 @@ close_listen_socks(void) { int i; @@ -546,7 +546,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c if (startup_pipes) for (i = 0; i < options.max_startups; i++) if (startup_pipes[i] != -1) -@@ -541,60 +550,99 @@ sshd_exchange_identification(int sock_in +@@ -547,60 +556,99 @@ sshd_exchange_identification(int sock_in close(sock_out); logit("Protocol major versions differ for %s: %.200s vs. %.200s", get_remote_ipaddr(), @@ -592,7 +592,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c + else + audit_destroy_sensitive_data(fp, + pid, uid); -+ xfree(fp); ++ free(fp); + } } - if (sensitive_data.host_certificates[i]) { @@ -639,7 +639,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c sensitive_data.ssh1_host_key = tmp; + if (fp != NULL) { + audit_destroy_sensitive_data(fp, pid, uid); -+ xfree(fp); ++ free(fp); + } } /* Certs do not need demotion */ @@ -649,7 +649,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c } static void -@@ -1154,16 +1202,17 @@ server_accept_loop(int *sock_in, int *so +@@ -1179,16 +1227,17 @@ server_accept_loop(int *sock_in, int *so /* Wait in select until there is a connection. */ ret = select(maxfd+1, fdset, NULL, NULL, NULL); @@ -667,7 +667,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c generate_ephemeral_server_key(); key_used = 0; key_do_regen = 0; -@@ -2077,27 +2126,28 @@ main(int ac, char **av) +@@ -2138,27 +2187,28 @@ main(int ac, char **av) /* * In privilege separation, we fork another child and prepare * file descriptor passing. @@ -697,11 +697,11 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c verbose("Closing connection to %.500s port %d", remote_ip, remote_port); -@@ -2316,17 +2366,17 @@ do_ssh1_kex(void) +@@ -2377,17 +2427,17 @@ do_ssh1_kex(void) MD5_Update(&md, sensitive_data.ssh1_cookie, SSH_SESSION_KEY_LENGTH); MD5_Final(session_key + 16, &md); memset(buf, 0, bytes); - xfree(buf); + free(buf); for (i = 0; i < 16; i++) session_id[i] = session_key[i] ^ session_key[i + 16]; } @@ -716,7 +716,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c BN_clear_free(session_key_int); /* Set the session key. From this on all communications will be encrypted. */ -@@ -2427,16 +2477,18 @@ cleanup_exit(int i) +@@ -2510,16 +2560,18 @@ cleanup_exit(int i) debug("Killing privsep child %d", pmonitor->m_pid); if (kill(pmonitor->m_pid, SIGKILL) != 0 && errno != ESRCH) diff --git a/openssh-6.2p2-audit7-libaudit_compat.patch b/openssh-6.4p1-audit7-libaudit_compat.patch similarity index 92% rename from openssh-6.2p2-audit7-libaudit_compat.patch rename to openssh-6.4p1-audit7-libaudit_compat.patch index 4def265..1924510 100644 --- a/openssh-6.2p2-audit7-libaudit_compat.patch +++ b/openssh-6.4p1-audit7-libaudit_compat.patch @@ -1,8 +1,8 @@ # definitions for AUDIT_CRYPTO_* symbols fom libaudit 2.x -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -25,16 +25,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @@ -21,10 +21,10 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c #include "key.h" #include "hostfile.h" #include "auth.h" -diff --git a/openssh-6.2p2/compat-libaudit.h b/openssh-6.2p2/compat-libaudit.h +diff --git a/openssh-6.4p1/compat-libaudit.h b/openssh-6.4p1/compat-libaudit.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/compat-libaudit.h ++++ b/openssh-6.4p1/compat-libaudit.h @@ -0,0 +1,79 @@ +/* AUDIT_CRYPTO symbol definitions from libaudit 2.x */ +/* libaudit.h -- diff --git a/openssh-6.2p2-audit8-libaudit_dns_timeouts.patch b/openssh-6.4p1-audit8-libaudit_dns_timeouts.patch similarity index 92% rename from openssh-6.2p2-audit8-libaudit_dns_timeouts.patch rename to openssh-6.4p1-audit8-libaudit_dns_timeouts.patch index 8e7f191..ad92f62 100644 --- a/openssh-6.2p2-audit8-libaudit_dns_timeouts.patch +++ b/openssh-6.4p1-audit8-libaudit_dns_timeouts.patch @@ -4,9 +4,9 @@ # Note that this particular solution causes the logs to always contain # "hostname=?, addr=?" when DNS lookups are disabled. -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -62,17 +62,17 @@ linux_audit_user_logxxx(int uid, const c if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT) diff --git a/openssh-6.2p2-blocksigalrm.patch b/openssh-6.4p1-blocksigalrm.patch similarity index 83% rename from openssh-6.2p2-blocksigalrm.patch rename to openssh-6.4p1-blocksigalrm.patch index c709009..2556adc 100644 --- a/openssh-6.2p2-blocksigalrm.patch +++ b/openssh-6.4p1-blocksigalrm.patch @@ -2,10 +2,10 @@ # grace_alarm_handler) # bnc#57354 -diff --git a/openssh-6.2p2/log.c b/openssh-6.2p2/log.c ---- a/openssh-6.2p2/log.c -+++ b/openssh-6.2p2/log.c -@@ -46,16 +46,17 @@ +diff --git a/openssh-6.4p1/log.c b/openssh-6.4p1/log.c +--- a/openssh-6.4p1/log.c ++++ b/openssh-6.4p1/log.c +@@ -47,16 +47,17 @@ #include #include #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) @@ -18,12 +18,12 @@ diff --git a/openssh-6.2p2/log.c b/openssh-6.2p2/log.c static LogLevel log_level = SYSLOG_LEVEL_INFO; static int log_on_stderr = 1; + static int log_stderr_fd = STDERR_FILENO; static int log_facility = LOG_AUTH; static char *argv0; static log_handler_fn *log_handler; static void *log_handler_ctx; - -@@ -368,16 +369,17 @@ do_log(LogLevel level, const char *fmt, +@@ -384,16 +385,17 @@ do_log(LogLevel level, const char *fmt, { #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) struct syslog_data sdata = SYSLOG_DATA_INIT; @@ -41,14 +41,14 @@ diff --git a/openssh-6.2p2/log.c b/openssh-6.2p2/log.c switch (level) { case SYSLOG_LEVEL_FATAL: -@@ -426,20 +428,29 @@ do_log(LogLevel level, const char *fmt, +@@ -442,20 +444,29 @@ do_log(LogLevel level, const char *fmt, tmp_handler = log_handler; log_handler = NULL; tmp_handler(level, fmtbuf, log_handler_ctx); log_handler = tmp_handler; } else if (log_on_stderr) { snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); - write(STDERR_FILENO, msgbuf, strlen(msgbuf)); + (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); } else { + /* Prevent a race between the grace_alarm + * which writes a log message and terminates diff --git a/openssh-6.2p2-default-protocol.patch b/openssh-6.4p1-default-protocol.patch similarity index 83% rename from openssh-6.2p2-default-protocol.patch rename to openssh-6.4p1-default-protocol.patch index 6d2d2b8..e71fabf 100644 --- a/openssh-6.2p2-default-protocol.patch +++ b/openssh-6.4p1-default-protocol.patch @@ -1,8 +1,8 @@ # only enable SSHv2 protocol by default (upstream default is fallback to v1) -diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config ---- a/openssh-6.2p2/ssh_config -+++ b/openssh-6.2p2/ssh_config +diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +--- a/openssh-6.4p1/ssh_config ++++ b/openssh-6.4p1/ssh_config @@ -41,17 +41,17 @@ ForwardX11Trusted yes # CheckHostIP yes # AddressFamily any diff --git a/openssh-6.2p2-disable-openssl-abi-check.patch b/openssh-6.4p1-disable-openssl-abi-check.patch similarity index 89% rename from openssh-6.2p2-disable-openssl-abi-check.patch rename to openssh-6.4p1-disable-openssl-abi-check.patch index 3f382ff..23288a5 100644 --- a/openssh-6.2p2-disable-openssl-abi-check.patch +++ b/openssh-6.4p1-disable-openssl-abi-check.patch @@ -2,9 +2,9 @@ # reliable indicator of ABI changes and doesn't make much sense in a # distribution package -diff --git a/openssh-6.2p2/entropy.c b/openssh-6.2p2/entropy.c ---- a/openssh-6.2p2/entropy.c -+++ b/openssh-6.2p2/entropy.c +diff --git a/openssh-6.4p1/entropy.c b/openssh-6.4p1/entropy.c +--- a/openssh-6.4p1/entropy.c ++++ b/openssh-6.4p1/entropy.c @@ -212,22 +212,23 @@ seed_rng(void) #endif /* diff --git a/openssh-6.2p2-eal3.patch b/openssh-6.4p1-eal3.patch similarity index 82% rename from openssh-6.2p2-eal3.patch rename to openssh-6.4p1-eal3.patch index 77501c9..22b8d8c 100644 --- a/openssh-6.2p2-eal3.patch +++ b/openssh-6.4p1-eal3.patch @@ -1,9 +1,9 @@ # fix paths and references in sshd man pages -diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 ---- a/openssh-6.2p2/sshd.8 -+++ b/openssh-6.2p2/sshd.8 -@@ -871,17 +871,17 @@ See +diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 +--- a/openssh-6.4p1/sshd.8 ++++ b/openssh-6.4p1/sshd.8 +@@ -872,17 +872,17 @@ See If this file exists, .Nm refuses to let anyone except root log in. @@ -22,7 +22,7 @@ diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 .It Pa /etc/ssh/ssh_host_key .It Pa /etc/ssh/ssh_host_dsa_key .It Pa /etc/ssh/ssh_host_ecdsa_key -@@ -950,17 +950,17 @@ The content of this file is not sensitiv +@@ -951,17 +951,17 @@ The content of this file is not sensitiv .Xr sftp 1 , .Xr ssh 1 , .Xr ssh-add 1 , @@ -41,10 +41,10 @@ diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, -diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 ---- a/openssh-6.2p2/sshd_config.5 -+++ b/openssh-6.2p2/sshd_config.5 -@@ -271,18 +271,17 @@ The contents of the specified file are s +diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 +--- a/openssh-6.4p1/sshd_config.5 ++++ b/openssh-6.4p1/sshd_config.5 +@@ -278,18 +278,17 @@ The contents of the specified file are s authentication is allowed. If the argument is .Dq none @@ -64,7 +64,7 @@ diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 to after authentication. All components of the pathname must be root-owned directories that are not writable by any other user or group. -@@ -550,17 +549,17 @@ and +@@ -565,17 +564,17 @@ and .Pa .shosts files will not be used in .Cm RhostsRSAAuthentication diff --git a/openssh-6.2p2-fingerprint_hash.patch b/openssh-6.4p1-fingerprint_hash.patch similarity index 76% rename from openssh-6.2p2-fingerprint_hash.patch rename to openssh-6.4p1-fingerprint_hash.patch index 57e4dad..392a403 100644 --- a/openssh-6.2p2-fingerprint_hash.patch +++ b/openssh-6.4p1-fingerprint_hash.patch @@ -1,36 +1,36 @@ # HG changeset patch -# Parent 2e71c896d924778e46e68e0c9be9a8b13e428f2f +# Parent d41afe56fd49d0a9669738b1f4d53ddae0cb195a # select fingerprint hash algorithms based on the environment variable # SSH_FP_TYPE_ENVVAR and append it to hex and randomart fingerprints # Petr Cerny -diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c ---- a/openssh-6.2p2/auth-rsa.c -+++ b/openssh-6.2p2/auth-rsa.c -@@ -323,17 +323,17 @@ auth_rsa(Authctxt *authctxt, BIGNUM *cli - return (0); - } - /* - * Correct response. The client has been successfully - * authenticated. Note that we have not yet processed the - * options; this will be reset if the options cause the - * authentication to be rejected. - */ -- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); -+ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); - verbose("Found matching %s key: %s", - key_type(key), fp); - xfree(fp); - key_free(key); +diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c +--- a/openssh-6.4p1/auth-rsa.c ++++ b/openssh-6.4p1/auth-rsa.c +@@ -226,17 +226,17 @@ rsa_key_allowed_in_file(struct passwd *p - packet_send_debug("RSA authentication accepted."); - return (1); - } -diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c ---- a/openssh-6.2p2/auth.c -+++ b/openssh-6.2p2/auth.c -@@ -658,17 +658,17 @@ auth_key_is_revoked(Key *key) + /* check the real bits */ + keybits = BN_num_bits(key->rsa->n); + if (keybits < 0 || bits != keybits) + logit("Warning: %s, line %lu: keysize mismatch: " + "actual %d vs. announced %d.", + file, linenum, BN_num_bits(key->rsa->n), bits); + +- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + debug("matching key found: file %s, line %lu %s %s", + file, linenum, key_type(key), fp); + free(fp); + + /* Never accept a revoked key */ + if (auth_key_is_revoked(key)) + break; + +diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c +--- a/openssh-6.4p1/auth.c ++++ b/openssh-6.4p1/auth.c +@@ -680,17 +680,17 @@ auth_key_is_revoked(Key *key) case -1: /* Error opening revoked_keys_file: refuse all keys */ error("Revoked keys file is unreadable: refusing public key " @@ -43,16 +43,16 @@ diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c + key_fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); error("WARNING: authentication attempt with a revoked " "%s key %s ", key_type(key), key_fp); - xfree(key_fp); + free(key_fp); return 1; } fatal("key_in_file returned junk"); } -diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c ---- a/openssh-6.2p2/auth2-hostbased.c -+++ b/openssh-6.2p2/auth2-hostbased.c -@@ -192,23 +192,23 @@ hostbased_key_allowed(struct passwd *pw, +diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c +--- a/openssh-6.4p1/auth2-hostbased.c ++++ b/openssh-6.4p1/auth2-hostbased.c +@@ -196,23 +196,23 @@ hostbased_key_allowed(struct passwd *pw, _PATH_SSH_SYSTEM_HOSTFILE2, options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE2); @@ -73,15 +73,43 @@ diff --git a/openssh-6.2p2/auth2-hostbased.c b/openssh-6.2p2/auth2-hostbased.c verbose("Accepted %s public key %s from %s@%s", key_type(key), fp, cuser, lookup); } - xfree(fp); + free(fp); } return (host_status == HOST_OK); } -diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c ---- a/openssh-6.2p2/auth2-pubkey.c -+++ b/openssh-6.2p2/auth2-pubkey.c -@@ -312,17 +312,17 @@ check_authkeys_file(FILE *f, char *file, +diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c +--- a/openssh-6.4p1/auth2-pubkey.c ++++ b/openssh-6.4p1/auth2-pubkey.c +@@ -202,25 +202,25 @@ pubkey_auth_info(Authctxt *authctxt, con + i = vasprintf(&extra, fmt, ap); + va_end(ap); + if (i < 0 || extra == NULL) + fatal("%s: vasprintf failed", __func__); + } + + if (key_is_cert(key)) { + fp = key_fingerprint(key->cert->signature_key, +- SSH_FP_MD5, SSH_FP_HEX); ++ key_fp_type_select(), SSH_FP_HEX); + auth_info(authctxt, "%s ID %s (serial %llu) CA %s %s%s%s", + key_type(key), key->cert->key_id, + (unsigned long long)key->cert->serial, + key_type(key->cert->signature_key), fp, + extra == NULL ? "" : ", ", extra == NULL ? "" : extra); + free(fp); + } else { +- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); ++ fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); + auth_info(authctxt, "%s %s%s%s", key_type(key), fp, + extra == NULL ? "" : ", ", extra == NULL ? "" : extra); + free(fp); + } + free(extra); + } + + static int +@@ -354,17 +354,17 @@ check_authkeys_file(FILE *f, char *file, if (key_is_cert(key)) { if (!key_equal(found, key->cert->signature_key)) continue; @@ -100,26 +128,26 @@ diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c * a key option, then prefer that list to matching * their username in the certificate principals list. */ -@@ -355,17 +355,17 @@ check_authkeys_file(FILE *f, char *file, +@@ -395,17 +395,17 @@ check_authkeys_file(FILE *f, char *file, + break; + } else if (key_equal(found, key)) { if (auth_parse_options(pw, key_options, file, linenum) != 1) continue; if (key_is_cert_authority) continue; found_key = 1; - debug("matching key found: file %s, line %lu", - file, linenum); - fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX); + fp = key_fingerprint(found, key_fp_type_select(), SSH_FP_HEX); - verbose("Found matching %s key: %s", - key_type(found), fp); - xfree(fp); + debug("matching key found: file %s, line %lu %s %s", + file, linenum, key_type(found), fp); + free(fp); break; } } - key_free(found); - if (!found_key) -@@ -380,17 +380,17 @@ user_cert_trusted_ca(struct passwd *pw, + if (found != NULL) + key_free(found); +@@ -421,17 +421,17 @@ user_cert_trusted_ca(struct passwd *pw, char *ca_fp, *principals_file = NULL; const char *reason; int ret = 0; @@ -138,11 +166,11 @@ diff --git a/openssh-6.2p2/auth2-pubkey.c b/openssh-6.2p2/auth2-pubkey.c options.trusted_user_ca_keys); goto out; } -diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c ---- a/openssh-6.2p2/key.c -+++ b/openssh-6.2p2/key.c -@@ -391,30 +391,38 @@ key_fingerprint_raw(const Key *k, enum f - xfree(blob); +diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c +--- a/openssh-6.4p1/key.c ++++ b/openssh-6.4p1/key.c +@@ -390,30 +390,38 @@ key_fingerprint_raw(const Key *k, enum f + free(blob); } else { fatal("key_fingerprint_raw: blob is null"); } @@ -183,7 +211,7 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c { char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm', -@@ -489,17 +497,18 @@ key_fingerprint_bubblebabble(u_char *dgs +@@ -488,17 +496,18 @@ key_fingerprint_bubblebabble(u_char *dgs * can be in the exact middle of the picture, and FLDBASE should be >=8 . * Else pictures would be too dense, and drawing the frame would * fail, too, because the key type would not fit in anymore. @@ -203,7 +231,7 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c char *augmentation_string = " .o+=*BOX@%&#/^SE"; char *retval, *p; u_char field[FLDSIZE_X][FLDSIZE_Y]; -@@ -556,18 +565,19 @@ key_fingerprint_randomart(u_char *dgst_r +@@ -555,18 +564,19 @@ key_fingerprint_randomart(u_char *dgst_r *p++ = '|'; for (x = 0; x < FLDSIZE_X; x++) *p++ = augmentation_string[MIN(field[x][y], len)]; @@ -224,8 +252,8 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c } char * - key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep) -@@ -576,34 +586,91 @@ key_fingerprint(Key *k, enum fp_type dgs + key_fingerprint(const Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep) +@@ -575,34 +585,91 @@ key_fingerprint(const Key *k, enum fp_ty u_char *dgst_raw; u_int dgst_raw_len; @@ -250,7 +278,7 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c break; } memset(dgst_raw, 0, dgst_raw_len); - xfree(dgst_raw); + free(dgst_raw); return retval; } @@ -319,9 +347,9 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c * the buffer containing the number. */ static int -diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h ---- a/openssh-6.2p2/key.h -+++ b/openssh-6.2p2/key.h +diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h +--- a/openssh-6.4p1/key.h ++++ b/openssh-6.4p1/key.h @@ -51,16 +51,18 @@ enum fp_type { SSH_FP_MD5, SSH_FP_SHA256 @@ -343,7 +371,7 @@ diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h u_int type; /* SSH2_CERT_TYPE_USER or SSH2_CERT_TYPE_HOST */ @@ -97,16 +99,18 @@ int key_equal_public(const Key *, cons int key_equal(const Key *, const Key *); - char *key_fingerprint(Key *, enum fp_type, enum fp_rep); + char *key_fingerprint(const Key *, enum fp_type, enum fp_rep); u_char *key_fingerprint_raw(const Key *, enum fp_type, u_int *); const char *key_type(const Key *); const char *key_cert_type(const Key *); @@ -360,9 +388,9 @@ diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h int key_type_plain(int); int key_to_certified(Key *, int); int key_drop_cert(Key *); -diff --git a/openssh-6.2p2/ssh-add.c b/openssh-6.2p2/ssh-add.c ---- a/openssh-6.2p2/ssh-add.c -+++ b/openssh-6.2p2/ssh-add.c +diff --git a/openssh-6.4p1/ssh-add.c b/openssh-6.4p1/ssh-add.c +--- a/openssh-6.4p1/ssh-add.c ++++ b/openssh-6.4p1/ssh-add.c @@ -321,17 +321,17 @@ list_identities(AuthenticationConnection int version; @@ -377,15 +405,15 @@ diff --git a/openssh-6.2p2/ssh-add.c b/openssh-6.2p2/ssh-add.c SSH_FP_HEX); printf("%d %s %s (%s)\n", key_size(key), fp, comment, key_type(key)); - xfree(fp); + free(fp); } else { if (!key_write(key, stdout)) fprintf(stderr, "key_write failed"); fprintf(stdout, " %s\n", comment); -diff --git a/openssh-6.2p2/ssh-agent.c b/openssh-6.2p2/ssh-agent.c ---- a/openssh-6.2p2/ssh-agent.c -+++ b/openssh-6.2p2/ssh-agent.c -@@ -194,17 +194,17 @@ lookup_identity(Key *key, int version) +diff --git a/openssh-6.4p1/ssh-agent.c b/openssh-6.4p1/ssh-agent.c +--- a/openssh-6.4p1/ssh-agent.c ++++ b/openssh-6.4p1/ssh-agent.c +@@ -193,17 +193,17 @@ lookup_identity(Key *key, int version) /* Check confirmation of keysign request */ static int @@ -399,14 +427,44 @@ diff --git a/openssh-6.2p2/ssh-agent.c b/openssh-6.2p2/ssh-agent.c if (ask_permission("Allow use of key %s?\nKey fingerprint %s.", id->comment, p)) ret = 0; - xfree(p); + free(p); return (ret); } -diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c ---- a/openssh-6.2p2/ssh-keygen.c -+++ b/openssh-6.2p2/ssh-keygen.c +diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c +--- a/openssh-6.4p1/ssh-keygen.c ++++ b/openssh-6.4p1/ssh-keygen.c +@@ -725,27 +725,27 @@ do_download(struct passwd *pw) + { + #ifdef ENABLE_PKCS11 + Key **keys = NULL; + int i, nkeys; + enum fp_rep rep; + enum fp_type fptype; + char *fp, *ra; + +- fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; ++ fptype = print_bubblebabble ? SSH_FP_SHA1 : key_fp_type_select(); + rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; + + pkcs11_init(0); + nkeys = pkcs11_add_provider(pkcs11provider, NULL, &keys); + if (nkeys <= 0) + fatal("cannot read public key from pkcs11"); + for (i = 0; i < nkeys; i++) { + if (print_fingerprint) { + fp = key_fingerprint(keys[i], fptype, rep); +- ra = key_fingerprint(keys[i], SSH_FP_MD5, ++ ra = key_fingerprint(keys[i], key_fp_type_select(), + SSH_FP_RANDOMART); + printf("%u %s %s (PKCS11 key)\n", key_size(keys[i]), + fp, key_type(keys[i])); + if (log_level >= SYSLOG_LEVEL_VERBOSE) + printf("%s\n", ra); + free(ra); + free(fp); + } else { @@ -768,29 +768,29 @@ do_fingerprint(struct passwd *pw) FILE *f; Key *public; @@ -436,9 +494,9 @@ diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c if (log_level >= SYSLOG_LEVEL_VERBOSE) printf("%s\n", ra); key_free(public); - xfree(comment); - xfree(ra); - xfree(fp); + free(comment); + free(ra); + free(fp); @@ -846,17 +846,17 @@ do_fingerprint(struct passwd *pw) public = key_new(KEY_UNSPEC); if (key_read(public, &cp) != 1) { @@ -454,8 +512,8 @@ diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c comment ? comment : "no comment", key_type(public)); if (log_level >= SYSLOG_LEVEL_VERBOSE) printf("%s\n", ra); - xfree(ra); - xfree(fp); + free(ra); + free(fp); key_free(public); invalid = 0; @@ -967,20 +967,20 @@ do_gen_all_hostkeys(struct passwd *pw) @@ -477,11 +535,11 @@ diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c key_type(public)); if (log_level >= SYSLOG_LEVEL_VERBOSE) printf("%s\n", ra); - xfree(ra); - xfree(fp); + free(ra); + free(fp); } else { if (hash && (name = host_hash(name, NULL, 0)) == NULL) -@@ -1849,19 +1849,19 @@ do_show_cert(struct passwd *pw) +@@ -1850,19 +1850,19 @@ do_show_cert(struct passwd *pw) if (stat(identity_file, &st) < 0) fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); if ((key = key_load_public(identity_file, NULL)) == NULL) @@ -503,7 +561,7 @@ diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c printf(" Signing CA: %s %s\n", key_type(key->cert->signature_key), ca_fp); printf(" Key ID: \"%s\"\n", key->cert->key_id); -@@ -2646,18 +2646,18 @@ passphrase_again: +@@ -2650,18 +2650,18 @@ passphrase_again: exit(1); } if (!key_write(public, f)) @@ -523,11 +581,11 @@ diff --git a/openssh-6.2p2/ssh-keygen.c b/openssh-6.2p2/ssh-keygen.c printf("%s %s\n", fp, comment); printf("The key's randomart image is:\n"); printf("%s\n", ra); - xfree(ra); -diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c ---- a/openssh-6.2p2/sshconnect.c -+++ b/openssh-6.2p2/sshconnect.c -@@ -826,18 +826,18 @@ check_host_key(char *hostname, struct so + free(ra); +diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c +--- a/openssh-6.4p1/sshconnect.c ++++ b/openssh-6.4p1/sshconnect.c +@@ -825,18 +825,18 @@ check_host_key(char *hostname, struct so "address '%.128s' to the list of known " "hosts (%.30s).", type, ip, user_hostfiles[0]); @@ -542,13 +600,13 @@ diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c + ra = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_RANDOMART); logit("Host key fingerprint is %s\n%s\n", fp, ra); - xfree(ra); - xfree(fp); + free(ra); + free(fp); } break; case HOST_NEW: if (options.host_key_alias == NULL && port != 0 && -@@ -867,18 +867,18 @@ check_host_key(char *hostname, struct so +@@ -866,18 +866,18 @@ check_host_key(char *hostname, struct so if (show_other_keys(host_hostkeys, host_key)) snprintf(msg1, sizeof(msg1), @@ -569,7 +627,7 @@ diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c "Matching host key fingerprint" " found in DNS.\n"); else -@@ -1132,17 +1132,17 @@ fail: +@@ -1131,17 +1131,17 @@ fail: /* returns 0 if key verifies or -1 if key does NOT verify */ int @@ -581,14 +639,14 @@ diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c - fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); + fp = key_fingerprint(host_key, key_fp_type_select(), SSH_FP_HEX); debug("Server host key: %s %s", key_type(host_key), fp); - xfree(fp); + free(fp); /* XXX certs are not yet supported for DNS */ if (!key_is_cert(host_key) && options.verify_host_key_dns && verify_host_key_dns(host, hostaddr, host_key, &flags) == 0) { if (flags & DNS_VERIFY_FOUND) { -@@ -1234,18 +1234,18 @@ show_other_keys(struct hostkeys *hostkey +@@ -1233,18 +1233,18 @@ show_other_keys(struct hostkeys *hostkey char *fp, *ra; const struct hostkey_entry *found; @@ -609,7 +667,7 @@ diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c key_type(found->key), fp); if (options.visual_host_key) logit("%s", ra); -@@ -1256,17 +1256,17 @@ show_other_keys(struct hostkeys *hostkey +@@ -1255,17 +1255,17 @@ show_other_keys(struct hostkeys *hostkey return ret; } @@ -628,10 +686,10 @@ diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); error("It is also possible that a host key has just been changed."); error("The fingerprint for the %s key sent by the remote host is\n%s.", -diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c ---- a/openssh-6.2p2/sshconnect2.c -+++ b/openssh-6.2p2/sshconnect2.c -@@ -592,17 +592,17 @@ input_userauth_pk_ok(int type, u_int32_t +diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c +--- a/openssh-6.4p1/sshconnect2.c ++++ b/openssh-6.4p1/sshconnect2.c +@@ -590,17 +590,17 @@ input_userauth_pk_ok(int type, u_int32_t goto done; } if (key->type != pktype) { @@ -643,14 +701,14 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c - fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); + fp = key_fingerprint(key, key_fp_type_select(), SSH_FP_HEX); debug2("input_userauth_pk_ok: fp %s", fp); - xfree(fp); + free(fp); /* * search keys in the reverse order, because last candidate has been * moved to the end of the queue. this also avoids confusion by * duplicate keys */ -@@ -1207,17 +1207,17 @@ sign_and_send_pubkey(Authctxt *authctxt, +@@ -1204,17 +1204,17 @@ sign_and_send_pubkey(Authctxt *authctxt, Buffer b; u_char *blob, *signature; u_int bloblen, slen; @@ -662,7 +720,7 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c - fp = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX); + fp = key_fingerprint(id->key, key_fp_type_select(), SSH_FP_HEX); debug3("sign_and_send_pubkey: %s %s", key_type(id->key), fp); - xfree(fp); + free(fp); if (key_to_blob(id->key, &blob, &bloblen) == 0) { /* we cannot handle this key */ diff --git a/openssh-6.2p2-fips.patch b/openssh-6.4p1-fips.patch similarity index 94% rename from openssh-6.2p2-fips.patch rename to openssh-6.4p1-fips.patch index d441f12..bd5b2f9 100644 --- a/openssh-6.2p2-fips.patch +++ b/openssh-6.4p1-fips.patch @@ -4,9 +4,9 @@ # HG changeset patch # Parent 6536ed881743cbf05afe962021b985f9b1eab495 -diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in ---- a/openssh-6.2p2/Makefile.in -+++ b/openssh-6.2p2/Makefile.in +diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in +--- a/openssh-6.4p1/Makefile.in ++++ b/openssh-6.4p1/Makefile.in @@ -72,17 +72,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ @@ -26,9 +26,9 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ audit.o audit-bsm.o audit-linux.o platform.o \ sshpty.o sshlogin.o servconf.o serverloop.o \ -diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c ---- a/openssh-6.2p2/auth-rsa.c -+++ b/openssh-6.2p2/auth-rsa.c +diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c +--- a/openssh-6.4p1/auth-rsa.c ++++ b/openssh-6.4p1/auth-rsa.c @@ -15,17 +15,17 @@ */ @@ -132,7 +132,7 @@ diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c debug("unsuccessful audit"); rv = 0; } - xfree(fp); + free(fp); @@ -135,17 +145,17 @@ auth_rsa_verify_response(Key *key, BIGNU * and returns true (non-zero) if the client gave the correct answer to * our challenge; returns zero if the client gives a wrong answer. @@ -171,9 +171,9 @@ diff --git a/openssh-6.2p2/auth-rsa.c b/openssh-6.2p2/auth-rsa.c return (success); } -diff --git a/openssh-6.2p2/cipher-ctr.c b/openssh-6.2p2/cipher-ctr.c ---- a/openssh-6.2p2/cipher-ctr.c -+++ b/openssh-6.2p2/cipher-ctr.c +diff --git a/openssh-6.4p1/cipher-ctr.c b/openssh-6.4p1/cipher-ctr.c +--- a/openssh-6.4p1/cipher-ctr.c ++++ b/openssh-6.4p1/cipher-ctr.c @@ -21,16 +21,17 @@ #include @@ -208,9 +208,9 @@ diff --git a/openssh-6.2p2/cipher-ctr.c b/openssh-6.2p2/cipher-ctr.c } #endif /* OPENSSL_HAVE_EVPCTR */ -diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c ---- a/openssh-6.2p2/cipher.c -+++ b/openssh-6.2p2/cipher.c +diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c +--- a/openssh-6.4p1/cipher.c ++++ b/openssh-6.4p1/cipher.c @@ -42,16 +42,17 @@ #include @@ -373,10 +373,10 @@ diff --git a/openssh-6.2p2/cipher.c b/openssh-6.2p2/cipher.c /* * Exports an IV from the CipherContext required to export the key * state back from the unprivileged child to the privileged parent -diff --git a/openssh-6.2p2/fips.c b/openssh-6.2p2/fips.c +diff --git a/openssh-6.4p1/fips.c b/openssh-6.4p1/fips.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/fips.c ++++ b/openssh-6.4p1/fips.c @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2012 Petr Cerny. All rights reserved. @@ -554,10 +554,10 @@ new file mode 100644 + return EVP_get_digestbynid(fips_hash_nid_min()); +} + -diff --git a/openssh-6.2p2/fips.h b/openssh-6.2p2/fips.h +diff --git a/openssh-6.4p1/fips.h b/openssh-6.4p1/fips.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/fips.h ++++ b/openssh-6.4p1/fips.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012 Petr Cerny. All rights reserved. @@ -613,9 +613,9 @@ new file mode 100644 + +#endif + -diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c ---- a/openssh-6.2p2/key.c -+++ b/openssh-6.2p2/key.c +diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c +--- a/openssh-6.4p1/key.c ++++ b/openssh-6.4p1/key.c @@ -49,16 +49,17 @@ #include "xmalloc.h" #include "key.h" @@ -654,9 +654,9 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c /* * string lengths must be less or equal to SSH_FP_TYPE_STRLEN (defined in * key.h) as to fit into the fingerprint string buffer -diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c ---- a/openssh-6.2p2/mac.c -+++ b/openssh-6.2p2/mac.c +diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c +--- a/openssh-6.4p1/mac.c ++++ b/openssh-6.4p1/mac.c @@ -36,34 +36,35 @@ #include "xmalloc.h" #include "log.h" @@ -760,9 +760,9 @@ diff --git a/openssh-6.2p2/mac.c b/openssh-6.2p2/mac.c mac_setup_by_id(mac, i); debug2("mac_setup: found %s", name); return (0); -diff --git a/openssh-6.2p2/myproposal.h b/openssh-6.2p2/myproposal.h ---- a/openssh-6.2p2/myproposal.h -+++ b/openssh-6.2p2/myproposal.h +diff --git a/openssh-6.4p1/myproposal.h b/openssh-6.4p1/myproposal.h +--- a/openssh-6.4p1/myproposal.h ++++ b/openssh-6.4p1/myproposal.h @@ -71,16 +71,20 @@ "ssh-dss" @@ -804,9 +804,9 @@ diff --git a/openssh-6.2p2/myproposal.h b/openssh-6.2p2/myproposal.h static char *myproposal[PROPOSAL_MAX] = { KEX_DEFAULT_KEX, KEX_DEFAULT_PK_ALG, -diff --git a/openssh-6.2p2/openbsd-compat/bsd-arc4random.c b/openssh-6.2p2/openbsd-compat/bsd-arc4random.c ---- a/openssh-6.2p2/openbsd-compat/bsd-arc4random.c -+++ b/openssh-6.2p2/openbsd-compat/bsd-arc4random.c +diff --git a/openssh-6.4p1/openbsd-compat/bsd-arc4random.c b/openssh-6.4p1/openbsd-compat/bsd-arc4random.c +--- a/openssh-6.4p1/openbsd-compat/bsd-arc4random.c ++++ b/openssh-6.4p1/openbsd-compat/bsd-arc4random.c @@ -18,34 +18,35 @@ #include @@ -930,9 +930,9 @@ diff --git a/openssh-6.2p2/openbsd-compat/bsd-arc4random.c b/openssh-6.2p2/openb { size_t i; u_int32_t r = 0; -diff --git a/openssh-6.2p2/ssh-rsa.c b/openssh-6.2p2/ssh-rsa.c ---- a/openssh-6.2p2/ssh-rsa.c -+++ b/openssh-6.2p2/ssh-rsa.c +diff --git a/openssh-6.4p1/ssh-rsa.c b/openssh-6.4p1/ssh-rsa.c +--- a/openssh-6.4p1/ssh-rsa.c ++++ b/openssh-6.4p1/ssh-rsa.c @@ -27,16 +27,17 @@ #include "xmalloc.h" @@ -981,15 +981,15 @@ diff --git a/openssh-6.2p2/ssh-rsa.c b/openssh-6.2p2/ssh-rsa.c + fips_correct_nid(&nid); if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { error("ssh_rsa_verify: EVP_get_digestbynid %d failed", nid); - xfree(sigblob); + free(sigblob); return -1; } EVP_DigestInit(&md, evp_md); EVP_DigestUpdate(&md, data, datalen); EVP_DigestFinal(&md, digest, &dlen); -diff --git a/openssh-6.2p2/ssh.c b/openssh-6.2p2/ssh.c ---- a/openssh-6.2p2/ssh.c -+++ b/openssh-6.2p2/ssh.c +diff --git a/openssh-6.4p1/ssh.c b/openssh-6.4p1/ssh.c +--- a/openssh-6.4p1/ssh.c ++++ b/openssh-6.4p1/ssh.c @@ -99,16 +99,17 @@ #include "kex.h" #include "mac.h" @@ -1028,7 +1028,7 @@ diff --git a/openssh-6.2p2/ssh.c b/openssh-6.2p2/ssh.c options.address_family = AF_INET; break; @@ -781,17 +784,22 @@ main(int ac, char **av) - xfree(cp); + free(cp); } if (muxclient_command != 0 && options.control_path == NULL) fatal("No ControlPath specified for \"-O\" command"); @@ -1051,9 +1051,9 @@ diff --git a/openssh-6.2p2/ssh.c b/openssh-6.2p2/ssh.c options.use_privileged_port, #else original_effective_uid == 0 && options.use_privileged_port, -diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c ---- a/openssh-6.2p2/sshconnect2.c -+++ b/openssh-6.2p2/sshconnect2.c +diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c +--- a/openssh-6.4p1/sshconnect2.c ++++ b/openssh-6.4p1/sshconnect2.c @@ -67,16 +67,17 @@ #include "dispatch.h" #include "canohost.h" @@ -1110,9 +1110,9 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c /* Prefer algorithms that we already have keys for */ myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = order_hostkeyalgs(host, hostaddr, port); -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c @@ -118,16 +118,17 @@ #ifdef GSSAPI #include "ssh-gss.h" diff --git a/openssh-6.2p2-gssapi_key_exchange.patch b/openssh-6.4p1-gssapi_key_exchange.patch similarity index 96% rename from openssh-6.2p2-gssapi_key_exchange.patch rename to openssh-6.4p1-gssapi_key_exchange.patch index f329b0a..ba3dec6 100644 --- a/openssh-6.2p2-gssapi_key_exchange.patch +++ b/openssh-6.4p1-gssapi_key_exchange.patch @@ -1,10 +1,10 @@ # HG changeset patch # Parent a72dad36a987a441e9c92807b1d654e43ddee409 -diff --git a/openssh-6.2p2/ChangeLog.gssapi b/openssh-6.2p2/ChangeLog.gssapi +diff --git a/openssh-6.4p1/ChangeLog.gssapi b/openssh-6.4p1/ChangeLog.gssapi new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ChangeLog.gssapi ++++ b/openssh-6.4p1/ChangeLog.gssapi @@ -0,0 +1,113 @@ +20110101 + - Finally update for OpenSSH 5.6p1 @@ -119,9 +119,9 @@ new file mode 100644 + add support for GssapiTrustDns option for gssapi-with-mic + (from jbasney AT ncsa.uiuc.edu) + -diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in ---- a/openssh-6.2p2/Makefile.in -+++ b/openssh-6.2p2/Makefile.in +diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in +--- a/openssh-6.4p1/Makefile.in ++++ b/openssh-6.4p1/Makefile.in @@ -71,33 +71,34 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o canohost.o channels.o cipher.o cipher-aes.o \ cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ @@ -158,9 +158,9 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in 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 ssh-ldap-helper.8.out ssh-ldap.conf.5.out 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 ssh-ldap-helper.8 ssh-ldap.conf.5 -diff --git a/openssh-6.2p2/auth-krb5.c b/openssh-6.2p2/auth-krb5.c ---- a/openssh-6.2p2/auth-krb5.c -+++ b/openssh-6.2p2/auth-krb5.c +diff --git a/openssh-6.4p1/auth-krb5.c b/openssh-6.4p1/auth-krb5.c +--- a/openssh-6.4p1/auth-krb5.c ++++ b/openssh-6.4p1/auth-krb5.c @@ -165,18 +165,23 @@ auth_krb5_password(Authctxt *authctxt, c if (problem) goto out; @@ -229,9 +229,9 @@ diff --git a/openssh-6.2p2/auth-krb5.c b/openssh-6.2p2/auth-krb5.c } #endif /* !HEIMDAL */ #endif /* KRB5 */ -diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c ---- a/openssh-6.2p2/auth2-gss.c -+++ b/openssh-6.2p2/auth2-gss.c +diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c +--- a/openssh-6.4p1/auth2-gss.c ++++ b/openssh-6.4p1/auth2-gss.c @@ -1,12 +1,12 @@ /* $OpenBSD: auth2-gss.c,v 1.18 2012/12/02 20:34:09 djm Exp $ */ @@ -284,7 +284,7 @@ diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c + authctxt->pw)); + + buffer_free(&b); -+ xfree(mic.value); ++ free(mic.value); + + return (authenticated); +} @@ -333,7 +333,7 @@ diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c logit("GSSAPI MIC check failed"); buffer_free(&b); - xfree(mic.value); + free(mic.value); authctxt->postponed = 0; dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); @@ -357,9 +357,9 @@ diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c Authmethod method_gssapi_old = { "gssapi", -diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c ---- a/openssh-6.2p2/auth2.c -+++ b/openssh-6.2p2/auth2.c +diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c +--- a/openssh-6.4p1/auth2.c ++++ b/openssh-6.4p1/auth2.c @@ -64,27 +64,29 @@ extern Buffer loginmsg; /* methods */ @@ -390,9 +390,9 @@ diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c #endif &method_passwd, &method_kbdint, -diff --git a/openssh-6.2p2/clientloop.c b/openssh-6.2p2/clientloop.c ---- a/openssh-6.2p2/clientloop.c -+++ b/openssh-6.2p2/clientloop.c +diff --git a/openssh-6.4p1/clientloop.c b/openssh-6.4p1/clientloop.c +--- a/openssh-6.4p1/clientloop.c ++++ b/openssh-6.4p1/clientloop.c @@ -106,16 +106,20 @@ #include "authfd.h" #include "atomicio.h" @@ -440,9 +440,9 @@ diff --git a/openssh-6.2p2/clientloop.c b/openssh-6.2p2/clientloop.c } } -diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac ---- a/openssh-6.2p2/configure.ac -+++ b/openssh-6.2p2/configure.ac +diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac +--- a/openssh-6.4p1/configure.ac ++++ b/openssh-6.4p1/configure.ac @@ -528,16 +528,40 @@ main() { if (NSVersionOfRunTimeLibrary(" AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], @@ -484,9 +484,9 @@ diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac [Define if pututxline updates lastlog too]) ) AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], -diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c ---- a/openssh-6.2p2/gss-genr.c -+++ b/openssh-6.2p2/gss-genr.c +diff --git a/openssh-6.4p1/gss-genr.c b/openssh-6.4p1/gss-genr.c +--- a/openssh-6.4p1/gss-genr.c ++++ b/openssh-6.4p1/gss-genr.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-genr.c,v 1.20 2009/06/22 05:39:28 dtucker Exp $ */ @@ -572,8 +572,8 @@ diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c + + if (gss_enc2oid != NULL) { + for (i = 0; gss_enc2oid[i].encoded != NULL; i++) -+ xfree(gss_enc2oid[i].encoded); -+ xfree(gss_enc2oid); ++ free(gss_enc2oid[i].encoded); ++ free(gss_enc2oid); + } + + gss_enc2oid = xmalloc(sizeof(ssh_gss_kex_mapping) * @@ -630,7 +630,7 @@ diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c + buffer_free(&buf); + + if (strlen(mechs) == 0) { -+ xfree(mechs); ++ free(mechs); + mechs = NULL; + } + @@ -702,7 +702,7 @@ diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c &gssbuf, GSS_C_NT_HOSTBASED_SERVICE, &ctx->name))) ssh_gssapi_error(ctx); - xfree(gssbuf.value); + free(gssbuf.value); return (ctx->major); } @@ -874,9 +874,9 @@ diff --git a/openssh-6.2p2/gss-genr.c b/openssh-6.2p2/gss-genr.c +} + #endif /* GSSAPI */ -diff --git a/openssh-6.2p2/gss-serv-krb5.c b/openssh-6.2p2/gss-serv-krb5.c ---- a/openssh-6.2p2/gss-serv-krb5.c -+++ b/openssh-6.2p2/gss-serv-krb5.c +diff --git a/openssh-6.4p1/gss-serv-krb5.c b/openssh-6.4p1/gss-serv-krb5.c +--- a/openssh-6.4p1/gss-serv-krb5.c ++++ b/openssh-6.4p1/gss-serv-krb5.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */ @@ -1023,9 +1023,9 @@ diff --git a/openssh-6.2p2/gss-serv-krb5.c b/openssh-6.2p2/gss-serv-krb5.c #endif /* KRB5 */ #endif /* GSSAPI */ -diff --git a/openssh-6.2p2/gss-serv.c b/openssh-6.2p2/gss-serv.c ---- a/openssh-6.2p2/gss-serv.c -+++ b/openssh-6.2p2/gss-serv.c +diff --git a/openssh-6.4p1/gss-serv.c b/openssh-6.4p1/gss-serv.c +--- a/openssh-6.4p1/gss-serv.c ++++ b/openssh-6.4p1/gss-serv.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-serv.c,v 1.23 2011/08/01 19:18:15 markus Exp $ */ @@ -1412,9 +1412,9 @@ diff --git a/openssh-6.2p2/gss-serv.c b/openssh-6.2p2/gss-serv.c } #endif -diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c ---- a/openssh-6.2p2/kex.c -+++ b/openssh-6.2p2/kex.c +diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c +--- a/openssh-6.4p1/kex.c ++++ b/openssh-6.4p1/kex.c @@ -46,16 +46,24 @@ #include "log.h" #include "mac.h" @@ -1471,9 +1471,9 @@ diff --git a/openssh-6.2p2/kex.c b/openssh-6.2p2/kex.c choose_hostkeyalg(Kex *k, char *client, char *server) { char *hostkeyalg = match_list(client, server, NULL); -diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h ---- a/openssh-6.2p2/kex.h -+++ b/openssh-6.2p2/kex.h +diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h +--- a/openssh-6.4p1/kex.h ++++ b/openssh-6.4p1/kex.h @@ -68,16 +68,19 @@ enum kex_modes { }; @@ -1539,10 +1539,10 @@ diff --git a/openssh-6.2p2/kex.h b/openssh-6.2p2/kex.h kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); -diff --git a/openssh-6.2p2/kexgssc.c b/openssh-6.2p2/kexgssc.c +diff --git a/openssh-6.4p1/kexgssc.c b/openssh-6.4p1/kexgssc.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/kexgssc.c ++++ b/openssh-6.4p1/kexgssc.c @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. @@ -1690,7 +1690,7 @@ new file mode 100644 + + /* If we've got an old receive buffer get rid of it */ + if (token_ptr != GSS_C_NO_BUFFER) -+ xfree(recv_tok.value); ++ free(recv_tok.value); + + if (maj_status == GSS_S_COMPLETE) { + /* If mutual state flag is not true, kex fails */ @@ -1807,7 +1807,7 @@ new file mode 100644 + fatal("kexdh_client: BN_bin2bn failed"); + + memset(kbuf, 0, klen); -+ xfree(kbuf); ++ free(kbuf); + + switch (kex->kex_type) { + case KEX_GSS_GRP1_SHA1: @@ -1850,11 +1850,11 @@ new file mode 100644 + if (GSS_ERROR(ssh_gssapi_checkmic(ctxt, &gssbuf, &msg_tok))) + packet_disconnect("Hash's MIC didn't verify"); + -+ xfree(msg_tok.value); ++ free(msg_tok.value); + + DH_free(dh); + if (serverhostkey) -+ xfree(serverhostkey); ++ free(serverhostkey); + BN_clear_free(dh_server_pub); + + /* save session id */ @@ -1878,10 +1878,10 @@ new file mode 100644 +} + +#endif /* GSSAPI */ -diff --git a/openssh-6.2p2/kexgsss.c b/openssh-6.2p2/kexgsss.c +diff --git a/openssh-6.4p1/kexgsss.c b/openssh-6.4p1/kexgsss.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/kexgsss.c ++++ b/openssh-6.4p1/kexgsss.c @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. @@ -1965,7 +1965,7 @@ new file mode 100644 + */ + if (!ssh_gssapi_oid_table_ok()) + if ((mechs = ssh_gssapi_server_mechanisms())) -+ xfree(mechs); ++ free(mechs); + + debug2("%s: Identifying %s", __func__, kex->name); + oid = ssh_gssapi_id_kex(NULL, kex->name, kex->kex_type); @@ -2043,7 +2043,7 @@ new file mode 100644 + maj_status = PRIVSEP(ssh_gssapi_accept_ctx(ctxt, &recv_tok, + &send_tok, &ret_flags)); + -+ xfree(recv_tok.value); ++ free(recv_tok.value); + + if (maj_status != GSS_S_COMPLETE && send_tok.length == 0) + fatal("Zero length token output when incomplete"); @@ -2092,7 +2092,7 @@ new file mode 100644 + fatal("kexgss_server: BN_bin2bn failed"); + + memset(kbuf, 0, klen); -+ xfree(kbuf); ++ free(kbuf); + + switch (kex->kex_type) { + case KEX_GSS_GRP1_SHA1: @@ -2171,9 +2171,9 @@ new file mode 100644 + ssh_gssapi_rekey_creds(); +} +#endif /* GSSAPI */ -diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c ---- a/openssh-6.2p2/key.c -+++ b/openssh-6.2p2/key.c +diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c +--- a/openssh-6.4p1/key.c ++++ b/openssh-6.4p1/key.c @@ -1038,16 +1038,18 @@ key_ssh_name_from_type_nid(int type, int return "ecdsa-sha2-nistp384-cert-v01@openssh.com"; case NID_secp521r1: @@ -2212,9 +2212,9 @@ diff --git a/openssh-6.2p2/key.c b/openssh-6.2p2/key.c int key_ecdsa_nid_from_name(const char *name) -diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h ---- a/openssh-6.2p2/key.h -+++ b/openssh-6.2p2/key.h +diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h +--- a/openssh-6.4p1/key.h ++++ b/openssh-6.4p1/key.h @@ -39,16 +39,17 @@ enum types { KEY_RSA, KEY_DSA, @@ -2233,9 +2233,9 @@ diff --git a/openssh-6.2p2/key.h b/openssh-6.2p2/key.h SSH_FP_SHA256 }; enum fp_rep { -diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ---- a/openssh-6.2p2/monitor.c -+++ b/openssh-6.2p2/monitor.c +diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +--- a/openssh-6.4p1/monitor.c ++++ b/openssh-6.4p1/monitor.c @@ -178,16 +178,18 @@ int mm_answer_pam_respond(int, Buffer *) int mm_answer_pam_free_ctx(int, Buffer *); #endif @@ -2355,7 +2355,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c blob = buffer_get_string(m, &bloblen); buffer_init(&kex->my); buffer_append(&kex->my, blob, bloblen); - xfree(blob); + free(blob); blob = buffer_get_string(m, &bloblen); @@ -2135,16 +2159,19 @@ monitor_reinit(struct monitor *mon) #ifdef GSSAPI @@ -2374,7 +2374,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c major = ssh_gssapi_server_ctx(&gsscontext, &goid); - xfree(goid.elements); + free(goid.elements); buffer_clear(m); @@ -2162,16 +2189,19 @@ int @@ -2392,7 +2392,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c in.value = buffer_get_string(m, &len); in.length = len; major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags); - xfree(in.value); + free(in.value); buffer_clear(m); buffer_put_int(m, major); @@ -2428,7 +2428,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c ret = ssh_gssapi_checkmic(gsscontext, &gssbuf, &mic); - xfree(gssbuf.value); + free(gssbuf.value); @@ -2216,29 +2250,101 @@ mm_answer_gss_checkmic(int sock, Buffer return (0); } @@ -2482,7 +2482,7 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + } + major = ssh_gssapi_sign(gsscontext, &data, &hash); + -+ xfree(data.value); ++ free(data.value); + + buffer_clear(m); + buffer_put_int(m, major); @@ -2512,9 +2512,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c + + ok = ssh_gssapi_update_creds(&store); + -+ xfree(store.filename); -+ xfree(store.envvar); -+ xfree(store.envval); ++ free(store.filename); ++ free(store.envvar); ++ free(store.envval); + + buffer_clear(m); + buffer_put_int(m, ok); @@ -2532,9 +2532,9 @@ diff --git a/openssh-6.2p2/monitor.c b/openssh-6.2p2/monitor.c { struct jpake_ctx *pctx; u_char *x3_proof, *x4_proof; -diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h ---- a/openssh-6.2p2/monitor.h -+++ b/openssh-6.2p2/monitor.h +diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h +--- a/openssh-6.4p1/monitor.h ++++ b/openssh-6.4p1/monitor.h @@ -70,16 +70,19 @@ enum monitor_reqtype { MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, @@ -2555,9 +2555,9 @@ diff --git a/openssh-6.2p2/monitor.h b/openssh-6.2p2/monitor.h int m_sendfd; int m_log_recvfd; int m_log_sendfd; -diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c ---- a/openssh-6.2p2/monitor_wrap.c -+++ b/openssh-6.2p2/monitor_wrap.c +diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c +--- a/openssh-6.4p1/monitor_wrap.c ++++ b/openssh-6.4p1/monitor_wrap.c @@ -1303,33 +1303,78 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss &m); @@ -2638,9 +2638,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.c b/openssh-6.2p2/monitor_wrap.c char **hash_scheme, char **salt) { Buffer m; -diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h ---- a/openssh-6.2p2/monitor_wrap.h -+++ b/openssh-6.2p2/monitor_wrap.h +diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h +--- a/openssh-6.4p1/monitor_wrap.h ++++ b/openssh-6.4p1/monitor_wrap.h @@ -54,18 +54,20 @@ int mm_user_key_verify(Key *, u_char *, int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); @@ -2663,9 +2663,9 @@ diff --git a/openssh-6.2p2/monitor_wrap.h b/openssh-6.2p2/monitor_wrap.h void *mm_sshpam_init_ctx(struct Authctxt *); int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); int mm_sshpam_respond(void *, u_int, char **); -diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c ---- a/openssh-6.2p2/readconf.c -+++ b/openssh-6.2p2/readconf.c +diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c +--- a/openssh-6.4p1/readconf.c ++++ b/openssh-6.4p1/readconf.c @@ -124,16 +124,18 @@ typedef enum { oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, @@ -2813,9 +2813,9 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c options->rhosts_rsa_authentication = 0; if (options->hostbased_authentication == -1) options->hostbased_authentication = 0; -diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h ---- a/openssh-6.2p2/readconf.h -+++ b/openssh-6.2p2/readconf.h +diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h +--- a/openssh-6.4p1/readconf.h ++++ b/openssh-6.4p1/readconf.h @@ -43,18 +43,23 @@ typedef struct { int rhosts_rsa_authentication; /* Try rhosts with RSA * authentication. */ @@ -2840,9 +2840,9 @@ diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h int batch_mode; /* Batch mode: do not ask for passwords. */ int check_host_ip; /* Also keep track of keys for IP address */ int strict_host_key_checking; /* Strict host key checking. */ -diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c ---- a/openssh-6.2p2/servconf.c -+++ b/openssh-6.2p2/servconf.c +diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c +--- a/openssh-6.4p1/servconf.c ++++ b/openssh-6.4p1/servconf.c @@ -98,18 +98,21 @@ initialize_server_options(ServerOptions options->hostbased_uses_name_from_packet_only = -1; options->rsa_authentication = -1; @@ -3000,9 +3000,9 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication); dump_cfg_fmtint(sKbdInteractiveAuthentication, o->kbd_interactive_authentication); -diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h ---- a/openssh-6.2p2/servconf.h -+++ b/openssh-6.2p2/servconf.h +diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h +--- a/openssh-6.4p1/servconf.h ++++ b/openssh-6.4p1/servconf.h @@ -105,18 +105,21 @@ typedef struct { * authentication mechanism, * such as SecurID or @@ -3025,9 +3025,9 @@ diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h /* If true, permit jpake auth */ int permit_empty_passwd; /* If false, do not permit empty * passwords. */ -diff --git a/openssh-6.2p2/ssh-gss.h b/openssh-6.2p2/ssh-gss.h ---- a/openssh-6.2p2/ssh-gss.h -+++ b/openssh-6.2p2/ssh-gss.h +diff --git a/openssh-6.4p1/ssh-gss.h b/openssh-6.4p1/ssh-gss.h +--- a/openssh-6.4p1/ssh-gss.h ++++ b/openssh-6.4p1/ssh-gss.h @@ -1,11 +1,11 @@ /* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ /* @@ -3151,9 +3151,9 @@ diff --git a/openssh-6.2p2/ssh-gss.h b/openssh-6.2p2/ssh-gss.h #endif /* GSSAPI */ #endif /* _SSH_GSS_H */ -diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config ---- a/openssh-6.2p2/ssh_config -+++ b/openssh-6.2p2/ssh_config +diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +--- a/openssh-6.4p1/ssh_config ++++ b/openssh-6.4p1/ssh_config @@ -32,16 +32,18 @@ Host * ForwardX11Trusted yes @@ -3173,9 +3173,9 @@ diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config # IdentityFile ~/.ssh/identity # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa -diff --git a/openssh-6.2p2/ssh_config.5 b/openssh-6.2p2/ssh_config.5 ---- a/openssh-6.2p2/ssh_config.5 -+++ b/openssh-6.2p2/ssh_config.5 +diff --git a/openssh-6.4p1/ssh_config.5 b/openssh-6.4p1/ssh_config.5 +--- a/openssh-6.4p1/ssh_config.5 ++++ b/openssh-6.4p1/ssh_config.5 @@ -525,21 +525,53 @@ host key database, separated by whitespa The default is .Pa /etc/ssh/ssh_known_hosts , @@ -3231,9 +3231,9 @@ diff --git a/openssh-6.2p2/ssh_config.5 b/openssh-6.2p2/ssh_config.5 These hashed names may be used normally by .Xr ssh 1 and -diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c ---- a/openssh-6.2p2/sshconnect2.c -+++ b/openssh-6.2p2/sshconnect2.c +diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c +--- a/openssh-6.4p1/sshconnect2.c ++++ b/openssh-6.4p1/sshconnect2.c @@ -155,19 +155,44 @@ order_hostkeyalgs(char *host, struct soc return ret; } @@ -3295,7 +3295,7 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c + orig = myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]; + xasprintf(&myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS], + "%s,null", orig); -+ xfree(gss); ++ free(gss); + } +#endif + @@ -3450,8 +3450,8 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c packet_check_eom(); debug("Server GSSAPI Error:\n%s", msg); - xfree(msg); - xfree(lang); + free(msg); + free(lang); } + +int @@ -3503,9 +3503,9 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c /* initial userauth request */ packet_start(SSH2_MSG_USERAUTH_REQUEST); packet_put_cstring(authctxt->server_user); -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c @@ -119,16 +119,24 @@ #include "ssh-gss.h" #endif @@ -3812,9 +3812,9 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c kex->host_key_index=&get_hostkey_index; xxx_kex = kex; -diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config ---- a/openssh-6.2p2/sshd_config -+++ b/openssh-6.2p2/sshd_config +diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +--- a/openssh-6.4p1/sshd_config ++++ b/openssh-6.4p1/sshd_config @@ -75,16 +75,18 @@ PasswordAuthentication no #KerberosAuthentication no #KerberosOrLocalPasswd yes @@ -3834,9 +3834,9 @@ diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config #GSSAPIEnableMITMAttack no -diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 ---- a/openssh-6.2p2/sshd_config.5 -+++ b/openssh-6.2p2/sshd_config.5 +diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 +--- a/openssh-6.4p1/sshd_config.5 ++++ b/openssh-6.4p1/sshd_config.5 @@ -475,22 +475,50 @@ to force remote port forwardings to bind to allow the client to select the address to which the forwarding is bound. The default is diff --git a/openssh-6.2p2-gssapimitm.patch b/openssh-6.4p1-gssapimitm.patch similarity index 86% rename from openssh-6.2p2-gssapimitm.patch rename to openssh-6.4p1-gssapimitm.patch index 1c0a996..0f9046d 100644 --- a/openssh-6.2p2-gssapimitm.patch +++ b/openssh-6.4p1-gssapimitm.patch @@ -13,10 +13,10 @@ # recommended to use the 'gssapi-with-mic' mechanism. Existing installations # are encouraged to upgrade as soon as possible. -diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c ---- a/openssh-6.2p2/auth2-gss.c -+++ b/openssh-6.2p2/auth2-gss.c -@@ -174,16 +174,25 @@ input_gssapi_token(int type, u_int32_t p +diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c +--- a/openssh-6.4p1/auth2-gss.c ++++ b/openssh-6.4p1/auth2-gss.c +@@ -173,16 +173,25 @@ input_gssapi_token(int type, u_int32_t p dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); if (flags & GSS_C_INTEG_FLAG) dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, @@ -42,7 +42,7 @@ diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c static void input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) -@@ -295,9 +304,15 @@ input_gssapi_mic(int type, u_int32_t ple +@@ -291,9 +300,15 @@ input_gssapi_mic(int type, u_int32_t ple } Authmethod method_gssapi = { @@ -58,9 +58,9 @@ diff --git a/openssh-6.2p2/auth2-gss.c b/openssh-6.2p2/auth2-gss.c +}; + #endif /* GSSAPI */ -diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c ---- a/openssh-6.2p2/auth2.c -+++ b/openssh-6.2p2/auth2.c +diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c +--- a/openssh-6.4p1/auth2.c ++++ b/openssh-6.4p1/auth2.c @@ -65,26 +65,28 @@ extern Buffer loginmsg; extern Authmethod method_none; @@ -90,10 +90,10 @@ diff --git a/openssh-6.2p2/auth2.c b/openssh-6.2p2/auth2.c &method_kbdint, &method_hostbased, NULL -diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c ---- a/openssh-6.2p2/readconf.c -+++ b/openssh-6.2p2/readconf.c -@@ -123,17 +123,17 @@ typedef enum { +diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c +--- a/openssh-6.4p1/readconf.c ++++ b/openssh-6.4p1/readconf.c +@@ -126,17 +126,17 @@ typedef enum { oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, @@ -109,10 +109,10 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c oHashKnownHosts, oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, - oKexAlgorithms, oIPQoS, oRequestTTY, - oDeprecated, oUnsupported + oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, + oIgnoredUnknownOption, oDeprecated, oUnsupported } OpCodes; -@@ -165,19 +165,21 @@ static struct { +@@ -168,19 +168,21 @@ static struct { { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ { "kerberosauthentication", oUnsupported }, @@ -134,7 +134,7 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c { "identitiesonly", oIdentitiesOnly }, { "hostname", oHostName }, { "hostkeyalias", oHostKeyAlias }, -@@ -501,16 +503,20 @@ parse_flag: +@@ -514,16 +516,20 @@ parse_flag: case oGssAuthentication: intptr = &options->gss_authentication; @@ -155,7 +155,7 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c case oCheckHostIP: intptr = &options->check_host_ip; goto parse_flag; -@@ -1154,16 +1160,17 @@ initialize_options(Options * options) +@@ -1164,16 +1170,17 @@ initialize_options(Options * options) options->xauth_location = NULL; options->gateway_ports = -1; options->use_privileged_port = -1; @@ -173,7 +173,7 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c options->batch_mode = -1; options->check_host_ip = -1; options->strict_host_key_checking = -1; -@@ -1255,16 +1262,18 @@ fill_default_options(Options * options) +@@ -1265,16 +1272,18 @@ fill_default_options(Options * options) if (options->pubkey_authentication == -1) options->pubkey_authentication = 1; if (options->challenge_response_authentication == -1) @@ -192,9 +192,9 @@ diff --git a/openssh-6.2p2/readconf.c b/openssh-6.2p2/readconf.c options->rhosts_rsa_authentication = 0; if (options->hostbased_authentication == -1) options->hostbased_authentication = 0; -diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h ---- a/openssh-6.2p2/readconf.h -+++ b/openssh-6.2p2/readconf.h +diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h +--- a/openssh-6.4p1/readconf.h ++++ b/openssh-6.4p1/readconf.h @@ -44,16 +44,17 @@ typedef struct { * authentication. */ int rsa_authentication; /* Try RSA authentication. */ @@ -213,10 +213,10 @@ diff --git a/openssh-6.2p2/readconf.h b/openssh-6.2p2/readconf.h int batch_mode; /* Batch mode: do not ask for passwords. */ int check_host_ip; /* Also keep track of keys for IP address */ int strict_host_key_checking; /* Strict host key checking. */ -diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c ---- a/openssh-6.2p2/servconf.c -+++ b/openssh-6.2p2/servconf.c -@@ -98,16 +98,17 @@ initialize_server_options(ServerOptions +diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c +--- a/openssh-6.4p1/servconf.c ++++ b/openssh-6.4p1/servconf.c +@@ -103,16 +103,17 @@ initialize_server_options(ServerOptions options->rsa_authentication = -1; options->pubkey_authentication = -1; options->kerberos_authentication = -1; @@ -233,8 +233,8 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c options->permit_user_env = -1; options->use_login = -1; options->compression = -1; - options->allow_tcp_forwarding = -1; -@@ -230,16 +231,18 @@ fill_default_server_options(ServerOption + options->rekey_limit = -1; +@@ -237,16 +238,18 @@ fill_default_server_options(ServerOption if (options->kerberos_ticket_cleanup == -1) options->kerberos_ticket_cleanup = 1; if (options->kerberos_get_afs_token == -1) @@ -253,9 +253,9 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c options->challenge_response_authentication = 1; if (options->permit_empty_passwd == -1) options->permit_empty_passwd = 0; -@@ -322,17 +325,17 @@ typedef enum { +@@ -333,17 +336,17 @@ typedef enum { sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, - sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, + sRekeyLimit, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups, sMaxAuthTries, sMaxSessions, @@ -270,9 +270,9 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, sKexAlgorithms, sIPQoS, sVersionAddendum, sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, - sAuthenticationMethods, + sAuthenticationMethods, sHostKeyAgent, sDeprecated, sUnsupported -@@ -388,19 +391,21 @@ static struct { +@@ -400,19 +403,21 @@ static struct { { "kerberosticketcleanup", sUnsupported, SSHCFG_GLOBAL }, { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL }, #endif @@ -294,7 +294,7 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c #ifdef JPAKE { "zeroknowledgepasswordauthentication", sZeroKnowledgePasswordAuthentication, SSHCFG_ALL }, #else -@@ -1048,16 +1053,20 @@ process_server_config_line(ServerOptions +@@ -1072,16 +1077,20 @@ process_server_config_line(ServerOptions case sGssAuthentication: intptr = &options->gss_authentication; goto parse_flag; @@ -315,10 +315,10 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c intptr = &options->zero_knowledge_password_authentication; goto parse_flag; -diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h ---- a/openssh-6.2p2/servconf.h -+++ b/openssh-6.2p2/servconf.h -@@ -106,16 +106,17 @@ typedef struct { +diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h +--- a/openssh-6.4p1/servconf.h ++++ b/openssh-6.4p1/servconf.h +@@ -107,16 +107,17 @@ typedef struct { * such as SecurID or * /etc/passwd */ int kerberos_ticket_cleanup; /* If true, destroy ticket @@ -336,10 +336,10 @@ diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h /* If true, permit jpake auth */ int permit_empty_passwd; /* If false, do not permit empty * passwords. */ -diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config ---- a/openssh-6.2p2/ssh_config -+++ b/openssh-6.2p2/ssh_config -@@ -51,8 +51,15 @@ ForwardX11Trusted yes +diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +--- a/openssh-6.4p1/ssh_config ++++ b/openssh-6.4p1/ssh_config +@@ -51,9 +51,16 @@ ForwardX11Trusted yes # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 # EscapeChar ~ @@ -355,10 +355,11 @@ diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to. +# GSSAPIEnableMITMAttack no + -diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c ---- a/openssh-6.2p2/sshconnect2.c -+++ b/openssh-6.2p2/sshconnect2.c -@@ -321,16 +321,21 @@ static char *authmethods_get(void); + # RekeyLimit 1G 1h +diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c +--- a/openssh-6.4p1/sshconnect2.c ++++ b/openssh-6.4p1/sshconnect2.c +@@ -322,16 +322,21 @@ static char *authmethods_get(void); Authmethod authmethods[] = { #ifdef GSSAPI @@ -380,7 +381,7 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c NULL}, {"publickey", userauth_pubkey, -@@ -698,17 +703,19 @@ process_gssapi_token(void *ctxt, gss_buf +@@ -696,17 +701,19 @@ process_gssapi_token(void *ctxt, gss_buf packet_put_string(send_tok.value, send_tok.length); packet_send(); @@ -401,10 +402,10 @@ diff --git a/openssh-6.2p2/sshconnect2.c b/openssh-6.2p2/sshconnect2.c gssbuf.value = buffer_ptr(&b); gssbuf.length = buffer_len(&b); -diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config ---- a/openssh-6.2p2/sshd_config -+++ b/openssh-6.2p2/sshd_config -@@ -76,16 +76,23 @@ PasswordAuthentication no +diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +--- a/openssh-6.4p1/sshd_config ++++ b/openssh-6.4p1/sshd_config +@@ -79,16 +79,23 @@ PasswordAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no diff --git a/openssh-6.2p2-host_ident.patch b/openssh-6.4p1-host_ident.patch similarity index 82% rename from openssh-6.2p2-host_ident.patch rename to openssh-6.4p1-host_ident.patch index 9cd3005..0888c48 100644 --- a/openssh-6.2p2-host_ident.patch +++ b/openssh-6.4p1-host_ident.patch @@ -1,10 +1,10 @@ # identify hashed hosts in known_hosts and suggest command line for their # removal -diff --git a/openssh-6.2p2/sshconnect.c b/openssh-6.2p2/sshconnect.c ---- a/openssh-6.2p2/sshconnect.c -+++ b/openssh-6.2p2/sshconnect.c -@@ -987,16 +987,21 @@ check_host_key(char *hostname, struct so +diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c +--- a/openssh-6.4p1/sshconnect.c ++++ b/openssh-6.4p1/sshconnect.c +@@ -986,16 +986,21 @@ check_host_key(char *hostname, struct so ip_found->file, ip_found->line); } /* The host key has changed. */ diff --git a/openssh-6.2p2-key-converter.patch b/openssh-6.4p1-key-converter.patch similarity index 94% rename from openssh-6.2p2-key-converter.patch rename to openssh-6.4p1-key-converter.patch index b9c5c85..8d463a1 100644 --- a/openssh-6.2p2-key-converter.patch +++ b/openssh-6.4p1-key-converter.patch @@ -1,9 +1,9 @@ # SSHv1 to SSHv2 RSA keys converter -diff --git a/openssh-6.2p2/converter/Makefile b/openssh-6.2p2/converter/Makefile +diff --git a/openssh-6.4p1/converter/Makefile b/openssh-6.4p1/converter/Makefile new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/converter/Makefile ++++ b/openssh-6.4p1/converter/Makefile @@ -0,0 +1,17 @@ + +bindir=/usr/bin @@ -12,20 +12,20 @@ new file mode 100644 +all : ssh-keyconverter + +ssh-keyconverter.o: ssh-keyconverter.c ../key.h ../authfile.h ../misc.h ../xmalloc.h -+ gcc $(RPM_OPT_FLAGS) -c -I../ $< -o $@ ++ gcc $(CFLAGS) $(RPM_OPT_FLAGS) -c -I../ $< -o $@ + +ssh-keyconverter: ssh-keyconverter.o ../libssh.a ../openbsd-compat/libopenbsd-compat.a -+ gcc $< -Wl,--no-as-needed $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ -lcrypto -lssh -lopenbsd-compat -lssh -lopenbsd-compat -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ ++ gcc $< $(LDFLAGS) $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ -lcrypto -lssh -lopenbsd-compat -lcrypto -lssh -lopenbsd-compat -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ + +install: ssh-keyconverter ssh-keyconverter.1 + if [ ! -d $(DESTDIR)$(bindir) ]; then install -d -m 755 $(DESTDIR)$(bindir); fi + install -m 755 ssh-keyconverter $(DESTDIR)$(bindir) + if [ ! -d $(DESTDIR)$(mandir)/man1 ]; then install -d -m 755 $(DESTDIR)$(mandir)/man1; fi + install -m 644 ssh-keyconverter.1 $(DESTDIR)$(mandir)/man1 -diff --git a/openssh-6.2p2/converter/ssh-keyconverter.1 b/openssh-6.2p2/converter/ssh-keyconverter.1 +diff --git a/openssh-6.4p1/converter/ssh-keyconverter.1 b/openssh-6.4p1/converter/ssh-keyconverter.1 new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/converter/ssh-keyconverter.1 ++++ b/openssh-6.4p1/converter/ssh-keyconverter.1 @@ -0,0 +1,155 @@ +.\" Manpage for ssh-keyconverter +.\" @@ -182,10 +182,10 @@ new file mode 100644 +.%D March 2001 +.%O work in progress material +.Re -diff --git a/openssh-6.2p2/converter/ssh-keyconverter.c b/openssh-6.2p2/converter/ssh-keyconverter.c +diff --git a/openssh-6.4p1/converter/ssh-keyconverter.c b/openssh-6.4p1/converter/ssh-keyconverter.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/converter/ssh-keyconverter.c ++++ b/openssh-6.4p1/converter/ssh-keyconverter.c @@ -0,0 +1,345 @@ +/* + * SSH v1 to v2 RSA key converter. @@ -330,7 +330,7 @@ new file mode 100644 + if (i) { + /* Zap old pass phrase */ + memset(passphrase, 0, strlen(passphrase)); -+ xfree(passphrase); ++ free(passphrase); + + /* Get a pass phrase from the user */ + passphrase = read_passphrase(prompt, 0); @@ -387,7 +387,7 @@ new file mode 100644 + +out: + memset(passphrase, 0, strlen(passphrase)); -+ xfree(passphrase); ++ free(passphrase); + if (key) + key_free(key); + if (pk) diff --git a/openssh-6.2p2-lastlog.patch b/openssh-6.4p1-lastlog.patch similarity index 82% rename from openssh-6.2p2-lastlog.patch rename to openssh-6.4p1-lastlog.patch index 75de9c4..907a643 100644 --- a/openssh-6.2p2-lastlog.patch +++ b/openssh-6.4p1-lastlog.patch @@ -1,9 +1,9 @@ # set uid for functions that use it to seek in lastlog and wtmp files # bnc#18024 (was suse #3024) -diff --git a/openssh-6.2p2/sshlogin.c b/openssh-6.2p2/sshlogin.c ---- a/openssh-6.2p2/sshlogin.c -+++ b/openssh-6.2p2/sshlogin.c +diff --git a/openssh-6.4p1/sshlogin.c b/openssh-6.4p1/sshlogin.c +--- a/openssh-6.4p1/sshlogin.c ++++ b/openssh-6.4p1/sshlogin.c @@ -128,16 +128,17 @@ record_login(pid_t pid, const char *tty, { struct logininfo *li; diff --git a/openssh-6.2p2-ldap.patch b/openssh-6.4p1-ldap.patch similarity index 96% rename from openssh-6.2p2-ldap.patch rename to openssh-6.4p1-ldap.patch index 27e1334..8418e77 100644 --- a/openssh-6.2p2-ldap.patch +++ b/openssh-6.4p1-ldap.patch @@ -8,10 +8,10 @@ # internal versions. ssh-keyconverter consequently fails to link as it lacks # the proper flags, and libopenbsd-compat doesn't contain the b64_* functions) -diff --git a/openssh-6.2p2/HOWTO.ldap-keys b/openssh-6.2p2/HOWTO.ldap-keys +diff --git a/openssh-6.4p1/HOWTO.ldap-keys b/openssh-6.4p1/HOWTO.ldap-keys new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/HOWTO.ldap-keys ++++ b/openssh-6.4p1/HOWTO.ldap-keys @@ -0,0 +1,108 @@ + +HOW TO START @@ -121,9 +121,9 @@ new file mode 100644 + - frederic peters. + - Finlay dobbie. + - Stefan Fisher. -diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in ---- a/openssh-6.2p2/Makefile.in -+++ b/openssh-6.2p2/Makefile.in +diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in +--- a/openssh-6.4p1/Makefile.in ++++ b/openssh-6.4p1/Makefile.in @@ -20,16 +20,18 @@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ @@ -185,7 +185,7 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in PATHSUBS = \ -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ -@@ -162,16 +166,19 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss +@@ -164,16 +168,19 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o @@ -205,7 +205,7 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in # test driver for the loginrec code - not built by default logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o -@@ -263,30 +270,38 @@ install-files: +@@ -266,30 +273,38 @@ install-files: $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) @@ -244,7 +244,7 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in install-sysconf: if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ -@@ -306,16 +321,23 @@ install-sysconf: +@@ -309,16 +324,23 @@ install-sysconf: echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ else \ @@ -268,7 +268,7 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in else \ ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \ fi ; \ -@@ -363,27 +385,30 @@ uninstall: +@@ -366,27 +388,30 @@ uninstall: -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) @@ -294,15 +294,15 @@ diff --git a/openssh-6.2p2/Makefile.in b/openssh-6.2p2/Makefile.in -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c - [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \ - $(CC) $(CPPFLAGS) -o $@ $? \ - $(LDFLAGS) -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) - - tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) -diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac ---- a/openssh-6.2p2/configure.ac -+++ b/openssh-6.2p2/configure.ac -@@ -1504,16 +1504,116 @@ AC_ARG_WITH([audit], + [ -d `pwd`/regress ] || mkdir -p `pwd`/regress + [ -f `pwd`/regress/Makefile ] || \ + ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ + $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) +diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac +--- a/openssh-6.4p1/configure.ac ++++ b/openssh-6.4p1/configure.ac +@@ -1519,16 +1519,116 @@ AC_ARG_WITH([audit], AC_MSG_RESULT([no]) ;; *) @@ -419,10 +419,10 @@ diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac asprintf \ b64_ntop \ __b64_ntop \ -diff --git a/openssh-6.2p2/ldap-helper.c b/openssh-6.2p2/ldap-helper.c +diff --git a/openssh-6.4p1/ldap-helper.c b/openssh-6.4p1/ldap-helper.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldap-helper.c ++++ b/openssh-6.4p1/ldap-helper.c @@ -0,0 +1,155 @@ +/* $OpenBSD: ssh-pka-ldap.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -579,10 +579,10 @@ new file mode 100644 +void *buffer_get_string(Buffer *b, u_int *l) { return NULL; } +void buffer_put_string(Buffer *b, const void *f, u_int l) {} + -diff --git a/openssh-6.2p2/ldap-helper.h b/openssh-6.2p2/ldap-helper.h +diff --git a/openssh-6.4p1/ldap-helper.h b/openssh-6.4p1/ldap-helper.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldap-helper.h ++++ b/openssh-6.4p1/ldap-helper.h @@ -0,0 +1,32 @@ +/* $OpenBSD: ldap-helper.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -616,10 +616,10 @@ new file mode 100644 +extern int config_warning_config_file; + +#endif /* LDAP_HELPER_H */ -diff --git a/openssh-6.2p2/ldap.conf b/openssh-6.2p2/ldap.conf +diff --git a/openssh-6.4p1/ldap.conf b/openssh-6.4p1/ldap.conf new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldap.conf ++++ b/openssh-6.4p1/ldap.conf @@ -0,0 +1,88 @@ +# $Id: openssh-5.5p1-ldap.patch,v 1.3 2010/07/07 13:48:36 jfch2222 Exp $ +# @@ -709,10 +709,10 @@ new file mode 100644 +#tls_cert +#tls_key + -diff --git a/openssh-6.2p2/ldapbody.c b/openssh-6.2p2/ldapbody.c +diff --git a/openssh-6.4p1/ldapbody.c b/openssh-6.4p1/ldapbody.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapbody.c ++++ b/openssh-6.4p1/ldapbody.c @@ -0,0 +1,494 @@ +/* $OpenBSD: ldapbody.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -873,7 +873,7 @@ new file mode 100644 + if ((logfile = fopen (logfilename, "a")) == NULL) + fatal ("cannot append to %s: %s", logfilename, strerror (errno)); + debug3 ("LDAP debug into %s", logfilename); -+ xfree (logfilename); ++ free (logfilename); + ber_set_option (NULL, LBER_OPT_LOG_PRINT_FILE, logfile); + } +#endif @@ -1162,12 +1162,12 @@ new file mode 100644 + timeout.tv_usec = 0; + if ((rc = ldap_search_st(ld, options.base, options.scope, buffer, attrs, 0, &timeout, &res)) != LDAP_SUCCESS) { + error ("ldap_search_st(): %s", ldap_err2string (rc)); -+ xfree (buffer); ++ free (buffer); + return; + } + + /* free */ -+ xfree (buffer); ++ free (buffer); + + for (e = ldap_first_entry(ld, res); e != NULL; e = ldap_next_entry(ld, e)) { + int num; @@ -1208,10 +1208,10 @@ new file mode 100644 + return; +} + -diff --git a/openssh-6.2p2/ldapbody.h b/openssh-6.2p2/ldapbody.h +diff --git a/openssh-6.4p1/ldapbody.h b/openssh-6.4p1/ldapbody.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapbody.h ++++ b/openssh-6.4p1/ldapbody.h @@ -0,0 +1,37 @@ +/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -1250,10 +1250,10 @@ new file mode 100644 + +#endif /* LDAPBODY_H */ + -diff --git a/openssh-6.2p2/ldapconf.c b/openssh-6.2p2/ldapconf.c +diff --git a/openssh-6.4p1/ldapconf.c b/openssh-6.4p1/ldapconf.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapconf.c ++++ b/openssh-6.4p1/ldapconf.c @@ -0,0 +1,682 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -1937,10 +1937,10 @@ new file mode 100644 + dump_cfg_string(lSSH_Filter, options.ssh_filter); +} + -diff --git a/openssh-6.2p2/ldapconf.h b/openssh-6.2p2/ldapconf.h +diff --git a/openssh-6.4p1/ldapconf.h b/openssh-6.4p1/ldapconf.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapconf.h ++++ b/openssh-6.4p1/ldapconf.h @@ -0,0 +1,71 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2013,10 +2013,10 @@ new file mode 100644 +void dump_config(void); + +#endif /* LDAPCONF_H */ -diff --git a/openssh-6.2p2/ldapincludes.h b/openssh-6.2p2/ldapincludes.h +diff --git a/openssh-6.4p1/ldapincludes.h b/openssh-6.4p1/ldapincludes.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapincludes.h ++++ b/openssh-6.4p1/ldapincludes.h @@ -0,0 +1,41 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2059,10 +2059,10 @@ new file mode 100644 +#endif + +#endif /* LDAPINCLUDES_H */ -diff --git a/openssh-6.2p2/ldapmisc.c b/openssh-6.2p2/ldapmisc.c +diff --git a/openssh-6.4p1/ldapmisc.c b/openssh-6.4p1/ldapmisc.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapmisc.c ++++ b/openssh-6.4p1/ldapmisc.c @@ -0,0 +1,79 @@ + +#include "ldapincludes.h" @@ -2143,10 +2143,10 @@ new file mode 100644 +} +#endif + -diff --git a/openssh-6.2p2/ldapmisc.h b/openssh-6.2p2/ldapmisc.h +diff --git a/openssh-6.4p1/ldapmisc.h b/openssh-6.4p1/ldapmisc.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ldapmisc.h ++++ b/openssh-6.4p1/ldapmisc.h @@ -0,0 +1,35 @@ +/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2183,9 +2183,9 @@ new file mode 100644 + +#endif /* LDAPMISC_H */ + -diff --git a/openssh-6.2p2/openbsd-compat/base64.c b/openssh-6.2p2/openbsd-compat/base64.c ---- a/openssh-6.2p2/openbsd-compat/base64.c -+++ b/openssh-6.2p2/openbsd-compat/base64.c +diff --git a/openssh-6.4p1/openbsd-compat/base64.c b/openssh-6.4p1/openbsd-compat/base64.c +--- a/openssh-6.4p1/openbsd-compat/base64.c ++++ b/openssh-6.4p1/openbsd-compat/base64.c @@ -41,17 +41,17 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. @@ -2243,9 +2243,9 @@ diff --git a/openssh-6.2p2/openbsd-compat/base64.c b/openssh-6.2p2/openbsd-compa */ int -diff --git a/openssh-6.2p2/openbsd-compat/base64.h b/openssh-6.2p2/openbsd-compat/base64.h ---- a/openssh-6.2p2/openbsd-compat/base64.h -+++ b/openssh-6.2p2/openbsd-compat/base64.h +diff --git a/openssh-6.4p1/openbsd-compat/base64.h b/openssh-6.4p1/openbsd-compat/base64.h +--- a/openssh-6.4p1/openbsd-compat/base64.h ++++ b/openssh-6.4p1/openbsd-compat/base64.h @@ -42,24 +42,24 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ @@ -2275,10 +2275,10 @@ diff --git a/openssh-6.2p2/openbsd-compat/base64.h b/openssh-6.2p2/openbsd-compa #endif /* HAVE___B64_PTON */ #endif /* _BSD_BASE64_H */ -diff --git a/openssh-6.2p2/openssh-lpk-openldap.schema b/openssh-6.2p2/openssh-lpk-openldap.schema +diff --git a/openssh-6.4p1/openssh-lpk-openldap.schema b/openssh-6.4p1/openssh-lpk-openldap.schema new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/openssh-lpk-openldap.schema ++++ b/openssh-6.4p1/openssh-lpk-openldap.schema @@ -0,0 +1,21 @@ +# +# LDAP Public Key Patch schema for use with openssh-ldappubkey @@ -2301,10 +2301,10 @@ new file mode 100644 + DESC 'MANDATORY: OpenSSH LPK objectclass' + MUST ( sshPublicKey $ uid ) + ) -diff --git a/openssh-6.2p2/openssh-lpk-sun.schema b/openssh-6.2p2/openssh-lpk-sun.schema +diff --git a/openssh-6.4p1/openssh-lpk-sun.schema b/openssh-6.4p1/openssh-lpk-sun.schema new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/openssh-lpk-sun.schema ++++ b/openssh-6.4p1/openssh-lpk-sun.schema @@ -0,0 +1,23 @@ +# +# LDAP Public Key Patch schema for use with openssh-ldappubkey @@ -2329,10 +2329,10 @@ new file mode 100644 + DESC 'MANDATORY: OpenSSH LPK objectclass' + MUST ( sshPublicKey $ uid ) + ) -diff --git a/openssh-6.2p2/ssh-ldap-helper.8 b/openssh-6.2p2/ssh-ldap-helper.8 +diff --git a/openssh-6.4p1/ssh-ldap-helper.8 b/openssh-6.4p1/ssh-ldap-helper.8 new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ssh-ldap-helper.8 ++++ b/openssh-6.4p1/ssh-ldap-helper.8 @@ -0,0 +1,79 @@ +.\" $OpenBSD: ssh-ldap-helper.8,v 1.1 2010/02/10 23:20:38 markus Exp $ +.\" @@ -2413,19 +2413,19 @@ new file mode 100644 +OpenSSH 5.5 + PKA-LDAP . +.Sh AUTHORS +.An Jan F. Chadima Aq jchadima@redhat.com -diff --git a/openssh-6.2p2/ssh-ldap-wrapper b/openssh-6.2p2/ssh-ldap-wrapper +diff --git a/openssh-6.4p1/ssh-ldap-wrapper b/openssh-6.4p1/ssh-ldap-wrapper new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ssh-ldap-wrapper ++++ b/openssh-6.4p1/ssh-ldap-wrapper @@ -0,0 +1,4 @@ +#!/bin/sh + +exec @LIBEXECDIR@/ssh-ldap-helper -s "$1" + -diff --git a/openssh-6.2p2/ssh-ldap.conf.5 b/openssh-6.2p2/ssh-ldap.conf.5 +diff --git a/openssh-6.4p1/ssh-ldap.conf.5 b/openssh-6.4p1/ssh-ldap.conf.5 new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/ssh-ldap.conf.5 ++++ b/openssh-6.4p1/ssh-ldap.conf.5 @@ -0,0 +1,376 @@ +.\" $OpenBSD: ssh-ldap.conf.5,v 1.1 2010/02/10 23:20:38 markus Exp $ +.\" diff --git a/openssh-6.2p2-login_options.patch b/openssh-6.4p1-login_options.patch similarity index 84% rename from openssh-6.2p2-login_options.patch rename to openssh-6.4p1-login_options.patch index 1c0005c..1b4552e 100644 --- a/openssh-6.2p2-login_options.patch +++ b/openssh-6.4p1-login_options.patch @@ -4,10 +4,10 @@ # # bnc#833605 -diff --git a/openssh-6.2p2/configure.ac b/openssh-6.2p2/configure.ac ---- a/openssh-6.2p2/configure.ac -+++ b/openssh-6.2p2/configure.ac -@@ -666,16 +666,18 @@ main() { if (NSVersionOfRunTimeLibrary(" +diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac +--- a/openssh-6.4p1/configure.ac ++++ b/openssh-6.4p1/configure.ac +@@ -657,16 +657,18 @@ main() { if (NSVersionOfRunTimeLibrary(" AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) diff --git a/openssh-6.2p2-no_fork-no_pid_file.patch b/openssh-6.4p1-no_fork-no_pid_file.patch similarity index 79% rename from openssh-6.2p2-no_fork-no_pid_file.patch rename to openssh-6.4p1-no_fork-no_pid_file.patch index 13df9b1..c0c0e0a 100644 --- a/openssh-6.2p2-no_fork-no_pid_file.patch +++ b/openssh-6.4p1-no_fork-no_pid_file.patch @@ -1,9 +1,9 @@ # Do not write a PID file when not daemonizing (e.g. when running from systemd) -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -1911,17 +1911,17 @@ main(int ac, char **av) +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -1959,17 +1959,17 @@ main(int ac, char **av) signal(SIGCHLD, main_sigchld_handler); signal(SIGTERM, sigterm_handler); signal(SIGQUIT, sigterm_handler); diff --git a/openssh-6.2p2-pam-check-locks.patch b/openssh-6.4p1-pam-check-locks.patch similarity index 84% rename from openssh-6.2p2-pam-check-locks.patch rename to openssh-6.4p1-pam-check-locks.patch index 3c1bf00..fa3c3d3 100644 --- a/openssh-6.2p2-pam-check-locks.patch +++ b/openssh-6.4p1-pam-check-locks.patch @@ -2,10 +2,10 @@ # UsePAM is used # bnc#708678, FATE#312033 -diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c ---- a/openssh-6.2p2/auth.c -+++ b/openssh-6.2p2/auth.c -@@ -102,17 +102,17 @@ allowed_user(struct passwd * pw) +diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c +--- a/openssh-6.4p1/auth.c ++++ b/openssh-6.4p1/auth.c +@@ -103,17 +103,17 @@ allowed_user(struct passwd * pw) struct spwd *spw = NULL; #endif @@ -24,7 +24,7 @@ diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c #endif /* USE_SHADOW */ /* grab passwd field for locked account check */ -@@ -122,17 +122,17 @@ allowed_user(struct passwd * pw) +@@ -123,17 +123,17 @@ allowed_user(struct passwd * pw) #ifdef USE_LIBIAF passwd = get_iaf_password(pw); #else @@ -43,10 +43,10 @@ diff --git a/openssh-6.2p2/auth.c b/openssh-6.2p2/auth.c #endif #ifdef LOCKED_PASSWD_PREFIX if (strncmp(passwd, LOCKED_PASSWD_PREFIX, -diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c ---- a/openssh-6.2p2/servconf.c -+++ b/openssh-6.2p2/servconf.c -@@ -62,16 +62,17 @@ extern Buffer cfg; +diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c +--- a/openssh-6.4p1/servconf.c ++++ b/openssh-6.4p1/servconf.c +@@ -66,16 +66,17 @@ extern Buffer cfg; void initialize_server_options(ServerOptions *options) @@ -64,7 +64,7 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c options->address_family = -1; options->num_host_key_files = 0; options->num_host_cert_files = 0; -@@ -150,16 +151,18 @@ initialize_server_options(ServerOptions +@@ -157,16 +158,18 @@ initialize_server_options(ServerOptions } void @@ -83,7 +83,7 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c /* fill default hostkeys for protocols */ if (options->protocol & SSH_PROTO_1) options->host_key_files[options->num_host_key_files++] = -@@ -304,17 +307,17 @@ fill_default_server_options(ServerOption +@@ -315,17 +318,17 @@ fill_default_server_options(ServerOption #endif } @@ -102,7 +102,7 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c sKerberosGetAFSToken, sKerberosTgtPassing, sChallengeResponseAuthentication, sPasswordAuthentication, sKbdInteractiveAuthentication, -@@ -349,18 +352,20 @@ typedef enum { +@@ -360,18 +363,20 @@ typedef enum { static struct { const char *name; ServerOpCodes opcode; @@ -121,9 +121,9 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c { "port", sPort, SSHCFG_GLOBAL }, { "hostkey", sHostKeyFile, SSHCFG_GLOBAL }, { "hostdsakey", sHostKeyFile, SSHCFG_GLOBAL }, /* alias */ + { "hostkeyagent", sHostKeyAgent, SSHCFG_GLOBAL }, { "pidfile", sPidFile, SSHCFG_GLOBAL }, - { "serverkeybits", sServerKeyBits, SSHCFG_GLOBAL }, -@@ -844,16 +849,19 @@ process_server_config_line(ServerOptions +@@ -857,16 +862,19 @@ process_server_config_line(ServerOptions } } @@ -143,10 +143,10 @@ diff --git a/openssh-6.2p2/servconf.c b/openssh-6.2p2/servconf.c /* ignore ports from configfile if cmdline specifies ports */ if (options->ports_from_cmdline) return 0; -diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h ---- a/openssh-6.2p2/servconf.h -+++ b/openssh-6.2p2/servconf.h -@@ -160,16 +160,17 @@ typedef struct { +diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h +--- a/openssh-6.4p1/servconf.h ++++ b/openssh-6.4p1/servconf.h +@@ -161,16 +161,17 @@ typedef struct { */ u_int num_authkeys_files; /* Files containing public keys */ @@ -164,10 +164,10 @@ diff --git a/openssh-6.2p2/servconf.h b/openssh-6.2p2/servconf.h char *chroot_directory; char *revoked_keys_file; char *trusted_user_ca_keys; -diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 ---- a/openssh-6.2p2/sshd_config.0 -+++ b/openssh-6.2p2/sshd_config.0 -@@ -673,16 +673,24 @@ DESCRIPTION +diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 +--- a/openssh-6.4p1/sshd_config.0 ++++ b/openssh-6.4p1/sshd_config.0 +@@ -706,16 +706,24 @@ DESCRIPTION Because PAM challenge-response authentication usually serves an equivalent role to password authentication, you should disable @@ -192,10 +192,10 @@ diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is ``yes''. If UsePrivilegeSeparation is set to -diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 ---- a/openssh-6.2p2/sshd_config.5 -+++ b/openssh-6.2p2/sshd_config.5 -@@ -1141,16 +1141,28 @@ or +diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 +--- a/openssh-6.4p1/sshd_config.5 ++++ b/openssh-6.4p1/sshd_config.5 +@@ -1178,16 +1178,28 @@ or .Pp If .Cm UsePAM diff --git a/openssh-6.2p2-pam-fix2.patch b/openssh-6.4p1-pam-fix2.patch similarity index 84% rename from openssh-6.2p2-pam-fix2.patch rename to openssh-6.4p1-pam-fix2.patch index bcb5b6c..5d1f003 100644 --- a/openssh-6.2p2-pam-fix2.patch +++ b/openssh-6.4p1-pam-fix2.patch @@ -1,10 +1,10 @@ # force PAM in defaullt install (this was removed from upstream in 3.8p1) # bnc#46749 -diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config ---- a/openssh-6.2p2/sshd_config -+++ b/openssh-6.2p2/sshd_config -@@ -60,17 +60,17 @@ AuthorizedKeysFile .ssh/authorized_keys +diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +--- a/openssh-6.4p1/sshd_config ++++ b/openssh-6.4p1/sshd_config +@@ -63,17 +63,17 @@ AuthorizedKeysFile .ssh/authorized_keys #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication @@ -23,7 +23,7 @@ diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes -@@ -85,17 +85,17 @@ AuthorizedKeysFile .ssh/authorized_keys +@@ -88,17 +88,17 @@ AuthorizedKeysFile .ssh/authorized_keys # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, diff --git a/openssh-6.2p2-pam-fix3.patch b/openssh-6.4p1-pam-fix3.patch similarity index 75% rename from openssh-6.2p2-pam-fix3.patch rename to openssh-6.4p1-pam-fix3.patch index 59ff8ad..9ae445d 100644 --- a/openssh-6.2p2-pam-fix3.patch +++ b/openssh-6.4p1-pam-fix3.patch @@ -1,10 +1,10 @@ # posix threads are generally not supported nor safe # (see upstream log from 2005-05-24) -diff --git a/openssh-6.2p2/auth-pam.c b/openssh-6.2p2/auth-pam.c ---- a/openssh-6.2p2/auth-pam.c -+++ b/openssh-6.2p2/auth-pam.c -@@ -781,17 +781,19 @@ sshpam_query(void *ctx, char **name, cha +diff --git a/openssh-6.4p1/auth-pam.c b/openssh-6.4p1/auth-pam.c +--- a/openssh-6.4p1/auth-pam.c ++++ b/openssh-6.4p1/auth-pam.c +@@ -779,17 +779,19 @@ sshpam_query(void *ctx, char **name, cha } if (type == PAM_SUCCESS) { if (!sshpam_authctxt->valid || @@ -19,7 +19,7 @@ diff --git a/openssh-6.2p2/auth-pam.c b/openssh-6.2p2/auth-pam.c *num = 0; **echo_on = 0; ctxt->pam_done = 1; - xfree(msg); + free(msg); return (0); } error("PAM: %s for %s%.100s from %.100s", msg, diff --git a/openssh-6.2p2-pts.patch b/openssh-6.4p1-pts.patch similarity index 91% rename from openssh-6.2p2-pts.patch rename to openssh-6.4p1-pts.patch index eb4573b..aa557fe 100644 --- a/openssh-6.2p2-pts.patch +++ b/openssh-6.4p1-pts.patch @@ -1,9 +1,9 @@ # use same lines naming as utempter (prevents problems with using different # formats in ?tmp? files) -diff --git a/openssh-6.2p2/loginrec.c b/openssh-6.2p2/loginrec.c ---- a/openssh-6.2p2/loginrec.c -+++ b/openssh-6.2p2/loginrec.c +diff --git a/openssh-6.4p1/loginrec.c b/openssh-6.4p1/loginrec.c +--- a/openssh-6.4p1/loginrec.c ++++ b/openssh-6.4p1/loginrec.c @@ -535,17 +535,17 @@ getlast_entry(struct logininfo *li) /* * 'line' string utility functions diff --git a/openssh-6.2p2-saveargv-fix.patch b/openssh-6.4p1-saveargv-fix.patch similarity index 84% rename from openssh-6.2p2-saveargv-fix.patch rename to openssh-6.4p1-saveargv-fix.patch index 44133d0..74fe962 100644 --- a/openssh-6.2p2-saveargv-fix.patch +++ b/openssh-6.4p1-saveargv-fix.patch @@ -1,9 +1,9 @@ # related to bnc#49845, upstream bug #529 -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c -@@ -303,16 +303,17 @@ sighup_handler(int sig) +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c +@@ -309,16 +309,17 @@ sighup_handler(int sig) /* * Called from the main program after receiving SIGHUP. @@ -21,7 +21,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c execv(saved_argv[0], saved_argv); logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], strerror(errno)); -@@ -1355,17 +1356,21 @@ main(int ac, char **av) +@@ -1382,17 +1383,21 @@ main(int ac, char **av) saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); for (i = 0; i < ac; i++) saved_argv[i] = xstrdup(av[i]); diff --git a/openssh-6.2p2-seed-prng.patch b/openssh-6.4p1-seed-prng.patch similarity index 85% rename from openssh-6.2p2-seed-prng.patch rename to openssh-6.4p1-seed-prng.patch index 5ecfd5a..ac021ed 100644 --- a/openssh-6.2p2-seed-prng.patch +++ b/openssh-6.4p1-seed-prng.patch @@ -1,9 +1,9 @@ # extended support for (re-)seeding the OpenSSL PRNG from /dev/random # bnc#703221, FATE#312172 -diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c ---- a/openssh-6.2p2/audit-bsm.c -+++ b/openssh-6.2p2/audit-bsm.c +diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c +--- a/openssh-6.4p1/audit-bsm.c ++++ b/openssh-6.4p1/audit-bsm.c @@ -504,9 +504,15 @@ audit_destroy_sensitive_data(const char /* not implemented */ } @@ -20,9 +20,9 @@ diff --git a/openssh-6.2p2/audit-bsm.c b/openssh-6.2p2/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c ---- a/openssh-6.2p2/audit-linux.c -+++ b/openssh-6.2p2/audit-linux.c +diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +--- a/openssh-6.4p1/audit-linux.c ++++ b/openssh-6.4p1/audit-linux.c @@ -398,9 +398,31 @@ audit_generate_ephemeral_server_key(cons } audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, @@ -55,9 +55,9 @@ diff --git a/openssh-6.2p2/audit-linux.c b/openssh-6.2p2/audit-linux.c + error("cannot write into audit"); +} #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c ---- a/openssh-6.2p2/audit.c -+++ b/openssh-6.2p2/audit.c +diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +--- a/openssh-6.4p1/audit.c ++++ b/openssh-6.4p1/audit.c @@ -304,10 +304,16 @@ audit_destroy_sensitive_data(const char /* * This will be called on generation of the ephemeral server key @@ -75,9 +75,9 @@ diff --git a/openssh-6.2p2/audit.c b/openssh-6.2p2/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h ---- a/openssh-6.2p2/audit.h -+++ b/openssh-6.2p2/audit.h +diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +--- a/openssh-6.4p1/audit.h ++++ b/openssh-6.4p1/audit.h @@ -63,10 +63,11 @@ void audit_key(int, int *, const Key *); void audit_unsupported(int); void audit_kex(int, char *, char *, char *); @@ -90,9 +90,9 @@ diff --git a/openssh-6.2p2/audit.h b/openssh-6.2p2/audit.h +void audit_linux_prng_seed(long, const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.2p2/entropy.c b/openssh-6.2p2/entropy.c ---- a/openssh-6.2p2/entropy.c -+++ b/openssh-6.2p2/entropy.c +diff --git a/openssh-6.4p1/entropy.c b/openssh-6.4p1/entropy.c +--- a/openssh-6.4p1/entropy.c ++++ b/openssh-6.4p1/entropy.c @@ -45,16 +45,17 @@ #include "ssh.h" @@ -126,15 +126,15 @@ diff --git a/openssh-6.2p2/entropy.c b/openssh-6.2p2/entropy.c if (RAND_status() != 1) fatal("PRNG is not seeded"); } -diff --git a/openssh-6.2p2/openbsd-compat/Makefile.in b/openssh-6.2p2/openbsd-compat/Makefile.in ---- a/openssh-6.2p2/openbsd-compat/Makefile.in -+++ b/openssh-6.2p2/openbsd-compat/Makefile.in +diff --git a/openssh-6.4p1/openbsd-compat/Makefile.in b/openssh-6.4p1/openbsd-compat/Makefile.in +--- a/openssh-6.4p1/openbsd-compat/Makefile.in ++++ b/openssh-6.4p1/openbsd-compat/Makefile.in @@ -15,17 +15,17 @@ AR=@AR@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ LDFLAGS=-L. @LDFLAGS@ - OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o + OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o @@ -148,10 +148,10 @@ diff --git a/openssh-6.2p2/openbsd-compat/Makefile.in b/openssh-6.2p2/openbsd-co $(COMPAT): ../config.h $(OPENBSD): ../config.h -diff --git a/openssh-6.2p2/openbsd-compat/port-linux-prng.c b/openssh-6.2p2/openbsd-compat/port-linux-prng.c +diff --git a/openssh-6.4p1/openbsd-compat/port-linux-prng.c b/openssh-6.4p1/openbsd-compat/port-linux-prng.c new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/openbsd-compat/port-linux-prng.c ++++ b/openssh-6.4p1/openbsd-compat/port-linux-prng.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2011 Jan F. Chadima @@ -232,9 +232,9 @@ new file mode 100644 + fatal ("EOF reading %s", random); + } +} -diff --git a/openssh-6.2p2/openbsd-compat/port-linux.h b/openssh-6.2p2/openbsd-compat/port-linux.h ---- a/openssh-6.2p2/openbsd-compat/port-linux.h -+++ b/openssh-6.2p2/openbsd-compat/port-linux.h +diff --git a/openssh-6.4p1/openbsd-compat/port-linux.h b/openssh-6.4p1/openbsd-compat/port-linux.h +--- a/openssh-6.4p1/openbsd-compat/port-linux.h ++++ b/openssh-6.4p1/openbsd-compat/port-linux.h @@ -14,16 +14,20 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -256,9 +256,9 @@ diff --git a/openssh-6.2p2/openbsd-compat/port-linux.h b/openssh-6.2p2/openbsd-c void ssh_selinux_setfscreatecon(const char *); #endif -diff --git a/openssh-6.2p2/ssh-add.1 b/openssh-6.2p2/ssh-add.1 ---- a/openssh-6.2p2/ssh-add.1 -+++ b/openssh-6.2p2/ssh-add.1 +diff --git a/openssh-6.4p1/ssh-add.1 b/openssh-6.4p1/ssh-add.1 +--- a/openssh-6.4p1/ssh-add.1 ++++ b/openssh-6.4p1/ssh-add.1 @@ -155,16 +155,30 @@ or related script. (Note that on some machines it may be necessary to redirect the input from @@ -290,9 +290,9 @@ diff --git a/openssh-6.2p2/ssh-add.1 b/openssh-6.2p2/ssh-add.1 .It Pa ~/.ssh/id_dsa Contains the protocol version 2 DSA authentication identity of the user. .It Pa ~/.ssh/id_ecdsa -diff --git a/openssh-6.2p2/ssh-agent.1 b/openssh-6.2p2/ssh-agent.1 ---- a/openssh-6.2p2/ssh-agent.1 -+++ b/openssh-6.2p2/ssh-agent.1 +diff --git a/openssh-6.4p1/ssh-agent.1 b/openssh-6.4p1/ssh-agent.1 +--- a/openssh-6.4p1/ssh-agent.1 ++++ b/openssh-6.4p1/ssh-agent.1 @@ -193,16 +193,33 @@ Contains the protocol version 2 ECDSA au .It Pa ~/.ssh/id_rsa Contains the protocol version 2 RSA authentication identity of the user. @@ -327,10 +327,10 @@ diff --git a/openssh-6.2p2/ssh-agent.1 b/openssh-6.2p2/ssh-agent.1 .Sh AUTHORS OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. -diff --git a/openssh-6.2p2/ssh-keygen.1 b/openssh-6.2p2/ssh-keygen.1 ---- a/openssh-6.2p2/ssh-keygen.1 -+++ b/openssh-6.2p2/ssh-keygen.1 -@@ -801,16 +801,33 @@ on all machines +diff --git a/openssh-6.4p1/ssh-keygen.1 b/openssh-6.4p1/ssh-keygen.1 +--- a/openssh-6.4p1/ssh-keygen.1 ++++ b/openssh-6.4p1/ssh-keygen.1 +@@ -800,16 +800,33 @@ on all machines where the user wishes to log in using public key authentication. There is no need to keep the contents of this file secret. .Pp @@ -364,9 +364,9 @@ diff --git a/openssh-6.2p2/ssh-keygen.1 b/openssh-6.2p2/ssh-keygen.1 .Xr sshd 8 .Rs .%R RFC 4716 -diff --git a/openssh-6.2p2/ssh-keysign.8 b/openssh-6.2p2/ssh-keysign.8 ---- a/openssh-6.2p2/ssh-keysign.8 -+++ b/openssh-6.2p2/ssh-keysign.8 +diff --git a/openssh-6.4p1/ssh-keysign.8 b/openssh-6.4p1/ssh-keysign.8 +--- a/openssh-6.4p1/ssh-keysign.8 ++++ b/openssh-6.4p1/ssh-keysign.8 @@ -73,16 +73,33 @@ Since they are readable only by root, must be set-uid root if host-based authentication is used. .Pp @@ -401,10 +401,10 @@ diff --git a/openssh-6.2p2/ssh-keysign.8 b/openssh-6.2p2/ssh-keysign.8 .Sh HISTORY .Nm first appeared in -diff --git a/openssh-6.2p2/ssh.1 b/openssh-6.2p2/ssh.1 ---- a/openssh-6.2p2/ssh.1 -+++ b/openssh-6.2p2/ssh.1 -@@ -1272,16 +1272,30 @@ reads +diff --git a/openssh-6.4p1/ssh.1 b/openssh-6.4p1/ssh.1 +--- a/openssh-6.4p1/ssh.1 ++++ b/openssh-6.4p1/ssh.1 +@@ -1290,16 +1290,30 @@ reads and adds lines of the format .Dq VARNAME=value to the environment if the file exists and users are allowed to @@ -435,10 +435,10 @@ diff --git a/openssh-6.2p2/ssh.1 b/openssh-6.2p2/ssh.1 world-readable if the user's home directory is on an NFS partition, because .Xr sshd 8 -diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 ---- a/openssh-6.2p2/sshd.8 -+++ b/openssh-6.2p2/sshd.8 -@@ -940,16 +940,33 @@ and not group or world-writable. +diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 +--- a/openssh-6.4p1/sshd.8 ++++ b/openssh-6.4p1/sshd.8 +@@ -941,16 +941,33 @@ and not group or world-writable. .It Pa /var/run/sshd.pid Contains the process ID of the .Nm @@ -472,9 +472,9 @@ diff --git a/openssh-6.2p2/sshd.8 b/openssh-6.2p2/sshd.8 .Xr ssh-agent 1 , .Xr ssh-keygen 1 , .Xr ssh-keyscan 1 , -diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c ---- a/openssh-6.2p2/sshd.c -+++ b/openssh-6.2p2/sshd.c +diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c +--- a/openssh-6.4p1/sshd.c ++++ b/openssh-6.4p1/sshd.c @@ -50,16 +50,18 @@ #ifdef HAVE_SYS_STAT_H # include @@ -494,8 +494,8 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c #ifdef HAVE_PATHS_H #include #endif -@@ -209,16 +211,23 @@ struct { - Key **host_keys; /* all private host keys */ +@@ -215,16 +217,23 @@ struct { + Key **host_pubkeys; /* all public host keys */ Key **host_certificates; /* all public host certificates */ int have_ssh1_key; int have_ssh2_key; @@ -518,7 +518,7 @@ diff --git a/openssh-6.2p2/sshd.c b/openssh-6.2p2/sshd.c /* This is set to true when a signal is received. */ static volatile sig_atomic_t received_sighup = 0; static volatile sig_atomic_t received_sigterm = 0; -@@ -1275,16 +1284,21 @@ server_accept_loop(int *sock_in, int *so +@@ -1300,16 +1309,21 @@ server_accept_loop(int *sock_in, int *so for (j = 0; j < options.max_startups; j++) if (startup_pipes[j] == -1) { startup_pipes[j] = startup_p[0]; diff --git a/openssh-6.2p2-send_locale.patch b/openssh-6.4p1-send_locale.patch similarity index 77% rename from openssh-6.2p2-send_locale.patch rename to openssh-6.4p1-send_locale.patch index 65dc913..45df36c 100644 --- a/openssh-6.2p2-send_locale.patch +++ b/openssh-6.4p1-send_locale.patch @@ -1,10 +1,10 @@ # send locales in default configuration # bnc#65747 -diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config ---- a/openssh-6.2p2/ssh_config -+++ b/openssh-6.2p2/ssh_config -@@ -58,8 +58,13 @@ ForwardX11Trusted yes +diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +--- a/openssh-6.4p1/ssh_config ++++ b/openssh-6.4p1/ssh_config +@@ -58,9 +58,14 @@ ForwardX11Trusted yes # ProxyCommand ssh -q -W %h:%p gateway.example.com # Set this to 'yes' to enable support for the deprecated 'gssapi' authentication @@ -18,10 +18,11 @@ diff --git a/openssh-6.2p2/ssh_config b/openssh-6.2p2/ssh_config +SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT +SendEnv LC_IDENTIFICATION LC_ALL + -diff --git a/openssh-6.2p2/sshd_config b/openssh-6.2p2/sshd_config ---- a/openssh-6.2p2/sshd_config -+++ b/openssh-6.2p2/sshd_config -@@ -122,13 +122,18 @@ UsePrivilegeSeparation sandbox # Defaul + # RekeyLimit 1G 1h +diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +--- a/openssh-6.4p1/sshd_config ++++ b/openssh-6.4p1/sshd_config +@@ -125,13 +125,18 @@ UsePrivilegeSeparation sandbox # Defaul #VersionAddendum none # no default banner path diff --git a/openssh-6.2p2-sftp_homechroot.patch b/openssh-6.4p1-sftp_homechroot.patch similarity index 90% rename from openssh-6.2p2-sftp_homechroot.patch rename to openssh-6.4p1-sftp_homechroot.patch index c1afabc..09127bb 100644 --- a/openssh-6.2p2-sftp_homechroot.patch +++ b/openssh-6.4p1-sftp_homechroot.patch @@ -1,9 +1,9 @@ # run sftp sessions inside a chroot -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c -@@ -119,16 +119,18 @@ int do_exec(Session *, const char *); +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c +@@ -120,16 +120,18 @@ int do_exec(Session *, const char *); void do_login(Session *, const char *); #ifdef LOGIN_NEEDS_UTMPX static void do_pre_login(Session *s); @@ -179,10 +179,10 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c do_setusercontext(struct passwd *pw) { char *chroot_path, *tmp; -diff --git a/openssh-6.2p2/sftp-chrootenv.h b/openssh-6.2p2/sftp-chrootenv.h +diff --git a/openssh-6.4p1/sftp-chrootenv.h b/openssh-6.4p1/sftp-chrootenv.h new file mode 100644 --- /dev/null -+++ b/openssh-6.2p2/sftp-chrootenv.h ++++ b/openssh-6.4p1/sftp-chrootenv.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2009 Jan F Chadima. All rights reserved. @@ -214,9 +214,9 @@ new file mode 100644 + +#endif + -diff --git a/openssh-6.2p2/sftp-common.c b/openssh-6.2p2/sftp-common.c ---- a/openssh-6.2p2/sftp-common.c -+++ b/openssh-6.2p2/sftp-common.c +diff --git a/openssh-6.4p1/sftp-common.c b/openssh-6.4p1/sftp-common.c +--- a/openssh-6.4p1/sftp-common.c ++++ b/openssh-6.4p1/sftp-common.c @@ -41,16 +41,17 @@ #endif @@ -261,9 +261,9 @@ diff --git a/openssh-6.2p2/sftp-common.c b/openssh-6.2p2/sftp-common.c if (ltime != NULL) { if (time(NULL) - st->st_mtime < (365*24*60*60)/2) sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime); -diff --git a/openssh-6.2p2/sftp-server-main.c b/openssh-6.2p2/sftp-server-main.c ---- a/openssh-6.2p2/sftp-server-main.c -+++ b/openssh-6.2p2/sftp-server-main.c +diff --git a/openssh-6.4p1/sftp-server-main.c b/openssh-6.4p1/sftp-server-main.c +--- a/openssh-6.4p1/sftp-server-main.c ++++ b/openssh-6.4p1/sftp-server-main.c @@ -17,21 +17,24 @@ #include "includes.h" @@ -289,10 +289,10 @@ diff --git a/openssh-6.2p2/sftp-server-main.c b/openssh-6.2p2/sftp-server-main.c int main(int argc, char **argv) -diff --git a/openssh-6.2p2/sftp.c b/openssh-6.2p2/sftp.c ---- a/openssh-6.2p2/sftp.c -+++ b/openssh-6.2p2/sftp.c -@@ -97,16 +97,18 @@ struct complete_ctx { +diff --git a/openssh-6.4p1/sftp.c b/openssh-6.4p1/sftp.c +--- a/openssh-6.4p1/sftp.c ++++ b/openssh-6.4p1/sftp.c +@@ -106,16 +106,18 @@ struct complete_ctx { char **remote_pathp; }; @@ -311,10 +311,10 @@ diff --git a/openssh-6.2p2/sftp.c b/openssh-6.2p2/sftp.c #define LS_SHORT_VIEW 0x0002 /* Single row view ala ls -1 */ #define LS_NUMERIC_VIEW 0x0004 /* Long view with numeric uid/gid */ #define LS_NAME_SORT 0x0008 /* Sort by name (default) */ -diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 ---- a/openssh-6.2p2/sshd_config.0 -+++ b/openssh-6.2p2/sshd_config.0 -@@ -181,16 +181,24 @@ DESCRIPTION +diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 +--- a/openssh-6.4p1/sshd_config.0 ++++ b/openssh-6.4p1/sshd_config.0 +@@ -189,16 +189,24 @@ DESCRIPTION session this requires at least a shell, typically sh(1), and basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), stderr(4), arandom(4) and tty(4) devices. For file transfer @@ -339,10 +339,10 @@ diff --git a/openssh-6.2p2/sshd_config.0 b/openssh-6.2p2/sshd_config.0 ``3des-cbc'', ``aes128-cbc'', ``aes192-cbc'', ``aes256-cbc'', ``aes128-ctr'', ``aes192-ctr'', ``aes256-ctr'', ``aes128-gcm@openssh.com'', ``aes256-gcm@openssh.com'', -diff --git a/openssh-6.2p2/sshd_config.5 b/openssh-6.2p2/sshd_config.5 ---- a/openssh-6.2p2/sshd_config.5 -+++ b/openssh-6.2p2/sshd_config.5 -@@ -317,16 +317,27 @@ For file transfer sessions using +diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 +--- a/openssh-6.4p1/sshd_config.5 ++++ b/openssh-6.4p1/sshd_config.5 +@@ -324,16 +324,27 @@ For file transfer sessions using no additional configuration of the environment is necessary if the in-process sftp server is used, though sessions which use logging do require diff --git a/openssh-6.2p2-xauth.patch b/openssh-6.4p1-xauth.patch similarity index 78% rename from openssh-6.2p2-xauth.patch rename to openssh-6.4p1-xauth.patch index 35dbb82..97a4484 100644 --- a/openssh-6.2p2-xauth.patch +++ b/openssh-6.4p1-xauth.patch @@ -1,10 +1,10 @@ # try to remove xauth cookies on logout # bnc#98815 -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c -@@ -2473,18 +2473,50 @@ session_exit_message(Session *s, int sta +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c +@@ -2477,18 +2477,50 @@ session_exit_message(Session *s, int sta if (c->ostate != CHAN_OUTPUT_CLOSED) chan_write_failed(c); } @@ -49,9 +49,9 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c + if (s->ttyfd != -1) session_pty_cleanup(s); - if (s->term) - xfree(s->term); - if (s->display) - xfree(s->display); - if (s->x11_chanids) - xfree(s->x11_chanids); + free(s->term); + free(s->display); + free(s->x11_chanids); + free(s->auth_display); + free(s->auth_data); + free(s->auth_proto); diff --git a/openssh-6.2p2-xauthlocalhostname.patch b/openssh-6.4p1-xauthlocalhostname.patch similarity index 91% rename from openssh-6.2p2-xauthlocalhostname.patch rename to openssh-6.4p1-xauthlocalhostname.patch index 8412af7..3ca28e5 100644 --- a/openssh-6.2p2-xauthlocalhostname.patch +++ b/openssh-6.4p1-xauthlocalhostname.patch @@ -1,14 +1,14 @@ # handle hostname changes when forwarding X # bnc#98627 -diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c ---- a/openssh-6.2p2/session.c -+++ b/openssh-6.2p2/session.c +diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c +--- a/openssh-6.4p1/session.c ++++ b/openssh-6.4p1/session.c @@ -1118,17 +1118,17 @@ copy_environment(char **source, char *** debug3("Copy environment: %s=%s", var_name, var_val); child_set_env(env, envsize, var_name, var_val); - xfree(var_name); + free(var_name); } } @@ -83,7 +83,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c } static void -@@ -1618,16 +1628,17 @@ child_close_fds(void) +@@ -1631,16 +1641,17 @@ child_close_fds(void) * ids, and executing the command or shell. */ #define ARGV_MAX 10 @@ -101,7 +101,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c /* remove hostkey from the child's memory */ destroy_sensitive_data(); -@@ -1684,17 +1695,17 @@ do_child(Session *s, const char *command +@@ -1697,17 +1708,17 @@ do_child(Session *s, const char *command * legal, and means /bin/sh. */ shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; @@ -120,7 +120,7 @@ diff --git a/openssh-6.2p2/session.c b/openssh-6.2p2/session.c /* we have to stash the hostname before we close our socket. */ if (options.use_login) hostname = get_remote_name_or_ip(utmp_len, -@@ -1753,17 +1764,17 @@ do_child(Session *s, const char *command +@@ -1766,17 +1777,17 @@ do_child(Session *s, const char *command strerror(errno)); if (r) exit(1); diff --git a/openssh-6.4p1.tar.gz b/openssh-6.4p1.tar.gz new file mode 100644 index 0000000..cd356bb --- /dev/null +++ b/openssh-6.4p1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5530f616513b14aea3662c4c373bafd6a97a269938674c006377e381f68975d2 +size 1201402 diff --git a/openssh-askpass-gnome.changes b/openssh-askpass-gnome.changes index e7cf1bd..96ca191 100644 --- a/openssh-askpass-gnome.changes +++ b/openssh-askpass-gnome.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com + +- Update of the underlying OpenSSH to 6.4p1 + ------------------------------------------------------------------- Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com diff --git a/openssh-askpass-gnome.spec b/openssh-askpass-gnome.spec index aff9335..ff959eb 100644 --- a/openssh-askpass-gnome.spec +++ b/openssh-askpass-gnome.spec @@ -1,7 +1,7 @@ # # spec file for package openssh-askpass-gnome # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,7 +26,7 @@ BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: tcpd-devel BuildRequires: update-desktop-files -Version: 6.2p2 +Version: 6.4p1 Release: 0 Requires: openssh = %{version} Summary: A GNOME-Based Passphrase Dialog for OpenSSH diff --git a/openssh.changes b/openssh.changes index 9aed0d7..0cb97cb 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,85 @@ +------------------------------------------------------------------- +Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com + +- Update to 6.4p1 + Features since 6.2p2: + * ssh-agent(1) support in sshd(8); allows encrypted hostkeys, or + hostkeys on smartcards. + * ssh(1)/sshd(8): allow optional time-based rekeying via a + second argument to the existing RekeyLimit option. RekeyLimit + is now supported in sshd_config as well as on the client. + * sshd(8): standardise logging of information during user + authentication. + * The presented key/cert and the remote username (if available) + is now logged in the authentication success/failure message on + the same log line as the local username, remote host/port and + protocol in use. Certificates contents and the key + fingerprint of the signing CA are logged too. + * ssh(1) ability to query what cryptographic algorithms are + supported in the binary. + * ssh(1): ProxyCommand=- for cases where stdin and stdout + already point to the proxy. + * ssh(1): allow IdentityFile=none + * ssh(1)/sshd(8): -E option to append debugging logs to a + specified file instead of stderr or syslog. + * sftp(1): support resuming partial downloads with the "reget" + command and on the sftp commandline or on the "get" + commandline with the "-a" (append) option. + * ssh(1): "IgnoreUnknown" configuration option to selectively + suppress errors arising from unknown configuration directives. + * sshd(8): support for submethods to be appended to required + authentication methods listed via AuthenticationMethods. + Bugfixes since 6.2p2: + * sshd(8): fix refusal to accept certificate if a key of a + different type to the CA key appeared in authorized_keys + before the CA key. + * ssh(1)/ssh-agent(1)/sshd(8): Use a monotonic time source for + timers so that things like keepalives and rekeying will work + properly over clock steps. + * sftp(1): update progressmeter when data is acknowledged, not + when it's sent. bz#2108 + * ssh(1)/ssh-keygen(1): improve error messages when the current + user does not exist in /etc/passwd; bz#2125 + * ssh(1): reset the order in which public keys are tried after + partial authentication success. + * ssh-agent(1): clean up socket files after SIGINT when in debug + mode; bz#2120 + * ssh(1) and others: avoid confusing error messages in the case + of broken system resolver configurations; bz#2122 + * ssh(1): set TCP nodelay for connections started with -N; + bz#2124 + * ssh(1): correct manual for permission requirements on + ~/.ssh/config; bz#2078 + * ssh(1): fix ControlPersist timeout not triggering in cases + where TCP connections have hung. bz#1917 + * ssh(1): properly deatch a ControlPersist master from its + controlling terminal. + * sftp(1): avoid crashes in libedit when it has been compiled + with multi- byte character support. bz#1990 + * sshd(8): when running sshd -D, close stderr unless we have + explicitly requested logging to stderr. bz#1976, + * ssh(1): fix incomplete bzero; bz#2100 + * sshd(8): log and error and exit if ChrootDirectory is + specified and running without root privileges. + * Many improvements to the regression test suite. In particular + log files are now saved from ssh and sshd after failures. + * Fix a number of memory leaks. bz#1967 bz#2096 and others + * sshd(8): fix public key authentication when a :style is + appended to the requested username. + * ssh(1): do not fatally exit when attempting to cleanup + multiplexing- created channels that are incompletely opened. + bz#2079 + * sshd(8): fix a memory corruption problem triggered during + rekeying when an AES-GCM cipher is selected + * Fix unaligned accesses in umac.c for strict-alignment + architectures. bz#2101 + * Fix broken incorrect commandline reporting errors. bz#1448 + * Only include SHA256 and ECC-based key exchange methods if + libcrypto has the required support. + * Fix crash in SOCKS5 dynamic forwarding code on + strict-alignment architectures. + - FIPS and GSSKEX patched disabled for now + ------------------------------------------------------------------- Fri Oct 4 17:50:32 UTC 2013 - pcerny@suse.com diff --git a/openssh.spec b/openssh.spec index a6843c6..4e053c5 100644 --- a/openssh.spec +++ b/openssh.spec @@ -1,7 +1,7 @@ # # spec file for package openssh # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,10 +18,8 @@ %if 0%{suse_version} >= 1100 %define has_fw_dir 1 -%define needs_xorg_libs 0 %else %define has_fw_dir 0 -%define needs_xorg_libs 1 %endif %if 0%{suse_version} >= 1110 @@ -80,7 +78,7 @@ BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pam-devel %if %{has_systemd} -BuildRequires: systemd +BuildRequires: pkgconfig(systemd) %{?systemd_requires} %endif BuildRequires: tcpd-devel @@ -88,8 +86,8 @@ Requires: /bin/netstat PreReq: pwdutils %{insserv_prereq} %{fillup_prereq} coreutils Conflicts: nonfreessh Recommends: xauth -Recommends: %{name}-akc-ldap -Version: 6.2p2 +Recommends: %{name}-helpers +Version: 6.4p1 Release: 0 Summary: Secure Shell Client and Server (Remote Login Program) License: BSD-3-Clause and MIT @@ -106,39 +104,39 @@ Source7: sshd.fw Source8: sysconfig.ssh Source9: sshd-gen-keys-start Source10: sshd.service -Patch1: %{name}-%{version}-key-converter.patch -Patch2: %{name}-%{version}-X11-forwarding.patch -Patch3: %{name}-%{version}-lastlog.patch -Patch4: %{name}-%{version}-pam-fix2.patch -Patch5: %{name}-%{version}-saveargv-fix.patch -Patch6: %{name}-%{version}-pam-fix3.patch -Patch7: %{name}-%{version}-gssapimitm.patch -Patch8: %{name}-%{version}-eal3.patch -Patch9: %{name}-%{version}-blocksigalrm.patch -Patch10: %{name}-%{version}-send_locale.patch -Patch11: %{name}-%{version}-xauthlocalhostname.patch -Patch12: %{name}-%{version}-xauth.patch -Patch13: %{name}-%{version}-default-protocol.patch -Patch14: %{name}-%{version}-pts.patch -Patch15: %{name}-%{version}-pam-check-locks.patch -Patch16: %{name}-%{version}-fingerprint_hash.patch -Patch17: %{name}-%{version}-audit1-remove_duplicit_audit.patch -Patch18: %{name}-%{version}-audit2-better_audit_of_user_actions.patch -Patch19: %{name}-%{version}-audit3-key_auth_usage.patch -Patch20: %{name}-%{version}-audit4-kex_results.patch -Patch21: %{name}-%{version}-audit5-session_key_destruction.patch -Patch22: %{name}-%{version}-audit6-server_key_destruction.patch -Patch23: %{name}-%{version}-audit7-libaudit_compat.patch -Patch24: %{name}-%{version}-audit8-libaudit_dns_timeouts.patch -Patch25: %{name}-%{version}-seed-prng.patch -Patch26: %{name}-%{version}-ldap.patch -Patch27: %{name}-%{version}-fips.patch -Patch28: %{name}-%{version}-gssapi_key_exchange.patch -Patch29: %{name}-%{version}-login_options.patch -Patch30: %{name}-%{version}-disable-openssl-abi-check.patch -Patch31: %{name}-%{version}-no_fork-no_pid_file.patch -Patch32: %{name}-%{version}-host_ident.patch -Patch33: %{name}-%{version}-sftp_homechroot.patch +Patch1: openssh-6.4p1-key-converter.patch +Patch2: openssh-6.4p1-X11-forwarding.patch +Patch3: openssh-6.4p1-lastlog.patch +Patch4: openssh-6.4p1-pam-fix2.patch +Patch5: openssh-6.4p1-saveargv-fix.patch +Patch6: openssh-6.4p1-pam-fix3.patch +Patch7: openssh-6.4p1-gssapimitm.patch +Patch8: openssh-6.4p1-eal3.patch +Patch9: openssh-6.4p1-blocksigalrm.patch +Patch10: openssh-6.4p1-send_locale.patch +Patch11: openssh-6.4p1-xauthlocalhostname.patch +Patch12: openssh-6.4p1-xauth.patch +Patch13: openssh-6.4p1-default-protocol.patch +Patch14: openssh-6.4p1-pts.patch +Patch15: openssh-6.4p1-pam-check-locks.patch +Patch16: openssh-6.4p1-fingerprint_hash.patch +Patch17: openssh-6.4p1-audit1-remove_duplicit_audit.patch +Patch18: openssh-6.4p1-audit2-better_audit_of_user_actions.patch +Patch19: openssh-6.4p1-audit3-key_auth_usage.patch +Patch20: openssh-6.4p1-audit4-kex_results.patch +Patch21: openssh-6.4p1-audit5-session_key_destruction.patch +Patch22: openssh-6.4p1-audit6-server_key_destruction.patch +Patch23: openssh-6.4p1-audit7-libaudit_compat.patch +Patch24: openssh-6.4p1-audit8-libaudit_dns_timeouts.patch +Patch25: openssh-6.4p1-seed-prng.patch +Patch26: openssh-6.4p1-ldap.patch +Patch27: openssh-6.4p1-fips.patch +Patch28: openssh-6.4p1-gssapi_key_exchange.patch +Patch29: openssh-6.4p1-login_options.patch +Patch30: openssh-6.4p1-disable-openssl-abi-check.patch +Patch31: openssh-6.4p1-no_fork-no_pid_file.patch +Patch32: openssh-6.4p1-host_ident.patch +Patch33: openssh-6.4p1-sftp_homechroot.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -152,15 +150,14 @@ xorg-x11 (X Window System) connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. -%package akc-ldap -Summary: OpenSSH AuthorizedKeysCommand helper for LDAP +%package helpers +Summary: OpenSSH AuthorizedKeysCommand helpers Group: Productivity/Networking/SSH Requires: openldap2 Requires: openssh -%description akc-ldap -Helper application for OpenSSH which retrieves authorized keys from -a LDAP server. +%description helpers +Helper applications for OpenSSH which retrieve keys from various sources. %prep @@ -192,7 +189,7 @@ a LDAP server. %patch25 -p2 %patch26 -p2 #patch27 -p2 -%patch28 -p2 +#patch28 -p2 %patch29 -p2 %patch30 -p2 %patch31 -p2 @@ -214,11 +211,17 @@ PIEFLAGS="-fPIE" PIEFLAGS="-fpie" %endif CFLAGS="%{optflags} $PIEFLAGS -fstack-protector" +%if 0%{?suse_version} < 1230 +CFLAGS="-lrt $CFLAGS" +%endif CXXFLAGS="%{optflags} $PIEFLAGS -fstack-protector" LDFLAGS="-pie -Wl,--as-needed" +%if 0%{?suse_version} < 1230 +LDFLAGS="-lrt $LDFLAGS" +%endif #CPPFLAGS="%{optflags} -DUSE_INTERNAL_B64" export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS -%configure \ +./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ @@ -249,9 +252,9 @@ export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS --target=%{_target_cpu}-suse-linux \ ### configure end -make %{?_smp_mflags} +make -j 1 -make %{?_smp_mflags} -C converter +make -j 1 -C converter %install make install DESTDIR=%{buildroot} @@ -360,7 +363,7 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %config %{_fwdefdir}/sshd %endif -%files akc-ldap +%files helpers %defattr(-,root,root) %attr(0755,root,root) %dir %{_sysconfdir}/ssh %verify(not mode) %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ldap.conf From 7d3e25f02e00f2bce92bfde16edf429b9f8ede57fe350eab33b07e61cfcc2f7d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 8 Feb 2014 10:47:01 +0000 Subject: [PATCH 5/9] Accepting request 221224 from home:namtrac:bugfix - Add openssh-6.2p1-forcepermissions.patch to implement a force permissions mode (fate#312774). The patch is based on http://marc.info/?l=openssh-unix-dev&m=128896838930893 OBS-URL: https://build.opensuse.org/request/show/221224 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=59 --- openssh-6.4p1-forcepermissions.patch | 81 ++++++++++++++++++++++++++++ openssh.changes | 7 +++ openssh.spec | 3 +- 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 openssh-6.4p1-forcepermissions.patch diff --git a/openssh-6.4p1-forcepermissions.patch b/openssh-6.4p1-forcepermissions.patch new file mode 100644 index 0000000..3c945ce --- /dev/null +++ b/openssh-6.4p1-forcepermissions.patch @@ -0,0 +1,81 @@ +Index: openssh-6.4p1/sftp-server.8 +=================================================================== +--- openssh-6.4p1.orig/sftp-server.8 ++++ openssh-6.4p1/sftp-server.8 +@@ -35,6 +35,7 @@ + .Op Fl f Ar log_facility + .Op Fl l Ar log_level + .Op Fl u Ar umask ++.Op Fl m Ar force_file_permissions + .Sh DESCRIPTION + .Nm + is a program that speaks the server side of SFTP protocol +@@ -104,6 +105,10 @@ Sets an explicit + .Xr umask 2 + to be applied to newly-created files and directories, instead of the + user's default mask. ++.It Fl m Ar force_file_permissions ++Sets explicit file permissions to be applied to newly-created files instead ++of the default or client requested mode. Numeric values include: ++777, 755, 750, 666, 644, 640, etc. Option -u is ineffective if -m is set. + .El + .Pp + For logging to work, +Index: openssh-6.4p1/sftp-server.c +=================================================================== +--- openssh-6.4p1.orig/sftp-server.c ++++ openssh-6.4p1/sftp-server.c +@@ -73,6 +73,10 @@ u_int version; + /* Disable writes */ + int readonly; + ++/* Force file permissions */ ++int permforce = 0; ++long permforcemode; ++ + /* portable attributes, etc. */ + + typedef struct Stat Stat; +@@ -557,6 +561,10 @@ process_open(void) + a = get_attrib(); + flags = flags_from_portable(pflags); + mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; ++ if (permforce == 1) { ++ mode = permforcemode; ++ (void)umask(0); /* so umask does not interfere */ ++ } + logit("open \"%s\" flags %s mode 0%o", + name, string_from_portable(pflags), mode); + if (readonly && +@@ -1391,7 +1399,7 @@ sftp_server_usage(void) + + fprintf(stderr, + "usage: %s [-ehR] [-d start_directory] [-f log_facility] " +- "[-l log_level]\n\t[-u umask]\n", ++ "[-l log_level]\n\t[-u umask]\n[-m force_file_permissions]\n", + __progname); + exit(1); + } +@@ -1414,7 +1422,7 @@ sftp_server_main(int argc, char **argv, + + pw = pwcopy(user_pw); + +- while (!skipargs && (ch = getopt(argc, argv, "d:f:l:u:cehR")) != -1) { ++ while (!skipargs && (ch = getopt(argc, argv, "d:f:l:u:m:cehR")) != -1) { + switch (ch) { + case 'R': + readonly = 1; +@@ -1453,6 +1461,13 @@ sftp_server_main(int argc, char **argv, + fatal("Invalid umask \"%s\"", optarg); + (void)umask((mode_t)mask); + break; ++ case 'm': ++ permforce = 1; ++ permforcemode = strtol(optarg, &cp, 8); ++ if (permforcemode < 0 || permforcemode > 0777 || *cp != '\0' || ++ cp == optarg || (permforcemode == 0 && errno != 0)) ++ fatal("Invalid umask \"%s\"", optarg); ++ break; + case 'h': + default: + sftp_server_usage(); diff --git a/openssh.changes b/openssh.changes index 0cb97cb..53027ea 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 5 08:38:11 UTC 2014 - idonmez@suse.com + +- Add openssh-6.2p1-forcepermissions.patch to implement a force + permissions mode (fate#312774). The patch is based on + http://marc.info/?l=openssh-unix-dev&m=128896838930893 + ------------------------------------------------------------------- Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com diff --git a/openssh.spec b/openssh.spec index 4e053c5..496a319 100644 --- a/openssh.spec +++ b/openssh.spec @@ -137,7 +137,7 @@ Patch30: openssh-6.4p1-disable-openssl-abi-check.patch Patch31: openssh-6.4p1-no_fork-no_pid_file.patch Patch32: openssh-6.4p1-host_ident.patch Patch33: openssh-6.4p1-sftp_homechroot.patch - +Patch34: openssh-6.4p1-forcepermissions.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -195,6 +195,7 @@ Helper applications for OpenSSH which retrieve keys from various sources. %patch31 -p2 %patch32 -p2 %patch33 -p2 +%patch34 -p1 cp %{SOURCE3} %{SOURCE4} . %build From db5db0c1c29e476e22c3e120dc29abfe97e10def687c758736fbee756db77ffb Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 11 Feb 2014 07:43:47 +0000 Subject: [PATCH 6/9] - add a rcsshd symlink to /usr/sbin/service OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=60 --- openssh.changes | 5 + ....changes.reb47944ec2d587d73f8e2ef1dd4caf5d | 2001 +++++++++++++++++ openssh.spec | 1 + 3 files changed, 2007 insertions(+) create mode 100644 openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d diff --git a/openssh.changes b/openssh.changes index 53027ea..350dc56 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 11 07:42:09 UTC 2014 - meissner@suse.com + +- add a rcsshd symlink to /usr/sbin/service + ------------------------------------------------------------------- Wed Feb 5 08:38:11 UTC 2014 - idonmez@suse.com diff --git a/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d b/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d new file mode 100644 index 0000000..53027ea --- /dev/null +++ b/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d @@ -0,0 +1,2001 @@ +------------------------------------------------------------------- +Wed Feb 5 08:38:11 UTC 2014 - idonmez@suse.com + +- Add openssh-6.2p1-forcepermissions.patch to implement a force + permissions mode (fate#312774). The patch is based on + http://marc.info/?l=openssh-unix-dev&m=128896838930893 + +------------------------------------------------------------------- +Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com + +- Update to 6.4p1 + Features since 6.2p2: + * ssh-agent(1) support in sshd(8); allows encrypted hostkeys, or + hostkeys on smartcards. + * ssh(1)/sshd(8): allow optional time-based rekeying via a + second argument to the existing RekeyLimit option. RekeyLimit + is now supported in sshd_config as well as on the client. + * sshd(8): standardise logging of information during user + authentication. + * The presented key/cert and the remote username (if available) + is now logged in the authentication success/failure message on + the same log line as the local username, remote host/port and + protocol in use. Certificates contents and the key + fingerprint of the signing CA are logged too. + * ssh(1) ability to query what cryptographic algorithms are + supported in the binary. + * ssh(1): ProxyCommand=- for cases where stdin and stdout + already point to the proxy. + * ssh(1): allow IdentityFile=none + * ssh(1)/sshd(8): -E option to append debugging logs to a + specified file instead of stderr or syslog. + * sftp(1): support resuming partial downloads with the "reget" + command and on the sftp commandline or on the "get" + commandline with the "-a" (append) option. + * ssh(1): "IgnoreUnknown" configuration option to selectively + suppress errors arising from unknown configuration directives. + * sshd(8): support for submethods to be appended to required + authentication methods listed via AuthenticationMethods. + Bugfixes since 6.2p2: + * sshd(8): fix refusal to accept certificate if a key of a + different type to the CA key appeared in authorized_keys + before the CA key. + * ssh(1)/ssh-agent(1)/sshd(8): Use a monotonic time source for + timers so that things like keepalives and rekeying will work + properly over clock steps. + * sftp(1): update progressmeter when data is acknowledged, not + when it's sent. bz#2108 + * ssh(1)/ssh-keygen(1): improve error messages when the current + user does not exist in /etc/passwd; bz#2125 + * ssh(1): reset the order in which public keys are tried after + partial authentication success. + * ssh-agent(1): clean up socket files after SIGINT when in debug + mode; bz#2120 + * ssh(1) and others: avoid confusing error messages in the case + of broken system resolver configurations; bz#2122 + * ssh(1): set TCP nodelay for connections started with -N; + bz#2124 + * ssh(1): correct manual for permission requirements on + ~/.ssh/config; bz#2078 + * ssh(1): fix ControlPersist timeout not triggering in cases + where TCP connections have hung. bz#1917 + * ssh(1): properly deatch a ControlPersist master from its + controlling terminal. + * sftp(1): avoid crashes in libedit when it has been compiled + with multi- byte character support. bz#1990 + * sshd(8): when running sshd -D, close stderr unless we have + explicitly requested logging to stderr. bz#1976, + * ssh(1): fix incomplete bzero; bz#2100 + * sshd(8): log and error and exit if ChrootDirectory is + specified and running without root privileges. + * Many improvements to the regression test suite. In particular + log files are now saved from ssh and sshd after failures. + * Fix a number of memory leaks. bz#1967 bz#2096 and others + * sshd(8): fix public key authentication when a :style is + appended to the requested username. + * ssh(1): do not fatally exit when attempting to cleanup + multiplexing- created channels that are incompletely opened. + bz#2079 + * sshd(8): fix a memory corruption problem triggered during + rekeying when an AES-GCM cipher is selected + * Fix unaligned accesses in umac.c for strict-alignment + architectures. bz#2101 + * Fix broken incorrect commandline reporting errors. bz#1448 + * Only include SHA256 and ECC-based key exchange methods if + libcrypto has the required support. + * Fix crash in SOCKS5 dynamic forwarding code on + strict-alignment architectures. + - FIPS and GSSKEX patched disabled for now + +------------------------------------------------------------------- +Fri Oct 4 17:50:32 UTC 2013 - pcerny@suse.com + +- fix server crashes when using AES-GCM +- removed superfluous build dependency on X + +------------------------------------------------------------------- +Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com + +- spec file and patch cleanup + * key converter is now in the -key-converter.patch + * openssh-nodaemon-nopid.patch is -no_fork-no_pid_file.patch + * openssh-nocrazyabicheck.patch is + -disable-openssl-abi-check.patch + * removing obsolete -engines.diff patch +- patches from SLE11 + * use auditing infrastructure extending upstream hooks + (-auditX-*.patch) instead of the single old patch + (-audit.patch) + * FIPS enablement (currently disabled) + (-fingerprint_hash.patch, -fips.patch) + * GSSAPI key exchange + (bnc#784689, fate#313068, -gssapi_key_exchange.patch) + * SysV init script update - 'stop' now terminates all sshd + processes and closes all connections, 'soft-stop' only + terminates the listener process (keeps active sessions intact) + (fate#314243) + * helper application for retrieving users' public keys from + an LDAP server (bnc#683733, fate#302144, -ldap.patch) + - subpackage openssh-akc-ldap + * several bugfixes: + - login invocation + (bnc#833605, -login_options.patch) + - disable locked accounts when using PAM + (bnc#708678, fate#312033, -pam-check-locks.patch) + - fix wtmp handling + (bnc#18024, -lastlog.patch) +- init script is moved into documentation for openSUSE 12.3+ + (as it confused systemd) + +------------------------------------------------------------------- +Tue Sep 10 21:15:59 UTC 2013 - crrodriguez@opensuse.org + +- fix the logic in openssh-nodaemon-nopid.patch which is broken + and pid_file therefore still being created. + +------------------------------------------------------------------- +Sat Aug 3 17:57:06 UTC 2013 - crrodriguez@opensuse.org + +- Update to version 6.2p2 +* ssh(1)/sshd(8): Added support for AES-GCM authenticated encryption +* ssh(1)/sshd(8): Added support for encrypt-then-mac (EtM) MAC modes +* ssh(1)/sshd(8): Added support for the UMAC-128 MAC +* sshd(8): Added support for multiple required authentication +* sshd(8)/ssh-keygen(1): Added support for Key Revocation Lists +* ssh(1): When SSH protocol 2 only is selected (the default), ssh(1) + now immediately sends its SSH protocol banner to the server without + waiting to receive the server's banner, saving time when connecting. +* dozens of other changes, see http://www.openssh.org/txt/release-6.2 + +------------------------------------------------------------------- +Mon Jul 1 18:54:31 UTC 2013 - coolo@suse.com + +- avoid the build cycle between curl, krb5, libssh2_org and openssh + by using krb5-mini-devel + +------------------------------------------------------------------- +Wed Jun 19 09:50:25 UTC 2013 - speilicke@suse.com + +- Recommend xauth, X11-forwarding won't work if it is not installed + +------------------------------------------------------------------- +Sun Apr 14 19:02:32 UTC 2013 - crrodriguez@opensuse.org + +- sshd.service: Do not order after syslog.target, it is + not required or recommended and that target does not even exist + anymore. + +------------------------------------------------------------------- +Tue Jan 8 10:16:45 UTC 2013 - dmueller@suse.com + +- use ssh-keygen(1) default keylengths in generating the host key + instead of hardcoding it + +------------------------------------------------------------------- +Tue Nov 13 10:26:37 UTC 2012 - meissner@suse.com + +- Updated to 6.1p1, a bugfix release + Features: + * sshd(8): This release turns on pre-auth sandboxing sshd by default for + new installs, by setting UsePrivilegeSeparation=sandbox in sshd_config. + * ssh-keygen(1): Add options to specify starting line number and number of + lines to process when screening moduli candidates, allowing processing + of different parts of a candidate moduli file in parallel + * sshd(8): The Match directive now supports matching on the local (listen) + address and port upon which the incoming connection was received via + LocalAddress and LocalPort clauses. + * sshd(8): Extend sshd_config Match directive to allow setting AcceptEnv + and {Allow,Deny}{Users,Groups} + * Add support for RFC6594 SSHFP DNS records for ECDSA key types. bz#1978 + * ssh-keygen(1): Allow conversion of RSA1 keys to public PEM and PKCS8 + * sshd(8): Allow the sshd_config PermitOpen directive to accept "none" as + an argument to refuse all port-forwarding requests. + * sshd(8): Support "none" as an argument for AuthorizedPrincipalsFile + * ssh-keyscan(1): Look for ECDSA keys by default. bz#1971 + * sshd(8): Add "VersionAddendum" to sshd_config to allow server operators + to append some arbitrary text to the server SSH protocol banner. + Bugfixes: + * ssh(1)/sshd(8): Don't spin in accept() in situations of file + descriptor exhaustion. Instead back off for a while. + * ssh(1)/sshd(8): Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs as + they were removed from the specification. bz#2023, + * sshd(8): Handle long comments in config files better. bz#2025 + * ssh(1): Delay setting tty_flag so RequestTTY options are correctly + picked up. bz#1995 + * sshd(8): Fix handling of /etc/nologin incorrectly being applied to root + on platforms that use login_cap. + Portable OpenSSH: + * sshd(8): Allow sshd pre-auth sandboxing to fall-back to the rlimit + sandbox from the Linux SECCOMP filter sandbox when the latter is + not available in the kernel. + * ssh(1): Fix NULL dereference when built with LDNS and using DNSSEC to + retrieve a CNAME SSHFP record. + * Fix cross-compilation problems related to pkg-config. bz#1996 + +------------------------------------------------------------------- +Tue Nov 13 10:26:16 CET 2012 - kukuk@suse.de + +- Fix groupadd arguments +- Add LSB tag to sshd init script + +------------------------------------------------------------------- +Fri Oct 26 15:01:21 UTC 2012 - coolo@suse.com + +- explicit buildrequire groff, needed for man pages + +------------------------------------------------------------------- +Tue Oct 16 12:29:36 UTC 2012 - coolo@suse.com + +- buildrequire systemd through pkgconfig to break cycle + +------------------------------------------------------------------- +Wed Aug 15 19:25:08 UTC 2012 - crrodriguez@opensuse.org + +- When not daemonizing, such is used with systemd, no not + create a PID file + +------------------------------------------------------------------- +Mon Jun 18 11:34:51 UTC 2012 - coolo@suse.com + +- do not buildrequire xorg-x11, the askpass is an extra package + and should build from a different package + +------------------------------------------------------------------- +Tue May 29 07:14:36 UTC 2012 - meissner@suse.com + +- use correct download url and tarball format. + +------------------------------------------------------------------- +Tue May 29 06:52:13 UTC 2012 - crrodriguez@opensuse.org + +- Update to version 6.0, large list of changes, seen + http://www.openssh.org/txt/release-6.0 for detail. + +------------------------------------------------------------------- +Thu May 10 20:50:33 UTC 2012 - crrodriguez@opensuse.org + +- By default openSSH checks at *runtime* if the openssl + API version matches with the running library, that might + be good if you are compiling SSH yourself but it is a totally + insane way to check for binary/source compatibility in a distribution. + +------------------------------------------------------------------- +Mon Feb 20 08:29:17 UTC 2012 - meissner@suse.com + +- include X11 app default dir + +------------------------------------------------------------------- +Fri Dec 23 08:27:08 UTC 2011 - brian@aljex.com + +- Fix building for OS 11.0, 10.3, 10.2 +* Don't require selinux on OS 11.0 or lower + +------------------------------------------------------------------- +Fri Dec 23 06:34:28 UTC 2011 - brian@aljex.com + +- Fix building for OS 11.2 and 11.1 +- Cleanup remove remaining litteral /etc/init.d 's + +------------------------------------------------------------------- +Wed Dec 21 10:38:59 UTC 2011 - coolo@suse.com + +- add autoconf as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Tue Nov 29 19:48:29 UTC 2011 - crrodriguez@opensuse.org + +- Add systemd startup units + +------------------------------------------------------------------- +Sat Oct 29 22:41:55 UTC 2011 - pcerny@suse.com + +- finalising libexecdir change (bnc#726712) + +------------------------------------------------------------------- +Wed Oct 19 00:32:20 UTC 2011 - pcerny@suse.com + +- Update to 5.9p1 + * sandboxing privsep child through rlimit + +------------------------------------------------------------------- +Fri Sep 16 09:43:47 UTC 2011 - jengelh@medozas.de + +- Avoid overriding libexecdir with %_lib (bnc#712025) +- Clean up the specfile by request of Minh Ngo, details entail: +* remove norootforbuild comments, redundant %clean section +* run spec-beautifier over it +- Add PIEFLAGS to compilation of askpass; fails otherwise + +------------------------------------------------------------------- +Mon Aug 29 23:47:58 UTC 2011 - crrodriguez@opensuse.org + +- Update to verison 5.8p2 +* Fixed vuln in systems without dev/random, we arenot affected +* Fixes problems building with selinux enabled +- Fix build with as-needed and no-add-needed + +------------------------------------------------------------------- +Sat Aug 13 20:46:17 UTC 2011 - crrodriguez@opensuse.org + +- Enable libedit/autocompletion support in sftp + +------------------------------------------------------------------- +Tue May 10 15:08:17 UTC 2011 - meissner@novell.com + +- Change default keysizes of rsa and dsa from 1024 to 2048 + to match ssh-keygen manpage recommendations. + +------------------------------------------------------------------- +Fri Feb 4 11:19:25 UTC 2011 - lchiquitto@novell.com + +- Update to 5.8p1 + * Fix vulnerability in legacy certificate signing introduced in + OpenSSH-5.6 and found by Mateusz Kocielski. + * Fix compilation failure when enableing SELinux support. + * Do not attempt to call SELinux functions when SELinux is + disabled. +- Remove patch that is now upstream: + * openssh-5.7p1-selinux.diff + +------------------------------------------------------------------- +Thu Feb 3 16:42:01 UTC 2011 - pcerny@novell.com + +- specfile/patches cleanup + +------------------------------------------------------------------- +Mon Jan 24 11:24:59 UTC 2011 - lchiquitto@novell.com + +- Update to 5.7p1 + * Implement Elliptic Curve Cryptography modes for key exchange (ECDH) + and host/user keys (ECDSA) as specified by RFC5656. + * sftp(1)/sftp-server(8): add a protocol extension to support a hard + link operation. + * scp(1): Add a new -3 option to scp: Copies between two remote hosts + are transferred through the local host. + * ssh(1): automatically order the hostkeys requested by the client + based on which hostkeys are already recorded in known_hosts. + * ssh(1)/sshd(8): add a new IPQoS option to specify arbitrary + TOS/DSCP/QoS values instead of hardcoding lowdelay/throughput. + * sftp(1): the sftp client is now significantly faster at performing + directory listings, using OpenBSD glob(3) extensions to preserve + the results of stat(3) operations performed in the course of its + execution rather than performing expensive round trips to fetch + them again afterwards. + * ssh(1): "atomically" create the listening mux socket by binding it on + a temporary name and then linking it into position after listen() has + succeeded. + * ssh(1)/sshd(8): add a KexAlgorithms knob to the client and server + configuration to allow selection of which key exchange methods are + used by ssh(1) and sshd(8) and their order of preference. + * sftp(1)/scp(1): factor out bandwidth limiting code from scp(1) into + a generic bandwidth limiter that can be attached using the atomicio + callback mechanism and use it to add a bandwidth limit option to + sftp(1). + * Support building against openssl-1.0.0a. + * Bug fixes. +- Remove patches that are now upstream: + * openssh-5.6p1-tmpdir.diff + * openssh-linux-new-oomkill.patch +- Add upstream patch to fix build with SELinux enabled. + +------------------------------------------------------------------- +Wed Jan 12 13:37:38 CET 2011 - sbrabec@suse.cz + +- Removed relics of no more implemented opensc support. + +------------------------------------------------------------------- +Thu Nov 18 12:20:59 UTC 2010 - lnussel@suse.de + +- add pam_lastlog to show failed login attempts +- remove permissions handling, no special handling needed + +------------------------------------------------------------------- +Tue Nov 16 14:45:14 UTC 2010 - cristian.rodriguez@opensuse.org + +- Use upstream oom_adj is deprecated patch + +------------------------------------------------------------------- +Tue Nov 2 13:25:19 UTC 2010 - coolo@novell.com + +- remove the code trying to patch X11 paths - which was broken + for a very long time and was useless anyway as the Makefiles + do this correctly themselves + +------------------------------------------------------------------- +Sun Oct 31 12:37:02 UTC 2010 - jengelh@medozas.de + +- Use %_smp_mflags + +------------------------------------------------------------------- +Thu Oct 14 16:00:19 UTC 2010 - crrodriguez@opensuse.org + +- Fix warning "oom_adj is deprecated use oom_score_adj instead" + +------------------------------------------------------------------- +Mon Sep 13 14:47:10 CEST 2010 - anicka@suse.cz + +- actualize README.SuSE (bnc#638893) + +------------------------------------------------------------------- +Tue Aug 24 15:43:08 CEST 2010 - anicka@suse.cz + +- update to 5.6p1 + * Added a ControlPersist option to ssh_config(5) that automatically + starts a background ssh(1) multiplex master when connecting. + * Hostbased authentication may now use certificate host keys. + * ssh-keygen(1) now supports signing certificate using a CA key that + has been stored in a PKCS#11 token. + * ssh(1) will now log the hostname and address that we connected to at + LogLevel=verbose after authentication is successful to mitigate + "phishing" attacks by servers with trusted keys that accept + authentication silently and automatically before presenting fake + password/passphrase prompts. + * Expand %h to the hostname in ssh_config Hostname options. + * Allow ssh-keygen(1) to import (-i) and export (-e) of PEM and PKCS#8 + keys in addition to RFC4716 (SSH.COM) encodings via a new -m option + * sshd(8) will now queue debug messages for bad ownership or + permissions on the user's keyfiles encountered during authentication + and will send them after authentication has successfully completed. + * ssh(1) connection multiplexing now supports remote forwarding with + dynamic port allocation and can report the allocated port back to + the user + * sshd(8) now supports indirection in matching of principal names + listed in certificates. + * sshd(8) now has a new AuthorizedPrincipalsFile option to specify a + file containing a list of names that may be accepted in place of the + username when authorizing a certificate trusted via the + sshd_config(5) TrustedCAKeys option. + * Additional sshd_config(5) options are now valid inside Match blocks + * Revised the format of certificate keys. + * bugfixes +- removed -forward patch (SSH_MAX_FORWARDS_PER_DIRECTION not hard-coded + any more), removed memory leak fix (fixed in upstream) + +------------------------------------------------------------------- +Fri Aug 20 13:00:43 CEST 2010 - anicka@suse.cz + +- hint user how to remove offending keys (bnc#625552) + +------------------------------------------------------------------- +Thu Jul 22 17:58:09 CEST 2010 - anicka@suse.cz + +- update to 5.5p1 + +------------------------------------------------------------------- +Tue Jul 20 17:19:24 CEST 2010 - anicka@suse.cz + +- update to 5.5p1 + * Allow ChrootDirectory to work in SELinux platforms. + * bugfixes + +------------------------------------------------------------------- +Wed Jun 30 16:01:30 CEST 2010 - meissner@suse.de + +- Disable visual hostkey support again, after discussion on + its usefulness. + +------------------------------------------------------------------- +Mon May 17 18:11:33 UTC 2010 - cristian.rodriguez@opensuse.org + +- Hardware crypto is supported and patched but never + enabled, need to use --with-ssl-engine explicitely + +------------------------------------------------------------------- +Fri May 14 16:03:17 CEST 2010 - anicka@suse.cz + +- fixed memory leak in sftp (bnc#604274) + +------------------------------------------------------------------- +Fri Apr 23 12:01:50 CEST 2010 - anicka@suse.cz + +- honour /etc/nologin (bnc#530885) + +------------------------------------------------------------------- +Thu Mar 25 11:00:00 CET 2010 - meissner@suse.de + +- Enable VisualHostKey (ascii art of the hostkey fingerprint) and + HashHostKeys (hardening measure to make them unusable for worms/malicious + users for further host hopping). + +------------------------------------------------------------------- +Tue Mar 23 18:57:07 CET 2010 - anicka@suse.cz + +- update to 5.4p1 + * After a transition period of about 10 years, this release disables + SSH protocol 1 by default. Clients and servers that need to use the + legacy protocol must explicitly enable it in ssh_config / sshd_config + or on the command-line. + * Remove the libsectok/OpenSC-based smartcard code and add support for + PKCS#11 tokens. This support is automatically enabled on all + platforms that support dlopen(3) and was inspired by patches written + by Alon Bar-Lev. Details in the ssh(1) and ssh-add(1) manpages. + * Add support for certificate authentication of users and hosts using a + new, minimal OpenSSH certificate format (not X.509). Certificates + contain a public key, identity information and some validity + constraints and are signed with a standard SSH public key using + ssh-keygen(1). CA keys may be marked as trusted in authorized_keys + or via a TrustedUserCAKeys option in sshd_config(5) (for user + authentication), or in known_hosts (for host authentication). + Documentation for certificate support may be found in ssh-keygen(1), + sshd(8) and ssh(1) and a description of the protocol extensions in + PROTOCOL.certkeys. + * Added a 'netcat mode' to ssh(1): "ssh -W host:port ..." This connects + stdio on the client to a single port forward on the server. This + allows, for example, using ssh as a ProxyCommand to route connections + via intermediate servers. bz#1618 + * Add the ability to revoke keys in sshd(8) and ssh(1). User keys may + be revoked using a new sshd_config(5) option "RevokedKeys". Host keys + are revoked through known_hosts (details in the sshd(8) man page). + Revoked keys cannot be used for user or host authentication and will + trigger a warning if used. + * Rewrite the ssh(1) multiplexing support to support non-blocking + operation of the mux master, improve the resilience of the master to + malformed messages sent to it by the slave and add support for + requesting port- forwardings via the multiplex protocol. The new + stdio-to-local forward mode ("ssh -W host:port ...") is also + supported. The revised multiplexing protocol is documented in the + file PROTOCOL.mux in the source distribution. + * Add a 'read-only' mode to sftp-server(8) that disables open in write + mode and all other fs-modifying protocol methods. bz#430 + * Allow setting an explicit umask on the sftp-server(8) commandline to + override whatever default the user has. bz#1229 + * Many improvements to the sftp(1) client, many of which were + implemented by Carlos Silva through the Google Summer of Code + program: + - Support the "-h" (human-readable units) flag for ls + - Implement tab-completion of commands, local and remote filenames + - Support most of scp(1)'s commandline arguments in sftp(1), as a + first step towards making sftp(1) a drop-in replacement for scp(1). + Note that the rarely-used "-P sftp_server_path" option has been + moved to "-D sftp_server_path" to make way for "-P port" to match + scp(1). + - Add recursive transfer support for get/put and on the commandline + * New RSA keys will be generated with a public exponent of RSA_F4 == + (2**16)+1 == 65537 instead of the previous value 35. + * Passphrase-protected SSH protocol 2 private keys are now protected + with AES-128 instead of 3DES. This applied to newly-generated keys + as well as keys that are reencrypted (e.g. by changing their + passphrase). +- cleanup in patches + +------------------------------------------------------------------- +Tue Mar 2 09:09:18 UTC 2010 - coolo@novell.com + +- do not use paths at all, but prereq packages + +------------------------------------------------------------------- +Sat Feb 27 20:35:01 UTC 2010 - aj@suse.de + +- Use complete path for groupadd and useradd in pre section. + +------------------------------------------------------------------- +Tue Feb 23 15:45:06 CET 2010 - anicka@suse.cz + +- audit patch: add fix for bnc#545271 + +------------------------------------------------------------------- +Mon Feb 22 17:15:22 CET 2010 - anicka@suse.cz + +- do not fix uid/gid anymore (bnc#536564) + +------------------------------------------------------------------- +Tue Dec 15 11:04:00 CET 2009 - jengelh@medozas.de + +- select large PIE for SPARC, it is required to avoid + "relocation truncated to fit: R_SPARC_GOT13 against symbol xyz + defined in COMMON section in sshd.o" + +------------------------------------------------------------------- +Mon Sep 21 14:40:51 CEST 2009 - anicka@suse.cz + +- add new version of homechroot patch (added documentation, added + check for nodev and nosuid) +- remove Provides and Obsoletes ssh + +------------------------------------------------------------------- +Thu Aug 20 16:54:08 CEST 2009 - anicka@suse.cz + +- make sftp in chroot users life easier (ie. bnc#518238), + many thanks jchadima@redhat.com for a patch + +------------------------------------------------------------------- +Sun Jul 12 21:43:21 CEST 2009 - coolo@novell.com + +- readd $SSHD_BIN so that sshd starts at all + +------------------------------------------------------------------- +Tue Jul 7 15:06:58 CEST 2009 - llunak@novell.com + +- Added a hook for ksshaskpass + +------------------------------------------------------------------- +Sun Jul 5 12:17:40 CEST 2009 - dmueller@novell.com + +- readd -f to startproc and remove -p instead to + ensure that sshd is started even though old instances + are still running (e.e. being logged in from remote) + +------------------------------------------------------------------- +Fri Jun 19 10:35:46 CEST 2009 - coolo@novell.com + +- disable as-needed for this package as it fails to build with it + +------------------------------------------------------------------- +Tue May 26 11:56:20 CEST 2009 - anicka@suse.cz + +- disable -f in startproc to calm the warning (bnc#506831) + +------------------------------------------------------------------- +Thu Apr 23 09:44:07 CEST 2009 - lnussel@suse.de + +- do not enable sshd by default + +------------------------------------------------------------------- +Mon Feb 23 17:27:45 CET 2009 - anicka@suse.cz + +- update to 5.2p1 + * This release changes the default cipher order to prefer the AES CTR + modes and the revised "arcfour256" mode to CBC mode ciphers that are + susceptible to CPNI-957037 "Plaintext Recovery Attack Against SSH". + * This release also adds countermeasures to mitigate CPNI-957037-style + attacks against the SSH protocol's use of CBC-mode ciphers. Upon + detection of an invalid packet length or Message Authentication + Code, ssh/sshd will continue reading up to the maximum supported + packet length rather than immediately terminating the connection. + This eliminates most of the known differences in behaviour that + leaked information about the plaintext of injected data which formed + the basis of this attack. We believe that these attacks are rendered + infeasible by these changes. + * Added a -y option to ssh(1) to force logging to syslog rather than + stderr, which is useful when running daemonised (ssh -f) + * The sshd_config(5) ForceCommand directive now accepts commandline + arguments for the internal-sftp server. + * The ssh(1) ~C escape commandline now support runtime creation of + dynamic (-D) port forwards. + * Support the SOCKS4A protocol in ssh(1) dynamic (-D) forwards. + (bz#1482) + * Support remote port forwarding with a listen port of '0'. This + informs the server that it should dynamically allocate a listen + port and report it back to the client. (bz#1003) + * sshd(8) now supports setting PermitEmptyPasswords and + AllowAgentForwarding in Match blocks + * Repair a ssh(1) crash introduced in openssh-5.1 when the client is + sent a zero-length banner (bz#1496) + * Due to interoperability problems with certain + broken SSH implementations, the eow@openssh.com and + no-more-sessions@openssh.com protocol extensions are now only sent + to peers that identify themselves as OpenSSH. + * Make ssh(1) send the correct channel number for + SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to + avoid triggering 'Non-public channel' error messages on sshd(8) in + openssh-5.1. + * Avoid printing 'Non-public channel' warnings in sshd(8), since the + ssh(1) has sent incorrect channel numbers since ~2004 (this reverts + a behaviour introduced in openssh-5.1). + * Avoid double-free in ssh(1) ~C escape -L handler (bz#1539) + * Correct fail-on-error behaviour in sftp(1) batchmode for remote + stat operations. (bz#1541) + * Disable nonfunctional ssh(1) ~C escape handler in multiplex slave + connections. (bz#1543) + * Avoid hang in ssh(1) when attempting to connect to a server that + has MaxSessions=0 set. + * Multiple fixes to sshd(8) configuration test (-T) mode + * Several core and portable OpenSSH bugs fixed: 1380, 1412, 1418, + 1419, 1421, 1490, 1491, 1492, 1514, 1515, 1518, 1520, 1538, 1540 + * Many manual page improvements. + +------------------------------------------------------------------- +Mon Dec 1 15:43:14 CET 2008 - anicka@suse.cz + +- respect SSH_MAX_FORWARDS_PER_DIRECTION (bnc#448775) + +------------------------------------------------------------------- +Mon Nov 10 16:01:27 CET 2008 - anicka@suse.cz + +- fix printing banner (bnc#443380) + +------------------------------------------------------------------- +Fri Oct 24 16:24:34 CEST 2008 - anicka@suse.cz + +- call pam functions in the right order (bnc#438292) +- mention default forwarding of locale settings in + README.SuSE (bnc#434799) + +------------------------------------------------------------------- +Tue Sep 9 17:55:29 CEST 2008 - anicka@suse.cz + +- remove pam_resmgr from sshd.pamd (bnc#422619) + +------------------------------------------------------------------- +Sun Aug 24 08:26:05 CEST 2008 - coolo@suse.de + +- fix fillup macro usage + +------------------------------------------------------------------- +Fri Aug 22 11:51:12 CEST 2008 - prusnak@suse.cz + +- enabled SELinux support [Fate#303662] + +------------------------------------------------------------------- +Tue Jul 22 20:39:29 CEST 2008 - anicka@suse.cz + +- update to 5.1p1 + * sshd(8): Avoid X11 man-in-the-middle attack on HP/UX (and possibly + other platforms) when X11UseLocalhost=no + * Introduce experimental SSH Fingerprint ASCII Visualisation to ssh(1) + and ssh-keygen(1). Visual fingerprinnt display is controlled by a new + ssh_config(5) option "VisualHostKey". + * sshd_config(5) now supports CIDR address/masklen matching in "Match + address" blocks, with a fallback to classic wildcard matching. + * sshd(8) now supports CIDR matching in ~/.ssh/authorized_keys + from="..." restrictions, also with a fallback to classic wildcard + matching. + * Added an extended test mode (-T) to sshd(8) to request that it write + its effective configuration to stdout and exit. Extended test mode + also supports the specification of connection parameters (username, + source address and hostname) to test the application of + sshd_config(5) Match rules. + * ssh(1) now prints the number of bytes transferred and the overall + connection throughput for SSH protocol 2 sessions when in verbose + mode (previously these statistics were displayed for protocol 1 + connections only). + * sftp-server(8) now supports extension methods statvfs@openssh.com and + fstatvfs@openssh.com that implement statvfs(2)-like operations. + * sftp(1) now has a "df" command to the sftp client that uses the + statvfs@openssh.com to produce a df(1)-like display of filesystem + space and inode utilisation (requires statvfs@openssh.com support on + the server) + * Added a MaxSessions option to sshd_config(5) to allow control of the + number of multiplexed sessions supported over a single TCP connection. + This allows increasing the number of allowed sessions above the + previous default of 10, disabling connection multiplexing + (MaxSessions=1) or disallowing login/shell/subsystem sessions + entirely (MaxSessions=0). + * Added a no-more-sessions@openssh.com global request extension that is + sent from ssh(1) to sshd(8) when the client knows that it will never + request another session (i.e. when session multiplexing is disabled). + This allows a server to disallow further session requests and + terminate the session in cases where the client has been hijacked. + * ssh-keygen(1) now supports the use of the -l option in combination + with -F to search for a host in ~/.ssh/known_hosts and display its + fingerprint. + * ssh-keyscan(1) now defaults to "rsa" (protocol 2) keys, instead of + "rsa1". + * Added an AllowAgentForwarding option to sshd_config(8) to control + whether authentication agent forwarding is permitted. Note that this + is a loose control, as a client may install their own unofficial + forwarder. + * ssh(1) and sshd(8): avoid unnecessary malloc/copy/free when receiving + network data, resulting in a ~10% speedup + * ssh(1) and sshd(8) will now try additional addresses when connecting + to a port forward destination whose DNS name resolves to more than + one address. The previous behaviour was to try the only first address + and give up if that failed. (bz#383) + * ssh(1) and sshd(8) now support signalling that channels are + half-closed for writing, through a channel protocol extension + notification "eow@openssh.com". This allows propagation of closed + file descriptors, so that commands such as: + "ssh -2 localhost od /bin/ls | true" + do not send unnecessary data over the wire. (bz#85) + * sshd(8): increased the default size of ssh protocol 1 ephemeral keys + from 768 to 1024 bits. + * When ssh(1) has been requested to fork after authentication + ("ssh -f") with ExitOnForwardFailure enabled, delay the fork until + after replies for any -R forwards have been seen. Allows for robust + detection of -R forward failure when using -f. (bz#92) + * "Match group" blocks in sshd_config(5) now support negation of + groups. E.g. "Match group staff,!guests" (bz#1315) + * sftp(1) and sftp-server(8) now allow chmod-like operations to set + set[ug]id/sticky bits. (bz#1310) + * The MaxAuthTries option is now permitted in sshd_config(5) match + blocks. + * Multiplexed ssh(1) sessions now support a subset of the ~ escapes + that are available to a primary connection. (bz#1331) + * ssh(1) connection multiplexing will now fall back to creating a new + connection in most error cases. (bz#1439 bz#1329) + * Added some basic interoperability tests against Twisted Conch. + * Documented OpenSSH's extensions to and deviations from the published + SSH protocols (the PROTOCOL file in the distribution) + * Documented OpenSSH's ssh-agent protocol (PROTOCOL.agent). + * bugfixes +- remove gssapi_krb5-fix patch + +------------------------------------------------------------------- +Fri Apr 18 17:53:30 CEST 2008 - werner@suse.de + +- Handle pts slave lines like utemper + +------------------------------------------------------------------- +Wed Apr 9 14:37:57 CEST 2008 - anicka@suse.cz + +- update to 5.0p1 + * CVE-2008-1483: Avoid possible hijacking of X11-forwarded + connections by refusing to listen on a port unless all address + families bind successfully. +- remove CVE-2008-1483 patch + +------------------------------------------------------------------- +Wed Apr 2 14:57:26 CEST 2008 - anicka@suse.cz + +- update to 4.9p1 + * Disable execution of ~/.ssh/rc for sessions where a command has been + forced by the sshd_config ForceCommand directive. Users who had + write access to this file could use it to execute abritrary commands. + This behaviour was documented, but was an unsafe default and an extra + hassle for administrators. + * Added chroot(2) support for sshd(8), controlled by a new option + "ChrootDirectory". Please refer to sshd_config(5) for details, and + please use this feature carefully. (bz#177 bz#1352) + * Linked sftp-server(8) into sshd(8). The internal sftp server is + used when the command "internal-sftp" is specified in a Subsystem + or ForceCommand declaration. When used with ChrootDirectory, the + internal sftp server requires no special configuration of files + inside the chroot environment. Please refer to sshd_config(5) for + more information. + * Added a "no-user-rc" option for authorized_keys to disable execution + of ~/.ssh/rc + * Added a protocol extension method "posix-rename@openssh.com" for + sftp-server(8) to perform POSIX atomic rename() operations. + (bz#1400) + * Removed the fixed limit of 100 file handles in sftp-server(8). The + server will now dynamically allocate handles up to the number of + available file descriptors. (bz#1397) + * ssh(8) will now skip generation of SSH protocol 1 ephemeral server + keys when in inetd mode and protocol 2 connections are negotiated. + This speeds up protocol 2 connections to inetd-mode servers that + also allow Protocol 1 (bz#440) + * Accept the PermitRootLogin directive in a sshd_config(5) Match + block. Allows for, e.g. permitting root only from the local + network. + * Reworked sftp(1) argument splitting and escaping to be more + internally consistent (i.e. between sftp commands) and more + consistent with sh(1). Please note that this will change the + interpretation of some quoted strings, especially those with + embedded backslash escape sequences. (bz#778) + * Support "Banner=none" in sshd_config(5) to disable sending of a + pre-login banner (e.g. in a Match block). + * ssh(1) ProxyCommands are now executed with $SHELL rather than + /bin/sh. + * ssh(1)'s ConnectTimeout option is now applied to both the TCP + connection and the SSH banner exchange (previously it just covered + the TCP connection). This allows callers of ssh(1) to better detect + and deal with stuck servers that accept a TCP connection but don't + progress the protocol, and also makes ConnectTimeout useful for + connections via a ProxyCommand. + * Many new regression tests, including interop tests against PuTTY's + plink. + * Support BSM auditing on Mac OS X + * bugfixes +- remove addrlist, pam_session_close, strict-aliasing-fix patches + (not needed anymore) + +------------------------------------------------------------------- +Tue Mar 25 11:10:14 CET 2008 - anicka@suse.cz + +- fix CVE-2008-1483 (bnc#373527) + +------------------------------------------------------------------- +Fri Jan 4 11:11:52 CET 2008 - anicka@suse.cz + +- fix privileges of a firewall definition file [#351193] + +------------------------------------------------------------------- +Sat Dec 15 00:10:13 CET 2007 - anicka@suse.cz + +- add patch calling pam with root privileges [#334559] +- drop pwname-home patch [#104773] + +------------------------------------------------------------------- +Fri Dec 7 22:28:40 CET 2007 - anicka@suse.cz + +- fix race condition in xauth patch + +------------------------------------------------------------------- +Wed Dec 5 10:45:36 CET 2007 - anicka@suse.cz + +- update to 4.7p1 + * Add "-K" flag for ssh to set GSSAPIAuthentication=yes and + GSSAPIDelegateCredentials=yes. This is symmetric with -k + * make scp try to skip FIFOs rather than blocking when nothing is + listening. + * increase default channel windows + * put the MAC list into a display + * many bugfixes + +------------------------------------------------------------------- +Mon Oct 8 16:34:06 CEST 2007 - anicka@suse.cz + +- block SIGALRM only during calling syslog() [#331032] + +------------------------------------------------------------------- +Thu Sep 13 15:50:39 CEST 2007 - nadvornik@suse.cz + +- fixed checking of an untrusted cookie, CVE-2007-4752 [#308521] + +------------------------------------------------------------------- +Tue Aug 28 18:25:57 CEST 2007 - anicka@suse.cz + +- fix blocksigalrm patch to set old signal mask after + writing the log in every case [#304819] + +------------------------------------------------------------------- +Tue Aug 21 04:51:45 CEST 2007 - anicka@suse.cz + +- avoid generating ssh keys when a non-standard location + is configured [#281228] + +------------------------------------------------------------------- +Wed Jul 25 16:18:50 CEST 2007 - anicka@suse.cz + +- fixed typo in sshd.fw [#293764] + +------------------------------------------------------------------- +Mon Mar 19 19:14:26 CET 2007 - nadvornik@suse.cz + +- fixed default for ChallengeResponseAuthentication [#255374] + +------------------------------------------------------------------- +Mon Mar 12 10:56:31 CET 2007 - anicka@suse.cz + +- update to 4.6p1 + * sshd now allows the enabling and disabling of authentication + methods on a per user, group, host and network basis via the + Match directive in sshd_config. + * Allow multiple forwarding options to work when specified in a + PermitOpen directive + * Clear SIGALRM when restarting due to SIGHUP. Prevents stray + signal from taking down sshd if a connection was pending at + the time SIGHUP was received + * hang on exit" when background processes are running at the + time of exit on a ttyful/login session + * some more bugfixes + +------------------------------------------------------------------- +Mon Mar 5 11:03:41 CET 2007 - anicka@suse.cz + +- fix path for firewall definition + +------------------------------------------------------------------- +Thu Mar 1 15:14:23 CET 2007 - anicka@suse.cz + +- add support for Linux audit (FATE #120269) + +------------------------------------------------------------------- +Wed Feb 21 11:21:48 CET 2007 - anicka@suse.cz + +- add firewall definition [#246921], FATE #300687, + source: sshd.fw + +------------------------------------------------------------------- +Sat Jan 6 12:30:16 CET 2007 - anicka@suse.cz + +- disable SSHv1 protocol in default configuration [#231808] + +------------------------------------------------------------------- +Tue Dec 12 14:41:45 CET 2006 - anicka@suse.cz + +- update to 4.5p1 + * Use privsep_pw if we have it, but only require it if we + absolutely need it. + * Correctly check for bad signatures in the monitor, otherwise + the monitor and the unpriv process can get out of sync. + * Clear errno before calling the strtol functions. + * exit instead of doing a blocking tcp send if we detect + a client/server timeout, since the tcp sendqueue might + be already full (of alive requests) + * include signal.h, errno.h, sys/in.h + * some more bugfixes + +------------------------------------------------------------------- +Wed Nov 22 13:42:32 CET 2006 - anicka@suse.cz + +- fixed README.SuSE [#223025] + +------------------------------------------------------------------- +Thu Nov 9 13:59:35 CET 2006 - anicka@suse.cz + +- backport security fixes from openssh 4.5 (#219115) + +------------------------------------------------------------------- +Tue Nov 7 13:43:44 CET 2006 - ro@suse.de + +- fix manpage permissions + +------------------------------------------------------------------- +Tue Oct 31 14:04:52 CET 2006 - anicka@suse.cz + +- fix gssapi_krb5-fix patch [#215615] +- fix xauth patch + +------------------------------------------------------------------- +Tue Oct 10 16:07:11 CEST 2006 - postadal@suse.cz + +- fixed building openssh from src.rpm [#176528] (gssapi_krb5-fix.patch) + +------------------------------------------------------------------- +Tue Oct 3 14:44:08 CEST 2006 - postadal@suse.cz + +- updated to version 4.4p1 [#208662] + * fixed pre-authentication DoS, that would cause sshd(8) to spin + until the login grace time expired + * fixed unsafe signal hander, which was vulnerable to a race condition + that could be exploited to perform a pre-authentication DoS + * fixed a GSSAPI authentication abort that could be used to determine + the validity of usernames on some platforms + * implemented conditional configuration in sshd_config(5) using the + "Match" directive + * added support for Diffie-Hellman group exchange key agreement with a + final hash of SHA256 + * added a "ForceCommand", "PermitOpen" directive to sshd_config(5) + * added optional logging of transactions to sftp-server(8) + * ssh(1) will now record port numbers for hosts stored in + ~/.ssh/authorized_keys when a non-standard port has been requested + * added an "ExitOnForwardFailure" option to cause ssh(1) to exit (with + a non-zero exit code) when requested port forwardings could not be + established + * extended sshd_config(5) "SubSystem" declarations to allow the + specification of command-line arguments +- removed obsoleted patches: autoconf-fix.patch, dos-fix.patch +- fixed gcc issues (gcc-fix.patch) + +------------------------------------------------------------------- +Wed Sep 20 17:34:54 CEST 2006 - postadal@suse.cz + +- fixed DoS by CRC compensation attack detector [#206917] (dos-fix.patch) +- fixed client NULL deref on protocol error +- cosmetic fix in init script [#203826] + +------------------------------------------------------------------- +Fri Sep 1 14:14:52 CEST 2006 - kukuk@suse.de + +- sshd.pamd: Add pam_loginuid, move pam_nologin to a better position + +------------------------------------------------------------------- +Fri Aug 25 15:37:46 CEST 2006 - postadal@suse.cz + +- fixed path for xauth [#198676] + +------------------------------------------------------------------- +Thu Aug 3 15:07:41 CEST 2006 - postadal@suse.cz + +- fixed build with X11R7 + +------------------------------------------------------------------- +Thu Jul 20 17:25:27 CEST 2006 - postadal@suse.cz + +- updated to version 4.3p2 + * experimental support for tunneling network packets via tun(4) +- removed obsoleted patches: pam-error.patch, CVE-2006-0225.patch, + scp.patch, sigalarm.patch + +------------------------------------------------------------------- +Mon Feb 13 12:54:28 CET 2006 - postadal@suse.cz + +- upstream fixes + - fixed "scp a b c", when c is not directory (scp.patch) + - eliminate some code duplicated in privsep and non-privsep paths, and + explicitly clear SIGALRM handler (sigalarm.patch) + +------------------------------------------------------------------- +Fri Feb 3 19:02:49 CET 2006 - postadal@suse.cz + +- fixed local arbitrary command execution vulnerability [#143435] + (CVE-2006-0225.patch) + +------------------------------------------------------------------- +Thu Feb 2 13:19:41 CET 2006 - postadal@suse.cz + +- fixed xauth.diff for disabled UsePrivilegeSeparation mode [#145809] +- build on s390 without Smart card support (opensc) [#147383] + +------------------------------------------------------------------- +Mon Jan 30 16:25:01 CET 2006 - postadal@suse.cz + +- fixed patch xauth.diff [#145809] +- fixed comments [#142989] + +------------------------------------------------------------------- +Wed Jan 25 21:39:06 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 16 18:05:44 CET 2006 - meissner@suse.de + +- added -fstack-protector. + +------------------------------------------------------------------- +Tue Jan 3 15:46:33 CET 2006 - postadal@suse.cz + +- updated to version 4.2p1 +- removed obsoleted patches: upstream_fixes.diff, gssapi-secfix.patch + +------------------------------------------------------------------- +Tue Nov 15 17:51:07 CET 2005 - postadal@suse.cz + +- do not delegate GSSAPI credentials to log in with a different method + than GSSAPI [#128928] (CAN-2005-2798, gssapi-secfix.patch) + +------------------------------------------------------------------- +Sun Oct 23 10:40:24 CEST 2005 - postadal@suse.cz + +- fixed PAM to send authentication failing mesaage to client [#130043] + (pam-error.patch) + +------------------------------------------------------------------- +Wed Sep 14 16:58:14 CEST 2005 - postadal@suse.cz + +- fixed uninitialized variable in patch xauth.diff [#98815] + +------------------------------------------------------------------- +Thu Sep 8 15:56:37 CEST 2005 - postadal@suse.cz + +- don't strip + +------------------------------------------------------------------- +Mon Sep 5 20:04:04 CEST 2005 - postadal@suse.cz + +- added patch xauth.diff prevent from polluting xauthority file [#98815] + +------------------------------------------------------------------- +Mon Aug 22 18:12:20 CEST 2005 - postadal@suse.cz + +- fixed problem when multiple accounts have same UID [#104773] + (pwname-home.diff) +- added fixes from upstream (upstream_fixes.diff) + +------------------------------------------------------------------- +Thu Aug 18 17:50:46 CEST 2005 - postadal@suse.cz + +- added patch tmpdir.diff for using $TMPDIR by ssh-agent [#95731] + +------------------------------------------------------------------- +Thu Aug 4 11:29:38 CEST 2005 - uli@suse.de + +- parallelize build + +------------------------------------------------------------------- +Mon Aug 1 17:48:02 CEST 2005 - postadal@suse.cz + +- added patch resolving problems with hostname changes [#98627] + (xauthlocalhostname.diff) + +------------------------------------------------------------------- +Wed Jun 22 18:42:57 CEST 2005 - kukuk@suse.de + +- Compile/link with -fpie/-pie + +------------------------------------------------------------------- +Wed Jun 15 17:41:24 CEST 2005 - meissner@suse.de + +- build x11-ask-pass with RPM_OPT_FLAGS. + +------------------------------------------------------------------- +Fri Jun 10 16:18:25 CEST 2005 - postadal@suse.cz + +- updated to version 4.1p1 +- removed obsoleted patches: restore_terminal, pam-returnfromsession, + timing-attacks-fix, krb5ccname, gssapi-pam, logdenysource, + sendenv-fix, documentation-fix + +------------------------------------------------------------------- +Thu Mar 10 10:36:42 CET 2005 - postadal@suse.cz + +- fixed SendEnv config parsing bug +- documented timeout on untrusted x11 forwarding sessions (openssh#849) +- mentioned ForwardX11Trusted in ssh.1 (openssh#987) + +------------------------------------------------------------------- +Thu Mar 3 13:29:13 CET 2005 - postadal@suse.cz + +- enabled accepting and sending locale environment variables in protocol 2 + [#65747, #50091] + +------------------------------------------------------------------- +Thu Feb 24 16:33:54 CET 2005 - postadal@suse.cz + +- added patches from cvs: gssapi-pam (openssh#918), + krb5ccname (openssh#445), logdenysource (openssh#909) + +------------------------------------------------------------------- +Thu Feb 3 13:29:23 CET 2005 - postadal@suse.cz + +- fixed keyboard-interactive/pam/Kerberos leaks info about user existence + [#48329] (openssh#971, CAN-2003-0190) + +------------------------------------------------------------------- +Wed Jan 19 15:58:07 CET 2005 - postadal@suse.cz + +- splited spec file to decreas number of build dependencies +- fixed restoring terminal setting after Ctrl+C during password prompt in scp/sftp [#43309] +- allowed users to see output from failing PAM session modules (openssh #890, + pam-returnfromsession.patch) + +------------------------------------------------------------------- +Mon Nov 8 17:17:45 CET 2004 - kukuk@suse.de + +- Use common-* PAM config files for sshd PAM configuration + +------------------------------------------------------------------- +Mon Oct 25 15:14:49 CEST 2004 - postadal@suse.cz + +- switched heimdal-* to kerberos-devel-packages in #needforbuild + +------------------------------------------------------------------- +Fri Sep 3 15:03:01 CEST 2004 - ro@suse.de + +- fix lib64 issue + +------------------------------------------------------------------- +Tue Aug 31 16:03:54 CEST 2004 - postadal@suse.cz + +- updated to version 3.9p1 + +- removed obsoleted patches: scp-fix.diff and window_change-fix.diff + +------------------------------------------------------------------- +Thu Aug 26 15:40:53 CEST 2004 - postadal@suse.cz + +- added openssh-askpass-gnome subpackage +- added ssh-askpass script for choosing askpass depending on windowmanager + (by Robert Love ) +- build with Smart card support (opensc) [#44289] + +------------------------------------------------------------------- +Tue Aug 17 15:52:20 CEST 2004 - postadal@suse.cz + +- removed old implementation of "Update Messages" [#36059] + +------------------------------------------------------------------- +Thu Aug 12 16:36:53 CEST 2004 - postadal@suse.cz + +- updated to version 3.8p1 + +- removed obsoleted patches: sftp-progress-fix and pam-fix4 + +------------------------------------------------------------------- +Mon Jun 28 16:56:23 CEST 2004 - meissner@suse.de + +- block sigalarm during syslog output or we might deadlock + on recursively entering syslog(). (LTC#9523, SUSE#42354) + +------------------------------------------------------------------- +Wed May 26 15:27:32 CEST 2004 - postadal@suse.cz + +- fixed commented default value for GSSAPI + +------------------------------------------------------------------- +Thu May 20 21:23:27 CEST 2004 - mludvig@suse.cz + +- Load drivers for available hardware crypto accelerators. + +------------------------------------------------------------------- +Fri Apr 30 15:03:39 CEST 2004 - postadal@suse.cz + +- updated README.kerberos (GSSAPICleanupCreds renamed to GSSAPICleanupCredentials) + +------------------------------------------------------------------- +Mon Apr 19 14:41:01 CEST 2004 - postadal@suse.cz + +- updated README.SuSE (GSSAPICleanupCreds renamed to GSSAPICleanupCredentials) + [#39010] + +------------------------------------------------------------------- +Fri Mar 26 17:24:45 CET 2004 - postadal@suse.cz + +- fixed sshd(8) and sshd_config(5) man pages (EAL3) +- fixed spelling errors in README.SuSE [#37086] + +------------------------------------------------------------------- +Thu Mar 25 14:50:50 CET 2004 - postadal@suse.cz + +- fixed change window request [#33177] + +------------------------------------------------------------------- +Mon Mar 22 15:19:15 CET 2004 - postadal@suse.cz + +- updated README.SuSE +- removed %verify from /usr/bin/ssh in specfile + +------------------------------------------------------------------- +Thu Mar 18 15:48:52 CET 2004 - postadal@suse.cz + +- fixed previous fix of security bug in scp [#35443] (CAN-2004-0175) + (was too restrictive) +- fixed permission of /usr/bin/ssh + +------------------------------------------------------------------- +Mon Mar 15 17:56:06 CET 2004 - postadal@suse.cz + +- fixed comments in sshd_config and ssh_config + +------------------------------------------------------------------- +Mon Mar 15 17:25:08 CET 2004 - postadal@suse.cz + +- enabled privilege separation mode (new version fixes a lot of problematic PAM + calling [#30328]) +- fixed security bug in scp [#35443] (CAN-2004-0175) +- reverted to old behaviour of ForwardingX11 [#35836] + (set ForwardX11Trusted to 'yes' by default) +- updated README.SuSE +- fixed pam code (pam-fix4.diff, backported from openssh-SNAP-20040311) + +------------------------------------------------------------------- +Fri Mar 05 13:10:55 CET 2004 - postadal@suse.cz + +- updated README.SuSE (Remote x11 clients are now untrusted by default) [#35368] +- added gssapimitm patch (support for old GSSAPI) + +------------------------------------------------------------------- +Mon Mar 01 18:13:37 CET 2004 - postadal@suse.cz + +- updated to version 3.8p1 + * The "gssapi" support has been replaced with the "gssapi-with-mic" + to fix possible MITM attacks. These two versions are not compatible. + +- removed obsoleted patches: krb5.patch, dns-lookups.patch, pam-fix.diff, + pam-end-fix.diff +- used process forking instead pthreads + (developers fixed bugs in pam calling and they recommended to don't use threads) + +------------------------------------------------------------------- +Tue Feb 24 11:37:17 CET 2004 - postadal@suse.cz + +- fixed the problem with save_argv in sshd.c re-apeared again in version 3.7.1p2 + (it caused bad behaviour after receiving SIGHUP - used by reload of init script) + [#34845] + +------------------------------------------------------------------- +Wed Feb 18 18:06:20 CET 2004 - kukuk@suse.de + +- Real strict-aliasing patch + +------------------------------------------------------------------- +Wed Feb 18 16:04:17 CET 2004 - postadal@suse.cz + +- fixed strict-aliasing patch [#34551] + +------------------------------------------------------------------- +Sat Feb 14 00:20:09 CET 2004 - adrian@suse.de + +- provide SLP registration file /etc/slp.reg.d/ssh.reg + +------------------------------------------------------------------- +Tue Feb 03 15:18:36 CET 2004 - postadal@suse.cz + +- used patch from pam-end-fix.diff [#33132] +- fixed instalation openssh without documentation [#33937] +- fixed auth-pam.c which breaks strict aliasing + +------------------------------------------------------------------- +Mon Jan 19 13:19:32 CET 2004 - meissner@suse.de + +- Added a ; to ssh-key-converter.c to fix gcc 3.4 build. + +------------------------------------------------------------------- +Fri Jan 16 12:57:41 CET 2004 - kukuk@suse.de + +- Add pam-devel to neededforbuild + +------------------------------------------------------------------- +Thu Nov 06 10:14:31 CET 2003 - postadal@suse.cz + +- added /usr/bin/slogin explicitly to %file list [#32921] + +------------------------------------------------------------------- +Sun Nov 2 21:10:35 CET 2003 - adrian@suse.de + +- add %run_permissions to fix build + +------------------------------------------------------------------- +Tue Oct 14 12:23:36 CEST 2003 - postadal@suse.cz + +- reverted value UsePAM to "yes" and set PasswordAuthentication to "no" + in file /etc/ssh/sshd_config (the version 3.7.1p2 disabled PAM support + by default) [#31749] + +------------------------------------------------------------------- +Tue Sep 23 15:02:00 CEST 2003 - draht@suse.de + +- New version 3.7.1p2; signature from 86FF9C48 Damien Miller + verified for source tarball. Bugs fixed with this version: + #31637 (CAN-2003-0786, CAN-2003-0786). Briefly: + 1) SSH1 PAM challenge response auth ignored the result of the + authentication (with privsep off) + 2) The PAM conversation function trashed the stack, by referring + to the **resp parameter as an array of pointers rather than + as a pointer to an array of struct pam_responses. + At least security bug 1) is exploitable. + +------------------------------------------------------------------- +Fri Sep 19 19:56:01 CEST 2003 - postadal@suse.cz + +- use pthreads instead process forking (it needs by pam modules) +- fixed bug in calling pam_setcred [#31025] + (pam-fix.diff - string "FILE:" added to begin of KRB5CCNAME) +- updated README.SuSE +- reverted ChallengeResponseAuthentication option to default value yes + (necessary for pam authentication) [#31432] + +------------------------------------------------------------------- +Thu Sep 18 18:34:33 CEST 2003 - postadal@suse.cz + +- updated to version 3.7.1p1 (with security patches) +- removed obsoleted patches: chauthtok.patch, krb-include-fix.diff, + gssapi-fix.diff, saveargv-fix.diff, gssapi-20030430.diff, racecondition-fix +- updated README.kerberos + +------------------------------------------------------------------- +Tue Sep 16 16:57:02 CEST 2003 - postadal@suse.cz + +- fixed race condition in allocating memory [#31025] (CAN-2003-0693) + +------------------------------------------------------------------- +Mon Sep 15 11:52:20 CEST 2003 - postadal@suse.cz + +- disabled privilege separation, which caused some problems [#30328] + (updated README.SuSE) + +------------------------------------------------------------------- +Thu Sep 04 11:59:39 CEST 2003 - postadal@suse.cz + +- fixed bug in x11-ssh-askpass dialog [#25846] (askpass-fix.diff is workaround for gcc bug) + +------------------------------------------------------------------- +Fri Aug 29 11:39:40 CEST 2003 - kukuk@suse.de + +- Call useradd -r for system account [Bug #29611] + +------------------------------------------------------------------- +Mon Aug 25 10:40:37 CEST 2003 - postadal@suse.cz + +- use new stop_on_removal/restart_on_upate macros +- fixed lib64 problem in /etc/ssh/sshd_config [#28766] + +------------------------------------------------------------------- +Tue Aug 19 11:21:33 CEST 2003 - mmj@suse.de + +- Add sysconfig metadata [#28943] + +------------------------------------------------------------------- +Fri Aug 1 01:57:08 CEST 2003 - ro@suse.de + +- add e2fsprogs-devel to neededforbuild + +------------------------------------------------------------------- +Thu Jul 24 19:47:14 CEST 2003 - postadal@suse.cz + +- updated to version 3.6.1p2 +- added the new version of patch for GSSAPI (gssapi-20030430.diff), + the older one was removed (gssapi.patch) +- added README.kerberos to filelist + +------------------------------------------------------------------- +Tue Jun 3 00:41:08 CEST 2003 - mmj@suse.de + +- Remove files we don't package + +------------------------------------------------------------------- +Wed Apr 02 15:03:44 CEST 2003 - postadal@suse.cz + +- fixed bad behaviour after receiving SIGHUP (this bug caused not working reload of init script) + +------------------------------------------------------------------- +Tue Mar 18 14:25:08 CET 2003 - postadal@suse.cz + +- added $remote_fs to init.d script (needed if /usr is on remote fs [#25577]) + +------------------------------------------------------------------- +Thu Mar 13 17:02:52 CET 2003 - postadal@suse.cz + +- fixed segfault while using GSSAPI for authentication when connecting to localhost (took care about error value of ssh_gssapi_import_name() in function ssh_gssapi_client_ctx()) + +------------------------------------------------------------------- +Mon Mar 10 09:28:31 CET 2003 - kukuk@suse.de + +- Remove extra "/" from pid file path. + +------------------------------------------------------------------- +Mon Mar 03 16:49:24 CET 2003 - postadal@suse.cz + +- modified init.d script (now checking sshd.init.pid instead of port 22) [#24263] + +------------------------------------------------------------------- +Mon Mar 3 16:05:24 CET 2003 - okir@suse.de + +- added comment to /etc/pam.d/ssh on how to enable + support for resmgr (#24363). + +------------------------------------------------------------------- +Fri Feb 21 18:52:05 CET 2003 - postadal@suse.cz + +- added ssh-copy-id shell script [#23745] + +------------------------------------------------------------------- +Fri Feb 14 13:42:14 CET 2003 - postadal@suse.cz + +- given back gssapi and dns-lookups patches + +------------------------------------------------------------------- +Wed Jan 22 23:05:35 CET 2003 - postadal@suse.cz + +- updated to version 3.5p1 +- removed obsolete patches: owl-mm, forced-commands-only, krb +- added patch krb5 (for heimdal) +- temporarily removed gssapi patch and dns-lookups (needs rewriting) +- fix sysconfig metadata + +------------------------------------------------------------------- +Thu Dec 5 10:52:41 CET 2002 - okir@suse.de + +- avoid Kerberos DNS lookups in the default config (#20395) +- added README.kerberos + +------------------------------------------------------------------- +Thu Sep 19 11:00:46 CEST 2002 - postadal@suse.cz + +- added info about changes in the new version of openssh + to README.SuSE [#19757] + +------------------------------------------------------------------- +Mon Sep 2 10:39:24 CEST 2002 - okir@suse.de + +- privsep directory now /var/lib/empty, which is provided by + filesystem package (#17556) + +------------------------------------------------------------------- +Wed Aug 28 05:48:16 CEST 2002 - nashif@suse.de + +- Added insserv & co to PreReq + +------------------------------------------------------------------- +Mon Aug 26 11:57:20 CEST 2002 - okir@suse.de + +- applied patch that adds GSSAPI support in protocol version 2 (#18239) + +------------------------------------------------------------------- +Thu Aug 22 14:09:43 CEST 2002 - postadal@suse.cz + +- added the patch to fix malfunction of PermitRootLogin seted to + forced-commands-only [#17149] + +------------------------------------------------------------------- +Fri Aug 9 14:41:30 CEST 2002 - okir@suse.de + +- syslog now reports kerberos auth method when logging in via + kerberos (#17469) + +------------------------------------------------------------------- +Tue Jul 23 04:34:10 PDT 2002 - okir@suse.de + +- enabled kerberos support +- added patch to support kerberos 5 authentication in privsep mode. +- added missing section 5 manpages +- added missing ssh-keysign to files list (new for privsep) + +------------------------------------------------------------------- +Mon Jul 22 14:16:54 CEST 2002 - okir@suse.de + +- fixed handling of expired passwords in privsep mode + +------------------------------------------------------------------- +Tue Jul 9 13:48:52 CEST 2002 - mmj@suse.de + +- Don't source rc.config + +------------------------------------------------------------------- +Wed Jul 3 01:01:24 CEST 2002 - draht@suse.de + +- ssh-keygen must be told to explicitly create type rsa1 keys + in the start script. + +------------------------------------------------------------------- +Tue Jul 2 12:03:58 CEST 2002 - ro@suse.de + +- useradd/groupadd in preinstall to standardize + +------------------------------------------------------------------- +Sat Jun 29 10:33:18 CEST 2002 - ro@suse.de + +- updated patch from solar: zero out bytes for no longer used pages + in mmap-fallback solution + +------------------------------------------------------------------- +Thu Jun 27 18:07:37 CEST 2002 - ro@suse.de + +- updated owl-fallback.diff from solar + +------------------------------------------------------------------- +Thu Jun 27 17:04:16 CEST 2002 - ro@suse.de + +- update to 3.4p1 + o privilege separation support + o overflow fix from ISS +- unsplit openssh-server and openssh-client + +------------------------------------------------------------------- +Tue Jun 18 12:12:41 CEST 2002 - mmj@suse.de + +- Update to 3.2.3p1 which fixed following compared to 3.2.2p1 + o a defect in the BSD_AUTH access control handling for + o login/tty problems on Solaris (bug #245) + o build problems on Cygwin systems + +- Split the package to openssh, openssh-server, openssh-client and + openssh-askpass + +------------------------------------------------------------------- +Sun May 19 16:15:03 CEST 2002 - mmj@suse.de + +- Updated to 3.2.2p which includes security and several bugfixes. + +------------------------------------------------------------------- +Fri Mar 15 12:05:21 CET 2002 - ro@suse.de + +- added "Obsoletes: ssh" + +------------------------------------------------------------------- +Tue Mar 5 17:15:30 MET 2002 - draht@suse.de + +- security fix for bug in channels.c (channelbug.dif) + +------------------------------------------------------------------- +Fri Mar 1 15:40:59 CET 2002 - bk@suse.de + +- fix ssh-agent example to use eval `ssh-agent -s` and a typo. +- add sentence on use of ssh-agent with startx + +------------------------------------------------------------------- +Tue Feb 26 12:31:21 CET 2002 - bk@suse.de + +- update README.SuSE to improve documentation on protocol version + +------------------------------------------------------------------- +Wed Feb 13 13:15:41 CET 2002 - cihlar@suse.cz + +- rewritten addrlist patch - "0.0.0.0" is removed from list + after "::" is successful [#8951] + +------------------------------------------------------------------- +Mon Feb 11 15:17:32 CET 2002 - cihlar@suse.cz + +- added info about the change of the default protocol version + to README.SuSE + +------------------------------------------------------------------- +Thu Feb 7 12:42:53 CET 2002 - cihlar@suse.cz + +- removed addrlist patch which fixed bug [#8951] as it breaks + functionality on machines with kernel without IPv6 support, + bug reopened, new solution will be find +- switched to default protocol version 2 +- added ssh-keyconvert (thanks Olaf Kirch ) +- removed static linking against libcrypto, as crypt() was removed + from it [#5333] + +------------------------------------------------------------------- +Tue Jan 22 15:43:33 CET 2002 - kukuk@suse.de + +- Add pam_nologin to account management (else it will not be + called if user does not do password authentification) + +------------------------------------------------------------------- +Tue Jan 15 15:49:07 CET 2002 - egmont@suselinux.hu + +- removed colon from shutdown message + +------------------------------------------------------------------- +Thu Jan 10 09:27:50 CET 2002 - cihlar@suse.cz + +- use %{_lib} + +------------------------------------------------------------------- +Thu Dec 13 01:01:36 CET 2001 - ro@suse.de + +- moved rc.config.d -> sysconfig + +------------------------------------------------------------------- +Mon Dec 10 14:07:21 CET 2001 - cihlar@suse.cz + +- removed START_SSHD + +------------------------------------------------------------------- +Fri Dec 7 11:26:22 CET 2001 - cihlar@suse.cz + +- update to version 3.0.2p1: + * CheckMail option in sshd_config is deprecated + * X11 cookies are now stored in $HOME + * fixed a vulnerability in the UseLogin option + * /etc/ssh_known_hosts2 and ~/.ssh/known_hosts2 are obsolete, + /etc/ssh_known_hosts and ~/.ssh/known_hosts can be used + * several minor fixes +- update x11-ssh-askpass to version 1.2.4.1: + * fixed Imakefile.in +- fixed bug in adresses "::" and "0.0.0.0" [#8951] + +------------------------------------------------------------------- +Fri Oct 5 07:34:11 CEST 2001 - cihlar@suse.cz + +- update to version 2.9.9p2 +- removed obsolete clientloop and command patches +- uncommented "HostKey /etc/ssh/ssh_host_rsa_key" in sshd_config +- added German translation of e-mail to sysadmin +- init script fixed to work when more listening sshd runs +- added /bin/netstat to requires + +------------------------------------------------------------------- +Mon Sep 24 14:25:58 CEST 2001 - cihlar@suse.cz + +- fixed security problem with sftp & bypassing + keypair auth restrictions - patch based on CVS +- fixed status part of init script - it returned + running even if there were only sshd of connections + and no listening sshd [#11220] +- fixed stop part of init script - when there was no + /var/run/sshd.pid, all sshd were killed + +------------------------------------------------------------------- +Thu Sep 6 14:31:15 CEST 2001 - nadvornik@suse.cz + +- added patch for correct buffer flushing from CVS [bug #6450] + +------------------------------------------------------------------- +Fri Jul 27 09:05:24 CEST 2001 - cihlar@suse.cz + +- update x11-ssh-askpass to version 1.2.2 + +------------------------------------------------------------------- +Thu Jul 26 10:55:16 CEST 2001 - cihlar@suse.cz + +- update to version 2.9p2 +- removed obsolete "cookies" patch + +------------------------------------------------------------------- +Mon Jun 11 11:21:22 CEST 2001 - cihlar@suse.cz + +- fixed to compile with new xmkmf + +------------------------------------------------------------------- +Thu Jun 7 09:42:23 CEST 2001 - cihlar@suse.cz + +- fixed security bug when any file "cookies" could + be removed by anybody + +------------------------------------------------------------------- +Tue Jun 5 12:49:50 CEST 2001 - bjacke@suse.de + +- generate rsa host key in init script + +------------------------------------------------------------------- +Tue Jun 5 07:59:41 CEST 2001 - cihlar@suse.cz + +- removed complete path from PAM modules + +------------------------------------------------------------------- +Thu May 3 09:36:17 CEST 2001 - cihlar@suse.cz + +- update to version 2.9p1 +- removed obsolete --with-openssl +- removed obsolete man patch + +------------------------------------------------------------------- +Mon Apr 30 07:50:23 CEST 2001 - cihlar@suse.cz + +- enable PAM support + +------------------------------------------------------------------- +Fri Apr 13 11:50:26 CEST 2001 - ro@suse.de + +- fixed specfile for extra README.SuSE + +------------------------------------------------------------------- +Fri Apr 13 08:03:45 CEST 2001 - cihlar@suse.cz + +- fixed init script by new skeleton + +------------------------------------------------------------------- +Thu Mar 22 14:56:50 CET 2001 - cihlar@suse.cz + +- update to version 2.5.2p2 + +------------------------------------------------------------------- +Wed Mar 14 14:12:38 CET 2001 - cihlar@suse.cz + +- fixed ssh man page + +------------------------------------------------------------------- +Mon Mar 12 07:56:37 CET 2001 - cihlar@suse.cz + +- update to version 2.5.1p2 +- added xf86 to neededforbuild + +------------------------------------------------------------------- +Fri Mar 9 15:16:59 CET 2001 - schwab@suse.de + +- Fix missing crypt declaration. + +------------------------------------------------------------------- +Fri Feb 23 08:57:55 CET 2001 - cihlar@suse.cz + +- update to version 2.5.1p1 +- update x11-ssh-askpass to version 1.2.0 + +------------------------------------------------------------------- +Tue Feb 20 11:27:20 CET 2001 - cihlar@suse.cz + +- modified README.SuSE [#4365] +- fixed start script to agree with skeleton +- fixed start script so "stop" kills only sshd + listening for connections +- compiled with --with-openssl +- "ListenAddress 0.0.0.0" in sshd_config commented out - + listen on both ipv4 and ipv6 +- fixed var/adm/notify/messages/openssh_update [#6406] + +------------------------------------------------------------------- +Thu Jan 25 15:02:01 CET 2001 - smid@suse.cz + +- startup script fixed [#5559] + +------------------------------------------------------------------- +Tue Jan 16 09:40:50 CET 2001 - nadvornik@suse.cz + +- libcrypto linked static [#5333] + +------------------------------------------------------------------- +Thu Jan 11 13:41:48 CET 2001 - cihlar@suse.cz + +- uncomment sftp-server part in sshd_config +- added /usr/X11R6/lib/X11/app-defaults/SshAskpass to %files + +------------------------------------------------------------------- +Thu Jan 11 12:37:10 CET 2001 - cihlar@suse.cz + +- fixed %files [#5230] +- fixed installation of x11-ssh-askpass to BuildRoot +- added man pages of x11-ssh-askpass + +------------------------------------------------------------------- +Wed Jan 10 11:54:42 CET 2001 - smid@suse.cz + +- notice about how to enable ipv6 added to mail +- for administrator [#5297] + +------------------------------------------------------------------- +Wed Dec 13 10:43:25 CET 2000 - smid@suse.cz + +- default ipv6 listennig disabled (problems with libc2.2) [#4588] + +------------------------------------------------------------------- +Tue Dec 5 14:03:35 CET 2000 - smid@suse.cz + +- notify message changed + +------------------------------------------------------------------- +Mon Dec 4 21:45:35 CET 2000 - lmuelle@suse.de + +- fixed provides/ conflicts to ssh + +------------------------------------------------------------------- +Thu Nov 30 16:03:34 CET 2000 - smid@suse.cz + +- path to ssh-askpass fixed +- stop in %preun removed +- new init style + +------------------------------------------------------------------- +Sun Nov 26 23:53:53 CET 2000 - schwab@suse.de + +- Restore rcsshd link. + +------------------------------------------------------------------- +Sun Nov 26 15:34:12 CET 2000 - kukuk@suse.de + +- Add openssl-devel to neededforbuild + +------------------------------------------------------------------- +Mon Nov 20 16:11:34 CET 2000 - smid@suse.cz + +- New version 2.3.0 + +------------------------------------------------------------------- +Wed Sep 6 12:52:06 CEST 2000 - smid@suse.cz + +- remove --with-ipv4-default option + +------------------------------------------------------------------- +Wed Jul 5 19:04:28 CEST 2000 - garloff@suse.de + +- ... and tell the sysadmin and user more about what they can do + about it (schwab). + +------------------------------------------------------------------- +Wed Jul 5 00:55:37 CEST 2000 - garloff@suse.de + +- Inform the user (admin) about the fact that the default behaviour + with respect to X11-forwarding has been changed to be disabled. + +------------------------------------------------------------------- +Wed Jun 28 13:11:08 CEST 2000 - smid@suse.cz + +- warning that generating DSA key can an take a long time. + (bugzilla 3015) +- writing to wtmp and lastlog fixed (bugzilla 3024) +- reading config file (parameter Protocol) fixed + +------------------------------------------------------------------- +Fri Jun 16 10:42:52 CEST 2000 - garloff@suse.de + +- Added generation of ssh_host_dsa_key + +------------------------------------------------------------------- +Tue Jun 13 08:32:19 MEST 2000 - nadvornik@suse.cz + +- update to 2.1.1p1 + +------------------------------------------------------------------- +Thu Jun 8 10:10:55 MEST 2000 - cihlar@suse.cz + +- uncommented %clean + +------------------------------------------------------------------- +Fri May 5 13:08:15 CEST 2000 - smid@suse.cz + +- buildroot added +- upgrade to 1.2.3 + +------------------------------------------------------------------- +Tue Mar 21 09:50:57 CET 2000 - kukuk@suse.de + +- Update to 1.2.2p1 + +------------------------------------------------------------------- +Mon Mar 6 12:03:49 CET 2000 - kukuk@suse.de + +- Fix the diff. + +------------------------------------------------------------------- +Sun Mar 5 18:22:07 CET 2000 - kukuk@suse.de + +- Add a README.SuSE with a short description how to use ssh-add + +------------------------------------------------------------------- +Tue Feb 29 21:03:50 CET 2000 - schwab@suse.de + +- Update config.{guess,sub}. + +------------------------------------------------------------------- +Fri Feb 25 11:01:24 CET 2000 - kukuk@suse.de + +- Fix need for build, add group tag. + +------------------------------------------------------------------- +Wed Feb 2 09:23:13 CET 2000 - kukuk@suse.de + +- Change new defaults back to old one + +------------------------------------------------------------------- +Sun Jan 30 12:51:49 CET 2000 - kukuk@suse.de + +- Add x11-ssh-askpass to filelist + +------------------------------------------------------------------- +Fri Jan 28 18:03:50 CET 2000 - kukuk@suse.de + +- Update to OpenSSH 1.2.2 +- Add x11-ssh-askpass-1.0 + +------------------------------------------------------------------- +Tue Jan 25 15:57:09 CET 2000 - kukuk@suse.de + +- Add reload and status to /sbin/init.d/sshd [Bug 1747] + +------------------------------------------------------------------- +Thu Jan 20 17:26:02 CET 2000 - kukuk@suse.de + +- Update to 1.2.1pre27 with IPv6 support + +------------------------------------------------------------------- +Fri Dec 31 21:18:10 CET 1999 - kukuk@suse.de + +- Initial version diff --git a/openssh.spec b/openssh.spec index 496a319..e346b9c 100644 --- a/openssh.spec +++ b/openssh.spec @@ -293,6 +293,7 @@ rm -f %{buildroot}%{_datadir}/Ssh.bin %if %{has_systemd} install -D -m 0755 %{SOURCE9} %{buildroot}%{_sbindir}/sshd-gen-keys-start install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service +ln -s /usr/sbin/service buildroot}%{_sbindir}/rcsshd %endif %pre From e282a93fa2a9ae1e8094864721831f6d2fc88825857179da8318848db335f1bd Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 11 Feb 2014 08:14:43 +0000 Subject: [PATCH 7/9] OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=61 --- openssh.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openssh.spec b/openssh.spec index e346b9c..af59b68 100644 --- a/openssh.spec +++ b/openssh.spec @@ -293,7 +293,7 @@ rm -f %{buildroot}%{_datadir}/Ssh.bin %if %{has_systemd} install -D -m 0755 %{SOURCE9} %{buildroot}%{_sbindir}/sshd-gen-keys-start install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service -ln -s /usr/sbin/service buildroot}%{_sbindir}/rcsshd +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcsshd %endif %pre From b189026b63770c18a8f811a1294b7c39cd32a09ddd7c7f2ad77b6ea944b7ddb7 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 11 Feb 2014 08:14:49 +0000 Subject: [PATCH 8/9] OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=62 --- ....changes.reb47944ec2d587d73f8e2ef1dd4caf5d | 2001 ----------------- 1 file changed, 2001 deletions(-) delete mode 100644 openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d diff --git a/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d b/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d deleted file mode 100644 index 53027ea..0000000 --- a/openssh.changes.reb47944ec2d587d73f8e2ef1dd4caf5d +++ /dev/null @@ -1,2001 +0,0 @@ -------------------------------------------------------------------- -Wed Feb 5 08:38:11 UTC 2014 - idonmez@suse.com - -- Add openssh-6.2p1-forcepermissions.patch to implement a force - permissions mode (fate#312774). The patch is based on - http://marc.info/?l=openssh-unix-dev&m=128896838930893 - -------------------------------------------------------------------- -Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com - -- Update to 6.4p1 - Features since 6.2p2: - * ssh-agent(1) support in sshd(8); allows encrypted hostkeys, or - hostkeys on smartcards. - * ssh(1)/sshd(8): allow optional time-based rekeying via a - second argument to the existing RekeyLimit option. RekeyLimit - is now supported in sshd_config as well as on the client. - * sshd(8): standardise logging of information during user - authentication. - * The presented key/cert and the remote username (if available) - is now logged in the authentication success/failure message on - the same log line as the local username, remote host/port and - protocol in use. Certificates contents and the key - fingerprint of the signing CA are logged too. - * ssh(1) ability to query what cryptographic algorithms are - supported in the binary. - * ssh(1): ProxyCommand=- for cases where stdin and stdout - already point to the proxy. - * ssh(1): allow IdentityFile=none - * ssh(1)/sshd(8): -E option to append debugging logs to a - specified file instead of stderr or syslog. - * sftp(1): support resuming partial downloads with the "reget" - command and on the sftp commandline or on the "get" - commandline with the "-a" (append) option. - * ssh(1): "IgnoreUnknown" configuration option to selectively - suppress errors arising from unknown configuration directives. - * sshd(8): support for submethods to be appended to required - authentication methods listed via AuthenticationMethods. - Bugfixes since 6.2p2: - * sshd(8): fix refusal to accept certificate if a key of a - different type to the CA key appeared in authorized_keys - before the CA key. - * ssh(1)/ssh-agent(1)/sshd(8): Use a monotonic time source for - timers so that things like keepalives and rekeying will work - properly over clock steps. - * sftp(1): update progressmeter when data is acknowledged, not - when it's sent. bz#2108 - * ssh(1)/ssh-keygen(1): improve error messages when the current - user does not exist in /etc/passwd; bz#2125 - * ssh(1): reset the order in which public keys are tried after - partial authentication success. - * ssh-agent(1): clean up socket files after SIGINT when in debug - mode; bz#2120 - * ssh(1) and others: avoid confusing error messages in the case - of broken system resolver configurations; bz#2122 - * ssh(1): set TCP nodelay for connections started with -N; - bz#2124 - * ssh(1): correct manual for permission requirements on - ~/.ssh/config; bz#2078 - * ssh(1): fix ControlPersist timeout not triggering in cases - where TCP connections have hung. bz#1917 - * ssh(1): properly deatch a ControlPersist master from its - controlling terminal. - * sftp(1): avoid crashes in libedit when it has been compiled - with multi- byte character support. bz#1990 - * sshd(8): when running sshd -D, close stderr unless we have - explicitly requested logging to stderr. bz#1976, - * ssh(1): fix incomplete bzero; bz#2100 - * sshd(8): log and error and exit if ChrootDirectory is - specified and running without root privileges. - * Many improvements to the regression test suite. In particular - log files are now saved from ssh and sshd after failures. - * Fix a number of memory leaks. bz#1967 bz#2096 and others - * sshd(8): fix public key authentication when a :style is - appended to the requested username. - * ssh(1): do not fatally exit when attempting to cleanup - multiplexing- created channels that are incompletely opened. - bz#2079 - * sshd(8): fix a memory corruption problem triggered during - rekeying when an AES-GCM cipher is selected - * Fix unaligned accesses in umac.c for strict-alignment - architectures. bz#2101 - * Fix broken incorrect commandline reporting errors. bz#1448 - * Only include SHA256 and ECC-based key exchange methods if - libcrypto has the required support. - * Fix crash in SOCKS5 dynamic forwarding code on - strict-alignment architectures. - - FIPS and GSSKEX patched disabled for now - -------------------------------------------------------------------- -Fri Oct 4 17:50:32 UTC 2013 - pcerny@suse.com - -- fix server crashes when using AES-GCM -- removed superfluous build dependency on X - -------------------------------------------------------------------- -Thu Sep 19 02:02:56 UTC 2013 - pcerny@suse.com - -- spec file and patch cleanup - * key converter is now in the -key-converter.patch - * openssh-nodaemon-nopid.patch is -no_fork-no_pid_file.patch - * openssh-nocrazyabicheck.patch is - -disable-openssl-abi-check.patch - * removing obsolete -engines.diff patch -- patches from SLE11 - * use auditing infrastructure extending upstream hooks - (-auditX-*.patch) instead of the single old patch - (-audit.patch) - * FIPS enablement (currently disabled) - (-fingerprint_hash.patch, -fips.patch) - * GSSAPI key exchange - (bnc#784689, fate#313068, -gssapi_key_exchange.patch) - * SysV init script update - 'stop' now terminates all sshd - processes and closes all connections, 'soft-stop' only - terminates the listener process (keeps active sessions intact) - (fate#314243) - * helper application for retrieving users' public keys from - an LDAP server (bnc#683733, fate#302144, -ldap.patch) - - subpackage openssh-akc-ldap - * several bugfixes: - - login invocation - (bnc#833605, -login_options.patch) - - disable locked accounts when using PAM - (bnc#708678, fate#312033, -pam-check-locks.patch) - - fix wtmp handling - (bnc#18024, -lastlog.patch) -- init script is moved into documentation for openSUSE 12.3+ - (as it confused systemd) - -------------------------------------------------------------------- -Tue Sep 10 21:15:59 UTC 2013 - crrodriguez@opensuse.org - -- fix the logic in openssh-nodaemon-nopid.patch which is broken - and pid_file therefore still being created. - -------------------------------------------------------------------- -Sat Aug 3 17:57:06 UTC 2013 - crrodriguez@opensuse.org - -- Update to version 6.2p2 -* ssh(1)/sshd(8): Added support for AES-GCM authenticated encryption -* ssh(1)/sshd(8): Added support for encrypt-then-mac (EtM) MAC modes -* ssh(1)/sshd(8): Added support for the UMAC-128 MAC -* sshd(8): Added support for multiple required authentication -* sshd(8)/ssh-keygen(1): Added support for Key Revocation Lists -* ssh(1): When SSH protocol 2 only is selected (the default), ssh(1) - now immediately sends its SSH protocol banner to the server without - waiting to receive the server's banner, saving time when connecting. -* dozens of other changes, see http://www.openssh.org/txt/release-6.2 - -------------------------------------------------------------------- -Mon Jul 1 18:54:31 UTC 2013 - coolo@suse.com - -- avoid the build cycle between curl, krb5, libssh2_org and openssh - by using krb5-mini-devel - -------------------------------------------------------------------- -Wed Jun 19 09:50:25 UTC 2013 - speilicke@suse.com - -- Recommend xauth, X11-forwarding won't work if it is not installed - -------------------------------------------------------------------- -Sun Apr 14 19:02:32 UTC 2013 - crrodriguez@opensuse.org - -- sshd.service: Do not order after syslog.target, it is - not required or recommended and that target does not even exist - anymore. - -------------------------------------------------------------------- -Tue Jan 8 10:16:45 UTC 2013 - dmueller@suse.com - -- use ssh-keygen(1) default keylengths in generating the host key - instead of hardcoding it - -------------------------------------------------------------------- -Tue Nov 13 10:26:37 UTC 2012 - meissner@suse.com - -- Updated to 6.1p1, a bugfix release - Features: - * sshd(8): This release turns on pre-auth sandboxing sshd by default for - new installs, by setting UsePrivilegeSeparation=sandbox in sshd_config. - * ssh-keygen(1): Add options to specify starting line number and number of - lines to process when screening moduli candidates, allowing processing - of different parts of a candidate moduli file in parallel - * sshd(8): The Match directive now supports matching on the local (listen) - address and port upon which the incoming connection was received via - LocalAddress and LocalPort clauses. - * sshd(8): Extend sshd_config Match directive to allow setting AcceptEnv - and {Allow,Deny}{Users,Groups} - * Add support for RFC6594 SSHFP DNS records for ECDSA key types. bz#1978 - * ssh-keygen(1): Allow conversion of RSA1 keys to public PEM and PKCS8 - * sshd(8): Allow the sshd_config PermitOpen directive to accept "none" as - an argument to refuse all port-forwarding requests. - * sshd(8): Support "none" as an argument for AuthorizedPrincipalsFile - * ssh-keyscan(1): Look for ECDSA keys by default. bz#1971 - * sshd(8): Add "VersionAddendum" to sshd_config to allow server operators - to append some arbitrary text to the server SSH protocol banner. - Bugfixes: - * ssh(1)/sshd(8): Don't spin in accept() in situations of file - descriptor exhaustion. Instead back off for a while. - * ssh(1)/sshd(8): Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs as - they were removed from the specification. bz#2023, - * sshd(8): Handle long comments in config files better. bz#2025 - * ssh(1): Delay setting tty_flag so RequestTTY options are correctly - picked up. bz#1995 - * sshd(8): Fix handling of /etc/nologin incorrectly being applied to root - on platforms that use login_cap. - Portable OpenSSH: - * sshd(8): Allow sshd pre-auth sandboxing to fall-back to the rlimit - sandbox from the Linux SECCOMP filter sandbox when the latter is - not available in the kernel. - * ssh(1): Fix NULL dereference when built with LDNS and using DNSSEC to - retrieve a CNAME SSHFP record. - * Fix cross-compilation problems related to pkg-config. bz#1996 - -------------------------------------------------------------------- -Tue Nov 13 10:26:16 CET 2012 - kukuk@suse.de - -- Fix groupadd arguments -- Add LSB tag to sshd init script - -------------------------------------------------------------------- -Fri Oct 26 15:01:21 UTC 2012 - coolo@suse.com - -- explicit buildrequire groff, needed for man pages - -------------------------------------------------------------------- -Tue Oct 16 12:29:36 UTC 2012 - coolo@suse.com - -- buildrequire systemd through pkgconfig to break cycle - -------------------------------------------------------------------- -Wed Aug 15 19:25:08 UTC 2012 - crrodriguez@opensuse.org - -- When not daemonizing, such is used with systemd, no not - create a PID file - -------------------------------------------------------------------- -Mon Jun 18 11:34:51 UTC 2012 - coolo@suse.com - -- do not buildrequire xorg-x11, the askpass is an extra package - and should build from a different package - -------------------------------------------------------------------- -Tue May 29 07:14:36 UTC 2012 - meissner@suse.com - -- use correct download url and tarball format. - -------------------------------------------------------------------- -Tue May 29 06:52:13 UTC 2012 - crrodriguez@opensuse.org - -- Update to version 6.0, large list of changes, seen - http://www.openssh.org/txt/release-6.0 for detail. - -------------------------------------------------------------------- -Thu May 10 20:50:33 UTC 2012 - crrodriguez@opensuse.org - -- By default openSSH checks at *runtime* if the openssl - API version matches with the running library, that might - be good if you are compiling SSH yourself but it is a totally - insane way to check for binary/source compatibility in a distribution. - -------------------------------------------------------------------- -Mon Feb 20 08:29:17 UTC 2012 - meissner@suse.com - -- include X11 app default dir - -------------------------------------------------------------------- -Fri Dec 23 08:27:08 UTC 2011 - brian@aljex.com - -- Fix building for OS 11.0, 10.3, 10.2 -* Don't require selinux on OS 11.0 or lower - -------------------------------------------------------------------- -Fri Dec 23 06:34:28 UTC 2011 - brian@aljex.com - -- Fix building for OS 11.2 and 11.1 -- Cleanup remove remaining litteral /etc/init.d 's - -------------------------------------------------------------------- -Wed Dec 21 10:38:59 UTC 2011 - coolo@suse.com - -- add autoconf as buildrequire to avoid implicit dependency - -------------------------------------------------------------------- -Tue Nov 29 19:48:29 UTC 2011 - crrodriguez@opensuse.org - -- Add systemd startup units - -------------------------------------------------------------------- -Sat Oct 29 22:41:55 UTC 2011 - pcerny@suse.com - -- finalising libexecdir change (bnc#726712) - -------------------------------------------------------------------- -Wed Oct 19 00:32:20 UTC 2011 - pcerny@suse.com - -- Update to 5.9p1 - * sandboxing privsep child through rlimit - -------------------------------------------------------------------- -Fri Sep 16 09:43:47 UTC 2011 - jengelh@medozas.de - -- Avoid overriding libexecdir with %_lib (bnc#712025) -- Clean up the specfile by request of Minh Ngo, details entail: -* remove norootforbuild comments, redundant %clean section -* run spec-beautifier over it -- Add PIEFLAGS to compilation of askpass; fails otherwise - -------------------------------------------------------------------- -Mon Aug 29 23:47:58 UTC 2011 - crrodriguez@opensuse.org - -- Update to verison 5.8p2 -* Fixed vuln in systems without dev/random, we arenot affected -* Fixes problems building with selinux enabled -- Fix build with as-needed and no-add-needed - -------------------------------------------------------------------- -Sat Aug 13 20:46:17 UTC 2011 - crrodriguez@opensuse.org - -- Enable libedit/autocompletion support in sftp - -------------------------------------------------------------------- -Tue May 10 15:08:17 UTC 2011 - meissner@novell.com - -- Change default keysizes of rsa and dsa from 1024 to 2048 - to match ssh-keygen manpage recommendations. - -------------------------------------------------------------------- -Fri Feb 4 11:19:25 UTC 2011 - lchiquitto@novell.com - -- Update to 5.8p1 - * Fix vulnerability in legacy certificate signing introduced in - OpenSSH-5.6 and found by Mateusz Kocielski. - * Fix compilation failure when enableing SELinux support. - * Do not attempt to call SELinux functions when SELinux is - disabled. -- Remove patch that is now upstream: - * openssh-5.7p1-selinux.diff - -------------------------------------------------------------------- -Thu Feb 3 16:42:01 UTC 2011 - pcerny@novell.com - -- specfile/patches cleanup - -------------------------------------------------------------------- -Mon Jan 24 11:24:59 UTC 2011 - lchiquitto@novell.com - -- Update to 5.7p1 - * Implement Elliptic Curve Cryptography modes for key exchange (ECDH) - and host/user keys (ECDSA) as specified by RFC5656. - * sftp(1)/sftp-server(8): add a protocol extension to support a hard - link operation. - * scp(1): Add a new -3 option to scp: Copies between two remote hosts - are transferred through the local host. - * ssh(1): automatically order the hostkeys requested by the client - based on which hostkeys are already recorded in known_hosts. - * ssh(1)/sshd(8): add a new IPQoS option to specify arbitrary - TOS/DSCP/QoS values instead of hardcoding lowdelay/throughput. - * sftp(1): the sftp client is now significantly faster at performing - directory listings, using OpenBSD glob(3) extensions to preserve - the results of stat(3) operations performed in the course of its - execution rather than performing expensive round trips to fetch - them again afterwards. - * ssh(1): "atomically" create the listening mux socket by binding it on - a temporary name and then linking it into position after listen() has - succeeded. - * ssh(1)/sshd(8): add a KexAlgorithms knob to the client and server - configuration to allow selection of which key exchange methods are - used by ssh(1) and sshd(8) and their order of preference. - * sftp(1)/scp(1): factor out bandwidth limiting code from scp(1) into - a generic bandwidth limiter that can be attached using the atomicio - callback mechanism and use it to add a bandwidth limit option to - sftp(1). - * Support building against openssl-1.0.0a. - * Bug fixes. -- Remove patches that are now upstream: - * openssh-5.6p1-tmpdir.diff - * openssh-linux-new-oomkill.patch -- Add upstream patch to fix build with SELinux enabled. - -------------------------------------------------------------------- -Wed Jan 12 13:37:38 CET 2011 - sbrabec@suse.cz - -- Removed relics of no more implemented opensc support. - -------------------------------------------------------------------- -Thu Nov 18 12:20:59 UTC 2010 - lnussel@suse.de - -- add pam_lastlog to show failed login attempts -- remove permissions handling, no special handling needed - -------------------------------------------------------------------- -Tue Nov 16 14:45:14 UTC 2010 - cristian.rodriguez@opensuse.org - -- Use upstream oom_adj is deprecated patch - -------------------------------------------------------------------- -Tue Nov 2 13:25:19 UTC 2010 - coolo@novell.com - -- remove the code trying to patch X11 paths - which was broken - for a very long time and was useless anyway as the Makefiles - do this correctly themselves - -------------------------------------------------------------------- -Sun Oct 31 12:37:02 UTC 2010 - jengelh@medozas.de - -- Use %_smp_mflags - -------------------------------------------------------------------- -Thu Oct 14 16:00:19 UTC 2010 - crrodriguez@opensuse.org - -- Fix warning "oom_adj is deprecated use oom_score_adj instead" - -------------------------------------------------------------------- -Mon Sep 13 14:47:10 CEST 2010 - anicka@suse.cz - -- actualize README.SuSE (bnc#638893) - -------------------------------------------------------------------- -Tue Aug 24 15:43:08 CEST 2010 - anicka@suse.cz - -- update to 5.6p1 - * Added a ControlPersist option to ssh_config(5) that automatically - starts a background ssh(1) multiplex master when connecting. - * Hostbased authentication may now use certificate host keys. - * ssh-keygen(1) now supports signing certificate using a CA key that - has been stored in a PKCS#11 token. - * ssh(1) will now log the hostname and address that we connected to at - LogLevel=verbose after authentication is successful to mitigate - "phishing" attacks by servers with trusted keys that accept - authentication silently and automatically before presenting fake - password/passphrase prompts. - * Expand %h to the hostname in ssh_config Hostname options. - * Allow ssh-keygen(1) to import (-i) and export (-e) of PEM and PKCS#8 - keys in addition to RFC4716 (SSH.COM) encodings via a new -m option - * sshd(8) will now queue debug messages for bad ownership or - permissions on the user's keyfiles encountered during authentication - and will send them after authentication has successfully completed. - * ssh(1) connection multiplexing now supports remote forwarding with - dynamic port allocation and can report the allocated port back to - the user - * sshd(8) now supports indirection in matching of principal names - listed in certificates. - * sshd(8) now has a new AuthorizedPrincipalsFile option to specify a - file containing a list of names that may be accepted in place of the - username when authorizing a certificate trusted via the - sshd_config(5) TrustedCAKeys option. - * Additional sshd_config(5) options are now valid inside Match blocks - * Revised the format of certificate keys. - * bugfixes -- removed -forward patch (SSH_MAX_FORWARDS_PER_DIRECTION not hard-coded - any more), removed memory leak fix (fixed in upstream) - -------------------------------------------------------------------- -Fri Aug 20 13:00:43 CEST 2010 - anicka@suse.cz - -- hint user how to remove offending keys (bnc#625552) - -------------------------------------------------------------------- -Thu Jul 22 17:58:09 CEST 2010 - anicka@suse.cz - -- update to 5.5p1 - -------------------------------------------------------------------- -Tue Jul 20 17:19:24 CEST 2010 - anicka@suse.cz - -- update to 5.5p1 - * Allow ChrootDirectory to work in SELinux platforms. - * bugfixes - -------------------------------------------------------------------- -Wed Jun 30 16:01:30 CEST 2010 - meissner@suse.de - -- Disable visual hostkey support again, after discussion on - its usefulness. - -------------------------------------------------------------------- -Mon May 17 18:11:33 UTC 2010 - cristian.rodriguez@opensuse.org - -- Hardware crypto is supported and patched but never - enabled, need to use --with-ssl-engine explicitely - -------------------------------------------------------------------- -Fri May 14 16:03:17 CEST 2010 - anicka@suse.cz - -- fixed memory leak in sftp (bnc#604274) - -------------------------------------------------------------------- -Fri Apr 23 12:01:50 CEST 2010 - anicka@suse.cz - -- honour /etc/nologin (bnc#530885) - -------------------------------------------------------------------- -Thu Mar 25 11:00:00 CET 2010 - meissner@suse.de - -- Enable VisualHostKey (ascii art of the hostkey fingerprint) and - HashHostKeys (hardening measure to make them unusable for worms/malicious - users for further host hopping). - -------------------------------------------------------------------- -Tue Mar 23 18:57:07 CET 2010 - anicka@suse.cz - -- update to 5.4p1 - * After a transition period of about 10 years, this release disables - SSH protocol 1 by default. Clients and servers that need to use the - legacy protocol must explicitly enable it in ssh_config / sshd_config - or on the command-line. - * Remove the libsectok/OpenSC-based smartcard code and add support for - PKCS#11 tokens. This support is automatically enabled on all - platforms that support dlopen(3) and was inspired by patches written - by Alon Bar-Lev. Details in the ssh(1) and ssh-add(1) manpages. - * Add support for certificate authentication of users and hosts using a - new, minimal OpenSSH certificate format (not X.509). Certificates - contain a public key, identity information and some validity - constraints and are signed with a standard SSH public key using - ssh-keygen(1). CA keys may be marked as trusted in authorized_keys - or via a TrustedUserCAKeys option in sshd_config(5) (for user - authentication), or in known_hosts (for host authentication). - Documentation for certificate support may be found in ssh-keygen(1), - sshd(8) and ssh(1) and a description of the protocol extensions in - PROTOCOL.certkeys. - * Added a 'netcat mode' to ssh(1): "ssh -W host:port ..." This connects - stdio on the client to a single port forward on the server. This - allows, for example, using ssh as a ProxyCommand to route connections - via intermediate servers. bz#1618 - * Add the ability to revoke keys in sshd(8) and ssh(1). User keys may - be revoked using a new sshd_config(5) option "RevokedKeys". Host keys - are revoked through known_hosts (details in the sshd(8) man page). - Revoked keys cannot be used for user or host authentication and will - trigger a warning if used. - * Rewrite the ssh(1) multiplexing support to support non-blocking - operation of the mux master, improve the resilience of the master to - malformed messages sent to it by the slave and add support for - requesting port- forwardings via the multiplex protocol. The new - stdio-to-local forward mode ("ssh -W host:port ...") is also - supported. The revised multiplexing protocol is documented in the - file PROTOCOL.mux in the source distribution. - * Add a 'read-only' mode to sftp-server(8) that disables open in write - mode and all other fs-modifying protocol methods. bz#430 - * Allow setting an explicit umask on the sftp-server(8) commandline to - override whatever default the user has. bz#1229 - * Many improvements to the sftp(1) client, many of which were - implemented by Carlos Silva through the Google Summer of Code - program: - - Support the "-h" (human-readable units) flag for ls - - Implement tab-completion of commands, local and remote filenames - - Support most of scp(1)'s commandline arguments in sftp(1), as a - first step towards making sftp(1) a drop-in replacement for scp(1). - Note that the rarely-used "-P sftp_server_path" option has been - moved to "-D sftp_server_path" to make way for "-P port" to match - scp(1). - - Add recursive transfer support for get/put and on the commandline - * New RSA keys will be generated with a public exponent of RSA_F4 == - (2**16)+1 == 65537 instead of the previous value 35. - * Passphrase-protected SSH protocol 2 private keys are now protected - with AES-128 instead of 3DES. This applied to newly-generated keys - as well as keys that are reencrypted (e.g. by changing their - passphrase). -- cleanup in patches - -------------------------------------------------------------------- -Tue Mar 2 09:09:18 UTC 2010 - coolo@novell.com - -- do not use paths at all, but prereq packages - -------------------------------------------------------------------- -Sat Feb 27 20:35:01 UTC 2010 - aj@suse.de - -- Use complete path for groupadd and useradd in pre section. - -------------------------------------------------------------------- -Tue Feb 23 15:45:06 CET 2010 - anicka@suse.cz - -- audit patch: add fix for bnc#545271 - -------------------------------------------------------------------- -Mon Feb 22 17:15:22 CET 2010 - anicka@suse.cz - -- do not fix uid/gid anymore (bnc#536564) - -------------------------------------------------------------------- -Tue Dec 15 11:04:00 CET 2009 - jengelh@medozas.de - -- select large PIE for SPARC, it is required to avoid - "relocation truncated to fit: R_SPARC_GOT13 against symbol xyz - defined in COMMON section in sshd.o" - -------------------------------------------------------------------- -Mon Sep 21 14:40:51 CEST 2009 - anicka@suse.cz - -- add new version of homechroot patch (added documentation, added - check for nodev and nosuid) -- remove Provides and Obsoletes ssh - -------------------------------------------------------------------- -Thu Aug 20 16:54:08 CEST 2009 - anicka@suse.cz - -- make sftp in chroot users life easier (ie. bnc#518238), - many thanks jchadima@redhat.com for a patch - -------------------------------------------------------------------- -Sun Jul 12 21:43:21 CEST 2009 - coolo@novell.com - -- readd $SSHD_BIN so that sshd starts at all - -------------------------------------------------------------------- -Tue Jul 7 15:06:58 CEST 2009 - llunak@novell.com - -- Added a hook for ksshaskpass - -------------------------------------------------------------------- -Sun Jul 5 12:17:40 CEST 2009 - dmueller@novell.com - -- readd -f to startproc and remove -p instead to - ensure that sshd is started even though old instances - are still running (e.e. being logged in from remote) - -------------------------------------------------------------------- -Fri Jun 19 10:35:46 CEST 2009 - coolo@novell.com - -- disable as-needed for this package as it fails to build with it - -------------------------------------------------------------------- -Tue May 26 11:56:20 CEST 2009 - anicka@suse.cz - -- disable -f in startproc to calm the warning (bnc#506831) - -------------------------------------------------------------------- -Thu Apr 23 09:44:07 CEST 2009 - lnussel@suse.de - -- do not enable sshd by default - -------------------------------------------------------------------- -Mon Feb 23 17:27:45 CET 2009 - anicka@suse.cz - -- update to 5.2p1 - * This release changes the default cipher order to prefer the AES CTR - modes and the revised "arcfour256" mode to CBC mode ciphers that are - susceptible to CPNI-957037 "Plaintext Recovery Attack Against SSH". - * This release also adds countermeasures to mitigate CPNI-957037-style - attacks against the SSH protocol's use of CBC-mode ciphers. Upon - detection of an invalid packet length or Message Authentication - Code, ssh/sshd will continue reading up to the maximum supported - packet length rather than immediately terminating the connection. - This eliminates most of the known differences in behaviour that - leaked information about the plaintext of injected data which formed - the basis of this attack. We believe that these attacks are rendered - infeasible by these changes. - * Added a -y option to ssh(1) to force logging to syslog rather than - stderr, which is useful when running daemonised (ssh -f) - * The sshd_config(5) ForceCommand directive now accepts commandline - arguments for the internal-sftp server. - * The ssh(1) ~C escape commandline now support runtime creation of - dynamic (-D) port forwards. - * Support the SOCKS4A protocol in ssh(1) dynamic (-D) forwards. - (bz#1482) - * Support remote port forwarding with a listen port of '0'. This - informs the server that it should dynamically allocate a listen - port and report it back to the client. (bz#1003) - * sshd(8) now supports setting PermitEmptyPasswords and - AllowAgentForwarding in Match blocks - * Repair a ssh(1) crash introduced in openssh-5.1 when the client is - sent a zero-length banner (bz#1496) - * Due to interoperability problems with certain - broken SSH implementations, the eow@openssh.com and - no-more-sessions@openssh.com protocol extensions are now only sent - to peers that identify themselves as OpenSSH. - * Make ssh(1) send the correct channel number for - SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to - avoid triggering 'Non-public channel' error messages on sshd(8) in - openssh-5.1. - * Avoid printing 'Non-public channel' warnings in sshd(8), since the - ssh(1) has sent incorrect channel numbers since ~2004 (this reverts - a behaviour introduced in openssh-5.1). - * Avoid double-free in ssh(1) ~C escape -L handler (bz#1539) - * Correct fail-on-error behaviour in sftp(1) batchmode for remote - stat operations. (bz#1541) - * Disable nonfunctional ssh(1) ~C escape handler in multiplex slave - connections. (bz#1543) - * Avoid hang in ssh(1) when attempting to connect to a server that - has MaxSessions=0 set. - * Multiple fixes to sshd(8) configuration test (-T) mode - * Several core and portable OpenSSH bugs fixed: 1380, 1412, 1418, - 1419, 1421, 1490, 1491, 1492, 1514, 1515, 1518, 1520, 1538, 1540 - * Many manual page improvements. - -------------------------------------------------------------------- -Mon Dec 1 15:43:14 CET 2008 - anicka@suse.cz - -- respect SSH_MAX_FORWARDS_PER_DIRECTION (bnc#448775) - -------------------------------------------------------------------- -Mon Nov 10 16:01:27 CET 2008 - anicka@suse.cz - -- fix printing banner (bnc#443380) - -------------------------------------------------------------------- -Fri Oct 24 16:24:34 CEST 2008 - anicka@suse.cz - -- call pam functions in the right order (bnc#438292) -- mention default forwarding of locale settings in - README.SuSE (bnc#434799) - -------------------------------------------------------------------- -Tue Sep 9 17:55:29 CEST 2008 - anicka@suse.cz - -- remove pam_resmgr from sshd.pamd (bnc#422619) - -------------------------------------------------------------------- -Sun Aug 24 08:26:05 CEST 2008 - coolo@suse.de - -- fix fillup macro usage - -------------------------------------------------------------------- -Fri Aug 22 11:51:12 CEST 2008 - prusnak@suse.cz - -- enabled SELinux support [Fate#303662] - -------------------------------------------------------------------- -Tue Jul 22 20:39:29 CEST 2008 - anicka@suse.cz - -- update to 5.1p1 - * sshd(8): Avoid X11 man-in-the-middle attack on HP/UX (and possibly - other platforms) when X11UseLocalhost=no - * Introduce experimental SSH Fingerprint ASCII Visualisation to ssh(1) - and ssh-keygen(1). Visual fingerprinnt display is controlled by a new - ssh_config(5) option "VisualHostKey". - * sshd_config(5) now supports CIDR address/masklen matching in "Match - address" blocks, with a fallback to classic wildcard matching. - * sshd(8) now supports CIDR matching in ~/.ssh/authorized_keys - from="..." restrictions, also with a fallback to classic wildcard - matching. - * Added an extended test mode (-T) to sshd(8) to request that it write - its effective configuration to stdout and exit. Extended test mode - also supports the specification of connection parameters (username, - source address and hostname) to test the application of - sshd_config(5) Match rules. - * ssh(1) now prints the number of bytes transferred and the overall - connection throughput for SSH protocol 2 sessions when in verbose - mode (previously these statistics were displayed for protocol 1 - connections only). - * sftp-server(8) now supports extension methods statvfs@openssh.com and - fstatvfs@openssh.com that implement statvfs(2)-like operations. - * sftp(1) now has a "df" command to the sftp client that uses the - statvfs@openssh.com to produce a df(1)-like display of filesystem - space and inode utilisation (requires statvfs@openssh.com support on - the server) - * Added a MaxSessions option to sshd_config(5) to allow control of the - number of multiplexed sessions supported over a single TCP connection. - This allows increasing the number of allowed sessions above the - previous default of 10, disabling connection multiplexing - (MaxSessions=1) or disallowing login/shell/subsystem sessions - entirely (MaxSessions=0). - * Added a no-more-sessions@openssh.com global request extension that is - sent from ssh(1) to sshd(8) when the client knows that it will never - request another session (i.e. when session multiplexing is disabled). - This allows a server to disallow further session requests and - terminate the session in cases where the client has been hijacked. - * ssh-keygen(1) now supports the use of the -l option in combination - with -F to search for a host in ~/.ssh/known_hosts and display its - fingerprint. - * ssh-keyscan(1) now defaults to "rsa" (protocol 2) keys, instead of - "rsa1". - * Added an AllowAgentForwarding option to sshd_config(8) to control - whether authentication agent forwarding is permitted. Note that this - is a loose control, as a client may install their own unofficial - forwarder. - * ssh(1) and sshd(8): avoid unnecessary malloc/copy/free when receiving - network data, resulting in a ~10% speedup - * ssh(1) and sshd(8) will now try additional addresses when connecting - to a port forward destination whose DNS name resolves to more than - one address. The previous behaviour was to try the only first address - and give up if that failed. (bz#383) - * ssh(1) and sshd(8) now support signalling that channels are - half-closed for writing, through a channel protocol extension - notification "eow@openssh.com". This allows propagation of closed - file descriptors, so that commands such as: - "ssh -2 localhost od /bin/ls | true" - do not send unnecessary data over the wire. (bz#85) - * sshd(8): increased the default size of ssh protocol 1 ephemeral keys - from 768 to 1024 bits. - * When ssh(1) has been requested to fork after authentication - ("ssh -f") with ExitOnForwardFailure enabled, delay the fork until - after replies for any -R forwards have been seen. Allows for robust - detection of -R forward failure when using -f. (bz#92) - * "Match group" blocks in sshd_config(5) now support negation of - groups. E.g. "Match group staff,!guests" (bz#1315) - * sftp(1) and sftp-server(8) now allow chmod-like operations to set - set[ug]id/sticky bits. (bz#1310) - * The MaxAuthTries option is now permitted in sshd_config(5) match - blocks. - * Multiplexed ssh(1) sessions now support a subset of the ~ escapes - that are available to a primary connection. (bz#1331) - * ssh(1) connection multiplexing will now fall back to creating a new - connection in most error cases. (bz#1439 bz#1329) - * Added some basic interoperability tests against Twisted Conch. - * Documented OpenSSH's extensions to and deviations from the published - SSH protocols (the PROTOCOL file in the distribution) - * Documented OpenSSH's ssh-agent protocol (PROTOCOL.agent). - * bugfixes -- remove gssapi_krb5-fix patch - -------------------------------------------------------------------- -Fri Apr 18 17:53:30 CEST 2008 - werner@suse.de - -- Handle pts slave lines like utemper - -------------------------------------------------------------------- -Wed Apr 9 14:37:57 CEST 2008 - anicka@suse.cz - -- update to 5.0p1 - * CVE-2008-1483: Avoid possible hijacking of X11-forwarded - connections by refusing to listen on a port unless all address - families bind successfully. -- remove CVE-2008-1483 patch - -------------------------------------------------------------------- -Wed Apr 2 14:57:26 CEST 2008 - anicka@suse.cz - -- update to 4.9p1 - * Disable execution of ~/.ssh/rc for sessions where a command has been - forced by the sshd_config ForceCommand directive. Users who had - write access to this file could use it to execute abritrary commands. - This behaviour was documented, but was an unsafe default and an extra - hassle for administrators. - * Added chroot(2) support for sshd(8), controlled by a new option - "ChrootDirectory". Please refer to sshd_config(5) for details, and - please use this feature carefully. (bz#177 bz#1352) - * Linked sftp-server(8) into sshd(8). The internal sftp server is - used when the command "internal-sftp" is specified in a Subsystem - or ForceCommand declaration. When used with ChrootDirectory, the - internal sftp server requires no special configuration of files - inside the chroot environment. Please refer to sshd_config(5) for - more information. - * Added a "no-user-rc" option for authorized_keys to disable execution - of ~/.ssh/rc - * Added a protocol extension method "posix-rename@openssh.com" for - sftp-server(8) to perform POSIX atomic rename() operations. - (bz#1400) - * Removed the fixed limit of 100 file handles in sftp-server(8). The - server will now dynamically allocate handles up to the number of - available file descriptors. (bz#1397) - * ssh(8) will now skip generation of SSH protocol 1 ephemeral server - keys when in inetd mode and protocol 2 connections are negotiated. - This speeds up protocol 2 connections to inetd-mode servers that - also allow Protocol 1 (bz#440) - * Accept the PermitRootLogin directive in a sshd_config(5) Match - block. Allows for, e.g. permitting root only from the local - network. - * Reworked sftp(1) argument splitting and escaping to be more - internally consistent (i.e. between sftp commands) and more - consistent with sh(1). Please note that this will change the - interpretation of some quoted strings, especially those with - embedded backslash escape sequences. (bz#778) - * Support "Banner=none" in sshd_config(5) to disable sending of a - pre-login banner (e.g. in a Match block). - * ssh(1) ProxyCommands are now executed with $SHELL rather than - /bin/sh. - * ssh(1)'s ConnectTimeout option is now applied to both the TCP - connection and the SSH banner exchange (previously it just covered - the TCP connection). This allows callers of ssh(1) to better detect - and deal with stuck servers that accept a TCP connection but don't - progress the protocol, and also makes ConnectTimeout useful for - connections via a ProxyCommand. - * Many new regression tests, including interop tests against PuTTY's - plink. - * Support BSM auditing on Mac OS X - * bugfixes -- remove addrlist, pam_session_close, strict-aliasing-fix patches - (not needed anymore) - -------------------------------------------------------------------- -Tue Mar 25 11:10:14 CET 2008 - anicka@suse.cz - -- fix CVE-2008-1483 (bnc#373527) - -------------------------------------------------------------------- -Fri Jan 4 11:11:52 CET 2008 - anicka@suse.cz - -- fix privileges of a firewall definition file [#351193] - -------------------------------------------------------------------- -Sat Dec 15 00:10:13 CET 2007 - anicka@suse.cz - -- add patch calling pam with root privileges [#334559] -- drop pwname-home patch [#104773] - -------------------------------------------------------------------- -Fri Dec 7 22:28:40 CET 2007 - anicka@suse.cz - -- fix race condition in xauth patch - -------------------------------------------------------------------- -Wed Dec 5 10:45:36 CET 2007 - anicka@suse.cz - -- update to 4.7p1 - * Add "-K" flag for ssh to set GSSAPIAuthentication=yes and - GSSAPIDelegateCredentials=yes. This is symmetric with -k - * make scp try to skip FIFOs rather than blocking when nothing is - listening. - * increase default channel windows - * put the MAC list into a display - * many bugfixes - -------------------------------------------------------------------- -Mon Oct 8 16:34:06 CEST 2007 - anicka@suse.cz - -- block SIGALRM only during calling syslog() [#331032] - -------------------------------------------------------------------- -Thu Sep 13 15:50:39 CEST 2007 - nadvornik@suse.cz - -- fixed checking of an untrusted cookie, CVE-2007-4752 [#308521] - -------------------------------------------------------------------- -Tue Aug 28 18:25:57 CEST 2007 - anicka@suse.cz - -- fix blocksigalrm patch to set old signal mask after - writing the log in every case [#304819] - -------------------------------------------------------------------- -Tue Aug 21 04:51:45 CEST 2007 - anicka@suse.cz - -- avoid generating ssh keys when a non-standard location - is configured [#281228] - -------------------------------------------------------------------- -Wed Jul 25 16:18:50 CEST 2007 - anicka@suse.cz - -- fixed typo in sshd.fw [#293764] - -------------------------------------------------------------------- -Mon Mar 19 19:14:26 CET 2007 - nadvornik@suse.cz - -- fixed default for ChallengeResponseAuthentication [#255374] - -------------------------------------------------------------------- -Mon Mar 12 10:56:31 CET 2007 - anicka@suse.cz - -- update to 4.6p1 - * sshd now allows the enabling and disabling of authentication - methods on a per user, group, host and network basis via the - Match directive in sshd_config. - * Allow multiple forwarding options to work when specified in a - PermitOpen directive - * Clear SIGALRM when restarting due to SIGHUP. Prevents stray - signal from taking down sshd if a connection was pending at - the time SIGHUP was received - * hang on exit" when background processes are running at the - time of exit on a ttyful/login session - * some more bugfixes - -------------------------------------------------------------------- -Mon Mar 5 11:03:41 CET 2007 - anicka@suse.cz - -- fix path for firewall definition - -------------------------------------------------------------------- -Thu Mar 1 15:14:23 CET 2007 - anicka@suse.cz - -- add support for Linux audit (FATE #120269) - -------------------------------------------------------------------- -Wed Feb 21 11:21:48 CET 2007 - anicka@suse.cz - -- add firewall definition [#246921], FATE #300687, - source: sshd.fw - -------------------------------------------------------------------- -Sat Jan 6 12:30:16 CET 2007 - anicka@suse.cz - -- disable SSHv1 protocol in default configuration [#231808] - -------------------------------------------------------------------- -Tue Dec 12 14:41:45 CET 2006 - anicka@suse.cz - -- update to 4.5p1 - * Use privsep_pw if we have it, but only require it if we - absolutely need it. - * Correctly check for bad signatures in the monitor, otherwise - the monitor and the unpriv process can get out of sync. - * Clear errno before calling the strtol functions. - * exit instead of doing a blocking tcp send if we detect - a client/server timeout, since the tcp sendqueue might - be already full (of alive requests) - * include signal.h, errno.h, sys/in.h - * some more bugfixes - -------------------------------------------------------------------- -Wed Nov 22 13:42:32 CET 2006 - anicka@suse.cz - -- fixed README.SuSE [#223025] - -------------------------------------------------------------------- -Thu Nov 9 13:59:35 CET 2006 - anicka@suse.cz - -- backport security fixes from openssh 4.5 (#219115) - -------------------------------------------------------------------- -Tue Nov 7 13:43:44 CET 2006 - ro@suse.de - -- fix manpage permissions - -------------------------------------------------------------------- -Tue Oct 31 14:04:52 CET 2006 - anicka@suse.cz - -- fix gssapi_krb5-fix patch [#215615] -- fix xauth patch - -------------------------------------------------------------------- -Tue Oct 10 16:07:11 CEST 2006 - postadal@suse.cz - -- fixed building openssh from src.rpm [#176528] (gssapi_krb5-fix.patch) - -------------------------------------------------------------------- -Tue Oct 3 14:44:08 CEST 2006 - postadal@suse.cz - -- updated to version 4.4p1 [#208662] - * fixed pre-authentication DoS, that would cause sshd(8) to spin - until the login grace time expired - * fixed unsafe signal hander, which was vulnerable to a race condition - that could be exploited to perform a pre-authentication DoS - * fixed a GSSAPI authentication abort that could be used to determine - the validity of usernames on some platforms - * implemented conditional configuration in sshd_config(5) using the - "Match" directive - * added support for Diffie-Hellman group exchange key agreement with a - final hash of SHA256 - * added a "ForceCommand", "PermitOpen" directive to sshd_config(5) - * added optional logging of transactions to sftp-server(8) - * ssh(1) will now record port numbers for hosts stored in - ~/.ssh/authorized_keys when a non-standard port has been requested - * added an "ExitOnForwardFailure" option to cause ssh(1) to exit (with - a non-zero exit code) when requested port forwardings could not be - established - * extended sshd_config(5) "SubSystem" declarations to allow the - specification of command-line arguments -- removed obsoleted patches: autoconf-fix.patch, dos-fix.patch -- fixed gcc issues (gcc-fix.patch) - -------------------------------------------------------------------- -Wed Sep 20 17:34:54 CEST 2006 - postadal@suse.cz - -- fixed DoS by CRC compensation attack detector [#206917] (dos-fix.patch) -- fixed client NULL deref on protocol error -- cosmetic fix in init script [#203826] - -------------------------------------------------------------------- -Fri Sep 1 14:14:52 CEST 2006 - kukuk@suse.de - -- sshd.pamd: Add pam_loginuid, move pam_nologin to a better position - -------------------------------------------------------------------- -Fri Aug 25 15:37:46 CEST 2006 - postadal@suse.cz - -- fixed path for xauth [#198676] - -------------------------------------------------------------------- -Thu Aug 3 15:07:41 CEST 2006 - postadal@suse.cz - -- fixed build with X11R7 - -------------------------------------------------------------------- -Thu Jul 20 17:25:27 CEST 2006 - postadal@suse.cz - -- updated to version 4.3p2 - * experimental support for tunneling network packets via tun(4) -- removed obsoleted patches: pam-error.patch, CVE-2006-0225.patch, - scp.patch, sigalarm.patch - -------------------------------------------------------------------- -Mon Feb 13 12:54:28 CET 2006 - postadal@suse.cz - -- upstream fixes - - fixed "scp a b c", when c is not directory (scp.patch) - - eliminate some code duplicated in privsep and non-privsep paths, and - explicitly clear SIGALRM handler (sigalarm.patch) - -------------------------------------------------------------------- -Fri Feb 3 19:02:49 CET 2006 - postadal@suse.cz - -- fixed local arbitrary command execution vulnerability [#143435] - (CVE-2006-0225.patch) - -------------------------------------------------------------------- -Thu Feb 2 13:19:41 CET 2006 - postadal@suse.cz - -- fixed xauth.diff for disabled UsePrivilegeSeparation mode [#145809] -- build on s390 without Smart card support (opensc) [#147383] - -------------------------------------------------------------------- -Mon Jan 30 16:25:01 CET 2006 - postadal@suse.cz - -- fixed patch xauth.diff [#145809] -- fixed comments [#142989] - -------------------------------------------------------------------- -Wed Jan 25 21:39:06 CET 2006 - mls@suse.de - -- converted neededforbuild to BuildRequires - -------------------------------------------------------------------- -Mon Jan 16 18:05:44 CET 2006 - meissner@suse.de - -- added -fstack-protector. - -------------------------------------------------------------------- -Tue Jan 3 15:46:33 CET 2006 - postadal@suse.cz - -- updated to version 4.2p1 -- removed obsoleted patches: upstream_fixes.diff, gssapi-secfix.patch - -------------------------------------------------------------------- -Tue Nov 15 17:51:07 CET 2005 - postadal@suse.cz - -- do not delegate GSSAPI credentials to log in with a different method - than GSSAPI [#128928] (CAN-2005-2798, gssapi-secfix.patch) - -------------------------------------------------------------------- -Sun Oct 23 10:40:24 CEST 2005 - postadal@suse.cz - -- fixed PAM to send authentication failing mesaage to client [#130043] - (pam-error.patch) - -------------------------------------------------------------------- -Wed Sep 14 16:58:14 CEST 2005 - postadal@suse.cz - -- fixed uninitialized variable in patch xauth.diff [#98815] - -------------------------------------------------------------------- -Thu Sep 8 15:56:37 CEST 2005 - postadal@suse.cz - -- don't strip - -------------------------------------------------------------------- -Mon Sep 5 20:04:04 CEST 2005 - postadal@suse.cz - -- added patch xauth.diff prevent from polluting xauthority file [#98815] - -------------------------------------------------------------------- -Mon Aug 22 18:12:20 CEST 2005 - postadal@suse.cz - -- fixed problem when multiple accounts have same UID [#104773] - (pwname-home.diff) -- added fixes from upstream (upstream_fixes.diff) - -------------------------------------------------------------------- -Thu Aug 18 17:50:46 CEST 2005 - postadal@suse.cz - -- added patch tmpdir.diff for using $TMPDIR by ssh-agent [#95731] - -------------------------------------------------------------------- -Thu Aug 4 11:29:38 CEST 2005 - uli@suse.de - -- parallelize build - -------------------------------------------------------------------- -Mon Aug 1 17:48:02 CEST 2005 - postadal@suse.cz - -- added patch resolving problems with hostname changes [#98627] - (xauthlocalhostname.diff) - -------------------------------------------------------------------- -Wed Jun 22 18:42:57 CEST 2005 - kukuk@suse.de - -- Compile/link with -fpie/-pie - -------------------------------------------------------------------- -Wed Jun 15 17:41:24 CEST 2005 - meissner@suse.de - -- build x11-ask-pass with RPM_OPT_FLAGS. - -------------------------------------------------------------------- -Fri Jun 10 16:18:25 CEST 2005 - postadal@suse.cz - -- updated to version 4.1p1 -- removed obsoleted patches: restore_terminal, pam-returnfromsession, - timing-attacks-fix, krb5ccname, gssapi-pam, logdenysource, - sendenv-fix, documentation-fix - -------------------------------------------------------------------- -Thu Mar 10 10:36:42 CET 2005 - postadal@suse.cz - -- fixed SendEnv config parsing bug -- documented timeout on untrusted x11 forwarding sessions (openssh#849) -- mentioned ForwardX11Trusted in ssh.1 (openssh#987) - -------------------------------------------------------------------- -Thu Mar 3 13:29:13 CET 2005 - postadal@suse.cz - -- enabled accepting and sending locale environment variables in protocol 2 - [#65747, #50091] - -------------------------------------------------------------------- -Thu Feb 24 16:33:54 CET 2005 - postadal@suse.cz - -- added patches from cvs: gssapi-pam (openssh#918), - krb5ccname (openssh#445), logdenysource (openssh#909) - -------------------------------------------------------------------- -Thu Feb 3 13:29:23 CET 2005 - postadal@suse.cz - -- fixed keyboard-interactive/pam/Kerberos leaks info about user existence - [#48329] (openssh#971, CAN-2003-0190) - -------------------------------------------------------------------- -Wed Jan 19 15:58:07 CET 2005 - postadal@suse.cz - -- splited spec file to decreas number of build dependencies -- fixed restoring terminal setting after Ctrl+C during password prompt in scp/sftp [#43309] -- allowed users to see output from failing PAM session modules (openssh #890, - pam-returnfromsession.patch) - -------------------------------------------------------------------- -Mon Nov 8 17:17:45 CET 2004 - kukuk@suse.de - -- Use common-* PAM config files for sshd PAM configuration - -------------------------------------------------------------------- -Mon Oct 25 15:14:49 CEST 2004 - postadal@suse.cz - -- switched heimdal-* to kerberos-devel-packages in #needforbuild - -------------------------------------------------------------------- -Fri Sep 3 15:03:01 CEST 2004 - ro@suse.de - -- fix lib64 issue - -------------------------------------------------------------------- -Tue Aug 31 16:03:54 CEST 2004 - postadal@suse.cz - -- updated to version 3.9p1 - -- removed obsoleted patches: scp-fix.diff and window_change-fix.diff - -------------------------------------------------------------------- -Thu Aug 26 15:40:53 CEST 2004 - postadal@suse.cz - -- added openssh-askpass-gnome subpackage -- added ssh-askpass script for choosing askpass depending on windowmanager - (by Robert Love ) -- build with Smart card support (opensc) [#44289] - -------------------------------------------------------------------- -Tue Aug 17 15:52:20 CEST 2004 - postadal@suse.cz - -- removed old implementation of "Update Messages" [#36059] - -------------------------------------------------------------------- -Thu Aug 12 16:36:53 CEST 2004 - postadal@suse.cz - -- updated to version 3.8p1 - -- removed obsoleted patches: sftp-progress-fix and pam-fix4 - -------------------------------------------------------------------- -Mon Jun 28 16:56:23 CEST 2004 - meissner@suse.de - -- block sigalarm during syslog output or we might deadlock - on recursively entering syslog(). (LTC#9523, SUSE#42354) - -------------------------------------------------------------------- -Wed May 26 15:27:32 CEST 2004 - postadal@suse.cz - -- fixed commented default value for GSSAPI - -------------------------------------------------------------------- -Thu May 20 21:23:27 CEST 2004 - mludvig@suse.cz - -- Load drivers for available hardware crypto accelerators. - -------------------------------------------------------------------- -Fri Apr 30 15:03:39 CEST 2004 - postadal@suse.cz - -- updated README.kerberos (GSSAPICleanupCreds renamed to GSSAPICleanupCredentials) - -------------------------------------------------------------------- -Mon Apr 19 14:41:01 CEST 2004 - postadal@suse.cz - -- updated README.SuSE (GSSAPICleanupCreds renamed to GSSAPICleanupCredentials) - [#39010] - -------------------------------------------------------------------- -Fri Mar 26 17:24:45 CET 2004 - postadal@suse.cz - -- fixed sshd(8) and sshd_config(5) man pages (EAL3) -- fixed spelling errors in README.SuSE [#37086] - -------------------------------------------------------------------- -Thu Mar 25 14:50:50 CET 2004 - postadal@suse.cz - -- fixed change window request [#33177] - -------------------------------------------------------------------- -Mon Mar 22 15:19:15 CET 2004 - postadal@suse.cz - -- updated README.SuSE -- removed %verify from /usr/bin/ssh in specfile - -------------------------------------------------------------------- -Thu Mar 18 15:48:52 CET 2004 - postadal@suse.cz - -- fixed previous fix of security bug in scp [#35443] (CAN-2004-0175) - (was too restrictive) -- fixed permission of /usr/bin/ssh - -------------------------------------------------------------------- -Mon Mar 15 17:56:06 CET 2004 - postadal@suse.cz - -- fixed comments in sshd_config and ssh_config - -------------------------------------------------------------------- -Mon Mar 15 17:25:08 CET 2004 - postadal@suse.cz - -- enabled privilege separation mode (new version fixes a lot of problematic PAM - calling [#30328]) -- fixed security bug in scp [#35443] (CAN-2004-0175) -- reverted to old behaviour of ForwardingX11 [#35836] - (set ForwardX11Trusted to 'yes' by default) -- updated README.SuSE -- fixed pam code (pam-fix4.diff, backported from openssh-SNAP-20040311) - -------------------------------------------------------------------- -Fri Mar 05 13:10:55 CET 2004 - postadal@suse.cz - -- updated README.SuSE (Remote x11 clients are now untrusted by default) [#35368] -- added gssapimitm patch (support for old GSSAPI) - -------------------------------------------------------------------- -Mon Mar 01 18:13:37 CET 2004 - postadal@suse.cz - -- updated to version 3.8p1 - * The "gssapi" support has been replaced with the "gssapi-with-mic" - to fix possible MITM attacks. These two versions are not compatible. - -- removed obsoleted patches: krb5.patch, dns-lookups.patch, pam-fix.diff, - pam-end-fix.diff -- used process forking instead pthreads - (developers fixed bugs in pam calling and they recommended to don't use threads) - -------------------------------------------------------------------- -Tue Feb 24 11:37:17 CET 2004 - postadal@suse.cz - -- fixed the problem with save_argv in sshd.c re-apeared again in version 3.7.1p2 - (it caused bad behaviour after receiving SIGHUP - used by reload of init script) - [#34845] - -------------------------------------------------------------------- -Wed Feb 18 18:06:20 CET 2004 - kukuk@suse.de - -- Real strict-aliasing patch - -------------------------------------------------------------------- -Wed Feb 18 16:04:17 CET 2004 - postadal@suse.cz - -- fixed strict-aliasing patch [#34551] - -------------------------------------------------------------------- -Sat Feb 14 00:20:09 CET 2004 - adrian@suse.de - -- provide SLP registration file /etc/slp.reg.d/ssh.reg - -------------------------------------------------------------------- -Tue Feb 03 15:18:36 CET 2004 - postadal@suse.cz - -- used patch from pam-end-fix.diff [#33132] -- fixed instalation openssh without documentation [#33937] -- fixed auth-pam.c which breaks strict aliasing - -------------------------------------------------------------------- -Mon Jan 19 13:19:32 CET 2004 - meissner@suse.de - -- Added a ; to ssh-key-converter.c to fix gcc 3.4 build. - -------------------------------------------------------------------- -Fri Jan 16 12:57:41 CET 2004 - kukuk@suse.de - -- Add pam-devel to neededforbuild - -------------------------------------------------------------------- -Thu Nov 06 10:14:31 CET 2003 - postadal@suse.cz - -- added /usr/bin/slogin explicitly to %file list [#32921] - -------------------------------------------------------------------- -Sun Nov 2 21:10:35 CET 2003 - adrian@suse.de - -- add %run_permissions to fix build - -------------------------------------------------------------------- -Tue Oct 14 12:23:36 CEST 2003 - postadal@suse.cz - -- reverted value UsePAM to "yes" and set PasswordAuthentication to "no" - in file /etc/ssh/sshd_config (the version 3.7.1p2 disabled PAM support - by default) [#31749] - -------------------------------------------------------------------- -Tue Sep 23 15:02:00 CEST 2003 - draht@suse.de - -- New version 3.7.1p2; signature from 86FF9C48 Damien Miller - verified for source tarball. Bugs fixed with this version: - #31637 (CAN-2003-0786, CAN-2003-0786). Briefly: - 1) SSH1 PAM challenge response auth ignored the result of the - authentication (with privsep off) - 2) The PAM conversation function trashed the stack, by referring - to the **resp parameter as an array of pointers rather than - as a pointer to an array of struct pam_responses. - At least security bug 1) is exploitable. - -------------------------------------------------------------------- -Fri Sep 19 19:56:01 CEST 2003 - postadal@suse.cz - -- use pthreads instead process forking (it needs by pam modules) -- fixed bug in calling pam_setcred [#31025] - (pam-fix.diff - string "FILE:" added to begin of KRB5CCNAME) -- updated README.SuSE -- reverted ChallengeResponseAuthentication option to default value yes - (necessary for pam authentication) [#31432] - -------------------------------------------------------------------- -Thu Sep 18 18:34:33 CEST 2003 - postadal@suse.cz - -- updated to version 3.7.1p1 (with security patches) -- removed obsoleted patches: chauthtok.patch, krb-include-fix.diff, - gssapi-fix.diff, saveargv-fix.diff, gssapi-20030430.diff, racecondition-fix -- updated README.kerberos - -------------------------------------------------------------------- -Tue Sep 16 16:57:02 CEST 2003 - postadal@suse.cz - -- fixed race condition in allocating memory [#31025] (CAN-2003-0693) - -------------------------------------------------------------------- -Mon Sep 15 11:52:20 CEST 2003 - postadal@suse.cz - -- disabled privilege separation, which caused some problems [#30328] - (updated README.SuSE) - -------------------------------------------------------------------- -Thu Sep 04 11:59:39 CEST 2003 - postadal@suse.cz - -- fixed bug in x11-ssh-askpass dialog [#25846] (askpass-fix.diff is workaround for gcc bug) - -------------------------------------------------------------------- -Fri Aug 29 11:39:40 CEST 2003 - kukuk@suse.de - -- Call useradd -r for system account [Bug #29611] - -------------------------------------------------------------------- -Mon Aug 25 10:40:37 CEST 2003 - postadal@suse.cz - -- use new stop_on_removal/restart_on_upate macros -- fixed lib64 problem in /etc/ssh/sshd_config [#28766] - -------------------------------------------------------------------- -Tue Aug 19 11:21:33 CEST 2003 - mmj@suse.de - -- Add sysconfig metadata [#28943] - -------------------------------------------------------------------- -Fri Aug 1 01:57:08 CEST 2003 - ro@suse.de - -- add e2fsprogs-devel to neededforbuild - -------------------------------------------------------------------- -Thu Jul 24 19:47:14 CEST 2003 - postadal@suse.cz - -- updated to version 3.6.1p2 -- added the new version of patch for GSSAPI (gssapi-20030430.diff), - the older one was removed (gssapi.patch) -- added README.kerberos to filelist - -------------------------------------------------------------------- -Tue Jun 3 00:41:08 CEST 2003 - mmj@suse.de - -- Remove files we don't package - -------------------------------------------------------------------- -Wed Apr 02 15:03:44 CEST 2003 - postadal@suse.cz - -- fixed bad behaviour after receiving SIGHUP (this bug caused not working reload of init script) - -------------------------------------------------------------------- -Tue Mar 18 14:25:08 CET 2003 - postadal@suse.cz - -- added $remote_fs to init.d script (needed if /usr is on remote fs [#25577]) - -------------------------------------------------------------------- -Thu Mar 13 17:02:52 CET 2003 - postadal@suse.cz - -- fixed segfault while using GSSAPI for authentication when connecting to localhost (took care about error value of ssh_gssapi_import_name() in function ssh_gssapi_client_ctx()) - -------------------------------------------------------------------- -Mon Mar 10 09:28:31 CET 2003 - kukuk@suse.de - -- Remove extra "/" from pid file path. - -------------------------------------------------------------------- -Mon Mar 03 16:49:24 CET 2003 - postadal@suse.cz - -- modified init.d script (now checking sshd.init.pid instead of port 22) [#24263] - -------------------------------------------------------------------- -Mon Mar 3 16:05:24 CET 2003 - okir@suse.de - -- added comment to /etc/pam.d/ssh on how to enable - support for resmgr (#24363). - -------------------------------------------------------------------- -Fri Feb 21 18:52:05 CET 2003 - postadal@suse.cz - -- added ssh-copy-id shell script [#23745] - -------------------------------------------------------------------- -Fri Feb 14 13:42:14 CET 2003 - postadal@suse.cz - -- given back gssapi and dns-lookups patches - -------------------------------------------------------------------- -Wed Jan 22 23:05:35 CET 2003 - postadal@suse.cz - -- updated to version 3.5p1 -- removed obsolete patches: owl-mm, forced-commands-only, krb -- added patch krb5 (for heimdal) -- temporarily removed gssapi patch and dns-lookups (needs rewriting) -- fix sysconfig metadata - -------------------------------------------------------------------- -Thu Dec 5 10:52:41 CET 2002 - okir@suse.de - -- avoid Kerberos DNS lookups in the default config (#20395) -- added README.kerberos - -------------------------------------------------------------------- -Thu Sep 19 11:00:46 CEST 2002 - postadal@suse.cz - -- added info about changes in the new version of openssh - to README.SuSE [#19757] - -------------------------------------------------------------------- -Mon Sep 2 10:39:24 CEST 2002 - okir@suse.de - -- privsep directory now /var/lib/empty, which is provided by - filesystem package (#17556) - -------------------------------------------------------------------- -Wed Aug 28 05:48:16 CEST 2002 - nashif@suse.de - -- Added insserv & co to PreReq - -------------------------------------------------------------------- -Mon Aug 26 11:57:20 CEST 2002 - okir@suse.de - -- applied patch that adds GSSAPI support in protocol version 2 (#18239) - -------------------------------------------------------------------- -Thu Aug 22 14:09:43 CEST 2002 - postadal@suse.cz - -- added the patch to fix malfunction of PermitRootLogin seted to - forced-commands-only [#17149] - -------------------------------------------------------------------- -Fri Aug 9 14:41:30 CEST 2002 - okir@suse.de - -- syslog now reports kerberos auth method when logging in via - kerberos (#17469) - -------------------------------------------------------------------- -Tue Jul 23 04:34:10 PDT 2002 - okir@suse.de - -- enabled kerberos support -- added patch to support kerberos 5 authentication in privsep mode. -- added missing section 5 manpages -- added missing ssh-keysign to files list (new for privsep) - -------------------------------------------------------------------- -Mon Jul 22 14:16:54 CEST 2002 - okir@suse.de - -- fixed handling of expired passwords in privsep mode - -------------------------------------------------------------------- -Tue Jul 9 13:48:52 CEST 2002 - mmj@suse.de - -- Don't source rc.config - -------------------------------------------------------------------- -Wed Jul 3 01:01:24 CEST 2002 - draht@suse.de - -- ssh-keygen must be told to explicitly create type rsa1 keys - in the start script. - -------------------------------------------------------------------- -Tue Jul 2 12:03:58 CEST 2002 - ro@suse.de - -- useradd/groupadd in preinstall to standardize - -------------------------------------------------------------------- -Sat Jun 29 10:33:18 CEST 2002 - ro@suse.de - -- updated patch from solar: zero out bytes for no longer used pages - in mmap-fallback solution - -------------------------------------------------------------------- -Thu Jun 27 18:07:37 CEST 2002 - ro@suse.de - -- updated owl-fallback.diff from solar - -------------------------------------------------------------------- -Thu Jun 27 17:04:16 CEST 2002 - ro@suse.de - -- update to 3.4p1 - o privilege separation support - o overflow fix from ISS -- unsplit openssh-server and openssh-client - -------------------------------------------------------------------- -Tue Jun 18 12:12:41 CEST 2002 - mmj@suse.de - -- Update to 3.2.3p1 which fixed following compared to 3.2.2p1 - o a defect in the BSD_AUTH access control handling for - o login/tty problems on Solaris (bug #245) - o build problems on Cygwin systems - -- Split the package to openssh, openssh-server, openssh-client and - openssh-askpass - -------------------------------------------------------------------- -Sun May 19 16:15:03 CEST 2002 - mmj@suse.de - -- Updated to 3.2.2p which includes security and several bugfixes. - -------------------------------------------------------------------- -Fri Mar 15 12:05:21 CET 2002 - ro@suse.de - -- added "Obsoletes: ssh" - -------------------------------------------------------------------- -Tue Mar 5 17:15:30 MET 2002 - draht@suse.de - -- security fix for bug in channels.c (channelbug.dif) - -------------------------------------------------------------------- -Fri Mar 1 15:40:59 CET 2002 - bk@suse.de - -- fix ssh-agent example to use eval `ssh-agent -s` and a typo. -- add sentence on use of ssh-agent with startx - -------------------------------------------------------------------- -Tue Feb 26 12:31:21 CET 2002 - bk@suse.de - -- update README.SuSE to improve documentation on protocol version - -------------------------------------------------------------------- -Wed Feb 13 13:15:41 CET 2002 - cihlar@suse.cz - -- rewritten addrlist patch - "0.0.0.0" is removed from list - after "::" is successful [#8951] - -------------------------------------------------------------------- -Mon Feb 11 15:17:32 CET 2002 - cihlar@suse.cz - -- added info about the change of the default protocol version - to README.SuSE - -------------------------------------------------------------------- -Thu Feb 7 12:42:53 CET 2002 - cihlar@suse.cz - -- removed addrlist patch which fixed bug [#8951] as it breaks - functionality on machines with kernel without IPv6 support, - bug reopened, new solution will be find -- switched to default protocol version 2 -- added ssh-keyconvert (thanks Olaf Kirch ) -- removed static linking against libcrypto, as crypt() was removed - from it [#5333] - -------------------------------------------------------------------- -Tue Jan 22 15:43:33 CET 2002 - kukuk@suse.de - -- Add pam_nologin to account management (else it will not be - called if user does not do password authentification) - -------------------------------------------------------------------- -Tue Jan 15 15:49:07 CET 2002 - egmont@suselinux.hu - -- removed colon from shutdown message - -------------------------------------------------------------------- -Thu Jan 10 09:27:50 CET 2002 - cihlar@suse.cz - -- use %{_lib} - -------------------------------------------------------------------- -Thu Dec 13 01:01:36 CET 2001 - ro@suse.de - -- moved rc.config.d -> sysconfig - -------------------------------------------------------------------- -Mon Dec 10 14:07:21 CET 2001 - cihlar@suse.cz - -- removed START_SSHD - -------------------------------------------------------------------- -Fri Dec 7 11:26:22 CET 2001 - cihlar@suse.cz - -- update to version 3.0.2p1: - * CheckMail option in sshd_config is deprecated - * X11 cookies are now stored in $HOME - * fixed a vulnerability in the UseLogin option - * /etc/ssh_known_hosts2 and ~/.ssh/known_hosts2 are obsolete, - /etc/ssh_known_hosts and ~/.ssh/known_hosts can be used - * several minor fixes -- update x11-ssh-askpass to version 1.2.4.1: - * fixed Imakefile.in -- fixed bug in adresses "::" and "0.0.0.0" [#8951] - -------------------------------------------------------------------- -Fri Oct 5 07:34:11 CEST 2001 - cihlar@suse.cz - -- update to version 2.9.9p2 -- removed obsolete clientloop and command patches -- uncommented "HostKey /etc/ssh/ssh_host_rsa_key" in sshd_config -- added German translation of e-mail to sysadmin -- init script fixed to work when more listening sshd runs -- added /bin/netstat to requires - -------------------------------------------------------------------- -Mon Sep 24 14:25:58 CEST 2001 - cihlar@suse.cz - -- fixed security problem with sftp & bypassing - keypair auth restrictions - patch based on CVS -- fixed status part of init script - it returned - running even if there were only sshd of connections - and no listening sshd [#11220] -- fixed stop part of init script - when there was no - /var/run/sshd.pid, all sshd were killed - -------------------------------------------------------------------- -Thu Sep 6 14:31:15 CEST 2001 - nadvornik@suse.cz - -- added patch for correct buffer flushing from CVS [bug #6450] - -------------------------------------------------------------------- -Fri Jul 27 09:05:24 CEST 2001 - cihlar@suse.cz - -- update x11-ssh-askpass to version 1.2.2 - -------------------------------------------------------------------- -Thu Jul 26 10:55:16 CEST 2001 - cihlar@suse.cz - -- update to version 2.9p2 -- removed obsolete "cookies" patch - -------------------------------------------------------------------- -Mon Jun 11 11:21:22 CEST 2001 - cihlar@suse.cz - -- fixed to compile with new xmkmf - -------------------------------------------------------------------- -Thu Jun 7 09:42:23 CEST 2001 - cihlar@suse.cz - -- fixed security bug when any file "cookies" could - be removed by anybody - -------------------------------------------------------------------- -Tue Jun 5 12:49:50 CEST 2001 - bjacke@suse.de - -- generate rsa host key in init script - -------------------------------------------------------------------- -Tue Jun 5 07:59:41 CEST 2001 - cihlar@suse.cz - -- removed complete path from PAM modules - -------------------------------------------------------------------- -Thu May 3 09:36:17 CEST 2001 - cihlar@suse.cz - -- update to version 2.9p1 -- removed obsolete --with-openssl -- removed obsolete man patch - -------------------------------------------------------------------- -Mon Apr 30 07:50:23 CEST 2001 - cihlar@suse.cz - -- enable PAM support - -------------------------------------------------------------------- -Fri Apr 13 11:50:26 CEST 2001 - ro@suse.de - -- fixed specfile for extra README.SuSE - -------------------------------------------------------------------- -Fri Apr 13 08:03:45 CEST 2001 - cihlar@suse.cz - -- fixed init script by new skeleton - -------------------------------------------------------------------- -Thu Mar 22 14:56:50 CET 2001 - cihlar@suse.cz - -- update to version 2.5.2p2 - -------------------------------------------------------------------- -Wed Mar 14 14:12:38 CET 2001 - cihlar@suse.cz - -- fixed ssh man page - -------------------------------------------------------------------- -Mon Mar 12 07:56:37 CET 2001 - cihlar@suse.cz - -- update to version 2.5.1p2 -- added xf86 to neededforbuild - -------------------------------------------------------------------- -Fri Mar 9 15:16:59 CET 2001 - schwab@suse.de - -- Fix missing crypt declaration. - -------------------------------------------------------------------- -Fri Feb 23 08:57:55 CET 2001 - cihlar@suse.cz - -- update to version 2.5.1p1 -- update x11-ssh-askpass to version 1.2.0 - -------------------------------------------------------------------- -Tue Feb 20 11:27:20 CET 2001 - cihlar@suse.cz - -- modified README.SuSE [#4365] -- fixed start script to agree with skeleton -- fixed start script so "stop" kills only sshd - listening for connections -- compiled with --with-openssl -- "ListenAddress 0.0.0.0" in sshd_config commented out - - listen on both ipv4 and ipv6 -- fixed var/adm/notify/messages/openssh_update [#6406] - -------------------------------------------------------------------- -Thu Jan 25 15:02:01 CET 2001 - smid@suse.cz - -- startup script fixed [#5559] - -------------------------------------------------------------------- -Tue Jan 16 09:40:50 CET 2001 - nadvornik@suse.cz - -- libcrypto linked static [#5333] - -------------------------------------------------------------------- -Thu Jan 11 13:41:48 CET 2001 - cihlar@suse.cz - -- uncomment sftp-server part in sshd_config -- added /usr/X11R6/lib/X11/app-defaults/SshAskpass to %files - -------------------------------------------------------------------- -Thu Jan 11 12:37:10 CET 2001 - cihlar@suse.cz - -- fixed %files [#5230] -- fixed installation of x11-ssh-askpass to BuildRoot -- added man pages of x11-ssh-askpass - -------------------------------------------------------------------- -Wed Jan 10 11:54:42 CET 2001 - smid@suse.cz - -- notice about how to enable ipv6 added to mail -- for administrator [#5297] - -------------------------------------------------------------------- -Wed Dec 13 10:43:25 CET 2000 - smid@suse.cz - -- default ipv6 listennig disabled (problems with libc2.2) [#4588] - -------------------------------------------------------------------- -Tue Dec 5 14:03:35 CET 2000 - smid@suse.cz - -- notify message changed - -------------------------------------------------------------------- -Mon Dec 4 21:45:35 CET 2000 - lmuelle@suse.de - -- fixed provides/ conflicts to ssh - -------------------------------------------------------------------- -Thu Nov 30 16:03:34 CET 2000 - smid@suse.cz - -- path to ssh-askpass fixed -- stop in %preun removed -- new init style - -------------------------------------------------------------------- -Sun Nov 26 23:53:53 CET 2000 - schwab@suse.de - -- Restore rcsshd link. - -------------------------------------------------------------------- -Sun Nov 26 15:34:12 CET 2000 - kukuk@suse.de - -- Add openssl-devel to neededforbuild - -------------------------------------------------------------------- -Mon Nov 20 16:11:34 CET 2000 - smid@suse.cz - -- New version 2.3.0 - -------------------------------------------------------------------- -Wed Sep 6 12:52:06 CEST 2000 - smid@suse.cz - -- remove --with-ipv4-default option - -------------------------------------------------------------------- -Wed Jul 5 19:04:28 CEST 2000 - garloff@suse.de - -- ... and tell the sysadmin and user more about what they can do - about it (schwab). - -------------------------------------------------------------------- -Wed Jul 5 00:55:37 CEST 2000 - garloff@suse.de - -- Inform the user (admin) about the fact that the default behaviour - with respect to X11-forwarding has been changed to be disabled. - -------------------------------------------------------------------- -Wed Jun 28 13:11:08 CEST 2000 - smid@suse.cz - -- warning that generating DSA key can an take a long time. - (bugzilla 3015) -- writing to wtmp and lastlog fixed (bugzilla 3024) -- reading config file (parameter Protocol) fixed - -------------------------------------------------------------------- -Fri Jun 16 10:42:52 CEST 2000 - garloff@suse.de - -- Added generation of ssh_host_dsa_key - -------------------------------------------------------------------- -Tue Jun 13 08:32:19 MEST 2000 - nadvornik@suse.cz - -- update to 2.1.1p1 - -------------------------------------------------------------------- -Thu Jun 8 10:10:55 MEST 2000 - cihlar@suse.cz - -- uncommented %clean - -------------------------------------------------------------------- -Fri May 5 13:08:15 CEST 2000 - smid@suse.cz - -- buildroot added -- upgrade to 1.2.3 - -------------------------------------------------------------------- -Tue Mar 21 09:50:57 CET 2000 - kukuk@suse.de - -- Update to 1.2.2p1 - -------------------------------------------------------------------- -Mon Mar 6 12:03:49 CET 2000 - kukuk@suse.de - -- Fix the diff. - -------------------------------------------------------------------- -Sun Mar 5 18:22:07 CET 2000 - kukuk@suse.de - -- Add a README.SuSE with a short description how to use ssh-add - -------------------------------------------------------------------- -Tue Feb 29 21:03:50 CET 2000 - schwab@suse.de - -- Update config.{guess,sub}. - -------------------------------------------------------------------- -Fri Feb 25 11:01:24 CET 2000 - kukuk@suse.de - -- Fix need for build, add group tag. - -------------------------------------------------------------------- -Wed Feb 2 09:23:13 CET 2000 - kukuk@suse.de - -- Change new defaults back to old one - -------------------------------------------------------------------- -Sun Jan 30 12:51:49 CET 2000 - kukuk@suse.de - -- Add x11-ssh-askpass to filelist - -------------------------------------------------------------------- -Fri Jan 28 18:03:50 CET 2000 - kukuk@suse.de - -- Update to OpenSSH 1.2.2 -- Add x11-ssh-askpass-1.0 - -------------------------------------------------------------------- -Tue Jan 25 15:57:09 CET 2000 - kukuk@suse.de - -- Add reload and status to /sbin/init.d/sshd [Bug 1747] - -------------------------------------------------------------------- -Thu Jan 20 17:26:02 CET 2000 - kukuk@suse.de - -- Update to 1.2.1pre27 with IPv6 support - -------------------------------------------------------------------- -Fri Dec 31 21:18:10 CET 1999 - kukuk@suse.de - -- Initial version From 08f907251327eadd14cd29fb43da8d6899bed238ba40948eab32d2769729d1e0 Mon Sep 17 00:00:00 2001 From: Petr Cerny Date: Fri, 14 Feb 2014 14:54:10 +0000 Subject: [PATCH 9/9] Accepting request 222365 from home:pcerny:factory - Update of the underlying OpenSSH to 6.5p1 - Update to 6.5p1 Features since 6.4p1: * ssh(1), sshd(8): support for key exchange using ECDH in Daniel Bernstein's Curve25519; default when both the client and server support it. * ssh(1), sshd(8): support for Ed25519 as a public key type fo rboth server and client. Ed25519 is an EC signature offering better security than ECDSA and DSA and good performance. * Add a new private key format that uses a bcrypt KDF to better protect keys at rest. Used unconditionally for Ed25519 keys, on demand for other key types via the -o ssh-keygen(1) option. Intended to become default in the near future. Details documented in PROTOCOL.key. * ssh(1), sshd(8): new transport cipher "chacha20-poly1305@openssh.com" combining Daniel Bernstein's ChaCha20 stream cipher and Poly1305 MAC to build an authenticated encryption mode. Details documented PROTOCOL.chacha20poly1305. * ssh(1), sshd(8): refuse RSA keys from old proprietary clients and servers that use the obsolete RSA+MD5 signature scheme. It will still be possible to connect with these clients/servers but only DSA keys will be accepted, and OpenSSH will refuse connection entirely in a future release. * ssh(1), sshd(8): refuse old proprietary clients and servers that use a weaker key exchange hash calculation. * ssh(1): increase the size of the Diffie-Hellman groups requested for each symmetric key size. New values from NIST Special Publication 800-57 with the upper limit specified by OBS-URL: https://build.opensuse.org/request/show/222365 OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=63 --- openssh-6.4p1-forcepermissions.patch | 81 -------- openssh-6.4p1-saveargv-fix.patch | 46 ----- openssh-6.4p1.tar.gz | 3 - ...atch => openssh-6.5p1-X11-forwarding.patch | 16 +- ...h-6.5p1-audit1-remove_duplicit_audit.patch | 6 +- ...-audit2-better_audit_of_user_actions.patch | 100 +++++----- ... openssh-6.5p1-audit3-key_auth_usage.patch | 72 +++---- ... => openssh-6.5p1-audit4-kex_results.patch | 125 ++++++------ ...6.5p1-audit5-session_key_destruction.patch | 138 +++++++------- ...-6.5p1-audit6-server_key_destruction.patch | 107 +++++------ ...openssh-6.5p1-audit7-libaudit_compat.patch | 10 +- ...h-6.5p1-audit8-libaudit_dns_timeouts.patch | 6 +- ....patch => openssh-6.5p1-blocksigalrm.patch | 6 +- ...ch => openssh-6.5p1-default-protocol.patch | 6 +- ...nssh-6.5p1-disable-openssl-abi-check.patch | 6 +- ...4p1-eal3.patch => openssh-6.5p1-eal3.patch | 18 +- ...ch => openssh-6.5p1-fingerprint_hash.patch | 127 ++++++------ ...4p1-fips.patch => openssh-6.5p1-fips.patch | 80 ++++---- ...=> openssh-6.5p1-gssapi_key_exchange.patch | 180 +++++++++--------- ...tm.patch => openssh-6.5p1-gssapimitm.patch | 94 ++++----- ...nt.patch => openssh-6.5p1-host_ident.patch | 8 +- ...patch => openssh-6.5p1-key-converter.patch | 16 +- ...stlog.patch => openssh-6.5p1-lastlog.patch | 6 +- ...4p1-ldap.patch => openssh-6.5p1-ldap.patch | 120 ++++++------ ...patch => openssh-6.5p1-login_options.patch | 10 +- ...=> openssh-6.5p1-no_fork-no_pid_file.patch | 8 +- ...tch => openssh-6.5p1-pam-check-locks.patch | 44 ++--- ...fix2.patch => openssh-6.5p1-pam-fix2.patch | 14 +- ...fix3.patch => openssh-6.5p1-pam-fix3.patch | 8 +- ...6.4p1-pts.patch => openssh-6.5p1-pts.patch | 10 +- openssh-6.5p1-saveargv-fix.patch | 28 +++ ...rng.patch => openssh-6.5p1-seed-prng.patch | 108 +++++------ ...e.patch => openssh-6.5p1-send_locale.patch | 15 +- openssh-6.5p1-sftp_force_permissions.patch | 155 +++++++++++++++ ...tch => openssh-6.5p1-sftp_homechroot.patch | 90 ++++----- ...1-xauth.patch => openssh-6.5p1-xauth.patch | 8 +- ... => openssh-6.5p1-xauthlocalhostname.patch | 18 +- openssh-6.5p1.tar.gz | 3 + openssh-askpass-gnome.changes | 5 + openssh-askpass-gnome.spec | 2 +- openssh.changes | 95 +++++++++ openssh.spec | 171 +++++++++-------- sshd.init | 2 +- sshd.service | 2 +- 44 files changed, 1171 insertions(+), 1002 deletions(-) delete mode 100644 openssh-6.4p1-forcepermissions.patch delete mode 100644 openssh-6.4p1-saveargv-fix.patch delete mode 100644 openssh-6.4p1.tar.gz rename openssh-6.4p1-X11-forwarding.patch => openssh-6.5p1-X11-forwarding.patch (84%) rename openssh-6.4p1-audit1-remove_duplicit_audit.patch => openssh-6.5p1-audit1-remove_duplicit_audit.patch (89%) rename openssh-6.4p1-audit2-better_audit_of_user_actions.patch => openssh-6.5p1-audit2-better_audit_of_user_actions.patch (91%) rename openssh-6.4p1-audit3-key_auth_usage.patch => openssh-6.5p1-audit3-key_auth_usage.patch (90%) rename openssh-6.4p1-audit4-kex_results.patch => openssh-6.5p1-audit4-kex_results.patch (89%) rename openssh-6.4p1-audit5-session_key_destruction.patch => openssh-6.5p1-audit5-session_key_destruction.patch (89%) rename openssh-6.4p1-audit6-server_key_destruction.patch => openssh-6.5p1-audit6-server_key_destruction.patch (90%) rename openssh-6.4p1-audit7-libaudit_compat.patch => openssh-6.5p1-audit7-libaudit_compat.patch (92%) rename openssh-6.4p1-audit8-libaudit_dns_timeouts.patch => openssh-6.5p1-audit8-libaudit_dns_timeouts.patch (92%) rename openssh-6.4p1-blocksigalrm.patch => openssh-6.5p1-blocksigalrm.patch (95%) rename openssh-6.4p1-default-protocol.patch => openssh-6.5p1-default-protocol.patch (83%) rename openssh-6.4p1-disable-openssl-abi-check.patch => openssh-6.5p1-disable-openssl-abi-check.patch (89%) rename openssh-6.4p1-eal3.patch => openssh-6.5p1-eal3.patch (84%) rename openssh-6.4p1-fingerprint_hash.patch => openssh-6.5p1-fingerprint_hash.patch (87%) rename openssh-6.4p1-fips.patch => openssh-6.5p1-fips.patch (94%) rename openssh-6.4p1-gssapi_key_exchange.patch => openssh-6.5p1-gssapi_key_exchange.patch (96%) rename openssh-6.4p1-gssapimitm.patch => openssh-6.5p1-gssapimitm.patch (87%) rename openssh-6.4p1-host_ident.patch => openssh-6.5p1-host_ident.patch (82%) rename openssh-6.4p1-key-converter.patch => openssh-6.5p1-key-converter.patch (95%) rename openssh-6.4p1-lastlog.patch => openssh-6.5p1-lastlog.patch (82%) rename openssh-6.4p1-ldap.patch => openssh-6.5p1-ldap.patch (97%) rename openssh-6.4p1-login_options.patch => openssh-6.5p1-login_options.patch (80%) rename openssh-6.4p1-no_fork-no_pid_file.patch => openssh-6.5p1-no_fork-no_pid_file.patch (79%) rename openssh-6.4p1-pam-check-locks.patch => openssh-6.5p1-pam-check-locks.patch (87%) rename openssh-6.4p1-pam-fix2.patch => openssh-6.5p1-pam-fix2.patch (82%) rename openssh-6.4p1-pam-fix3.patch => openssh-6.5p1-pam-fix3.patch (77%) rename openssh-6.4p1-pts.patch => openssh-6.5p1-pts.patch (82%) create mode 100644 openssh-6.5p1-saveargv-fix.patch rename openssh-6.4p1-seed-prng.patch => openssh-6.5p1-seed-prng.patch (82%) rename openssh-6.4p1-send_locale.patch => openssh-6.5p1-send_locale.patch (80%) create mode 100644 openssh-6.5p1-sftp_force_permissions.patch rename openssh-6.4p1-sftp_homechroot.patch => openssh-6.5p1-sftp_homechroot.patch (84%) rename openssh-6.4p1-xauth.patch => openssh-6.5p1-xauth.patch (87%) rename openssh-6.4p1-xauthlocalhostname.patch => openssh-6.5p1-xauthlocalhostname.patch (86%) create mode 100644 openssh-6.5p1.tar.gz diff --git a/openssh-6.4p1-forcepermissions.patch b/openssh-6.4p1-forcepermissions.patch deleted file mode 100644 index 3c945ce..0000000 --- a/openssh-6.4p1-forcepermissions.patch +++ /dev/null @@ -1,81 +0,0 @@ -Index: openssh-6.4p1/sftp-server.8 -=================================================================== ---- openssh-6.4p1.orig/sftp-server.8 -+++ openssh-6.4p1/sftp-server.8 -@@ -35,6 +35,7 @@ - .Op Fl f Ar log_facility - .Op Fl l Ar log_level - .Op Fl u Ar umask -+.Op Fl m Ar force_file_permissions - .Sh DESCRIPTION - .Nm - is a program that speaks the server side of SFTP protocol -@@ -104,6 +105,10 @@ Sets an explicit - .Xr umask 2 - to be applied to newly-created files and directories, instead of the - user's default mask. -+.It Fl m Ar force_file_permissions -+Sets explicit file permissions to be applied to newly-created files instead -+of the default or client requested mode. Numeric values include: -+777, 755, 750, 666, 644, 640, etc. Option -u is ineffective if -m is set. - .El - .Pp - For logging to work, -Index: openssh-6.4p1/sftp-server.c -=================================================================== ---- openssh-6.4p1.orig/sftp-server.c -+++ openssh-6.4p1/sftp-server.c -@@ -73,6 +73,10 @@ u_int version; - /* Disable writes */ - int readonly; - -+/* Force file permissions */ -+int permforce = 0; -+long permforcemode; -+ - /* portable attributes, etc. */ - - typedef struct Stat Stat; -@@ -557,6 +561,10 @@ process_open(void) - a = get_attrib(); - flags = flags_from_portable(pflags); - mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; -+ if (permforce == 1) { -+ mode = permforcemode; -+ (void)umask(0); /* so umask does not interfere */ -+ } - logit("open \"%s\" flags %s mode 0%o", - name, string_from_portable(pflags), mode); - if (readonly && -@@ -1391,7 +1399,7 @@ sftp_server_usage(void) - - fprintf(stderr, - "usage: %s [-ehR] [-d start_directory] [-f log_facility] " -- "[-l log_level]\n\t[-u umask]\n", -+ "[-l log_level]\n\t[-u umask]\n[-m force_file_permissions]\n", - __progname); - exit(1); - } -@@ -1414,7 +1422,7 @@ sftp_server_main(int argc, char **argv, - - pw = pwcopy(user_pw); - -- while (!skipargs && (ch = getopt(argc, argv, "d:f:l:u:cehR")) != -1) { -+ while (!skipargs && (ch = getopt(argc, argv, "d:f:l:u:m:cehR")) != -1) { - switch (ch) { - case 'R': - readonly = 1; -@@ -1453,6 +1461,13 @@ sftp_server_main(int argc, char **argv, - fatal("Invalid umask \"%s\"", optarg); - (void)umask((mode_t)mask); - break; -+ case 'm': -+ permforce = 1; -+ permforcemode = strtol(optarg, &cp, 8); -+ if (permforcemode < 0 || permforcemode > 0777 || *cp != '\0' || -+ cp == optarg || (permforcemode == 0 && errno != 0)) -+ fatal("Invalid umask \"%s\"", optarg); -+ break; - case 'h': - default: - sftp_server_usage(); diff --git a/openssh-6.4p1-saveargv-fix.patch b/openssh-6.4p1-saveargv-fix.patch deleted file mode 100644 index 74fe962..0000000 --- a/openssh-6.4p1-saveargv-fix.patch +++ /dev/null @@ -1,46 +0,0 @@ -# related to bnc#49845, upstream bug #529 - -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c -@@ -309,16 +309,17 @@ sighup_handler(int sig) - - /* - * Called from the main program after receiving SIGHUP. - * Restarts the server. - */ - static void - sighup_restart(void) - { -+ int i; - logit("Received SIGHUP; restarting."); - close_listen_socks(); - close_startup_pipes(); - alarm(0); /* alarm timer persists across exec */ - signal(SIGHUP, SIG_IGN); /* will be restored after exec */ - execv(saved_argv[0], saved_argv); - logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], - strerror(errno)); -@@ -1382,17 +1383,21 @@ main(int ac, char **av) - saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); - for (i = 0; i < ac; i++) - saved_argv[i] = xstrdup(av[i]); - saved_argv[i] = NULL; - - #ifndef HAVE_SETPROCTITLE - /* Prepare for later setproctitle emulation */ - compat_init_setproctitle(ac, av); -- av = saved_argv; -+ -+ av = xmalloc(sizeof(*saved_argv) * (saved_argc + 1)); -+ for (i = 0; i < saved_argc; i++) -+ av[i] = xstrdup(saved_argv[i]); -+ av[i] = NULL; - #endif - - if (geteuid() == 0 && setgroups(0, NULL) == -1) - debug("setgroups(): %.200s", strerror(errno)); - - /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ - sanitise_stdfd(); - diff --git a/openssh-6.4p1.tar.gz b/openssh-6.4p1.tar.gz deleted file mode 100644 index cd356bb..0000000 --- a/openssh-6.4p1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5530f616513b14aea3662c4c373bafd6a97a269938674c006377e381f68975d2 -size 1201402 diff --git a/openssh-6.4p1-X11-forwarding.patch b/openssh-6.5p1-X11-forwarding.patch similarity index 84% rename from openssh-6.4p1-X11-forwarding.patch rename to openssh-6.5p1-X11-forwarding.patch index f2914fa..8be22fa 100644 --- a/openssh-6.4p1-X11-forwarding.patch +++ b/openssh-6.5p1-X11-forwarding.patch @@ -2,9 +2,9 @@ # configuration # bnc#50836 (was suse #35836) -diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config ---- a/openssh-6.4p1/ssh_config -+++ b/openssh-6.4p1/ssh_config +diff --git a/openssh-6.5p1/ssh_config b/openssh-6.5p1/ssh_config +--- a/openssh-6.5p1/ssh_config ++++ b/openssh-6.5p1/ssh_config @@ -12,19 +12,30 @@ # Any configuration value is only changed the first time it is set. # Thus, host-specific definitions should be at the beginning of the @@ -37,10 +37,10 @@ diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config # GSSAPIDelegateCredentials no # BatchMode no # CheckHostIP yes -diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config ---- a/openssh-6.4p1/sshd_config -+++ b/openssh-6.4p1/sshd_config -@@ -93,17 +93,17 @@ AuthorizedKeysFile .ssh/authorized_keys +diff --git a/openssh-6.5p1/sshd_config b/openssh-6.5p1/sshd_config +--- a/openssh-6.5p1/sshd_config ++++ b/openssh-6.5p1/sshd_config +@@ -94,17 +94,17 @@ AuthorizedKeysFile .ssh/authorized_keys # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. @@ -53,9 +53,9 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes + #PermitTTY yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no UsePrivilegeSeparation sandbox # Default for new installations. - #PermitUserEnvironment no diff --git a/openssh-6.4p1-audit1-remove_duplicit_audit.patch b/openssh-6.5p1-audit1-remove_duplicit_audit.patch similarity index 89% rename from openssh-6.4p1-audit1-remove_duplicit_audit.patch rename to openssh-6.5p1-audit1-remove_duplicit_audit.patch index 891a91b..dc5b49f 100644 --- a/openssh-6.4p1-audit1-remove_duplicit_audit.patch +++ b/openssh-6.5p1-audit1-remove_duplicit_audit.patch @@ -8,9 +8,9 @@ # # PRIVSEP(getpwnamallow()) a few lines above already did this. -diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c ---- a/openssh-6.4p1/auth2.c -+++ b/openssh-6.4p1/auth2.c +diff --git a/openssh-6.5p1/auth2.c b/openssh-6.5p1/auth2.c +--- a/openssh-6.5p1/auth2.c ++++ b/openssh-6.5p1/auth2.c @@ -242,19 +242,16 @@ input_userauth_request(int type, u_int32 authctxt->pw = PRIVSEP(getpwnamallow(user)); authctxt->user = xstrdup(user); diff --git a/openssh-6.4p1-audit2-better_audit_of_user_actions.patch b/openssh-6.5p1-audit2-better_audit_of_user_actions.patch similarity index 91% rename from openssh-6.4p1-audit2-better_audit_of_user_actions.patch rename to openssh-6.5p1-audit2-better_audit_of_user_actions.patch index d95521e..43f3a9b 100644 --- a/openssh-6.4p1-audit2-better_audit_of_user_actions.patch +++ b/openssh-6.5p1-audit2-better_audit_of_user_actions.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2011 # by jchadima@redhat.com -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -370,20 +370,33 @@ audit_connection_from(const char *host, /* this is used on IPv4-only machines */ tid->port = (dev_t)port; @@ -42,9 +42,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c /* not implemented */ } -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -30,97 +30,210 @@ #include "includes.h" #if defined(USE_LINUX_AUDIT) @@ -276,9 +276,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c } #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -135,16 +135,27 @@ audit_connection_from(const char *host, void audit_event(ssh_audit_event_t event) @@ -344,9 +344,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c + # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -44,14 +44,16 @@ enum ssh_audit_event_type { SSH_CONNECTION_CLOSE, /* closed after attempting auth or session */ SSH_CONNECTION_ABANDON, /* closed without completing auth */ @@ -365,9 +365,9 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ssh_audit_event_t audit_classify_auth(const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -181,16 +181,17 @@ int mm_answer_gss_setup_ctx(int, Buffer int mm_answer_gss_accept_ctx(int, Buffer *); int mm_answer_gss_userok(int, Buffer *); @@ -500,9 +500,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c void monitor_apply_keystate(struct monitor *pmonitor) { -diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h ---- a/openssh-6.4p1/monitor.h -+++ b/openssh-6.4p1/monitor.h +diff --git a/openssh-6.5p1/monitor.h b/openssh-6.5p1/monitor.h +--- a/openssh-6.5p1/monitor.h ++++ b/openssh-6.5p1/monitor.h @@ -64,16 +64,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_START = 100, @@ -521,9 +521,9 @@ diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -1186,27 +1186,48 @@ mm_audit_event(ssh_audit_event_t event) buffer_init(&m); @@ -574,9 +574,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID goid) { -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -69,17 +69,18 @@ void *mm_sshpam_init_ctx(struct Authctxt int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); int mm_sshpam_respond(void *, u_int, char **); @@ -597,9 +597,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c @@ -740,16 +740,24 @@ do_exec_pty(Session *s, const char *comm cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); #endif @@ -625,13 +625,13 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c session_set_fds(s, ptyfd, fdout, -1, 1, 1); } else { server_loop(pid, ptyfd, fdout, -1); -@@ -811,25 +819,29 @@ do_exec(Session *s, const char *command) - s->is_subsystem = s->is_subsystem ? - SUBSYSTEM_INT_SFTP : SUBSYSTEM_INT_SFTP_ERROR; - } else if (s->is_subsystem) - s->is_subsystem = SUBSYSTEM_EXT; - debug("Forced command (key option) '%.900s'", command); - } +@@ -834,25 +842,29 @@ do_exec(Session *s, const char *command) + session_type, + tty == NULL ? "" : " on ", + tty == NULL ? "" : tty, + s->pw->pw_name, + get_remote_ipaddr(), + get_remote_port()); #ifdef SSH_AUDIT_EVENTS + if (s->command != NULL || s->command_handle != -1) @@ -657,7 +657,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c original_command = NULL; -@@ -1875,16 +1887,17 @@ session_unused(int id) +@@ -1903,16 +1915,17 @@ session_unused(int id) bzero(&sessions[id], sizeof(*sessions)); sessions[id].self = id; sessions[id].used = 0; @@ -675,7 +675,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c session_new(void) { Session *s, *tmp; -@@ -1957,16 +1970,29 @@ session_open(Authctxt *authctxt, int cha +@@ -1985,16 +1998,29 @@ session_open(Authctxt *authctxt, int cha if (s->pw == NULL || !authctxt->valid) fatal("no user for session %d", s->self); debug("session_open: session %d: link with channel %d", s->self, chanid); @@ -705,7 +705,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c if (s->used && s->ttyfd != -1 && strcmp(s->tty, tty) == 0) { debug("session_by_tty: session %d tty %s", i, tty); return s; -@@ -2473,16 +2499,40 @@ session_exit_message(Session *s, int sta +@@ -2501,16 +2527,40 @@ session_exit_message(Session *s, int sta * interested in data we write. * Note that we must not call 'chan_read_failed', since there could * be some more data waiting in the pipe. @@ -746,7 +746,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c debug("session_close: session %d pid %ld", s->self, (long)s->pid); -@@ -2513,16 +2563,20 @@ session_close(Session *s) +@@ -2541,16 +2591,20 @@ session_close(Session *s) int status; waitpid(pid, &status, 0); @@ -765,9 +765,9 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c free(s->auth_display); free(s->auth_data); free(s->auth_proto); + free(s->subsys); if (s->env != NULL) { - for (i = 0; i < s->num_env; i++) { -@@ -2726,16 +2780,25 @@ session_setup_x11fwd(Session *s) +@@ -2755,16 +2809,25 @@ session_setup_x11fwd(Session *s) } static void @@ -793,7 +793,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c debug("do_cleanup"); /* no cleanup if we're in the child for login shell */ -@@ -2774,10 +2837,10 @@ do_cleanup(Authctxt *authctxt) +@@ -2803,10 +2866,10 @@ do_cleanup(Authctxt *authctxt) /* remove agent socket */ auth_sock_cleanup_proc(authctxt->pw); @@ -805,13 +805,13 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c - session_destroy_all(session_pty_cleanup2); + session_destroy_all(do_cleanup_one_session); } -diff --git a/openssh-6.4p1/session.h b/openssh-6.4p1/session.h ---- a/openssh-6.4p1/session.h -+++ b/openssh-6.4p1/session.h -@@ -55,29 +55,37 @@ struct Session { - int chanid; +diff --git a/openssh-6.5p1/session.h b/openssh-6.5p1/session.h +--- a/openssh-6.5p1/session.h ++++ b/openssh-6.5p1/session.h +@@ -56,29 +56,37 @@ struct Session { int *x11_chanids; int is_subsystem; + char *subsys; u_int num_env; struct { char *name; @@ -846,10 +846,10 @@ diff --git a/openssh-6.4p1/session.h b/openssh-6.4p1/session.h const char *value); #endif -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c -@@ -2487,13 +2487,14 @@ cleanup_exit(int i) +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c +@@ -2504,13 +2504,14 @@ cleanup_exit(int i) if (kill(pmonitor->m_pid, SIGKILL) != 0 && errno != ESRCH) error("%s: kill(%d): %s", __func__, diff --git a/openssh-6.4p1-audit3-key_auth_usage.patch b/openssh-6.5p1-audit3-key_auth_usage.patch similarity index 90% rename from openssh-6.4p1-audit3-key_auth_usage.patch rename to openssh-6.5p1-audit3-key_auth_usage.patch index 0b04782..ce84f93 100644 --- a/openssh-6.4p1-audit3-key_auth_usage.patch +++ b/openssh-6.5p1-audit3-key_auth_usage.patch @@ -5,9 +5,9 @@ # (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1975) # by jchadima@redhat.com -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -401,16 +401,22 @@ audit_session_open(struct logininfo *li) } @@ -31,9 +31,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c const char *user = the_authctxt ? the_authctxt->user : "(unknown user)"; if (cannot_audit(0)) -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -36,16 +36,18 @@ #include "log.h" #include "audit.h" @@ -101,9 +101,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c audit_connection_from(const char *host, int port) { /* not implemented */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -31,16 +31,17 @@ #ifdef SSH_AUDIT_EVENTS @@ -178,9 +178,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -23,16 +23,17 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -212,9 +212,9 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +void audit_key(int, int *, const Key *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c ---- a/openssh-6.4p1/auth-rsa.c -+++ b/openssh-6.4p1/auth-rsa.c +diff --git a/openssh-6.5p1/auth-rsa.c b/openssh-6.5p1/auth-rsa.c +--- a/openssh-6.5p1/auth-rsa.c ++++ b/openssh-6.5p1/auth-rsa.c @@ -87,17 +87,20 @@ auth_rsa_generate_challenge(Key *key) return challenge; } @@ -271,9 +271,9 @@ diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c * our challenge; returns zero if the client gives a wrong answer. */ -diff --git a/openssh-6.4p1/auth.h b/openssh-6.4p1/auth.h ---- a/openssh-6.4p1/auth.h -+++ b/openssh-6.4p1/auth.h +diff --git a/openssh-6.5p1/auth.h b/openssh-6.5p1/auth.h +--- a/openssh-6.5p1/auth.h ++++ b/openssh-6.5p1/auth.h @@ -182,16 +182,17 @@ int allowed_user(struct passwd *); struct passwd * getpwnamallow(const char *user); @@ -310,10 +310,10 @@ diff --git a/openssh-6.4p1/auth.h b/openssh-6.4p1/auth.h struct passwd *fakepw(void); -diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c ---- a/openssh-6.4p1/auth2-hostbased.c -+++ b/openssh-6.4p1/auth2-hostbased.c -@@ -118,33 +118,45 @@ userauth_hostbased(Authctxt *authctxt) +diff --git a/openssh-6.5p1/auth2-hostbased.c b/openssh-6.5p1/auth2-hostbased.c +--- a/openssh-6.5p1/auth2-hostbased.c ++++ b/openssh-6.5p1/auth2-hostbased.c +@@ -124,33 +124,45 @@ userauth_hostbased(Authctxt *authctxt) #endif pubkey_auth_info(authctxt, key, @@ -360,10 +360,10 @@ diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c const char *resolvedname, *ipaddr, *lookup, *reason; HostStatus host_status; int len; -diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c ---- a/openssh-6.4p1/auth2-pubkey.c -+++ b/openssh-6.4p1/auth2-pubkey.c -@@ -147,17 +147,17 @@ userauth_pubkey(Authctxt *authctxt) +diff --git a/openssh-6.5p1/auth2-pubkey.c b/openssh-6.5p1/auth2-pubkey.c +--- a/openssh-6.5p1/auth2-pubkey.c ++++ b/openssh-6.5p1/auth2-pubkey.c +@@ -153,17 +153,17 @@ userauth_pubkey(Authctxt *authctxt) #ifdef DEBUG_PK buffer_dump(&b); #endif @@ -382,7 +382,7 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c debug("test whether pkalg/pkblob are acceptable"); packet_check_eom(); -@@ -184,16 +184,28 @@ done: +@@ -190,16 +190,28 @@ done: debug2("userauth_pubkey: authenticated %d pkalg %s", authenticated, pkalg); if (key != NULL) key_free(key); @@ -411,9 +411,9 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c int i; extra = NULL; -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -1362,26 +1362,30 @@ monitor_valid_hostbasedblob(u_char *data } @@ -474,9 +474,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c free(signature); free(data); -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -428,30 +428,31 @@ mm_key_allowed(enum mm_keytype type, cha /* @@ -540,9 +540,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c u_int len; Newkeys *newkey = NULL; Enc *enc; -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -44,17 +44,18 @@ int mm_key_sign(Key *, u_char **, u_int void mm_inform_authserv(char *, char *); struct passwd *mm_getpwnamallow(const char *); diff --git a/openssh-6.4p1-audit4-kex_results.patch b/openssh-6.5p1-audit4-kex_results.patch similarity index 89% rename from openssh-6.4p1-audit4-kex_results.patch rename to openssh-6.5p1-audit4-kex_results.patch index bb3adcd..e54b128 100644 --- a/openssh-6.4p1-audit4-kex_results.patch +++ b/openssh-6.5p1-audit4-kex_results.patch @@ -5,20 +5,21 @@ # (replaces: https://bugzilla.mindrot.org/attachment.cgi?id=1976) # by jchadima@redhat.com -diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in ---- a/openssh-6.4p1/Makefile.in -+++ b/openssh-6.4p1/Makefile.in -@@ -68,17 +68,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o - cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ - compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ - log.o match.o md-sha256.o moduli.o nchan.o packet.o \ +diff --git a/openssh-6.5p1/Makefile.in b/openssh-6.5p1/Makefile.in +--- a/openssh-6.5p1/Makefile.in ++++ b/openssh-6.5p1/Makefile.in +@@ -71,17 +71,18 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ -- jpake.o schnorr.o ssh-pkcs11.o krl.o -+ jpake.o schnorr.o ssh-pkcs11.o krl.o auditstub.o + jpake.o schnorr.o ssh-pkcs11.o krl.o smult_curve25519_ref.o \ + kexc25519.o kexc25519c.o poly1305.o chacha.o cipher-chachapoly.o \ + ssh-ed25519.o digest.o \ +- sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o blocks.o ++ sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o blocks.o \ ++ auditstub.o SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ sshconnect.o sshconnect1.o sshconnect2.o mux.o \ @@ -27,9 +28,9 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ audit.o audit-bsm.o audit-linux.o platform.o \ sshpty.o sshlogin.o servconf.o serverloop.o \ -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -468,9 +468,21 @@ audit_event(ssh_audit_event_t event) case SSH_AUTH_FAIL_KBDINT: bsm_audit_bad_login("interactive password entry"); @@ -52,9 +53,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -35,16 +35,18 @@ #include "log.h" @@ -140,9 +141,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +} + #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -23,24 +23,27 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -232,9 +233,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -53,10 +53,14 @@ void audit_event(ssh_audit_event_t); void audit_count_session_open(void); void audit_session_open(struct logininfo *); @@ -250,10 +251,10 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +void audit_kex_body(int, char *, char *, char *, pid_t, uid_t); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/auditstub.c b/openssh-6.4p1/auditstub.c +diff --git a/openssh-6.5p1/auditstub.c b/openssh-6.5p1/auditstub.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/auditstub.c ++++ b/openssh-6.5p1/auditstub.c @@ -0,0 +1,39 @@ +/* $Id: auditstub.c,v 1.1 jfch Exp $ */ + @@ -294,10 +295,10 @@ new file mode 100644 +{ +} + -diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c ---- a/openssh-6.4p1/cipher.c -+++ b/openssh-6.4p1/cipher.c -@@ -50,29 +50,17 @@ +diff --git a/openssh-6.5p1/cipher.c b/openssh-6.5p1/cipher.c +--- a/openssh-6.5p1/cipher.c ++++ b/openssh-6.5p1/cipher.c +@@ -52,31 +52,17 @@ /* compatibility with old or broken OpenSSL versions */ #include "openbsd-compat/openssl-compat.h" @@ -314,7 +315,9 @@ diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c - u_int iv_len; /* defaults to block_size */ - u_int auth_len; - u_int discard_len; -- u_int cbc_mode; +- u_int flags; +-#define CFLAG_CBC (1<<0) +-#define CFLAG_CHACHAPOLY (1<<1) - const EVP_CIPHER *(*evptype)(void); -}; - @@ -328,10 +331,10 @@ diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc }, { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc }, -diff --git a/openssh-6.4p1/cipher.h b/openssh-6.4p1/cipher.h ---- a/openssh-6.4p1/cipher.h -+++ b/openssh-6.4p1/cipher.h -@@ -56,17 +56,28 @@ +diff --git a/openssh-6.5p1/cipher.h b/openssh-6.5p1/cipher.h +--- a/openssh-6.5p1/cipher.h ++++ b/openssh-6.5p1/cipher.h +@@ -58,17 +58,30 @@ #define SSH_CIPHER_MAX 31 #define CIPHER_ENCRYPT 1 @@ -349,7 +352,9 @@ diff --git a/openssh-6.4p1/cipher.h b/openssh-6.4p1/cipher.h + u_int iv_len; /* defaults to block_size */ + u_int auth_len; + u_int discard_len; -+ u_int cbc_mode; ++ u_int flags; ++#define CFLAG_CBC (1<<0) ++#define CFLAG_CHACHAPOLY (1<<1) + const EVP_CIPHER *(*evptype)(void); +}; + @@ -357,15 +362,14 @@ diff --git a/openssh-6.4p1/cipher.h b/openssh-6.4p1/cipher.h int plaintext; int encrypt; EVP_CIPHER_CTX evp; + struct chachapoly_ctx cp_ctx; /* XXX union with evp? */ const Cipher *cipher; }; - u_int cipher_mask_ssh1(int); -diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c ---- a/openssh-6.4p1/kex.c -+++ b/openssh-6.4p1/kex.c -@@ -44,16 +44,17 @@ - #include "key.h" +diff --git a/openssh-6.5p1/kex.c b/openssh-6.5p1/kex.c +--- a/openssh-6.5p1/kex.c ++++ b/openssh-6.5p1/kex.c +@@ -45,16 +45,17 @@ #include "kex.h" #include "log.h" #include "mac.h" @@ -373,6 +377,7 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c #include "dispatch.h" #include "monitor.h" #include "roaming.h" + #include "digest.h" +#include "audit.h" #if OPENSSL_VERSION_NUMBER >= 0x00907000L @@ -382,7 +387,7 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c extern const EVP_MD *evp_ssh_sha256(void); # endif #endif -@@ -336,53 +337,65 @@ kex_kexinit_finish(Kex *kex) +@@ -346,53 +347,65 @@ kex_kexinit_finish(Kex *kex) fatal("Unsupported key exchange %d", kex->kex_type); } } @@ -451,7 +456,7 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c comp->type = COMP_NONE; } else { fatal("unsupported comp %s", name); -@@ -487,16 +500,19 @@ kex_choose_conf(Kex *kex) +@@ -497,16 +510,19 @@ kex_choose_conf(Kex *kex) if (authlen == 0) choose_mac(&newkeys->mac, cprop[nmac], sprop[nmac]); choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); @@ -467,13 +472,13 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c choose_kex(kex, cprop[PROPOSAL_KEX_ALGS], sprop[PROPOSAL_KEX_ALGS]); choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS], sprop[PROPOSAL_SERVER_HOST_KEY_ALGS]); - need = 0; + need = dh_need = 0; for (mode = 0; mode < MODE_MAX; mode++) { newkeys = kex->newkeys[mode]; - if (need < newkeys->enc.key_len) -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c + need = MAX(need, newkeys->enc.key_len); +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -93,16 +93,17 @@ #include "monitor_wrap.h" #include "monitor_fdpass.h" @@ -582,7 +587,7 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -2410,8 +2421,52 @@ mm_answer_jpake_check_confirm(int sock, +@@ -2411,8 +2422,52 @@ mm_answer_jpake_check_confirm(int sock, monitor_permit(mon_dispatch, MONITOR_REQ_JPAKE_STEP1, 1); @@ -635,9 +640,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c +} + +#endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h ---- a/openssh-6.4p1/monitor.h -+++ b/openssh-6.4p1/monitor.h +diff --git a/openssh-6.5p1/monitor.h b/openssh-6.5p1/monitor.h +--- a/openssh-6.5p1/monitor.h ++++ b/openssh-6.5p1/monitor.h @@ -65,16 +65,18 @@ enum monitor_reqtype { MONITOR_REQ_PAM_START = 100, MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, @@ -657,9 +662,9 @@ diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -1483,8 +1483,46 @@ mm_jpake_check_confirm(const BIGNUM *k, success = buffer_get_int(&m); @@ -707,9 +712,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c + buffer_free(&m); +} +#endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -72,16 +72,18 @@ int mm_sshpam_respond(void *, u_int, cha void mm_sshpam_free_ctx(void *); #endif @@ -729,9 +734,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c @@ -114,16 +114,17 @@ #include "session.h" #include "monitor_mm.h" @@ -750,7 +755,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c #include int allow_severity; int deny_severity; -@@ -2297,16 +2298,20 @@ do_ssh1_kex(void) +@@ -2312,16 +2313,20 @@ do_ssh1_kex(void) packet_disconnect("Warning: client selects unsupported cipher."); /* Get check bytes from the packet. These must match those we diff --git a/openssh-6.4p1-audit5-session_key_destruction.patch b/openssh-6.5p1-audit5-session_key_destruction.patch similarity index 89% rename from openssh-6.4p1-audit5-session_key_destruction.patch rename to openssh-6.5p1-audit5-session_key_destruction.patch index e8eb05a..e68dd56 100644 --- a/openssh-6.4p1-audit5-session_key_destruction.patch +++ b/openssh-6.5p1-audit5-session_key_destruction.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2014 # by jchadima@redhat.com -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -480,9 +480,15 @@ audit_unsupported_body(int what) /* not implemented */ } @@ -23,9 +23,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -289,24 +289,25 @@ audit_unsupported_body(int what) /* no problem, the next instruction will be fatal() */ return; @@ -91,9 +91,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c +} + #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -138,16 +138,22 @@ audit_unsupported(int what) } @@ -138,9 +138,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -57,10 +57,12 @@ int audit_run_command(const char *); void audit_end_command(int, const char *); ssh_audit_event_t audit_classify_auth(const char *); @@ -154,9 +154,9 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +void audit_session_key_free_body(int ctos, pid_t, uid_t); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/auditstub.c b/openssh-6.4p1/auditstub.c ---- a/openssh-6.4p1/auditstub.c -+++ b/openssh-6.4p1/auditstub.c +diff --git a/openssh-6.5p1/auditstub.c b/openssh-6.5p1/auditstub.c +--- a/openssh-6.5p1/auditstub.c ++++ b/openssh-6.5p1/auditstub.c @@ -22,18 +22,29 @@ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT @@ -187,10 +187,10 @@ diff --git a/openssh-6.4p1/auditstub.c b/openssh-6.4p1/auditstub.c +audit_session_key_free_body(int ctos, pid_t pid, uid_t uid) +{ +} -diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c ---- a/openssh-6.4p1/kex.c -+++ b/openssh-6.4p1/kex.c -@@ -667,8 +667,39 @@ dump_digest(char *msg, u_char *digest, i +diff --git a/openssh-6.5p1/kex.c b/openssh-6.5p1/kex.c +--- a/openssh-6.5p1/kex.c ++++ b/openssh-6.5p1/kex.c +@@ -698,8 +698,39 @@ dump_digest(char *msg, u_char *digest, i if (i%32 == 31) fprintf(stderr, "\n"); else if (i%8 == 7) @@ -230,17 +230,17 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c + memset(&newkeys->comp, 0, sizeof(newkeys->comp)); +} + -diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h ---- a/openssh-6.4p1/kex.h -+++ b/openssh-6.4p1/kex.h -@@ -157,16 +157,18 @@ Newkeys *kex_get_newkeys(int); - - void kexdh_client(Kex *); +diff --git a/openssh-6.5p1/kex.h b/openssh-6.5p1/kex.h +--- a/openssh-6.5p1/kex.h ++++ b/openssh-6.5p1/kex.h +@@ -163,16 +163,18 @@ void kexdh_client(Kex *); void kexdh_server(Kex *); void kexgex_client(Kex *); void kexgex_server(Kex *); void kexecdh_client(Kex *); void kexecdh_server(Kex *); + void kexc25519_client(Kex *); + void kexc25519_server(Kex *); +void newkeys_destroy(Newkeys *newkeys); + @@ -248,13 +248,13 @@ diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); void - kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, + kexgex_hash(int, char *, char *, char *, int, char *, int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); #ifdef OPENSSL_HAS_ECC -diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c ---- a/openssh-6.4p1/mac.c -+++ b/openssh-6.4p1/mac.c +diff --git a/openssh-6.5p1/mac.c b/openssh-6.5p1/mac.c +--- a/openssh-6.5p1/mac.c ++++ b/openssh-6.5p1/mac.c @@ -219,16 +219,30 @@ mac_clear(Mac *mac) if (mac->umac_ctx != NULL) umac128_delete(mac->umac_ctx); @@ -286,22 +286,22 @@ diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c char *maclist, *cp, *p; if (names == NULL || strcmp(names, "") == 0) -diff --git a/openssh-6.4p1/mac.h b/openssh-6.4p1/mac.h ---- a/openssh-6.4p1/mac.h -+++ b/openssh-6.4p1/mac.h +diff --git a/openssh-6.5p1/mac.h b/openssh-6.5p1/mac.h +--- a/openssh-6.5p1/mac.h ++++ b/openssh-6.5p1/mac.h @@ -24,8 +24,9 @@ */ int mac_valid(const char *); - char *mac_alg_list(void); + char *mac_alg_list(char); int mac_setup(Mac *, char *); int mac_init(Mac *); u_char *mac_compute(Mac *, u_int32_t, u_char *, int); void mac_clear(Mac *); +void mac_destroy(Mac *); -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -185,16 +185,17 @@ int mm_answer_gss_checkmic(int, Buffer * #endif @@ -389,7 +389,7 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c /* Specifies if a certain message is allowed at the moment */ -@@ -1970,21 +1975,23 @@ mm_get_keystate(struct monitor *pmonitor +@@ -1971,21 +1976,23 @@ mm_get_keystate(struct monitor *pmonitor goto skip; } else { /* Get the Kex for rekeying */ @@ -413,7 +413,7 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c packets = buffer_get_int(&m); bytes = buffer_get_int64(&m); packet_set_state(MODE_OUT, seqnr, blocks, packets, bytes); -@@ -2020,16 +2027,31 @@ mm_get_keystate(struct monitor *pmonitor +@@ -2021,16 +2028,31 @@ mm_get_keystate(struct monitor *pmonitor /* Roaming */ if (compat20) { @@ -445,7 +445,7 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) { size_t len = (size_t) size * ncount; -@@ -2464,9 +2486,27 @@ mm_answer_audit_kex_body(int sock, Buffe +@@ -2465,9 +2487,27 @@ mm_answer_audit_kex_body(int sock, Buffe free(mac); free(compress); buffer_clear(m); @@ -473,9 +473,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c + return 0; +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h ---- a/openssh-6.4p1/monitor.h -+++ b/openssh-6.4p1/monitor.h +diff --git a/openssh-6.5p1/monitor.h b/openssh-6.5p1/monitor.h +--- a/openssh-6.5p1/monitor.h ++++ b/openssh-6.5p1/monitor.h @@ -67,16 +67,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_INIT_CTX = 104, MONITOR_ANS_PAM_INIT_CTX = 105, MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, @@ -494,9 +494,9 @@ diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -651,22 +651,24 @@ mm_send_keystate(struct monitor *monitor __func__, packet_get_newkeys(MODE_OUT), packet_get_newkeys(MODE_IN)); @@ -547,9 +547,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c + buffer_free(&m); +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -74,16 +74,17 @@ void mm_sshpam_free_ctx(void *); #ifdef SSH_AUDIT_EVENTS @@ -568,9 +568,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c ---- a/openssh-6.4p1/packet.c -+++ b/openssh-6.4p1/packet.c +diff --git a/openssh-6.5p1/packet.c b/openssh-6.5p1/packet.c +--- a/openssh-6.5p1/packet.c ++++ b/openssh-6.5p1/packet.c @@ -56,16 +56,17 @@ #include #include @@ -650,7 +650,7 @@ diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c packet_set_protocol_flags(u_int protocol_flags) { active_state->remote_protocol_flags = protocol_flags; -@@ -728,16 +739,35 @@ packet_send1(void) +@@ -729,16 +740,35 @@ packet_send1(void) /* * Note that the packet is now only buffered in output. It won't be @@ -686,7 +686,7 @@ diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c Comp *comp; CipherContext *cc; u_int64_t *max_blocks; -@@ -753,31 +783,19 @@ set_newkeys(int mode) +@@ -754,31 +784,19 @@ set_newkeys(int mode) } else { cc = &active_state->receive_context; crypt_type = CIPHER_DECRYPT; @@ -720,7 +720,7 @@ diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c mac = &active_state->newkeys[mode]->mac; comp = &active_state->newkeys[mode]->comp; if (cipher_authlen(enc->cipher) == 0 && mac_init(mac) == 0) -@@ -1995,54 +2013,93 @@ packet_get_output(void) +@@ -2004,54 +2022,93 @@ packet_get_output(void) } void * @@ -823,9 +823,9 @@ diff --git a/openssh-6.4p1/packet.c b/openssh-6.4p1/packet.c + backup_state = NULL; } + -diff --git a/openssh-6.4p1/packet.h b/openssh-6.4p1/packet.h ---- a/openssh-6.4p1/packet.h -+++ b/openssh-6.4p1/packet.h +diff --git a/openssh-6.5p1/packet.h b/openssh-6.5p1/packet.h +--- a/openssh-6.5p1/packet.h ++++ b/openssh-6.5p1/packet.h @@ -119,9 +119,10 @@ void packet_set_rekey_limits(u_int32_t, time_t packet_get_rekey_timeout(void); @@ -837,10 +837,10 @@ diff --git a/openssh-6.4p1/packet.h b/openssh-6.4p1/packet.h +void packet_destroy_all(int, int); #endif /* PACKET_H */ -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c -@@ -1661,16 +1661,19 @@ do_child(Session *s, const char *command +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c +@@ -1689,16 +1689,19 @@ do_child(Session *s, const char *command int env_size; char *argv[ARGV_MAX]; const char *shell, *shell0, *hostname = NULL; @@ -860,10 +860,10 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c do_pwchange(s); exit(1); } -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c -@@ -703,16 +703,18 @@ privsep_preauth(Authctxt *authctxt) +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c +@@ -711,16 +711,18 @@ privsep_preauth(Authctxt *authctxt) setproctitle("%s", "[net]"); if (box != NULL) ssh_sandbox_child(box); @@ -882,7 +882,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c #ifdef DISABLE_FD_PASSING if (1) { #else -@@ -727,16 +729,20 @@ privsep_postauth(Authctxt *authctxt) +@@ -735,16 +737,20 @@ privsep_postauth(Authctxt *authctxt) monitor_reinit(pmonitor); pmonitor->m_pid = fork(); @@ -903,7 +903,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c /* child */ -@@ -2089,16 +2095,17 @@ main(int ac, char **av) +@@ -2104,16 +2110,17 @@ main(int ac, char **av) do_authentication(authctxt); } /* @@ -921,7 +921,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c * Cancel the alarm we set to limit the time taken for * authentication. */ -@@ -2141,16 +2148,18 @@ main(int ac, char **av) +@@ -2156,16 +2163,18 @@ main(int ac, char **av) packet_set_timeout(options.client_alive_interval, options.client_alive_count_max); @@ -940,7 +940,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c verbose("Closing connection to %.500s port %d", remote_ip, remote_port); #ifdef USE_PAM -@@ -2480,26 +2489,38 @@ do_ssh2_kex(void) +@@ -2497,26 +2506,38 @@ do_ssh2_kex(void) #endif debug("KEX done"); } diff --git a/openssh-6.4p1-audit6-server_key_destruction.patch b/openssh-6.5p1-audit6-server_key_destruction.patch similarity index 90% rename from openssh-6.4p1-audit6-server_key_destruction.patch rename to openssh-6.5p1-audit6-server_key_destruction.patch index 09d9742..d6e520c 100644 --- a/openssh-6.4p1-audit6-server_key_destruction.patch +++ b/openssh-6.5p1-audit6-server_key_destruction.patch @@ -4,9 +4,9 @@ # https://bugzilla.mindrot.org/attachment.cgi?id=2015 # by jchadima@redhat.com -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -486,9 +486,27 @@ audit_kex_body(int ctos, char *enc, char /* not implemented */ } @@ -35,9 +35,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -351,9 +351,55 @@ audit_session_key_free_body(int ctos, pi audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, buf, NULL, get_remote_ipaddr(), NULL, 1); @@ -94,9 +94,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c + error("cannot write into audit"); +} #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -285,10 +285,29 @@ audit_kex_body(int ctos, char *enc, char * This will be called on succesfull session key discard */ @@ -127,9 +127,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -43,26 +43,30 @@ enum ssh_audit_event_type { SSH_INVALID_USER, SSH_NOLOGIN, /* denied by /etc/nologin, not implemented */ @@ -161,11 +161,11 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +void audit_generate_ephemeral_server_key(const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c ---- a/openssh-6.4p1/key.c -+++ b/openssh-6.4p1/key.c -@@ -1805,16 +1805,40 @@ key_demote(const Key *k) - fatal("key_free: bad key type %d", k->type); +diff --git a/openssh-6.5p1/key.c b/openssh-6.5p1/key.c +--- a/openssh-6.5p1/key.c ++++ b/openssh-6.5p1/key.c +@@ -1959,16 +1959,41 @@ key_demote(const Key *k) + fatal("key_demote: bad key type %d", k->type); break; } @@ -191,7 +191,8 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c + return EC_KEY_get0_private_key(k->ecdsa) != NULL; +#endif + default: -+ fatal("key_is_private: bad key type %d", k->type); ++ /* fatal("key_is_private: bad key type %d", k->type); */ ++ debug2("key_is_private: bad key type %d", k->type); + return 1; + } +} @@ -201,23 +202,24 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c { if (k == NULL) return 0; - switch (k->type) { - case KEY_RSA_CERT_V00: - case KEY_DSA_CERT_V00: - case KEY_RSA_CERT: -diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h ---- a/openssh-6.4p1/key.h -+++ b/openssh-6.4p1/key.h -@@ -106,16 +106,17 @@ int key_read(Key *, char **); + return key_type_is_cert(k->type); + } + + /* Return the cert-less equivalent to a certified key type */ +diff --git a/openssh-6.5p1/key.h b/openssh-6.5p1/key.h +--- a/openssh-6.5p1/key.h ++++ b/openssh-6.5p1/key.h +@@ -113,16 +113,17 @@ int key_read(Key *, char **); u_int key_size(const Key *); enum fp_type key_fp_type_select(void); - char *key_fp_type_str(enum fp_type); + char *key_fp_type_str(enum fp_type); Key *key_generate(int, u_int); Key *key_from_private(const Key *); int key_type_from_name(char *); int key_is_cert(const Key *); +int key_is_private(const Key *k); + int key_type_is_cert(int); int key_type_plain(int); int key_to_certified(Key *, int); int key_drop_cert(Key *); @@ -225,10 +227,9 @@ diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h void key_cert_copy(const Key *, struct Key *); int key_cert_check_authority(const Key *, int, int, const char *, const char **); - int key_cert_is_legacy(const Key *); -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -110,16 +110,18 @@ extern u_int utmp_len; extern Newkeys *current_keys[]; extern z_stream incoming_stream; @@ -355,7 +356,7 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c /* Terminate process */ exit(res); -@@ -2504,9 +2513,30 @@ mm_answer_audit_session_key_free_body(in +@@ -2505,9 +2514,30 @@ mm_answer_audit_session_key_free_body(in audit_session_key_free_body(ctos, pid, uid); @@ -386,9 +387,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c + return 0; +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h ---- a/openssh-6.4p1/monitor.h -+++ b/openssh-6.4p1/monitor.h +diff --git a/openssh-6.5p1/monitor.h b/openssh-6.5p1/monitor.h +--- a/openssh-6.5p1/monitor.h ++++ b/openssh-6.5p1/monitor.h @@ -68,16 +68,17 @@ enum monitor_reqtype { MONITOR_REQ_PAM_QUERY = 106, MONITOR_ANS_PAM_QUERY = 107, MONITOR_REQ_PAM_RESPOND = 108, MONITOR_ANS_PAM_RESPOND = 109, @@ -407,9 +408,9 @@ diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h int m_recvfd; int m_sendfd; int m_log_recvfd; -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -1537,9 +1537,25 @@ mm_audit_session_key_free_body(int ctos, buffer_put_int(&m, ctos); buffer_put_int64(&m, pid); @@ -436,9 +437,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c + buffer_free(&m); +} #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -75,16 +75,17 @@ void mm_sshpam_free_ctx(void *); #ifdef SSH_AUDIT_EVENTS #include "audit.h" @@ -457,9 +458,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c @@ -132,17 +132,17 @@ static int session_pty_req(Session *); /* import */ @@ -479,7 +480,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c /* data */ static int sessions_first_unused = -1; static int sessions_nalloc = 0; -@@ -1660,17 +1660,17 @@ do_child(Session *s, const char *command +@@ -1688,17 +1688,17 @@ do_child(Session *s, const char *command char **env; int env_size; char *argv[ARGV_MAX]; @@ -498,9 +499,9 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c if (s->authctxt->force_pwchange) { do_setusercontext(pw); child_close_fds(); -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c @@ -256,17 +256,17 @@ Buffer cfg; /* message to be displayed after login */ @@ -546,7 +547,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c if (startup_pipes) for (i = 0; i < options.max_startups; i++) if (startup_pipes[i] != -1) -@@ -547,60 +556,99 @@ sshd_exchange_identification(int sock_in +@@ -554,60 +563,99 @@ sshd_exchange_identification(int sock_in close(sock_out); logit("Protocol major versions differ for %s: %.200s vs. %.200s", get_remote_ipaddr(), @@ -649,7 +650,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c } static void -@@ -1179,16 +1227,17 @@ server_accept_loop(int *sock_in, int *so +@@ -1192,16 +1240,17 @@ server_accept_loop(int *sock_in, int *so /* Wait in select until there is a connection. */ ret = select(maxfd+1, fdset, NULL, NULL, NULL); @@ -667,7 +668,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c generate_ephemeral_server_key(); key_used = 0; key_do_regen = 0; -@@ -2138,27 +2187,28 @@ main(int ac, char **av) +@@ -2153,27 +2202,28 @@ main(int ac, char **av) /* * In privilege separation, we fork another child and prepare * file descriptor passing. @@ -697,7 +698,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c verbose("Closing connection to %.500s port %d", remote_ip, remote_port); -@@ -2377,17 +2427,17 @@ do_ssh1_kex(void) +@@ -2392,17 +2442,17 @@ do_ssh1_kex(void) MD5_Update(&md, sensitive_data.ssh1_cookie, SSH_SESSION_KEY_LENGTH); MD5_Final(session_key + 16, &md); memset(buf, 0, bytes); @@ -716,7 +717,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c BN_clear_free(session_key_int); /* Set the session key. From this on all communications will be encrypted. */ -@@ -2510,16 +2560,18 @@ cleanup_exit(int i) +@@ -2527,16 +2577,18 @@ cleanup_exit(int i) debug("Killing privsep child %d", pmonitor->m_pid); if (kill(pmonitor->m_pid, SIGKILL) != 0 && errno != ESRCH) diff --git a/openssh-6.4p1-audit7-libaudit_compat.patch b/openssh-6.5p1-audit7-libaudit_compat.patch similarity index 92% rename from openssh-6.4p1-audit7-libaudit_compat.patch rename to openssh-6.5p1-audit7-libaudit_compat.patch index 1924510..6618b3d 100644 --- a/openssh-6.4p1-audit7-libaudit_compat.patch +++ b/openssh-6.5p1-audit7-libaudit_compat.patch @@ -1,8 +1,8 @@ # definitions for AUDIT_CRYPTO_* symbols fom libaudit 2.x -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -25,16 +25,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @@ -21,10 +21,10 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c #include "key.h" #include "hostfile.h" #include "auth.h" -diff --git a/openssh-6.4p1/compat-libaudit.h b/openssh-6.4p1/compat-libaudit.h +diff --git a/openssh-6.5p1/compat-libaudit.h b/openssh-6.5p1/compat-libaudit.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/compat-libaudit.h ++++ b/openssh-6.5p1/compat-libaudit.h @@ -0,0 +1,79 @@ +/* AUDIT_CRYPTO symbol definitions from libaudit 2.x */ +/* libaudit.h -- diff --git a/openssh-6.4p1-audit8-libaudit_dns_timeouts.patch b/openssh-6.5p1-audit8-libaudit_dns_timeouts.patch similarity index 92% rename from openssh-6.4p1-audit8-libaudit_dns_timeouts.patch rename to openssh-6.5p1-audit8-libaudit_dns_timeouts.patch index ad92f62..bbf76a8 100644 --- a/openssh-6.4p1-audit8-libaudit_dns_timeouts.patch +++ b/openssh-6.5p1-audit8-libaudit_dns_timeouts.patch @@ -4,9 +4,9 @@ # Note that this particular solution causes the logs to always contain # "hostname=?, addr=?" when DNS lookups are disabled. -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -62,17 +62,17 @@ linux_audit_user_logxxx(int uid, const c if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT) diff --git a/openssh-6.4p1-blocksigalrm.patch b/openssh-6.5p1-blocksigalrm.patch similarity index 95% rename from openssh-6.4p1-blocksigalrm.patch rename to openssh-6.5p1-blocksigalrm.patch index 2556adc..b2b6483 100644 --- a/openssh-6.4p1-blocksigalrm.patch +++ b/openssh-6.5p1-blocksigalrm.patch @@ -2,9 +2,9 @@ # grace_alarm_handler) # bnc#57354 -diff --git a/openssh-6.4p1/log.c b/openssh-6.4p1/log.c ---- a/openssh-6.4p1/log.c -+++ b/openssh-6.4p1/log.c +diff --git a/openssh-6.5p1/log.c b/openssh-6.5p1/log.c +--- a/openssh-6.5p1/log.c ++++ b/openssh-6.5p1/log.c @@ -47,16 +47,17 @@ #include #include diff --git a/openssh-6.4p1-default-protocol.patch b/openssh-6.5p1-default-protocol.patch similarity index 83% rename from openssh-6.4p1-default-protocol.patch rename to openssh-6.5p1-default-protocol.patch index e71fabf..cea3064 100644 --- a/openssh-6.4p1-default-protocol.patch +++ b/openssh-6.5p1-default-protocol.patch @@ -1,8 +1,8 @@ # only enable SSHv2 protocol by default (upstream default is fallback to v1) -diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config ---- a/openssh-6.4p1/ssh_config -+++ b/openssh-6.4p1/ssh_config +diff --git a/openssh-6.5p1/ssh_config b/openssh-6.5p1/ssh_config +--- a/openssh-6.5p1/ssh_config ++++ b/openssh-6.5p1/ssh_config @@ -41,17 +41,17 @@ ForwardX11Trusted yes # CheckHostIP yes # AddressFamily any diff --git a/openssh-6.4p1-disable-openssl-abi-check.patch b/openssh-6.5p1-disable-openssl-abi-check.patch similarity index 89% rename from openssh-6.4p1-disable-openssl-abi-check.patch rename to openssh-6.5p1-disable-openssl-abi-check.patch index 23288a5..84a9e11 100644 --- a/openssh-6.4p1-disable-openssl-abi-check.patch +++ b/openssh-6.5p1-disable-openssl-abi-check.patch @@ -2,9 +2,9 @@ # reliable indicator of ABI changes and doesn't make much sense in a # distribution package -diff --git a/openssh-6.4p1/entropy.c b/openssh-6.4p1/entropy.c ---- a/openssh-6.4p1/entropy.c -+++ b/openssh-6.4p1/entropy.c +diff --git a/openssh-6.5p1/entropy.c b/openssh-6.5p1/entropy.c +--- a/openssh-6.5p1/entropy.c ++++ b/openssh-6.5p1/entropy.c @@ -212,22 +212,23 @@ seed_rng(void) #endif /* diff --git a/openssh-6.4p1-eal3.patch b/openssh-6.5p1-eal3.patch similarity index 84% rename from openssh-6.4p1-eal3.patch rename to openssh-6.5p1-eal3.patch index 22b8d8c..f2c5fdc 100644 --- a/openssh-6.4p1-eal3.patch +++ b/openssh-6.5p1-eal3.patch @@ -1,9 +1,9 @@ # fix paths and references in sshd man pages -diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 ---- a/openssh-6.4p1/sshd.8 -+++ b/openssh-6.4p1/sshd.8 -@@ -872,17 +872,17 @@ See +diff --git a/openssh-6.5p1/sshd.8 b/openssh-6.5p1/sshd.8 +--- a/openssh-6.5p1/sshd.8 ++++ b/openssh-6.5p1/sshd.8 +@@ -875,17 +875,17 @@ See If this file exists, .Nm refuses to let anyone except root log in. @@ -22,7 +22,7 @@ diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 .It Pa /etc/ssh/ssh_host_key .It Pa /etc/ssh/ssh_host_dsa_key .It Pa /etc/ssh/ssh_host_ecdsa_key -@@ -951,17 +951,17 @@ The content of this file is not sensitiv +@@ -956,17 +956,17 @@ The content of this file is not sensitiv .Xr sftp 1 , .Xr ssh 1 , .Xr ssh-add 1 , @@ -41,9 +41,9 @@ diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, -diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 ---- a/openssh-6.4p1/sshd_config.5 -+++ b/openssh-6.4p1/sshd_config.5 +diff --git a/openssh-6.5p1/sshd_config.5 b/openssh-6.5p1/sshd_config.5 +--- a/openssh-6.5p1/sshd_config.5 ++++ b/openssh-6.5p1/sshd_config.5 @@ -278,18 +278,17 @@ The contents of the specified file are s authentication is allowed. If the argument is @@ -64,7 +64,7 @@ diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 to after authentication. All components of the pathname must be root-owned directories that are not writable by any other user or group. -@@ -565,17 +564,17 @@ and +@@ -576,17 +575,17 @@ and .Pa .shosts files will not be used in .Cm RhostsRSAAuthentication diff --git a/openssh-6.4p1-fingerprint_hash.patch b/openssh-6.5p1-fingerprint_hash.patch similarity index 87% rename from openssh-6.4p1-fingerprint_hash.patch rename to openssh-6.5p1-fingerprint_hash.patch index 392a403..61c681a 100644 --- a/openssh-6.4p1-fingerprint_hash.patch +++ b/openssh-6.5p1-fingerprint_hash.patch @@ -1,13 +1,13 @@ # HG changeset patch -# Parent d41afe56fd49d0a9669738b1f4d53ddae0cb195a +# Parent 450c3933f35c6801a682ea32c588e4c9ff73414a # select fingerprint hash algorithms based on the environment variable # SSH_FP_TYPE_ENVVAR and append it to hex and randomart fingerprints # Petr Cerny -diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c ---- a/openssh-6.4p1/auth-rsa.c -+++ b/openssh-6.4p1/auth-rsa.c +diff --git a/openssh-6.5p1/auth-rsa.c b/openssh-6.5p1/auth-rsa.c +--- a/openssh-6.5p1/auth-rsa.c ++++ b/openssh-6.5p1/auth-rsa.c @@ -226,17 +226,17 @@ rsa_key_allowed_in_file(struct passwd *p /* check the real bits */ @@ -27,9 +27,9 @@ diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c if (auth_key_is_revoked(key)) break; -diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c ---- a/openssh-6.4p1/auth.c -+++ b/openssh-6.4p1/auth.c +diff --git a/openssh-6.5p1/auth.c b/openssh-6.5p1/auth.c +--- a/openssh-6.5p1/auth.c ++++ b/openssh-6.5p1/auth.c @@ -680,17 +680,17 @@ auth_key_is_revoked(Key *key) case -1: /* Error opening revoked_keys_file: refuse all keys */ @@ -49,10 +49,10 @@ diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c fatal("key_in_file returned junk"); } -diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c ---- a/openssh-6.4p1/auth2-hostbased.c -+++ b/openssh-6.4p1/auth2-hostbased.c -@@ -196,23 +196,23 @@ hostbased_key_allowed(struct passwd *pw, +diff --git a/openssh-6.5p1/auth2-hostbased.c b/openssh-6.5p1/auth2-hostbased.c +--- a/openssh-6.5p1/auth2-hostbased.c ++++ b/openssh-6.5p1/auth2-hostbased.c +@@ -202,23 +202,23 @@ hostbased_key_allowed(struct passwd *pw, _PATH_SSH_SYSTEM_HOSTFILE2, options.ignore_user_known_hosts ? NULL : _PATH_SSH_USER_HOSTFILE2); @@ -78,10 +78,10 @@ diff --git a/openssh-6.4p1/auth2-hostbased.c b/openssh-6.4p1/auth2-hostbased.c return (host_status == HOST_OK); } -diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c ---- a/openssh-6.4p1/auth2-pubkey.c -+++ b/openssh-6.4p1/auth2-pubkey.c -@@ -202,25 +202,25 @@ pubkey_auth_info(Authctxt *authctxt, con +diff --git a/openssh-6.5p1/auth2-pubkey.c b/openssh-6.5p1/auth2-pubkey.c +--- a/openssh-6.5p1/auth2-pubkey.c ++++ b/openssh-6.5p1/auth2-pubkey.c +@@ -208,25 +208,25 @@ pubkey_auth_info(Authctxt *authctxt, con i = vasprintf(&extra, fmt, ap); va_end(ap); if (i < 0 || extra == NULL) @@ -109,7 +109,7 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c } static int -@@ -354,17 +354,17 @@ check_authkeys_file(FILE *f, char *file, +@@ -360,17 +360,17 @@ check_authkeys_file(FILE *f, char *file, if (key_is_cert(key)) { if (!key_equal(found, key->cert->signature_key)) continue; @@ -128,7 +128,7 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c * a key option, then prefer that list to matching * their username in the certificate principals list. */ -@@ -395,17 +395,17 @@ check_authkeys_file(FILE *f, char *file, +@@ -401,17 +401,17 @@ check_authkeys_file(FILE *f, char *file, break; } else if (key_equal(found, key)) { if (auth_parse_options(pw, key_options, file, @@ -147,7 +147,7 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c } if (found != NULL) key_free(found); -@@ -421,17 +421,17 @@ user_cert_trusted_ca(struct passwd *pw, +@@ -427,17 +427,17 @@ user_cert_trusted_ca(struct passwd *pw, char *ca_fp, *principals_file = NULL; const char *reason; int ret = 0; @@ -166,13 +166,13 @@ diff --git a/openssh-6.4p1/auth2-pubkey.c b/openssh-6.4p1/auth2-pubkey.c options.trusted_user_ca_keys); goto out; } -diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c ---- a/openssh-6.4p1/key.c -+++ b/openssh-6.4p1/key.c -@@ -390,30 +390,38 @@ key_fingerprint_raw(const Key *k, enum f - free(blob); +diff --git a/openssh-6.5p1/key.c b/openssh-6.5p1/key.c +--- a/openssh-6.5p1/key.c ++++ b/openssh-6.5p1/key.c +@@ -420,30 +420,39 @@ key_fingerprint_raw(const Key *k, enum f + *dgst_raw_length = ssh_digest_bytes(hash_alg); } else { - fatal("key_fingerprint_raw: blob is null"); + fatal("%s: blob is null", __func__); } return retval; } @@ -185,6 +185,7 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c u_int i; - retval = xcalloc(1, dgst_raw_len * 3 + 1); ++ /* reserve space for both the key hash and the string for the hash type */ + retval = xcalloc(1, dgst_raw_len * 3 + 1 + SSH_FP_TYPE_STRLEN + 2); for (i = 0; i < dgst_raw_len; i++) { char hex[4]; @@ -211,7 +212,7 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c { char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm', -@@ -488,17 +496,18 @@ key_fingerprint_bubblebabble(u_char *dgs +@@ -518,17 +527,18 @@ key_fingerprint_bubblebabble(u_char *dgs * can be in the exact middle of the picture, and FLDBASE should be >=8 . * Else pictures would be too dense, and drawing the frame would * fail, too, because the key type would not fit in anymore. @@ -231,7 +232,7 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c char *augmentation_string = " .o+=*BOX@%&#/^SE"; char *retval, *p; u_char field[FLDSIZE_X][FLDSIZE_Y]; -@@ -555,18 +564,19 @@ key_fingerprint_randomart(u_char *dgst_r +@@ -585,18 +595,19 @@ key_fingerprint_randomart(u_char *dgst_r *p++ = '|'; for (x = 0; x < FLDSIZE_X; x++) *p++ = augmentation_string[MIN(field[x][y], len)]; @@ -253,7 +254,7 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c char * key_fingerprint(const Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep) -@@ -575,34 +585,91 @@ key_fingerprint(const Key *k, enum fp_ty +@@ -605,34 +616,91 @@ key_fingerprint(const Key *k, enum fp_ty u_char *dgst_raw; u_int dgst_raw_len; @@ -347,10 +348,10 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c * the buffer containing the number. */ static int -diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h ---- a/openssh-6.4p1/key.h -+++ b/openssh-6.4p1/key.h -@@ -51,16 +51,18 @@ enum fp_type { +diff --git a/openssh-6.5p1/key.h b/openssh-6.5p1/key.h +--- a/openssh-6.5p1/key.h ++++ b/openssh-6.5p1/key.h +@@ -53,16 +53,18 @@ enum fp_type { SSH_FP_MD5, SSH_FP_SHA256 }; @@ -369,7 +370,7 @@ diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h struct KeyCert { Buffer certblob; /* Kept around for use on wire */ u_int type; /* SSH2_CERT_TYPE_USER or SSH2_CERT_TYPE_HOST */ -@@ -97,16 +99,18 @@ int key_equal_public(const Key *, cons +@@ -104,16 +106,18 @@ int key_equal_public(const Key *, cons int key_equal(const Key *, const Key *); char *key_fingerprint(const Key *, enum fp_type, enum fp_rep); u_char *key_fingerprint_raw(const Key *, enum fp_type, u_int *); @@ -379,19 +380,19 @@ diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h int key_read(Key *, char **); u_int key_size(const Key *); +enum fp_type key_fp_type_select(void); -+char *key_fp_type_str(enum fp_type); ++char *key_fp_type_str(enum fp_type); Key *key_generate(int, u_int); Key *key_from_private(const Key *); int key_type_from_name(char *); int key_is_cert(const Key *); + int key_type_is_cert(int); int key_type_plain(int); int key_to_certified(Key *, int); - int key_drop_cert(Key *); -diff --git a/openssh-6.4p1/ssh-add.c b/openssh-6.4p1/ssh-add.c ---- a/openssh-6.4p1/ssh-add.c -+++ b/openssh-6.4p1/ssh-add.c -@@ -321,17 +321,17 @@ list_identities(AuthenticationConnection +diff --git a/openssh-6.5p1/ssh-add.c b/openssh-6.5p1/ssh-add.c +--- a/openssh-6.5p1/ssh-add.c ++++ b/openssh-6.5p1/ssh-add.c +@@ -325,17 +325,17 @@ list_identities(AuthenticationConnection int version; for (version = 1; version <= 2; version++) { @@ -410,9 +411,9 @@ diff --git a/openssh-6.4p1/ssh-add.c b/openssh-6.4p1/ssh-add.c if (!key_write(key, stdout)) fprintf(stderr, "key_write failed"); fprintf(stdout, " %s\n", comment); -diff --git a/openssh-6.4p1/ssh-agent.c b/openssh-6.4p1/ssh-agent.c ---- a/openssh-6.4p1/ssh-agent.c -+++ b/openssh-6.4p1/ssh-agent.c +diff --git a/openssh-6.5p1/ssh-agent.c b/openssh-6.5p1/ssh-agent.c +--- a/openssh-6.5p1/ssh-agent.c ++++ b/openssh-6.5p1/ssh-agent.c @@ -193,17 +193,17 @@ lookup_identity(Key *key, int version) /* Check confirmation of keysign request */ @@ -432,10 +433,10 @@ diff --git a/openssh-6.4p1/ssh-agent.c b/openssh-6.4p1/ssh-agent.c return (ret); } -diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c ---- a/openssh-6.4p1/ssh-keygen.c -+++ b/openssh-6.4p1/ssh-keygen.c -@@ -725,27 +725,27 @@ do_download(struct passwd *pw) +diff --git a/openssh-6.5p1/ssh-keygen.c b/openssh-6.5p1/ssh-keygen.c +--- a/openssh-6.5p1/ssh-keygen.c ++++ b/openssh-6.5p1/ssh-keygen.c +@@ -741,27 +741,27 @@ do_download(struct passwd *pw) { #ifdef ENABLE_PKCS11 Key **keys = NULL; @@ -465,7 +466,7 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c free(ra); free(fp); } else { -@@ -768,29 +768,29 @@ do_fingerprint(struct passwd *pw) +@@ -784,29 +784,29 @@ do_fingerprint(struct passwd *pw) FILE *f; Key *public; char *comment = NULL, *cp, *ep, line[16*1024], *fp, *ra; @@ -497,7 +498,7 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c free(comment); free(ra); free(fp); -@@ -846,17 +846,17 @@ do_fingerprint(struct passwd *pw) +@@ -862,17 +862,17 @@ do_fingerprint(struct passwd *pw) public = key_new(KEY_UNSPEC); if (key_read(public, &cp) != 1) { key_free(public); @@ -516,7 +517,7 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c free(fp); key_free(public); invalid = 0; -@@ -967,20 +967,20 @@ do_gen_all_hostkeys(struct passwd *pw) +@@ -983,20 +983,20 @@ do_gen_all_hostkeys(struct passwd *pw) static void printhost(FILE *f, const char *name, Key *public, int ca, int hash) { @@ -539,7 +540,7 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c free(fp); } else { if (hash && (name = host_hash(name, NULL, 0)) == NULL) -@@ -1850,19 +1850,19 @@ do_show_cert(struct passwd *pw) +@@ -1873,19 +1873,19 @@ do_show_cert(struct passwd *pw) if (stat(identity_file, &st) < 0) fatal("%s: %s: %s", __progname, identity_file, strerror(errno)); if ((key = key_load_public(identity_file, NULL)) == NULL) @@ -561,7 +562,7 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c printf(" Signing CA: %s %s\n", key_type(key->cert->signature_key), ca_fp); printf(" Key ID: \"%s\"\n", key->cert->key_id); -@@ -2650,18 +2650,18 @@ passphrase_again: +@@ -2681,18 +2681,18 @@ passphrase_again: exit(1); } if (!key_write(public, f)) @@ -582,10 +583,10 @@ diff --git a/openssh-6.4p1/ssh-keygen.c b/openssh-6.4p1/ssh-keygen.c printf("The key's randomart image is:\n"); printf("%s\n", ra); free(ra); -diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c ---- a/openssh-6.4p1/sshconnect.c -+++ b/openssh-6.4p1/sshconnect.c -@@ -825,18 +825,18 @@ check_host_key(char *hostname, struct so +diff --git a/openssh-6.5p1/sshconnect.c b/openssh-6.5p1/sshconnect.c +--- a/openssh-6.5p1/sshconnect.c ++++ b/openssh-6.5p1/sshconnect.c +@@ -906,18 +906,18 @@ check_host_key(char *hostname, struct so "address '%.128s' to the list of known " "hosts (%.30s).", type, ip, user_hostfiles[0]); @@ -606,7 +607,7 @@ diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c break; case HOST_NEW: if (options.host_key_alias == NULL && port != 0 && -@@ -866,18 +866,18 @@ check_host_key(char *hostname, struct so +@@ -947,18 +947,18 @@ check_host_key(char *hostname, struct so if (show_other_keys(host_hostkeys, host_key)) snprintf(msg1, sizeof(msg1), @@ -627,7 +628,7 @@ diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c "Matching host key fingerprint" " found in DNS.\n"); else -@@ -1131,17 +1131,17 @@ fail: +@@ -1212,17 +1212,17 @@ fail: /* returns 0 if key verifies or -1 if key does NOT verify */ int @@ -646,7 +647,7 @@ diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c verify_host_key_dns(host, hostaddr, host_key, &flags) == 0) { if (flags & DNS_VERIFY_FOUND) { -@@ -1233,18 +1233,18 @@ show_other_keys(struct hostkeys *hostkey +@@ -1319,18 +1319,18 @@ show_other_keys(struct hostkeys *hostkey char *fp, *ra; const struct hostkey_entry *found; @@ -667,7 +668,7 @@ diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c key_type(found->key), fp); if (options.visual_host_key) logit("%s", ra); -@@ -1255,17 +1255,17 @@ show_other_keys(struct hostkeys *hostkey +@@ -1341,17 +1341,17 @@ show_other_keys(struct hostkeys *hostkey return ret; } @@ -686,10 +687,10 @@ diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); error("It is also possible that a host key has just been changed."); error("The fingerprint for the %s key sent by the remote host is\n%s.", -diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c ---- a/openssh-6.4p1/sshconnect2.c -+++ b/openssh-6.4p1/sshconnect2.c -@@ -590,17 +590,17 @@ input_userauth_pk_ok(int type, u_int32_t +diff --git a/openssh-6.5p1/sshconnect2.c b/openssh-6.5p1/sshconnect2.c +--- a/openssh-6.5p1/sshconnect2.c ++++ b/openssh-6.5p1/sshconnect2.c +@@ -592,17 +592,17 @@ input_userauth_pk_ok(int type, u_int32_t goto done; } if (key->type != pktype) { @@ -708,7 +709,7 @@ diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c * moved to the end of the queue. this also avoids confusion by * duplicate keys */ -@@ -1204,17 +1204,17 @@ sign_and_send_pubkey(Authctxt *authctxt, +@@ -1206,17 +1206,17 @@ sign_and_send_pubkey(Authctxt *authctxt, Buffer b; u_char *blob, *signature; u_int bloblen, slen; diff --git a/openssh-6.4p1-fips.patch b/openssh-6.5p1-fips.patch similarity index 94% rename from openssh-6.4p1-fips.patch rename to openssh-6.5p1-fips.patch index bd5b2f9..4b1cf63 100644 --- a/openssh-6.4p1-fips.patch +++ b/openssh-6.5p1-fips.patch @@ -4,9 +4,9 @@ # HG changeset patch # Parent 6536ed881743cbf05afe962021b985f9b1eab495 -diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in ---- a/openssh-6.4p1/Makefile.in -+++ b/openssh-6.4p1/Makefile.in +diff --git a/openssh-6.5p1/Makefile.in b/openssh-6.5p1/Makefile.in +--- a/openssh-6.5p1/Makefile.in ++++ b/openssh-6.5p1/Makefile.in @@ -72,17 +72,17 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ @@ -26,9 +26,9 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ audit.o audit-bsm.o audit-linux.o platform.o \ sshpty.o sshlogin.o servconf.o serverloop.o \ -diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c ---- a/openssh-6.4p1/auth-rsa.c -+++ b/openssh-6.4p1/auth-rsa.c +diff --git a/openssh-6.5p1/auth-rsa.c b/openssh-6.5p1/auth-rsa.c +--- a/openssh-6.5p1/auth-rsa.c ++++ b/openssh-6.5p1/auth-rsa.c @@ -15,17 +15,17 @@ */ @@ -171,9 +171,9 @@ diff --git a/openssh-6.4p1/auth-rsa.c b/openssh-6.4p1/auth-rsa.c return (success); } -diff --git a/openssh-6.4p1/cipher-ctr.c b/openssh-6.4p1/cipher-ctr.c ---- a/openssh-6.4p1/cipher-ctr.c -+++ b/openssh-6.4p1/cipher-ctr.c +diff --git a/openssh-6.5p1/cipher-ctr.c b/openssh-6.5p1/cipher-ctr.c +--- a/openssh-6.5p1/cipher-ctr.c ++++ b/openssh-6.5p1/cipher-ctr.c @@ -21,16 +21,17 @@ #include @@ -208,9 +208,9 @@ diff --git a/openssh-6.4p1/cipher-ctr.c b/openssh-6.4p1/cipher-ctr.c } #endif /* OPENSSL_HAVE_EVPCTR */ -diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c ---- a/openssh-6.4p1/cipher.c -+++ b/openssh-6.4p1/cipher.c +diff --git a/openssh-6.5p1/cipher.c b/openssh-6.5p1/cipher.c +--- a/openssh-6.5p1/cipher.c ++++ b/openssh-6.5p1/cipher.c @@ -42,16 +42,17 @@ #include @@ -373,10 +373,10 @@ diff --git a/openssh-6.4p1/cipher.c b/openssh-6.4p1/cipher.c /* * Exports an IV from the CipherContext required to export the key * state back from the unprivileged child to the privileged parent -diff --git a/openssh-6.4p1/fips.c b/openssh-6.4p1/fips.c +diff --git a/openssh-6.5p1/fips.c b/openssh-6.5p1/fips.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/fips.c ++++ b/openssh-6.5p1/fips.c @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2012 Petr Cerny. All rights reserved. @@ -554,10 +554,10 @@ new file mode 100644 + return EVP_get_digestbynid(fips_hash_nid_min()); +} + -diff --git a/openssh-6.4p1/fips.h b/openssh-6.4p1/fips.h +diff --git a/openssh-6.5p1/fips.h b/openssh-6.5p1/fips.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/fips.h ++++ b/openssh-6.5p1/fips.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012 Petr Cerny. All rights reserved. @@ -613,9 +613,9 @@ new file mode 100644 + +#endif + -diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c ---- a/openssh-6.4p1/key.c -+++ b/openssh-6.4p1/key.c +diff --git a/openssh-6.5p1/key.c b/openssh-6.5p1/key.c +--- a/openssh-6.5p1/key.c ++++ b/openssh-6.5p1/key.c @@ -49,16 +49,17 @@ #include "xmalloc.h" #include "key.h" @@ -654,9 +654,9 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c /* * string lengths must be less or equal to SSH_FP_TYPE_STRLEN (defined in * key.h) as to fit into the fingerprint string buffer -diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c ---- a/openssh-6.4p1/mac.c -+++ b/openssh-6.4p1/mac.c +diff --git a/openssh-6.5p1/mac.c b/openssh-6.5p1/mac.c +--- a/openssh-6.5p1/mac.c ++++ b/openssh-6.5p1/mac.c @@ -36,34 +36,35 @@ #include "xmalloc.h" #include "log.h" @@ -760,9 +760,9 @@ diff --git a/openssh-6.4p1/mac.c b/openssh-6.4p1/mac.c mac_setup_by_id(mac, i); debug2("mac_setup: found %s", name); return (0); -diff --git a/openssh-6.4p1/myproposal.h b/openssh-6.4p1/myproposal.h ---- a/openssh-6.4p1/myproposal.h -+++ b/openssh-6.4p1/myproposal.h +diff --git a/openssh-6.5p1/myproposal.h b/openssh-6.5p1/myproposal.h +--- a/openssh-6.5p1/myproposal.h ++++ b/openssh-6.5p1/myproposal.h @@ -71,16 +71,20 @@ "ssh-dss" @@ -804,9 +804,9 @@ diff --git a/openssh-6.4p1/myproposal.h b/openssh-6.4p1/myproposal.h static char *myproposal[PROPOSAL_MAX] = { KEX_DEFAULT_KEX, KEX_DEFAULT_PK_ALG, -diff --git a/openssh-6.4p1/openbsd-compat/bsd-arc4random.c b/openssh-6.4p1/openbsd-compat/bsd-arc4random.c ---- a/openssh-6.4p1/openbsd-compat/bsd-arc4random.c -+++ b/openssh-6.4p1/openbsd-compat/bsd-arc4random.c +diff --git a/openssh-6.5p1/openbsd-compat/bsd-arc4random.c b/openssh-6.5p1/openbsd-compat/bsd-arc4random.c +--- a/openssh-6.5p1/openbsd-compat/bsd-arc4random.c ++++ b/openssh-6.5p1/openbsd-compat/bsd-arc4random.c @@ -18,34 +18,35 @@ #include @@ -930,9 +930,9 @@ diff --git a/openssh-6.4p1/openbsd-compat/bsd-arc4random.c b/openssh-6.4p1/openb { size_t i; u_int32_t r = 0; -diff --git a/openssh-6.4p1/ssh-rsa.c b/openssh-6.4p1/ssh-rsa.c ---- a/openssh-6.4p1/ssh-rsa.c -+++ b/openssh-6.4p1/ssh-rsa.c +diff --git a/openssh-6.5p1/ssh-rsa.c b/openssh-6.5p1/ssh-rsa.c +--- a/openssh-6.5p1/ssh-rsa.c ++++ b/openssh-6.5p1/ssh-rsa.c @@ -27,16 +27,17 @@ #include "xmalloc.h" @@ -987,9 +987,9 @@ diff --git a/openssh-6.4p1/ssh-rsa.c b/openssh-6.4p1/ssh-rsa.c EVP_DigestInit(&md, evp_md); EVP_DigestUpdate(&md, data, datalen); EVP_DigestFinal(&md, digest, &dlen); -diff --git a/openssh-6.4p1/ssh.c b/openssh-6.4p1/ssh.c ---- a/openssh-6.4p1/ssh.c -+++ b/openssh-6.4p1/ssh.c +diff --git a/openssh-6.5p1/ssh.c b/openssh-6.5p1/ssh.c +--- a/openssh-6.5p1/ssh.c ++++ b/openssh-6.5p1/ssh.c @@ -99,16 +99,17 @@ #include "kex.h" #include "mac.h" @@ -1051,9 +1051,9 @@ diff --git a/openssh-6.4p1/ssh.c b/openssh-6.4p1/ssh.c options.use_privileged_port, #else original_effective_uid == 0 && options.use_privileged_port, -diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c ---- a/openssh-6.4p1/sshconnect2.c -+++ b/openssh-6.4p1/sshconnect2.c +diff --git a/openssh-6.5p1/sshconnect2.c b/openssh-6.5p1/sshconnect2.c +--- a/openssh-6.5p1/sshconnect2.c ++++ b/openssh-6.5p1/sshconnect2.c @@ -67,16 +67,17 @@ #include "dispatch.h" #include "canohost.h" @@ -1110,9 +1110,9 @@ diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c /* Prefer algorithms that we already have keys for */ myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = order_hostkeyalgs(host, hostaddr, port); -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c @@ -118,16 +118,17 @@ #ifdef GSSAPI #include "ssh-gss.h" diff --git a/openssh-6.4p1-gssapi_key_exchange.patch b/openssh-6.5p1-gssapi_key_exchange.patch similarity index 96% rename from openssh-6.4p1-gssapi_key_exchange.patch rename to openssh-6.5p1-gssapi_key_exchange.patch index ba3dec6..5b62617 100644 --- a/openssh-6.4p1-gssapi_key_exchange.patch +++ b/openssh-6.5p1-gssapi_key_exchange.patch @@ -1,10 +1,10 @@ # HG changeset patch # Parent a72dad36a987a441e9c92807b1d654e43ddee409 -diff --git a/openssh-6.4p1/ChangeLog.gssapi b/openssh-6.4p1/ChangeLog.gssapi +diff --git a/openssh-6.5p1/ChangeLog.gssapi b/openssh-6.5p1/ChangeLog.gssapi new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ChangeLog.gssapi ++++ b/openssh-6.5p1/ChangeLog.gssapi @@ -0,0 +1,113 @@ +20110101 + - Finally update for OpenSSH 5.6p1 @@ -119,9 +119,9 @@ new file mode 100644 + add support for GssapiTrustDns option for gssapi-with-mic + (from jbasney AT ncsa.uiuc.edu) + -diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in ---- a/openssh-6.4p1/Makefile.in -+++ b/openssh-6.4p1/Makefile.in +diff --git a/openssh-6.5p1/Makefile.in b/openssh-6.5p1/Makefile.in +--- a/openssh-6.5p1/Makefile.in ++++ b/openssh-6.5p1/Makefile.in @@ -71,33 +71,34 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o canohost.o channels.o cipher.o cipher-aes.o \ cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ @@ -158,9 +158,9 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in 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 ssh-ldap-helper.8.out ssh-ldap.conf.5.out 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 ssh-ldap-helper.8 ssh-ldap.conf.5 -diff --git a/openssh-6.4p1/auth-krb5.c b/openssh-6.4p1/auth-krb5.c ---- a/openssh-6.4p1/auth-krb5.c -+++ b/openssh-6.4p1/auth-krb5.c +diff --git a/openssh-6.5p1/auth-krb5.c b/openssh-6.5p1/auth-krb5.c +--- a/openssh-6.5p1/auth-krb5.c ++++ b/openssh-6.5p1/auth-krb5.c @@ -165,18 +165,23 @@ auth_krb5_password(Authctxt *authctxt, c if (problem) goto out; @@ -229,9 +229,9 @@ diff --git a/openssh-6.4p1/auth-krb5.c b/openssh-6.4p1/auth-krb5.c } #endif /* !HEIMDAL */ #endif /* KRB5 */ -diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c ---- a/openssh-6.4p1/auth2-gss.c -+++ b/openssh-6.4p1/auth2-gss.c +diff --git a/openssh-6.5p1/auth2-gss.c b/openssh-6.5p1/auth2-gss.c +--- a/openssh-6.5p1/auth2-gss.c ++++ b/openssh-6.5p1/auth2-gss.c @@ -1,12 +1,12 @@ /* $OpenBSD: auth2-gss.c,v 1.18 2012/12/02 20:34:09 djm Exp $ */ @@ -357,9 +357,9 @@ diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c Authmethod method_gssapi_old = { "gssapi", -diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c ---- a/openssh-6.4p1/auth2.c -+++ b/openssh-6.4p1/auth2.c +diff --git a/openssh-6.5p1/auth2.c b/openssh-6.5p1/auth2.c +--- a/openssh-6.5p1/auth2.c ++++ b/openssh-6.5p1/auth2.c @@ -64,27 +64,29 @@ extern Buffer loginmsg; /* methods */ @@ -390,9 +390,9 @@ diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c #endif &method_passwd, &method_kbdint, -diff --git a/openssh-6.4p1/clientloop.c b/openssh-6.4p1/clientloop.c ---- a/openssh-6.4p1/clientloop.c -+++ b/openssh-6.4p1/clientloop.c +diff --git a/openssh-6.5p1/clientloop.c b/openssh-6.5p1/clientloop.c +--- a/openssh-6.5p1/clientloop.c ++++ b/openssh-6.5p1/clientloop.c @@ -106,16 +106,20 @@ #include "authfd.h" #include "atomicio.h" @@ -440,9 +440,9 @@ diff --git a/openssh-6.4p1/clientloop.c b/openssh-6.4p1/clientloop.c } } -diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac ---- a/openssh-6.4p1/configure.ac -+++ b/openssh-6.4p1/configure.ac +diff --git a/openssh-6.5p1/configure.ac b/openssh-6.5p1/configure.ac +--- a/openssh-6.5p1/configure.ac ++++ b/openssh-6.5p1/configure.ac @@ -528,16 +528,40 @@ main() { if (NSVersionOfRunTimeLibrary(" AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], @@ -484,9 +484,9 @@ diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac [Define if pututxline updates lastlog too]) ) AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], -diff --git a/openssh-6.4p1/gss-genr.c b/openssh-6.4p1/gss-genr.c ---- a/openssh-6.4p1/gss-genr.c -+++ b/openssh-6.4p1/gss-genr.c +diff --git a/openssh-6.5p1/gss-genr.c b/openssh-6.5p1/gss-genr.c +--- a/openssh-6.5p1/gss-genr.c ++++ b/openssh-6.5p1/gss-genr.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-genr.c,v 1.20 2009/06/22 05:39:28 dtucker Exp $ */ @@ -874,9 +874,9 @@ diff --git a/openssh-6.4p1/gss-genr.c b/openssh-6.4p1/gss-genr.c +} + #endif /* GSSAPI */ -diff --git a/openssh-6.4p1/gss-serv-krb5.c b/openssh-6.4p1/gss-serv-krb5.c ---- a/openssh-6.4p1/gss-serv-krb5.c -+++ b/openssh-6.4p1/gss-serv-krb5.c +diff --git a/openssh-6.5p1/gss-serv-krb5.c b/openssh-6.5p1/gss-serv-krb5.c +--- a/openssh-6.5p1/gss-serv-krb5.c ++++ b/openssh-6.5p1/gss-serv-krb5.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */ @@ -1023,9 +1023,9 @@ diff --git a/openssh-6.4p1/gss-serv-krb5.c b/openssh-6.4p1/gss-serv-krb5.c #endif /* KRB5 */ #endif /* GSSAPI */ -diff --git a/openssh-6.4p1/gss-serv.c b/openssh-6.4p1/gss-serv.c ---- a/openssh-6.4p1/gss-serv.c -+++ b/openssh-6.4p1/gss-serv.c +diff --git a/openssh-6.5p1/gss-serv.c b/openssh-6.5p1/gss-serv.c +--- a/openssh-6.5p1/gss-serv.c ++++ b/openssh-6.5p1/gss-serv.c @@ -1,12 +1,12 @@ /* $OpenBSD: gss-serv.c,v 1.23 2011/08/01 19:18:15 markus Exp $ */ @@ -1412,9 +1412,9 @@ diff --git a/openssh-6.4p1/gss-serv.c b/openssh-6.4p1/gss-serv.c } #endif -diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c ---- a/openssh-6.4p1/kex.c -+++ b/openssh-6.4p1/kex.c +diff --git a/openssh-6.5p1/kex.c b/openssh-6.5p1/kex.c +--- a/openssh-6.5p1/kex.c ++++ b/openssh-6.5p1/kex.c @@ -46,16 +46,24 @@ #include "log.h" #include "mac.h" @@ -1471,9 +1471,9 @@ diff --git a/openssh-6.4p1/kex.c b/openssh-6.4p1/kex.c choose_hostkeyalg(Kex *k, char *client, char *server) { char *hostkeyalg = match_list(client, server, NULL); -diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h ---- a/openssh-6.4p1/kex.h -+++ b/openssh-6.4p1/kex.h +diff --git a/openssh-6.5p1/kex.h b/openssh-6.5p1/kex.h +--- a/openssh-6.5p1/kex.h ++++ b/openssh-6.5p1/kex.h @@ -68,16 +68,19 @@ enum kex_modes { }; @@ -1539,10 +1539,10 @@ diff --git a/openssh-6.4p1/kex.h b/openssh-6.4p1/kex.h kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); -diff --git a/openssh-6.4p1/kexgssc.c b/openssh-6.4p1/kexgssc.c +diff --git a/openssh-6.5p1/kexgssc.c b/openssh-6.5p1/kexgssc.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/kexgssc.c ++++ b/openssh-6.5p1/kexgssc.c @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. @@ -1878,10 +1878,10 @@ new file mode 100644 +} + +#endif /* GSSAPI */ -diff --git a/openssh-6.4p1/kexgsss.c b/openssh-6.4p1/kexgsss.c +diff --git a/openssh-6.5p1/kexgsss.c b/openssh-6.5p1/kexgsss.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/kexgsss.c ++++ b/openssh-6.5p1/kexgsss.c @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2001-2009 Simon Wilkinson. All rights reserved. @@ -2171,9 +2171,9 @@ new file mode 100644 + ssh_gssapi_rekey_creds(); +} +#endif /* GSSAPI */ -diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c ---- a/openssh-6.4p1/key.c -+++ b/openssh-6.4p1/key.c +diff --git a/openssh-6.5p1/key.c b/openssh-6.5p1/key.c +--- a/openssh-6.5p1/key.c ++++ b/openssh-6.5p1/key.c @@ -1038,16 +1038,18 @@ key_ssh_name_from_type_nid(int type, int return "ecdsa-sha2-nistp384-cert-v01@openssh.com"; case NID_secp521r1: @@ -2212,9 +2212,9 @@ diff --git a/openssh-6.4p1/key.c b/openssh-6.4p1/key.c int key_ecdsa_nid_from_name(const char *name) -diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h ---- a/openssh-6.4p1/key.h -+++ b/openssh-6.4p1/key.h +diff --git a/openssh-6.5p1/key.h b/openssh-6.5p1/key.h +--- a/openssh-6.5p1/key.h ++++ b/openssh-6.5p1/key.h @@ -39,16 +39,17 @@ enum types { KEY_RSA, KEY_DSA, @@ -2233,9 +2233,9 @@ diff --git a/openssh-6.4p1/key.h b/openssh-6.4p1/key.h SSH_FP_SHA256 }; enum fp_rep { -diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c ---- a/openssh-6.4p1/monitor.c -+++ b/openssh-6.4p1/monitor.c +diff --git a/openssh-6.5p1/monitor.c b/openssh-6.5p1/monitor.c +--- a/openssh-6.5p1/monitor.c ++++ b/openssh-6.5p1/monitor.c @@ -178,16 +178,18 @@ int mm_answer_pam_respond(int, Buffer *) int mm_answer_pam_free_ctx(int, Buffer *); #endif @@ -2532,9 +2532,9 @@ diff --git a/openssh-6.4p1/monitor.c b/openssh-6.4p1/monitor.c { struct jpake_ctx *pctx; u_char *x3_proof, *x4_proof; -diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h ---- a/openssh-6.4p1/monitor.h -+++ b/openssh-6.4p1/monitor.h +diff --git a/openssh-6.5p1/monitor.h b/openssh-6.5p1/monitor.h +--- a/openssh-6.5p1/monitor.h ++++ b/openssh-6.5p1/monitor.h @@ -70,16 +70,19 @@ enum monitor_reqtype { MONITOR_REQ_PAM_FREE_CTX = 110, MONITOR_ANS_PAM_FREE_CTX = 111, MONITOR_REQ_AUDIT_EVENT = 112, MONITOR_REQ_AUDIT_COMMAND = 113, @@ -2555,9 +2555,9 @@ diff --git a/openssh-6.4p1/monitor.h b/openssh-6.4p1/monitor.h int m_sendfd; int m_log_recvfd; int m_log_sendfd; -diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c ---- a/openssh-6.4p1/monitor_wrap.c -+++ b/openssh-6.4p1/monitor_wrap.c +diff --git a/openssh-6.5p1/monitor_wrap.c b/openssh-6.5p1/monitor_wrap.c +--- a/openssh-6.5p1/monitor_wrap.c ++++ b/openssh-6.5p1/monitor_wrap.c @@ -1303,33 +1303,78 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss &m); @@ -2638,9 +2638,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.c b/openssh-6.4p1/monitor_wrap.c char **hash_scheme, char **salt) { Buffer m; -diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h ---- a/openssh-6.4p1/monitor_wrap.h -+++ b/openssh-6.4p1/monitor_wrap.h +diff --git a/openssh-6.5p1/monitor_wrap.h b/openssh-6.5p1/monitor_wrap.h +--- a/openssh-6.5p1/monitor_wrap.h ++++ b/openssh-6.5p1/monitor_wrap.h @@ -54,18 +54,20 @@ int mm_user_key_verify(Key *, u_char *, int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **); int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); @@ -2663,9 +2663,9 @@ diff --git a/openssh-6.4p1/monitor_wrap.h b/openssh-6.4p1/monitor_wrap.h void *mm_sshpam_init_ctx(struct Authctxt *); int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **); int mm_sshpam_respond(void *, u_int, char **); -diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c ---- a/openssh-6.4p1/readconf.c -+++ b/openssh-6.4p1/readconf.c +diff --git a/openssh-6.5p1/readconf.c b/openssh-6.5p1/readconf.c +--- a/openssh-6.5p1/readconf.c ++++ b/openssh-6.5p1/readconf.c @@ -124,16 +124,18 @@ typedef enum { oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, @@ -2813,9 +2813,9 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c options->rhosts_rsa_authentication = 0; if (options->hostbased_authentication == -1) options->hostbased_authentication = 0; -diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h ---- a/openssh-6.4p1/readconf.h -+++ b/openssh-6.4p1/readconf.h +diff --git a/openssh-6.5p1/readconf.h b/openssh-6.5p1/readconf.h +--- a/openssh-6.5p1/readconf.h ++++ b/openssh-6.5p1/readconf.h @@ -43,18 +43,23 @@ typedef struct { int rhosts_rsa_authentication; /* Try rhosts with RSA * authentication. */ @@ -2840,9 +2840,9 @@ diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h int batch_mode; /* Batch mode: do not ask for passwords. */ int check_host_ip; /* Also keep track of keys for IP address */ int strict_host_key_checking; /* Strict host key checking. */ -diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c ---- a/openssh-6.4p1/servconf.c -+++ b/openssh-6.4p1/servconf.c +diff --git a/openssh-6.5p1/servconf.c b/openssh-6.5p1/servconf.c +--- a/openssh-6.5p1/servconf.c ++++ b/openssh-6.5p1/servconf.c @@ -98,18 +98,21 @@ initialize_server_options(ServerOptions options->hostbased_uses_name_from_packet_only = -1; options->rsa_authentication = -1; @@ -3000,9 +3000,9 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication); dump_cfg_fmtint(sKbdInteractiveAuthentication, o->kbd_interactive_authentication); -diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h ---- a/openssh-6.4p1/servconf.h -+++ b/openssh-6.4p1/servconf.h +diff --git a/openssh-6.5p1/servconf.h b/openssh-6.5p1/servconf.h +--- a/openssh-6.5p1/servconf.h ++++ b/openssh-6.5p1/servconf.h @@ -105,18 +105,21 @@ typedef struct { * authentication mechanism, * such as SecurID or @@ -3025,9 +3025,9 @@ diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h /* If true, permit jpake auth */ int permit_empty_passwd; /* If false, do not permit empty * passwords. */ -diff --git a/openssh-6.4p1/ssh-gss.h b/openssh-6.4p1/ssh-gss.h ---- a/openssh-6.4p1/ssh-gss.h -+++ b/openssh-6.4p1/ssh-gss.h +diff --git a/openssh-6.5p1/ssh-gss.h b/openssh-6.5p1/ssh-gss.h +--- a/openssh-6.5p1/ssh-gss.h ++++ b/openssh-6.5p1/ssh-gss.h @@ -1,11 +1,11 @@ /* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ /* @@ -3151,9 +3151,9 @@ diff --git a/openssh-6.4p1/ssh-gss.h b/openssh-6.4p1/ssh-gss.h #endif /* GSSAPI */ #endif /* _SSH_GSS_H */ -diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config ---- a/openssh-6.4p1/ssh_config -+++ b/openssh-6.4p1/ssh_config +diff --git a/openssh-6.5p1/ssh_config b/openssh-6.5p1/ssh_config +--- a/openssh-6.5p1/ssh_config ++++ b/openssh-6.5p1/ssh_config @@ -32,16 +32,18 @@ Host * ForwardX11Trusted yes @@ -3173,9 +3173,9 @@ diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config # IdentityFile ~/.ssh/identity # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa -diff --git a/openssh-6.4p1/ssh_config.5 b/openssh-6.4p1/ssh_config.5 ---- a/openssh-6.4p1/ssh_config.5 -+++ b/openssh-6.4p1/ssh_config.5 +diff --git a/openssh-6.5p1/ssh_config.5 b/openssh-6.5p1/ssh_config.5 +--- a/openssh-6.5p1/ssh_config.5 ++++ b/openssh-6.5p1/ssh_config.5 @@ -525,21 +525,53 @@ host key database, separated by whitespa The default is .Pa /etc/ssh/ssh_known_hosts , @@ -3231,9 +3231,9 @@ diff --git a/openssh-6.4p1/ssh_config.5 b/openssh-6.4p1/ssh_config.5 These hashed names may be used normally by .Xr ssh 1 and -diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c ---- a/openssh-6.4p1/sshconnect2.c -+++ b/openssh-6.4p1/sshconnect2.c +diff --git a/openssh-6.5p1/sshconnect2.c b/openssh-6.5p1/sshconnect2.c +--- a/openssh-6.5p1/sshconnect2.c ++++ b/openssh-6.5p1/sshconnect2.c @@ -155,19 +155,44 @@ order_hostkeyalgs(char *host, struct soc return ret; } @@ -3503,9 +3503,9 @@ diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c /* initial userauth request */ packet_start(SSH2_MSG_USERAUTH_REQUEST); packet_put_cstring(authctxt->server_user); -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c @@ -119,16 +119,24 @@ #include "ssh-gss.h" #endif @@ -3812,9 +3812,9 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c kex->host_key_index=&get_hostkey_index; xxx_kex = kex; -diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config ---- a/openssh-6.4p1/sshd_config -+++ b/openssh-6.4p1/sshd_config +diff --git a/openssh-6.5p1/sshd_config b/openssh-6.5p1/sshd_config +--- a/openssh-6.5p1/sshd_config ++++ b/openssh-6.5p1/sshd_config @@ -75,16 +75,18 @@ PasswordAuthentication no #KerberosAuthentication no #KerberosOrLocalPasswd yes @@ -3834,9 +3834,9 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config #GSSAPIEnableMITMAttack no -diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 ---- a/openssh-6.4p1/sshd_config.5 -+++ b/openssh-6.4p1/sshd_config.5 +diff --git a/openssh-6.5p1/sshd_config.5 b/openssh-6.5p1/sshd_config.5 +--- a/openssh-6.5p1/sshd_config.5 ++++ b/openssh-6.5p1/sshd_config.5 @@ -475,22 +475,50 @@ to force remote port forwardings to bind to allow the client to select the address to which the forwarding is bound. The default is diff --git a/openssh-6.4p1-gssapimitm.patch b/openssh-6.5p1-gssapimitm.patch similarity index 87% rename from openssh-6.4p1-gssapimitm.patch rename to openssh-6.5p1-gssapimitm.patch index 0f9046d..fb87bb0 100644 --- a/openssh-6.4p1-gssapimitm.patch +++ b/openssh-6.5p1-gssapimitm.patch @@ -13,9 +13,9 @@ # recommended to use the 'gssapi-with-mic' mechanism. Existing installations # are encouraged to upgrade as soon as possible. -diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c ---- a/openssh-6.4p1/auth2-gss.c -+++ b/openssh-6.4p1/auth2-gss.c +diff --git a/openssh-6.5p1/auth2-gss.c b/openssh-6.5p1/auth2-gss.c +--- a/openssh-6.5p1/auth2-gss.c ++++ b/openssh-6.5p1/auth2-gss.c @@ -173,16 +173,25 @@ input_gssapi_token(int type, u_int32_t p dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); if (flags & GSS_C_INTEG_FLAG) @@ -58,9 +58,9 @@ diff --git a/openssh-6.4p1/auth2-gss.c b/openssh-6.4p1/auth2-gss.c +}; + #endif /* GSSAPI */ -diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c ---- a/openssh-6.4p1/auth2.c -+++ b/openssh-6.4p1/auth2.c +diff --git a/openssh-6.5p1/auth2.c b/openssh-6.5p1/auth2.c +--- a/openssh-6.5p1/auth2.c ++++ b/openssh-6.5p1/auth2.c @@ -65,26 +65,28 @@ extern Buffer loginmsg; extern Authmethod method_none; @@ -90,10 +90,10 @@ diff --git a/openssh-6.4p1/auth2.c b/openssh-6.4p1/auth2.c &method_kbdint, &method_hostbased, NULL -diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c ---- a/openssh-6.4p1/readconf.c -+++ b/openssh-6.4p1/readconf.c -@@ -126,17 +126,17 @@ typedef enum { +diff --git a/openssh-6.5p1/readconf.c b/openssh-6.5p1/readconf.c +--- a/openssh-6.5p1/readconf.c ++++ b/openssh-6.5p1/readconf.c +@@ -134,17 +134,17 @@ typedef enum { oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication, @@ -109,10 +109,10 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c oHashKnownHosts, oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, - oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, - oIgnoredUnknownOption, oDeprecated, oUnsupported - } OpCodes; -@@ -168,19 +168,21 @@ static struct { + oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass, + oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots, + oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs, +@@ -178,19 +178,21 @@ static struct { { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ { "kerberosauthentication", oUnsupported }, @@ -134,7 +134,7 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c { "identitiesonly", oIdentitiesOnly }, { "hostname", oHostName }, { "hostkeyalias", oHostKeyAlias }, -@@ -514,16 +516,20 @@ parse_flag: +@@ -837,16 +839,20 @@ parse_time: case oGssAuthentication: intptr = &options->gss_authentication; @@ -155,7 +155,7 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c case oCheckHostIP: intptr = &options->check_host_ip; goto parse_flag; -@@ -1164,16 +1170,17 @@ initialize_options(Options * options) +@@ -1484,16 +1490,17 @@ initialize_options(Options * options) options->xauth_location = NULL; options->gateway_ports = -1; options->use_privileged_port = -1; @@ -173,7 +173,7 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c options->batch_mode = -1; options->check_host_ip = -1; options->strict_host_key_checking = -1; -@@ -1265,16 +1272,18 @@ fill_default_options(Options * options) +@@ -1591,16 +1598,18 @@ fill_default_options(Options * options) if (options->pubkey_authentication == -1) options->pubkey_authentication = 1; if (options->challenge_response_authentication == -1) @@ -192,10 +192,10 @@ diff --git a/openssh-6.4p1/readconf.c b/openssh-6.4p1/readconf.c options->rhosts_rsa_authentication = 0; if (options->hostbased_authentication == -1) options->hostbased_authentication = 0; -diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h ---- a/openssh-6.4p1/readconf.h -+++ b/openssh-6.4p1/readconf.h -@@ -44,16 +44,17 @@ typedef struct { +diff --git a/openssh-6.5p1/readconf.h b/openssh-6.5p1/readconf.h +--- a/openssh-6.5p1/readconf.h ++++ b/openssh-6.5p1/readconf.h +@@ -50,16 +50,17 @@ typedef struct { * authentication. */ int rsa_authentication; /* Try RSA authentication. */ int pubkey_authentication; /* Try ssh2 pubkey authentication. */ @@ -213,10 +213,10 @@ diff --git a/openssh-6.4p1/readconf.h b/openssh-6.4p1/readconf.h int batch_mode; /* Batch mode: do not ask for passwords. */ int check_host_ip; /* Also keep track of keys for IP address */ int strict_host_key_checking; /* Strict host key checking. */ -diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c ---- a/openssh-6.4p1/servconf.c -+++ b/openssh-6.4p1/servconf.c -@@ -103,16 +103,17 @@ initialize_server_options(ServerOptions +diff --git a/openssh-6.5p1/servconf.c b/openssh-6.5p1/servconf.c +--- a/openssh-6.5p1/servconf.c ++++ b/openssh-6.5p1/servconf.c +@@ -104,16 +104,17 @@ initialize_server_options(ServerOptions options->rsa_authentication = -1; options->pubkey_authentication = -1; options->kerberos_authentication = -1; @@ -234,7 +234,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c options->use_login = -1; options->compression = -1; options->rekey_limit = -1; -@@ -237,16 +238,18 @@ fill_default_server_options(ServerOption +@@ -242,16 +243,18 @@ fill_default_server_options(ServerOption if (options->kerberos_ticket_cleanup == -1) options->kerberos_ticket_cleanup = 1; if (options->kerberos_get_afs_token == -1) @@ -253,7 +253,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c options->challenge_response_authentication = 1; if (options->permit_empty_passwd == -1) options->permit_empty_passwd = 0; -@@ -333,17 +336,17 @@ typedef enum { +@@ -338,17 +341,17 @@ typedef enum { sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression, sRekeyLimit, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, @@ -272,7 +272,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, sAuthenticationMethods, sHostKeyAgent, sDeprecated, sUnsupported -@@ -400,19 +403,21 @@ static struct { +@@ -405,19 +408,21 @@ static struct { { "kerberosticketcleanup", sUnsupported, SSHCFG_GLOBAL }, { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL }, #endif @@ -294,7 +294,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c #ifdef JPAKE { "zeroknowledgepasswordauthentication", sZeroKnowledgePasswordAuthentication, SSHCFG_ALL }, #else -@@ -1072,16 +1077,20 @@ process_server_config_line(ServerOptions +@@ -1093,16 +1098,20 @@ process_server_config_line(ServerOptions case sGssAuthentication: intptr = &options->gss_authentication; goto parse_flag; @@ -315,10 +315,10 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c intptr = &options->zero_knowledge_password_authentication; goto parse_flag; -diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h ---- a/openssh-6.4p1/servconf.h -+++ b/openssh-6.4p1/servconf.h -@@ -107,16 +107,17 @@ typedef struct { +diff --git a/openssh-6.5p1/servconf.h b/openssh-6.5p1/servconf.h +--- a/openssh-6.5p1/servconf.h ++++ b/openssh-6.5p1/servconf.h +@@ -108,16 +108,17 @@ typedef struct { * such as SecurID or * /etc/passwd */ int kerberos_ticket_cleanup; /* If true, destroy ticket @@ -336,9 +336,9 @@ diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h /* If true, permit jpake auth */ int permit_empty_passwd; /* If false, do not permit empty * passwords. */ -diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config ---- a/openssh-6.4p1/ssh_config -+++ b/openssh-6.4p1/ssh_config +diff --git a/openssh-6.5p1/ssh_config b/openssh-6.5p1/ssh_config +--- a/openssh-6.5p1/ssh_config ++++ b/openssh-6.5p1/ssh_config @@ -51,9 +51,16 @@ ForwardX11Trusted yes # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 @@ -356,10 +356,10 @@ diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +# GSSAPIEnableMITMAttack no + # RekeyLimit 1G 1h -diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c ---- a/openssh-6.4p1/sshconnect2.c -+++ b/openssh-6.4p1/sshconnect2.c -@@ -322,16 +322,21 @@ static char *authmethods_get(void); +diff --git a/openssh-6.5p1/sshconnect2.c b/openssh-6.5p1/sshconnect2.c +--- a/openssh-6.5p1/sshconnect2.c ++++ b/openssh-6.5p1/sshconnect2.c +@@ -324,16 +324,21 @@ static char *authmethods_get(void); Authmethod authmethods[] = { #ifdef GSSAPI @@ -381,7 +381,7 @@ diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c NULL}, {"publickey", userauth_pubkey, -@@ -696,17 +701,19 @@ process_gssapi_token(void *ctxt, gss_buf +@@ -698,17 +703,19 @@ process_gssapi_token(void *ctxt, gss_buf packet_put_string(send_tok.value, send_tok.length); packet_send(); @@ -402,10 +402,10 @@ diff --git a/openssh-6.4p1/sshconnect2.c b/openssh-6.4p1/sshconnect2.c gssbuf.value = buffer_ptr(&b); gssbuf.length = buffer_len(&b); -diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config ---- a/openssh-6.4p1/sshd_config -+++ b/openssh-6.4p1/sshd_config -@@ -79,16 +79,23 @@ PasswordAuthentication no +diff --git a/openssh-6.5p1/sshd_config b/openssh-6.5p1/sshd_config +--- a/openssh-6.5p1/sshd_config ++++ b/openssh-6.5p1/sshd_config +@@ -80,16 +80,23 @@ PasswordAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no @@ -421,8 +421,8 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config +#GSSAPIEnableMITMAttack no + + - # Set this to 'yes' to enable PAM authentication, account processing, - # and session processing. If this is enabled, PAM authentication will + # Set this to 'yes' to enable PAM authentication, account processing, + # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass diff --git a/openssh-6.4p1-host_ident.patch b/openssh-6.5p1-host_ident.patch similarity index 82% rename from openssh-6.4p1-host_ident.patch rename to openssh-6.5p1-host_ident.patch index 0888c48..5a24c4c 100644 --- a/openssh-6.4p1-host_ident.patch +++ b/openssh-6.5p1-host_ident.patch @@ -1,10 +1,10 @@ # identify hashed hosts in known_hosts and suggest command line for their # removal -diff --git a/openssh-6.4p1/sshconnect.c b/openssh-6.4p1/sshconnect.c ---- a/openssh-6.4p1/sshconnect.c -+++ b/openssh-6.4p1/sshconnect.c -@@ -986,16 +986,21 @@ check_host_key(char *hostname, struct so +diff --git a/openssh-6.5p1/sshconnect.c b/openssh-6.5p1/sshconnect.c +--- a/openssh-6.5p1/sshconnect.c ++++ b/openssh-6.5p1/sshconnect.c +@@ -1067,16 +1067,21 @@ check_host_key(char *hostname, struct so ip_found->file, ip_found->line); } /* The host key has changed. */ diff --git a/openssh-6.4p1-key-converter.patch b/openssh-6.5p1-key-converter.patch similarity index 95% rename from openssh-6.4p1-key-converter.patch rename to openssh-6.5p1-key-converter.patch index 8d463a1..86c65c6 100644 --- a/openssh-6.4p1-key-converter.patch +++ b/openssh-6.5p1-key-converter.patch @@ -1,9 +1,9 @@ # SSHv1 to SSHv2 RSA keys converter -diff --git a/openssh-6.4p1/converter/Makefile b/openssh-6.4p1/converter/Makefile +diff --git a/openssh-6.5p1/converter/Makefile b/openssh-6.5p1/converter/Makefile new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/converter/Makefile ++++ b/openssh-6.5p1/converter/Makefile @@ -0,0 +1,17 @@ + +bindir=/usr/bin @@ -12,20 +12,20 @@ new file mode 100644 +all : ssh-keyconverter + +ssh-keyconverter.o: ssh-keyconverter.c ../key.h ../authfile.h ../misc.h ../xmalloc.h -+ gcc $(CFLAGS) $(RPM_OPT_FLAGS) -c -I../ $< -o $@ ++ gcc $(RPM_OPT_FLAGS) -c -I../ $< -o $@ + +ssh-keyconverter: ssh-keyconverter.o ../libssh.a ../openbsd-compat/libopenbsd-compat.a -+ gcc $< $(LDFLAGS) $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ -lcrypto -lssh -lopenbsd-compat -lcrypto -lssh -lopenbsd-compat -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ ++ gcc $< -Wl,--no-as-needed $(RPM_OPT_FLAGS) -L../ -L../openbsd-compat/ -lcrypto -lssh -lopenbsd-compat -lssh -lopenbsd-compat -lpam -ldl -lwrap -lutil -lz -lnsl -lcrypt -lssl -o $@ + +install: ssh-keyconverter ssh-keyconverter.1 + if [ ! -d $(DESTDIR)$(bindir) ]; then install -d -m 755 $(DESTDIR)$(bindir); fi + install -m 755 ssh-keyconverter $(DESTDIR)$(bindir) + if [ ! -d $(DESTDIR)$(mandir)/man1 ]; then install -d -m 755 $(DESTDIR)$(mandir)/man1; fi + install -m 644 ssh-keyconverter.1 $(DESTDIR)$(mandir)/man1 -diff --git a/openssh-6.4p1/converter/ssh-keyconverter.1 b/openssh-6.4p1/converter/ssh-keyconverter.1 +diff --git a/openssh-6.5p1/converter/ssh-keyconverter.1 b/openssh-6.5p1/converter/ssh-keyconverter.1 new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/converter/ssh-keyconverter.1 ++++ b/openssh-6.5p1/converter/ssh-keyconverter.1 @@ -0,0 +1,155 @@ +.\" Manpage for ssh-keyconverter +.\" @@ -182,10 +182,10 @@ new file mode 100644 +.%D March 2001 +.%O work in progress material +.Re -diff --git a/openssh-6.4p1/converter/ssh-keyconverter.c b/openssh-6.4p1/converter/ssh-keyconverter.c +diff --git a/openssh-6.5p1/converter/ssh-keyconverter.c b/openssh-6.5p1/converter/ssh-keyconverter.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/converter/ssh-keyconverter.c ++++ b/openssh-6.5p1/converter/ssh-keyconverter.c @@ -0,0 +1,345 @@ +/* + * SSH v1 to v2 RSA key converter. diff --git a/openssh-6.4p1-lastlog.patch b/openssh-6.5p1-lastlog.patch similarity index 82% rename from openssh-6.4p1-lastlog.patch rename to openssh-6.5p1-lastlog.patch index 907a643..16fd2c6 100644 --- a/openssh-6.4p1-lastlog.patch +++ b/openssh-6.5p1-lastlog.patch @@ -1,9 +1,9 @@ # set uid for functions that use it to seek in lastlog and wtmp files # bnc#18024 (was suse #3024) -diff --git a/openssh-6.4p1/sshlogin.c b/openssh-6.4p1/sshlogin.c ---- a/openssh-6.4p1/sshlogin.c -+++ b/openssh-6.4p1/sshlogin.c +diff --git a/openssh-6.5p1/sshlogin.c b/openssh-6.5p1/sshlogin.c +--- a/openssh-6.5p1/sshlogin.c ++++ b/openssh-6.5p1/sshlogin.c @@ -128,16 +128,17 @@ record_login(pid_t pid, const char *tty, { struct logininfo *li; diff --git a/openssh-6.4p1-ldap.patch b/openssh-6.5p1-ldap.patch similarity index 97% rename from openssh-6.4p1-ldap.patch rename to openssh-6.5p1-ldap.patch index 8418e77..7eee04a 100644 --- a/openssh-6.4p1-ldap.patch +++ b/openssh-6.5p1-ldap.patch @@ -8,10 +8,10 @@ # internal versions. ssh-keyconverter consequently fails to link as it lacks # the proper flags, and libopenbsd-compat doesn't contain the b64_* functions) -diff --git a/openssh-6.4p1/HOWTO.ldap-keys b/openssh-6.4p1/HOWTO.ldap-keys +diff --git a/openssh-6.5p1/HOWTO.ldap-keys b/openssh-6.5p1/HOWTO.ldap-keys new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/HOWTO.ldap-keys ++++ b/openssh-6.5p1/HOWTO.ldap-keys @@ -0,0 +1,108 @@ + +HOW TO START @@ -121,9 +121,9 @@ new file mode 100644 + - frederic peters. + - Finlay dobbie. + - Stefan Fisher. -diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in ---- a/openssh-6.4p1/Makefile.in -+++ b/openssh-6.4p1/Makefile.in +diff --git a/openssh-6.5p1/Makefile.in b/openssh-6.5p1/Makefile.in +--- a/openssh-6.5p1/Makefile.in ++++ b/openssh-6.5p1/Makefile.in @@ -20,16 +20,18 @@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ @@ -164,14 +164,14 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in log.o match.o md-sha256.o moduli.o nchan.o packet.o \ readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ -@@ -90,18 +94,18 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw - auth-krb5.o \ +@@ -94,18 +98,18 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw + kexc25519s.o auth-krb5.o \ auth2-gss.o gss-serv.o gss-serv-krb5.o \ loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ sftp-server.o sftp-common.o \ roaming_common.o roaming_serv.o \ sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ - sandbox-seccomp-filter.o + sandbox-seccomp-filter.o sandbox-capsicum.o -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 -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 @@ -185,7 +185,7 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in PATHSUBS = \ -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ -@@ -164,16 +168,19 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss +@@ -169,16 +173,19 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o @@ -205,7 +205,7 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in # test driver for the loginrec code - not built by default logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o -@@ -266,30 +273,38 @@ install-files: +@@ -271,30 +278,38 @@ install-files: $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) @@ -244,7 +244,7 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in install-sysconf: if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ -@@ -309,16 +324,23 @@ install-sysconf: +@@ -314,16 +329,23 @@ install-sysconf: echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ else \ @@ -268,7 +268,7 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in else \ ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \ fi ; \ -@@ -366,27 +388,30 @@ uninstall: +@@ -377,27 +399,30 @@ uninstall: -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) @@ -299,10 +299,10 @@ diff --git a/openssh-6.4p1/Makefile.in b/openssh-6.4p1/Makefile.in ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) -diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac ---- a/openssh-6.4p1/configure.ac -+++ b/openssh-6.4p1/configure.ac -@@ -1519,16 +1519,116 @@ AC_ARG_WITH([audit], +diff --git a/openssh-6.5p1/configure.ac b/openssh-6.5p1/configure.ac +--- a/openssh-6.5p1/configure.ac ++++ b/openssh-6.5p1/configure.ac +@@ -1573,16 +1573,116 @@ AC_ARG_WITH([audit], AC_MSG_RESULT([no]) ;; *) @@ -411,18 +411,18 @@ diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac +) +AC_SUBST(INSTALL_SSH_LDAP_HELPER) + - dnl Checks for library functions. Please keep in alphabetical order - AC_CHECK_FUNCS([ \ - arc4random \ - arc4random_buf \ - arc4random_uniform \ - asprintf \ - b64_ntop \ - __b64_ntop \ -diff --git a/openssh-6.4p1/ldap-helper.c b/openssh-6.4p1/ldap-helper.c + AC_ARG_WITH([pie], + [ --with-pie Build Position Independent Executables if possible], [ + if test "x$withval" = "xno"; then + use_pie=no + fi + if test "x$withval" = "xyes"; then + use_pie=yes + fi +diff --git a/openssh-6.5p1/ldap-helper.c b/openssh-6.5p1/ldap-helper.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldap-helper.c ++++ b/openssh-6.5p1/ldap-helper.c @@ -0,0 +1,155 @@ +/* $OpenBSD: ssh-pka-ldap.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -579,10 +579,10 @@ new file mode 100644 +void *buffer_get_string(Buffer *b, u_int *l) { return NULL; } +void buffer_put_string(Buffer *b, const void *f, u_int l) {} + -diff --git a/openssh-6.4p1/ldap-helper.h b/openssh-6.4p1/ldap-helper.h +diff --git a/openssh-6.5p1/ldap-helper.h b/openssh-6.5p1/ldap-helper.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldap-helper.h ++++ b/openssh-6.5p1/ldap-helper.h @@ -0,0 +1,32 @@ +/* $OpenBSD: ldap-helper.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -616,10 +616,10 @@ new file mode 100644 +extern int config_warning_config_file; + +#endif /* LDAP_HELPER_H */ -diff --git a/openssh-6.4p1/ldap.conf b/openssh-6.4p1/ldap.conf +diff --git a/openssh-6.5p1/ldap.conf b/openssh-6.5p1/ldap.conf new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldap.conf ++++ b/openssh-6.5p1/ldap.conf @@ -0,0 +1,88 @@ +# $Id: openssh-5.5p1-ldap.patch,v 1.3 2010/07/07 13:48:36 jfch2222 Exp $ +# @@ -709,10 +709,10 @@ new file mode 100644 +#tls_cert +#tls_key + -diff --git a/openssh-6.4p1/ldapbody.c b/openssh-6.4p1/ldapbody.c +diff --git a/openssh-6.5p1/ldapbody.c b/openssh-6.5p1/ldapbody.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapbody.c ++++ b/openssh-6.5p1/ldapbody.c @@ -0,0 +1,494 @@ +/* $OpenBSD: ldapbody.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -1208,10 +1208,10 @@ new file mode 100644 + return; +} + -diff --git a/openssh-6.4p1/ldapbody.h b/openssh-6.4p1/ldapbody.h +diff --git a/openssh-6.5p1/ldapbody.h b/openssh-6.5p1/ldapbody.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapbody.h ++++ b/openssh-6.5p1/ldapbody.h @@ -0,0 +1,37 @@ +/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -1250,10 +1250,10 @@ new file mode 100644 + +#endif /* LDAPBODY_H */ + -diff --git a/openssh-6.4p1/ldapconf.c b/openssh-6.4p1/ldapconf.c +diff --git a/openssh-6.5p1/ldapconf.c b/openssh-6.5p1/ldapconf.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapconf.c ++++ b/openssh-6.5p1/ldapconf.c @@ -0,0 +1,682 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -1937,10 +1937,10 @@ new file mode 100644 + dump_cfg_string(lSSH_Filter, options.ssh_filter); +} + -diff --git a/openssh-6.4p1/ldapconf.h b/openssh-6.4p1/ldapconf.h +diff --git a/openssh-6.5p1/ldapconf.h b/openssh-6.5p1/ldapconf.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapconf.h ++++ b/openssh-6.5p1/ldapconf.h @@ -0,0 +1,71 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2013,10 +2013,10 @@ new file mode 100644 +void dump_config(void); + +#endif /* LDAPCONF_H */ -diff --git a/openssh-6.4p1/ldapincludes.h b/openssh-6.4p1/ldapincludes.h +diff --git a/openssh-6.5p1/ldapincludes.h b/openssh-6.5p1/ldapincludes.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapincludes.h ++++ b/openssh-6.5p1/ldapincludes.h @@ -0,0 +1,41 @@ +/* $OpenBSD: ldapconf.c,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2059,10 +2059,10 @@ new file mode 100644 +#endif + +#endif /* LDAPINCLUDES_H */ -diff --git a/openssh-6.4p1/ldapmisc.c b/openssh-6.4p1/ldapmisc.c +diff --git a/openssh-6.5p1/ldapmisc.c b/openssh-6.5p1/ldapmisc.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapmisc.c ++++ b/openssh-6.5p1/ldapmisc.c @@ -0,0 +1,79 @@ + +#include "ldapincludes.h" @@ -2143,10 +2143,10 @@ new file mode 100644 +} +#endif + -diff --git a/openssh-6.4p1/ldapmisc.h b/openssh-6.4p1/ldapmisc.h +diff --git a/openssh-6.5p1/ldapmisc.h b/openssh-6.5p1/ldapmisc.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ldapmisc.h ++++ b/openssh-6.5p1/ldapmisc.h @@ -0,0 +1,35 @@ +/* $OpenBSD: ldapbody.h,v 1.1 2009/12/03 03:34:42 jfch Exp $ */ +/* @@ -2183,9 +2183,9 @@ new file mode 100644 + +#endif /* LDAPMISC_H */ + -diff --git a/openssh-6.4p1/openbsd-compat/base64.c b/openssh-6.4p1/openbsd-compat/base64.c ---- a/openssh-6.4p1/openbsd-compat/base64.c -+++ b/openssh-6.4p1/openbsd-compat/base64.c +diff --git a/openssh-6.5p1/openbsd-compat/base64.c b/openssh-6.5p1/openbsd-compat/base64.c +--- a/openssh-6.5p1/openbsd-compat/base64.c ++++ b/openssh-6.5p1/openbsd-compat/base64.c @@ -41,17 +41,17 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. @@ -2243,9 +2243,9 @@ diff --git a/openssh-6.4p1/openbsd-compat/base64.c b/openssh-6.4p1/openbsd-compa */ int -diff --git a/openssh-6.4p1/openbsd-compat/base64.h b/openssh-6.4p1/openbsd-compat/base64.h ---- a/openssh-6.4p1/openbsd-compat/base64.h -+++ b/openssh-6.4p1/openbsd-compat/base64.h +diff --git a/openssh-6.5p1/openbsd-compat/base64.h b/openssh-6.5p1/openbsd-compat/base64.h +--- a/openssh-6.5p1/openbsd-compat/base64.h ++++ b/openssh-6.5p1/openbsd-compat/base64.h @@ -42,24 +42,24 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ @@ -2275,10 +2275,10 @@ diff --git a/openssh-6.4p1/openbsd-compat/base64.h b/openssh-6.4p1/openbsd-compa #endif /* HAVE___B64_PTON */ #endif /* _BSD_BASE64_H */ -diff --git a/openssh-6.4p1/openssh-lpk-openldap.schema b/openssh-6.4p1/openssh-lpk-openldap.schema +diff --git a/openssh-6.5p1/openssh-lpk-openldap.schema b/openssh-6.5p1/openssh-lpk-openldap.schema new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/openssh-lpk-openldap.schema ++++ b/openssh-6.5p1/openssh-lpk-openldap.schema @@ -0,0 +1,21 @@ +# +# LDAP Public Key Patch schema for use with openssh-ldappubkey @@ -2301,10 +2301,10 @@ new file mode 100644 + DESC 'MANDATORY: OpenSSH LPK objectclass' + MUST ( sshPublicKey $ uid ) + ) -diff --git a/openssh-6.4p1/openssh-lpk-sun.schema b/openssh-6.4p1/openssh-lpk-sun.schema +diff --git a/openssh-6.5p1/openssh-lpk-sun.schema b/openssh-6.5p1/openssh-lpk-sun.schema new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/openssh-lpk-sun.schema ++++ b/openssh-6.5p1/openssh-lpk-sun.schema @@ -0,0 +1,23 @@ +# +# LDAP Public Key Patch schema for use with openssh-ldappubkey @@ -2329,10 +2329,10 @@ new file mode 100644 + DESC 'MANDATORY: OpenSSH LPK objectclass' + MUST ( sshPublicKey $ uid ) + ) -diff --git a/openssh-6.4p1/ssh-ldap-helper.8 b/openssh-6.4p1/ssh-ldap-helper.8 +diff --git a/openssh-6.5p1/ssh-ldap-helper.8 b/openssh-6.5p1/ssh-ldap-helper.8 new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ssh-ldap-helper.8 ++++ b/openssh-6.5p1/ssh-ldap-helper.8 @@ -0,0 +1,79 @@ +.\" $OpenBSD: ssh-ldap-helper.8,v 1.1 2010/02/10 23:20:38 markus Exp $ +.\" @@ -2413,19 +2413,19 @@ new file mode 100644 +OpenSSH 5.5 + PKA-LDAP . +.Sh AUTHORS +.An Jan F. Chadima Aq jchadima@redhat.com -diff --git a/openssh-6.4p1/ssh-ldap-wrapper b/openssh-6.4p1/ssh-ldap-wrapper +diff --git a/openssh-6.5p1/ssh-ldap-wrapper b/openssh-6.5p1/ssh-ldap-wrapper new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ssh-ldap-wrapper ++++ b/openssh-6.5p1/ssh-ldap-wrapper @@ -0,0 +1,4 @@ +#!/bin/sh + +exec @LIBEXECDIR@/ssh-ldap-helper -s "$1" + -diff --git a/openssh-6.4p1/ssh-ldap.conf.5 b/openssh-6.4p1/ssh-ldap.conf.5 +diff --git a/openssh-6.5p1/ssh-ldap.conf.5 b/openssh-6.5p1/ssh-ldap.conf.5 new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/ssh-ldap.conf.5 ++++ b/openssh-6.5p1/ssh-ldap.conf.5 @@ -0,0 +1,376 @@ +.\" $OpenBSD: ssh-ldap.conf.5,v 1.1 2010/02/10 23:20:38 markus Exp $ +.\" diff --git a/openssh-6.4p1-login_options.patch b/openssh-6.5p1-login_options.patch similarity index 80% rename from openssh-6.4p1-login_options.patch rename to openssh-6.5p1-login_options.patch index 1b4552e..80bd6cb 100644 --- a/openssh-6.4p1-login_options.patch +++ b/openssh-6.5p1-login_options.patch @@ -4,16 +4,16 @@ # # bnc#833605 -diff --git a/openssh-6.4p1/configure.ac b/openssh-6.4p1/configure.ac ---- a/openssh-6.4p1/configure.ac -+++ b/openssh-6.4p1/configure.ac -@@ -657,16 +657,18 @@ main() { if (NSVersionOfRunTimeLibrary(" - AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) +diff --git a/openssh-6.5p1/configure.ac b/openssh-6.5p1/configure.ac +--- a/openssh-6.5p1/configure.ac ++++ b/openssh-6.5p1/configure.ac +@@ -695,16 +695,18 @@ main() { if (NSVersionOfRunTimeLibrary(" AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) ;; *-*-linux*) no_dev_ptmx=1 + use_pie=auto check_for_libcrypt_later=1 check_for_openpty_ctty_bug=1 + AC_DEFINE([LOGIN_NO_ENDOPT], [1], diff --git a/openssh-6.4p1-no_fork-no_pid_file.patch b/openssh-6.5p1-no_fork-no_pid_file.patch similarity index 79% rename from openssh-6.4p1-no_fork-no_pid_file.patch rename to openssh-6.5p1-no_fork-no_pid_file.patch index c0c0e0a..d4b8c2b 100644 --- a/openssh-6.4p1-no_fork-no_pid_file.patch +++ b/openssh-6.5p1-no_fork-no_pid_file.patch @@ -1,9 +1,9 @@ # Do not write a PID file when not daemonizing (e.g. when running from systemd) -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c -@@ -1959,17 +1959,17 @@ main(int ac, char **av) +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c +@@ -1973,17 +1973,17 @@ main(int ac, char **av) signal(SIGCHLD, main_sigchld_handler); signal(SIGTERM, sigterm_handler); signal(SIGQUIT, sigterm_handler); diff --git a/openssh-6.4p1-pam-check-locks.patch b/openssh-6.5p1-pam-check-locks.patch similarity index 87% rename from openssh-6.4p1-pam-check-locks.patch rename to openssh-6.5p1-pam-check-locks.patch index fa3c3d3..c48c3f2 100644 --- a/openssh-6.4p1-pam-check-locks.patch +++ b/openssh-6.5p1-pam-check-locks.patch @@ -2,9 +2,9 @@ # UsePAM is used # bnc#708678, FATE#312033 -diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c ---- a/openssh-6.4p1/auth.c -+++ b/openssh-6.4p1/auth.c +diff --git a/openssh-6.5p1/auth.c b/openssh-6.5p1/auth.c +--- a/openssh-6.5p1/auth.c ++++ b/openssh-6.5p1/auth.c @@ -103,17 +103,17 @@ allowed_user(struct passwd * pw) struct spwd *spw = NULL; #endif @@ -43,9 +43,9 @@ diff --git a/openssh-6.4p1/auth.c b/openssh-6.4p1/auth.c #endif #ifdef LOCKED_PASSWD_PREFIX if (strncmp(passwd, LOCKED_PASSWD_PREFIX, -diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c ---- a/openssh-6.4p1/servconf.c -+++ b/openssh-6.4p1/servconf.c +diff --git a/openssh-6.5p1/servconf.c b/openssh-6.5p1/servconf.c +--- a/openssh-6.5p1/servconf.c ++++ b/openssh-6.5p1/servconf.c @@ -66,16 +66,17 @@ extern Buffer cfg; void @@ -64,7 +64,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c options->address_family = -1; options->num_host_key_files = 0; options->num_host_cert_files = 0; -@@ -157,16 +158,18 @@ initialize_server_options(ServerOptions +@@ -158,16 +159,18 @@ initialize_server_options(ServerOptions } void @@ -83,7 +83,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c /* fill default hostkeys for protocols */ if (options->protocol & SSH_PROTO_1) options->host_key_files[options->num_host_key_files++] = -@@ -315,17 +318,17 @@ fill_default_server_options(ServerOption +@@ -320,17 +323,17 @@ fill_default_server_options(ServerOption #endif } @@ -102,7 +102,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c sKerberosGetAFSToken, sKerberosTgtPassing, sChallengeResponseAuthentication, sPasswordAuthentication, sKbdInteractiveAuthentication, -@@ -360,18 +363,20 @@ typedef enum { +@@ -365,18 +368,20 @@ typedef enum { static struct { const char *name; ServerOpCodes opcode; @@ -123,7 +123,7 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c { "hostdsakey", sHostKeyFile, SSHCFG_GLOBAL }, /* alias */ { "hostkeyagent", sHostKeyAgent, SSHCFG_GLOBAL }, { "pidfile", sPidFile, SSHCFG_GLOBAL }, -@@ -857,16 +862,19 @@ process_server_config_line(ServerOptions +@@ -878,16 +883,19 @@ process_server_config_line(ServerOptions } } @@ -143,10 +143,10 @@ diff --git a/openssh-6.4p1/servconf.c b/openssh-6.4p1/servconf.c /* ignore ports from configfile if cmdline specifies ports */ if (options->ports_from_cmdline) return 0; -diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h ---- a/openssh-6.4p1/servconf.h -+++ b/openssh-6.4p1/servconf.h -@@ -161,16 +161,17 @@ typedef struct { +diff --git a/openssh-6.5p1/servconf.h b/openssh-6.5p1/servconf.h +--- a/openssh-6.5p1/servconf.h ++++ b/openssh-6.5p1/servconf.h +@@ -162,16 +162,17 @@ typedef struct { */ u_int num_authkeys_files; /* Files containing public keys */ @@ -164,10 +164,10 @@ diff --git a/openssh-6.4p1/servconf.h b/openssh-6.4p1/servconf.h char *chroot_directory; char *revoked_keys_file; char *trusted_user_ca_keys; -diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 ---- a/openssh-6.4p1/sshd_config.0 -+++ b/openssh-6.4p1/sshd_config.0 -@@ -706,16 +706,24 @@ DESCRIPTION +diff --git a/openssh-6.5p1/sshd_config.0 b/openssh-6.5p1/sshd_config.0 +--- a/openssh-6.5p1/sshd_config.0 ++++ b/openssh-6.5p1/sshd_config.0 +@@ -720,16 +720,24 @@ DESCRIPTION Because PAM challenge-response authentication usually serves an equivalent role to password authentication, you should disable @@ -192,10 +192,10 @@ diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is ``yes''. If UsePrivilegeSeparation is set to -diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 ---- a/openssh-6.4p1/sshd_config.5 -+++ b/openssh-6.4p1/sshd_config.5 -@@ -1178,16 +1178,28 @@ or +diff --git a/openssh-6.5p1/sshd_config.5 b/openssh-6.5p1/sshd_config.5 +--- a/openssh-6.5p1/sshd_config.5 ++++ b/openssh-6.5p1/sshd_config.5 +@@ -1199,16 +1199,28 @@ or .Pp If .Cm UsePAM diff --git a/openssh-6.4p1-pam-fix2.patch b/openssh-6.5p1-pam-fix2.patch similarity index 82% rename from openssh-6.4p1-pam-fix2.patch rename to openssh-6.5p1-pam-fix2.patch index 5d1f003..d3415c4 100644 --- a/openssh-6.4p1-pam-fix2.patch +++ b/openssh-6.5p1-pam-fix2.patch @@ -1,10 +1,10 @@ # force PAM in defaullt install (this was removed from upstream in 3.8p1) # bnc#46749 -diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config ---- a/openssh-6.4p1/sshd_config -+++ b/openssh-6.4p1/sshd_config -@@ -63,17 +63,17 @@ AuthorizedKeysFile .ssh/authorized_keys +diff --git a/openssh-6.5p1/sshd_config b/openssh-6.5p1/sshd_config +--- a/openssh-6.5p1/sshd_config ++++ b/openssh-6.5p1/sshd_config +@@ -64,17 +64,17 @@ AuthorizedKeysFile .ssh/authorized_keys #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication @@ -23,8 +23,8 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes -@@ -88,17 +88,17 @@ AuthorizedKeysFile .ssh/authorized_keys - # and session processing. If this is enabled, PAM authentication will +@@ -89,17 +89,17 @@ AuthorizedKeysFile .ssh/authorized_keys + # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass @@ -41,4 +41,4 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes - #PrintMotd yes + #PermitTTY yes diff --git a/openssh-6.4p1-pam-fix3.patch b/openssh-6.5p1-pam-fix3.patch similarity index 77% rename from openssh-6.4p1-pam-fix3.patch rename to openssh-6.5p1-pam-fix3.patch index 9ae445d..de3bb8e 100644 --- a/openssh-6.4p1-pam-fix3.patch +++ b/openssh-6.5p1-pam-fix3.patch @@ -1,10 +1,10 @@ # posix threads are generally not supported nor safe # (see upstream log from 2005-05-24) -diff --git a/openssh-6.4p1/auth-pam.c b/openssh-6.4p1/auth-pam.c ---- a/openssh-6.4p1/auth-pam.c -+++ b/openssh-6.4p1/auth-pam.c -@@ -779,17 +779,19 @@ sshpam_query(void *ctx, char **name, cha +diff --git a/openssh-6.5p1/auth-pam.c b/openssh-6.5p1/auth-pam.c +--- a/openssh-6.5p1/auth-pam.c ++++ b/openssh-6.5p1/auth-pam.c +@@ -781,17 +781,19 @@ sshpam_query(void *ctx, char **name, cha } if (type == PAM_SUCCESS) { if (!sshpam_authctxt->valid || diff --git a/openssh-6.4p1-pts.patch b/openssh-6.5p1-pts.patch similarity index 82% rename from openssh-6.4p1-pts.patch rename to openssh-6.5p1-pts.patch index aa557fe..6d0b826 100644 --- a/openssh-6.4p1-pts.patch +++ b/openssh-6.5p1-pts.patch @@ -1,10 +1,10 @@ # use same lines naming as utempter (prevents problems with using different # formats in ?tmp? files) -diff --git a/openssh-6.4p1/loginrec.c b/openssh-6.4p1/loginrec.c ---- a/openssh-6.4p1/loginrec.c -+++ b/openssh-6.4p1/loginrec.c -@@ -535,17 +535,17 @@ getlast_entry(struct logininfo *li) +diff --git a/openssh-6.5p1/loginrec.c b/openssh-6.5p1/loginrec.c +--- a/openssh-6.5p1/loginrec.c ++++ b/openssh-6.5p1/loginrec.c +@@ -538,17 +538,17 @@ getlast_entry(struct logininfo *li) /* * 'line' string utility functions * @@ -23,7 +23,7 @@ diff --git a/openssh-6.4p1/loginrec.c b/openssh-6.4p1/loginrec.c */ -@@ -596,16 +596,20 @@ line_abbrevname(char *dst, const char *s +@@ -599,16 +599,20 @@ line_abbrevname(char *dst, const char *s /* Always skip prefix if present */ if (strncmp(src, "/dev/", 5) == 0) src += 5; diff --git a/openssh-6.5p1-saveargv-fix.patch b/openssh-6.5p1-saveargv-fix.patch new file mode 100644 index 0000000..b9f1ca6 --- /dev/null +++ b/openssh-6.5p1-saveargv-fix.patch @@ -0,0 +1,28 @@ +# related to bnc#49845, upstream bug #529 + +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c +@@ -1399,17 +1399,21 @@ main(int ac, char **av) + saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); + for (i = 0; i < ac; i++) + saved_argv[i] = xstrdup(av[i]); + saved_argv[i] = NULL; + + #ifndef HAVE_SETPROCTITLE + /* Prepare for later setproctitle emulation */ + compat_init_setproctitle(ac, av); +- av = saved_argv; ++ ++ av = xmalloc(sizeof(*saved_argv) * (saved_argc + 1)); ++ for (i = 0; i < saved_argc; i++) ++ av[i] = xstrdup(saved_argv[i]); ++ av[i] = NULL; + #endif + + if (geteuid() == 0 && setgroups(0, NULL) == -1) + debug("setgroups(): %.200s", strerror(errno)); + + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ + sanitise_stdfd(); + diff --git a/openssh-6.4p1-seed-prng.patch b/openssh-6.5p1-seed-prng.patch similarity index 82% rename from openssh-6.4p1-seed-prng.patch rename to openssh-6.5p1-seed-prng.patch index ac021ed..cbc2c03 100644 --- a/openssh-6.4p1-seed-prng.patch +++ b/openssh-6.5p1-seed-prng.patch @@ -1,9 +1,9 @@ # extended support for (re-)seeding the OpenSSL PRNG from /dev/random # bnc#703221, FATE#312172 -diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c ---- a/openssh-6.4p1/audit-bsm.c -+++ b/openssh-6.4p1/audit-bsm.c +diff --git a/openssh-6.5p1/audit-bsm.c b/openssh-6.5p1/audit-bsm.c +--- a/openssh-6.5p1/audit-bsm.c ++++ b/openssh-6.5p1/audit-bsm.c @@ -504,9 +504,15 @@ audit_destroy_sensitive_data(const char /* not implemented */ } @@ -20,9 +20,9 @@ diff --git a/openssh-6.4p1/audit-bsm.c b/openssh-6.4p1/audit-bsm.c + /* not implemented */ +} #endif /* BSM */ -diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c ---- a/openssh-6.4p1/audit-linux.c -+++ b/openssh-6.4p1/audit-linux.c +diff --git a/openssh-6.5p1/audit-linux.c b/openssh-6.5p1/audit-linux.c +--- a/openssh-6.5p1/audit-linux.c ++++ b/openssh-6.5p1/audit-linux.c @@ -398,9 +398,31 @@ audit_generate_ephemeral_server_key(cons } audit_ok = audit_log_user_message(audit_fd, AUDIT_CRYPTO_KEY_USER, @@ -55,9 +55,9 @@ diff --git a/openssh-6.4p1/audit-linux.c b/openssh-6.4p1/audit-linux.c + error("cannot write into audit"); +} #endif /* USE_LINUX_AUDIT */ -diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c ---- a/openssh-6.4p1/audit.c -+++ b/openssh-6.4p1/audit.c +diff --git a/openssh-6.5p1/audit.c b/openssh-6.5p1/audit.c +--- a/openssh-6.5p1/audit.c ++++ b/openssh-6.5p1/audit.c @@ -304,10 +304,16 @@ audit_destroy_sensitive_data(const char /* * This will be called on generation of the ephemeral server key @@ -75,9 +75,9 @@ diff --git a/openssh-6.4p1/audit.c b/openssh-6.4p1/audit.c +} # endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ #endif /* SSH_AUDIT_EVENTS */ -diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h ---- a/openssh-6.4p1/audit.h -+++ b/openssh-6.4p1/audit.h +diff --git a/openssh-6.5p1/audit.h b/openssh-6.5p1/audit.h +--- a/openssh-6.5p1/audit.h ++++ b/openssh-6.5p1/audit.h @@ -63,10 +63,11 @@ void audit_key(int, int *, const Key *); void audit_unsupported(int); void audit_kex(int, char *, char *, char *); @@ -90,9 +90,9 @@ diff --git a/openssh-6.4p1/audit.h b/openssh-6.4p1/audit.h +void audit_linux_prng_seed(long, const char *); #endif /* _SSH_AUDIT_H */ -diff --git a/openssh-6.4p1/entropy.c b/openssh-6.4p1/entropy.c ---- a/openssh-6.4p1/entropy.c -+++ b/openssh-6.4p1/entropy.c +diff --git a/openssh-6.5p1/entropy.c b/openssh-6.5p1/entropy.c +--- a/openssh-6.5p1/entropy.c ++++ b/openssh-6.5p1/entropy.c @@ -45,16 +45,17 @@ #include "ssh.h" @@ -126,17 +126,17 @@ diff --git a/openssh-6.4p1/entropy.c b/openssh-6.4p1/entropy.c if (RAND_status() != 1) fatal("PRNG is not seeded"); } -diff --git a/openssh-6.4p1/openbsd-compat/Makefile.in b/openssh-6.4p1/openbsd-compat/Makefile.in ---- a/openssh-6.4p1/openbsd-compat/Makefile.in -+++ b/openssh-6.4p1/openbsd-compat/Makefile.in +diff --git a/openssh-6.5p1/openbsd-compat/Makefile.in b/openssh-6.5p1/openbsd-compat/Makefile.in +--- a/openssh-6.5p1/openbsd-compat/Makefile.in ++++ b/openssh-6.5p1/openbsd-compat/Makefile.in @@ -15,17 +15,17 @@ AR=@AR@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ LDFLAGS=-L. @LDFLAGS@ - OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o + OPENBSD=base64.o basename.o bcrypt_pbkdf.o bindresvport.o blowfish.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o blowfish.o bcrypt_pbkdf.o - COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o + COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o -PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o +PORTS=port-aix.o port-irix.o port-linux.o port-linux-prng.o port-solaris.o port-tun.o port-uw.o @@ -148,10 +148,10 @@ diff --git a/openssh-6.4p1/openbsd-compat/Makefile.in b/openssh-6.4p1/openbsd-co $(COMPAT): ../config.h $(OPENBSD): ../config.h -diff --git a/openssh-6.4p1/openbsd-compat/port-linux-prng.c b/openssh-6.4p1/openbsd-compat/port-linux-prng.c +diff --git a/openssh-6.5p1/openbsd-compat/port-linux-prng.c b/openssh-6.5p1/openbsd-compat/port-linux-prng.c new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/openbsd-compat/port-linux-prng.c ++++ b/openssh-6.5p1/openbsd-compat/port-linux-prng.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2011 Jan F. Chadima @@ -232,9 +232,9 @@ new file mode 100644 + fatal ("EOF reading %s", random); + } +} -diff --git a/openssh-6.4p1/openbsd-compat/port-linux.h b/openssh-6.4p1/openbsd-compat/port-linux.h ---- a/openssh-6.4p1/openbsd-compat/port-linux.h -+++ b/openssh-6.4p1/openbsd-compat/port-linux.h +diff --git a/openssh-6.5p1/openbsd-compat/port-linux.h b/openssh-6.5p1/openbsd-compat/port-linux.h +--- a/openssh-6.5p1/openbsd-compat/port-linux.h ++++ b/openssh-6.5p1/openbsd-compat/port-linux.h @@ -14,16 +14,20 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -256,10 +256,10 @@ diff --git a/openssh-6.4p1/openbsd-compat/port-linux.h b/openssh-6.4p1/openbsd-c void ssh_selinux_setfscreatecon(const char *); #endif -diff --git a/openssh-6.4p1/ssh-add.1 b/openssh-6.4p1/ssh-add.1 ---- a/openssh-6.4p1/ssh-add.1 -+++ b/openssh-6.4p1/ssh-add.1 -@@ -155,16 +155,30 @@ or related script. +diff --git a/openssh-6.5p1/ssh-add.1 b/openssh-6.5p1/ssh-add.1 +--- a/openssh-6.5p1/ssh-add.1 ++++ b/openssh-6.5p1/ssh-add.1 +@@ -156,16 +156,30 @@ or related script. (Note that on some machines it may be necessary to redirect the input from .Pa /dev/null @@ -290,10 +290,10 @@ diff --git a/openssh-6.4p1/ssh-add.1 b/openssh-6.4p1/ssh-add.1 .It Pa ~/.ssh/id_dsa Contains the protocol version 2 DSA authentication identity of the user. .It Pa ~/.ssh/id_ecdsa -diff --git a/openssh-6.4p1/ssh-agent.1 b/openssh-6.4p1/ssh-agent.1 ---- a/openssh-6.4p1/ssh-agent.1 -+++ b/openssh-6.4p1/ssh-agent.1 -@@ -193,16 +193,33 @@ Contains the protocol version 2 ECDSA au +diff --git a/openssh-6.5p1/ssh-agent.1 b/openssh-6.5p1/ssh-agent.1 +--- a/openssh-6.5p1/ssh-agent.1 ++++ b/openssh-6.5p1/ssh-agent.1 +@@ -196,16 +196,33 @@ Contains the protocol version 2 ED25519 .It Pa ~/.ssh/id_rsa Contains the protocol version 2 RSA authentication identity of the user. .It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.\*(Ltppid\*(Gt @@ -327,10 +327,10 @@ diff --git a/openssh-6.4p1/ssh-agent.1 b/openssh-6.4p1/ssh-agent.1 .Sh AUTHORS OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. -diff --git a/openssh-6.4p1/ssh-keygen.1 b/openssh-6.4p1/ssh-keygen.1 ---- a/openssh-6.4p1/ssh-keygen.1 -+++ b/openssh-6.4p1/ssh-keygen.1 -@@ -800,16 +800,33 @@ on all machines +diff --git a/openssh-6.5p1/ssh-keygen.1 b/openssh-6.5p1/ssh-keygen.1 +--- a/openssh-6.5p1/ssh-keygen.1 ++++ b/openssh-6.5p1/ssh-keygen.1 +@@ -827,16 +827,33 @@ on all machines where the user wishes to log in using public key authentication. There is no need to keep the contents of this file secret. .Pp @@ -364,14 +364,14 @@ diff --git a/openssh-6.4p1/ssh-keygen.1 b/openssh-6.4p1/ssh-keygen.1 .Xr sshd 8 .Rs .%R RFC 4716 -diff --git a/openssh-6.4p1/ssh-keysign.8 b/openssh-6.4p1/ssh-keysign.8 ---- a/openssh-6.4p1/ssh-keysign.8 -+++ b/openssh-6.4p1/ssh-keysign.8 -@@ -73,16 +73,33 @@ Since they are readable only by root, - must be set-uid root if host-based authentication is used. +diff --git a/openssh-6.5p1/ssh-keysign.8 b/openssh-6.5p1/ssh-keysign.8 +--- a/openssh-6.5p1/ssh-keysign.8 ++++ b/openssh-6.5p1/ssh-keysign.8 +@@ -75,16 +75,33 @@ must be set-uid root if host-based authe .Pp .It Pa /etc/ssh/ssh_host_dsa_key-cert.pub .It Pa /etc/ssh/ssh_host_ecdsa_key-cert.pub + .It Pa /etc/ssh/ssh_host_ed25519_key-cert.pub .It Pa /etc/ssh/ssh_host_rsa_key-cert.pub If these files exist they are assumed to contain public certificate information corresponding with the private keys above. @@ -401,10 +401,10 @@ diff --git a/openssh-6.4p1/ssh-keysign.8 b/openssh-6.4p1/ssh-keysign.8 .Sh HISTORY .Nm first appeared in -diff --git a/openssh-6.4p1/ssh.1 b/openssh-6.4p1/ssh.1 ---- a/openssh-6.4p1/ssh.1 -+++ b/openssh-6.4p1/ssh.1 -@@ -1290,16 +1290,30 @@ reads +diff --git a/openssh-6.5p1/ssh.1 b/openssh-6.5p1/ssh.1 +--- a/openssh-6.5p1/ssh.1 ++++ b/openssh-6.5p1/ssh.1 +@@ -1304,16 +1304,30 @@ reads and adds lines of the format .Dq VARNAME=value to the environment if the file exists and users are allowed to @@ -435,10 +435,10 @@ diff --git a/openssh-6.4p1/ssh.1 b/openssh-6.4p1/ssh.1 world-readable if the user's home directory is on an NFS partition, because .Xr sshd 8 -diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 ---- a/openssh-6.4p1/sshd.8 -+++ b/openssh-6.4p1/sshd.8 -@@ -941,16 +941,33 @@ and not group or world-writable. +diff --git a/openssh-6.5p1/sshd.8 b/openssh-6.5p1/sshd.8 +--- a/openssh-6.5p1/sshd.8 ++++ b/openssh-6.5p1/sshd.8 +@@ -946,16 +946,33 @@ and not group or world-writable. .It Pa /var/run/sshd.pid Contains the process ID of the .Nm @@ -472,9 +472,9 @@ diff --git a/openssh-6.4p1/sshd.8 b/openssh-6.4p1/sshd.8 .Xr ssh-agent 1 , .Xr ssh-keygen 1 , .Xr ssh-keyscan 1 , -diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c ---- a/openssh-6.4p1/sshd.c -+++ b/openssh-6.4p1/sshd.c +diff --git a/openssh-6.5p1/sshd.c b/openssh-6.5p1/sshd.c +--- a/openssh-6.5p1/sshd.c ++++ b/openssh-6.5p1/sshd.c @@ -50,16 +50,18 @@ #ifdef HAVE_SYS_STAT_H # include @@ -518,7 +518,7 @@ diff --git a/openssh-6.4p1/sshd.c b/openssh-6.4p1/sshd.c /* This is set to true when a signal is received. */ static volatile sig_atomic_t received_sighup = 0; static volatile sig_atomic_t received_sigterm = 0; -@@ -1300,16 +1309,21 @@ server_accept_loop(int *sock_in, int *so +@@ -1313,16 +1322,21 @@ server_accept_loop(int *sock_in, int *so for (j = 0; j < options.max_startups; j++) if (startup_pipes[j] == -1) { startup_pipes[j] = startup_p[0]; diff --git a/openssh-6.4p1-send_locale.patch b/openssh-6.5p1-send_locale.patch similarity index 80% rename from openssh-6.4p1-send_locale.patch rename to openssh-6.5p1-send_locale.patch index 45df36c..2d67445 100644 --- a/openssh-6.4p1-send_locale.patch +++ b/openssh-6.5p1-send_locale.patch @@ -1,9 +1,9 @@ # send locales in default configuration # bnc#65747 -diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config ---- a/openssh-6.4p1/ssh_config -+++ b/openssh-6.4p1/ssh_config +diff --git a/openssh-6.5p1/ssh_config b/openssh-6.5p1/ssh_config +--- a/openssh-6.5p1/ssh_config ++++ b/openssh-6.5p1/ssh_config @@ -58,9 +58,14 @@ ForwardX11Trusted yes # ProxyCommand ssh -q -W %h:%p gateway.example.com @@ -19,10 +19,10 @@ diff --git a/openssh-6.4p1/ssh_config b/openssh-6.4p1/ssh_config +SendEnv LC_IDENTIFICATION LC_ALL + # RekeyLimit 1G 1h -diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config ---- a/openssh-6.4p1/sshd_config -+++ b/openssh-6.4p1/sshd_config -@@ -125,13 +125,18 @@ UsePrivilegeSeparation sandbox # Defaul +diff --git a/openssh-6.5p1/sshd_config b/openssh-6.5p1/sshd_config +--- a/openssh-6.5p1/sshd_config ++++ b/openssh-6.5p1/sshd_config +@@ -127,14 +127,19 @@ UsePrivilegeSeparation sandbox # Defaul #VersionAddendum none # no default banner path @@ -40,4 +40,5 @@ diff --git a/openssh-6.4p1/sshd_config b/openssh-6.4p1/sshd_config #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no + # PermitTTY no # ForceCommand cvs server diff --git a/openssh-6.5p1-sftp_force_permissions.patch b/openssh-6.5p1-sftp_force_permissions.patch new file mode 100644 index 0000000..00bef0e --- /dev/null +++ b/openssh-6.5p1-sftp_force_permissions.patch @@ -0,0 +1,155 @@ +# additional option for sftp-server to force file mode for new files +# FATE#312774 +# http://lists.mindrot.org/pipermail/openssh-unix-dev/2010-November/029044.html +# http://marc.info/?l=openssh-unix-dev&m=128896838930893 + +diff --git a/openssh-6.5p1/sftp-server.8 b/openssh-6.5p1/sftp-server.8 +--- a/openssh-6.5p1/sftp-server.8 ++++ b/openssh-6.5p1/sftp-server.8 +@@ -33,16 +33,17 @@ + .Bk -words + .Op Fl ehR + .Op Fl d Ar start_directory + .Op Fl f Ar log_facility + .Op Fl l Ar log_level + .Op Fl P Ar blacklisted_requests + .Op Fl p Ar whitelisted_requests + .Op Fl u Ar umask ++.Op Fl m Ar force_file_permissions + .Ek + .Nm + .Fl Q Ar protocol_feature + .Sh DESCRIPTION + .Nm + is a program that speaks the server side of SFTP protocol + to stdout and expects client requests from stdin. + .Nm +@@ -133,16 +134,20 @@ Places this instance of + into a read-only mode. + Attempts to open files for writing, as well as other operations that change + the state of the filesystem, will be denied. + .It Fl u Ar umask + Sets an explicit + .Xr umask 2 + to be applied to newly-created files and directories, instead of the + user's default mask. ++.It Fl m Ar force_file_permissions ++Sets explicit file permissions to be applied to newly-created files instead ++of the default or client requested mode. Numeric values include: ++777, 755, 750, 666, 644, 640, etc. Option -u is ineffective if -m is set. + .El + .Pp + For logging to work, + .Nm + must be able to access + .Pa /dev/log . + Use of + .Nm +diff --git a/openssh-6.5p1/sftp-server.c b/openssh-6.5p1/sftp-server.c +--- a/openssh-6.5p1/sftp-server.c ++++ b/openssh-6.5p1/sftp-server.c +@@ -75,16 +75,20 @@ static u_int version; + static int init_done; + + /* Disable writes */ + static int readonly; + + /* Requests that are allowed/denied */ + static char *request_whitelist, *request_blacklist; + ++/* Force file permissions */ ++int permforce = 0; ++long permforcemode; ++ + /* portable attributes, etc. */ + typedef struct Stat Stat; + + struct Stat { + char *name; + char *long_name; + Attrib attrib; + }; +@@ -670,16 +674,20 @@ process_open(u_int32_t id) + int handle, fd, flags, mode, status = SSH2_FX_FAILURE; + + name = get_string(NULL); + pflags = get_int(); /* portable flags */ + debug3("request %u: open flags %d", id, pflags); + a = get_attrib(); + flags = flags_from_portable(pflags); + mode = (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) ? a->perm : 0666; ++ if (permforce == 1) { ++ mode = permforcemode; ++ (void)umask(0); /* so umask does not interfere */ ++ } + logit("open \"%s\" flags %s mode 0%o", + name, string_from_portable(pflags), mode); + if (readonly && + ((flags & O_ACCMODE) == O_WRONLY || + (flags & O_ACCMODE) == O_RDWR)) { + verbose("Refusing open request in read-only mode"); + status = SSH2_FX_PERMISSION_DENIED; + } else { +@@ -1425,17 +1433,18 @@ sftp_server_cleanup_exit(int i) + static void + sftp_server_usage(void) + { + extern char *__progname; + + fprintf(stderr, + "usage: %s [-ehR] [-d start_directory] [-f log_facility] " + "[-l log_level]\n\t[-P blacklisted_requests] " +- "[-p whitelisted_requests] [-u umask]\n" ++ "[-p whitelisted_requests] [-u umask]\n\t" ++ "[-m force_file_permissions]\n", + " %s -Q protocol_feature\n", + __progname, __progname); + exit(1); + } + + int + sftp_server_main(int argc, char **argv, struct passwd *user_pw) + { +@@ -1450,17 +1459,17 @@ sftp_server_main(int argc, char **argv, + extern char *__progname; + + __progname = ssh_get_progname(argv[0]); + log_init(__progname, log_level, log_facility, log_stderr); + + pw = pwcopy(user_pw); + + while (!skipargs && (ch = getopt(argc, argv, +- "d:f:l:P:p:Q:u:cehR")) != -1) { ++ "d:f:l:P:p:Q:u:m:cehR")) != -1) { + switch (ch) { + case 'Q': + if (strcasecmp(optarg, "requests") != 0) { + fprintf(stderr, "Invalid query type\n"); + exit(1); + } + for (i = 0; handlers[i].handler != NULL; i++) + printf("%s\n", handlers[i].name); +@@ -1510,16 +1519,23 @@ sftp_server_main(int argc, char **argv, + case 'u': + errno = 0; + mask = strtol(optarg, &cp, 8); + if (mask < 0 || mask > 0777 || *cp != '\0' || + cp == optarg || (mask == 0 && errno != 0)) + fatal("Invalid umask \"%s\"", optarg); + (void)umask((mode_t)mask); + break; ++ case 'm': ++ permforce = 1; ++ permforcemode = strtol(optarg, &cp, 8); ++ if (permforcemode < 0 || permforcemode > 0777 || *cp != '\0' || ++ cp == optarg || (permforcemode == 0 && errno != 0)) ++ fatal("Invalid umask \"%s\"", optarg); ++ break; + case 'h': + default: + sftp_server_usage(); + } + } + + log_init(__progname, log_level, log_facility, log_stderr); + diff --git a/openssh-6.4p1-sftp_homechroot.patch b/openssh-6.5p1-sftp_homechroot.patch similarity index 84% rename from openssh-6.4p1-sftp_homechroot.patch rename to openssh-6.5p1-sftp_homechroot.patch index 09127bb..d5b28f1 100644 --- a/openssh-6.4p1-sftp_homechroot.patch +++ b/openssh-6.5p1-sftp_homechroot.patch @@ -1,8 +1,8 @@ # run sftp sessions inside a chroot -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c @@ -120,16 +120,18 @@ int do_exec(Session *, const char *); void do_login(Session *, const char *); #ifdef LOGIN_NEEDS_UTMPX @@ -22,13 +22,13 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c /* import */ extern ServerOptions options; extern char *__progname; -@@ -818,16 +820,21 @@ do_exec(Session *s, const char *command) - if (IS_INTERNAL_SFTP(command)) { - s->is_subsystem = s->is_subsystem ? - SUBSYSTEM_INT_SFTP : SUBSYSTEM_INT_SFTP_ERROR; - } else if (s->is_subsystem) - s->is_subsystem = SUBSYSTEM_EXT; - debug("Forced command (key option) '%.900s'", command); +@@ -827,16 +829,21 @@ do_exec(Session *s, const char *command) + "subsystem '%.900s'", s->subsys); + } else if (command == NULL) { + snprintf(session_type, sizeof(session_type), "shell"); + } else { + /* NB. we don't log unforced commands to preserve privacy */ + snprintf(session_type, sizeof(session_type), "command"); } + if ((s->is_subsystem != SUBSYSTEM_INT_SFTP) && chroot_no_tree) { @@ -36,15 +36,15 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c + exit (1); + } + - #ifdef SSH_AUDIT_EVENTS - if (s->command != NULL || s->command_handle != -1) - fatal("do_exec: command already set"); - if (command != NULL) - s->command = xstrdup(command); - else if (s->ttyfd == -1) { - char *shell = s->pw->pw_shell; + if (s->ttyfd != -1) { + tty = s->tty; + if (strncmp(tty, "/dev/", 5) == 0) + tty += 5; + } -@@ -1435,67 +1442,132 @@ do_nologin(struct passwd *pw) + verbose("Starting session: %s%s%s for %s from %.200s port %d", + session_type, +@@ -1458,67 +1465,132 @@ do_nologin(struct passwd *pw) while (fgets(buf, sizeof(buf), f)) fputs(buf, stderr); fclose(f); @@ -179,10 +179,10 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c do_setusercontext(struct passwd *pw) { char *chroot_path, *tmp; -diff --git a/openssh-6.4p1/sftp-chrootenv.h b/openssh-6.4p1/sftp-chrootenv.h +diff --git a/openssh-6.5p1/sftp-chrootenv.h b/openssh-6.5p1/sftp-chrootenv.h new file mode 100644 --- /dev/null -+++ b/openssh-6.4p1/sftp-chrootenv.h ++++ b/openssh-6.5p1/sftp-chrootenv.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2009 Jan F Chadima. All rights reserved. @@ -214,10 +214,10 @@ new file mode 100644 + +#endif + -diff --git a/openssh-6.4p1/sftp-common.c b/openssh-6.4p1/sftp-common.c ---- a/openssh-6.4p1/sftp-common.c -+++ b/openssh-6.4p1/sftp-common.c -@@ -41,16 +41,17 @@ +diff --git a/openssh-6.5p1/sftp-common.c b/openssh-6.5p1/sftp-common.c +--- a/openssh-6.5p1/sftp-common.c ++++ b/openssh-6.5p1/sftp-common.c +@@ -42,16 +42,17 @@ #endif #include "xmalloc.h" @@ -235,13 +235,13 @@ diff --git a/openssh-6.4p1/sftp-common.c b/openssh-6.4p1/sftp-common.c a->flags = 0; a->size = 0; a->uid = 0; -@@ -191,23 +192,23 @@ ls_file(const char *name, const struct s - { +@@ -193,23 +194,23 @@ ls_file(const char *name, const struct s int ulen, glen, sz = 0; struct tm *ltime = localtime(&st->st_mtime); char *user, *group; char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char sbuf[FMT_SCALED_STRSIZE]; + time_t now; strmode(st->st_mode, mode); - if (!remote) { @@ -259,11 +259,11 @@ diff --git a/openssh-6.4p1/sftp-common.c b/openssh-6.4p1/sftp-common.c group = gbuf; } if (ltime != NULL) { - if (time(NULL) - st->st_mtime < (365*24*60*60)/2) - sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime); -diff --git a/openssh-6.4p1/sftp-server-main.c b/openssh-6.4p1/sftp-server-main.c ---- a/openssh-6.4p1/sftp-server-main.c -+++ b/openssh-6.4p1/sftp-server-main.c + now = time(NULL); + if (now - (365*24*60*60)/2 < st->st_mtime && +diff --git a/openssh-6.5p1/sftp-server-main.c b/openssh-6.5p1/sftp-server-main.c +--- a/openssh-6.5p1/sftp-server-main.c ++++ b/openssh-6.5p1/sftp-server-main.c @@ -17,21 +17,24 @@ #include "includes.h" @@ -289,10 +289,10 @@ diff --git a/openssh-6.4p1/sftp-server-main.c b/openssh-6.4p1/sftp-server-main.c int main(int argc, char **argv) -diff --git a/openssh-6.4p1/sftp.c b/openssh-6.4p1/sftp.c ---- a/openssh-6.4p1/sftp.c -+++ b/openssh-6.4p1/sftp.c -@@ -106,16 +106,18 @@ struct complete_ctx { +diff --git a/openssh-6.5p1/sftp.c b/openssh-6.5p1/sftp.c +--- a/openssh-6.5p1/sftp.c ++++ b/openssh-6.5p1/sftp.c +@@ -109,16 +109,18 @@ struct complete_ctx { char **remote_pathp; }; @@ -311,9 +311,9 @@ diff --git a/openssh-6.4p1/sftp.c b/openssh-6.4p1/sftp.c #define LS_SHORT_VIEW 0x0002 /* Single row view ala ls -1 */ #define LS_NUMERIC_VIEW 0x0004 /* Long view with numeric uid/gid */ #define LS_NAME_SORT 0x0008 /* Sort by name (default) */ -diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 ---- a/openssh-6.4p1/sshd_config.0 -+++ b/openssh-6.4p1/sshd_config.0 +diff --git a/openssh-6.5p1/sshd_config.0 b/openssh-6.5p1/sshd_config.0 +--- a/openssh-6.5p1/sshd_config.0 ++++ b/openssh-6.5p1/sshd_config.0 @@ -189,16 +189,24 @@ DESCRIPTION session this requires at least a shell, typically sh(1), and basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), @@ -335,13 +335,13 @@ diff --git a/openssh-6.4p1/sshd_config.0 b/openssh-6.4p1/sshd_config.0 Ciphers Specifies the ciphers allowed for protocol version 2. Multiple - ciphers must be comma-separated. The supported ciphers are + ciphers must be comma-separated. The supported ciphers are: + ``3des-cbc'', ``aes128-cbc'', ``aes192-cbc'', ``aes256-cbc'', ``aes128-ctr'', ``aes192-ctr'', ``aes256-ctr'', - ``aes128-gcm@openssh.com'', ``aes256-gcm@openssh.com'', -diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 ---- a/openssh-6.4p1/sshd_config.5 -+++ b/openssh-6.4p1/sshd_config.5 +diff --git a/openssh-6.5p1/sshd_config.5 b/openssh-6.5p1/sshd_config.5 +--- a/openssh-6.5p1/sshd_config.5 ++++ b/openssh-6.5p1/sshd_config.5 @@ -324,16 +324,27 @@ For file transfer sessions using no additional configuration of the environment is necessary if the in-process sftp server is used, @@ -367,6 +367,6 @@ diff --git a/openssh-6.4p1/sshd_config.5 b/openssh-6.4p1/sshd_config.5 .It Cm Ciphers Specifies the ciphers allowed for protocol version 2. Multiple ciphers must be comma-separated. - The supported ciphers are + The supported ciphers are: + .Pp .Dq 3des-cbc , - .Dq aes128-cbc , diff --git a/openssh-6.4p1-xauth.patch b/openssh-6.5p1-xauth.patch similarity index 87% rename from openssh-6.4p1-xauth.patch rename to openssh-6.5p1-xauth.patch index 97a4484..e799eed 100644 --- a/openssh-6.4p1-xauth.patch +++ b/openssh-6.5p1-xauth.patch @@ -1,10 +1,10 @@ # try to remove xauth cookies on logout # bnc#98815 -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c -@@ -2477,18 +2477,50 @@ session_exit_message(Session *s, int sta +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c +@@ -2505,18 +2505,50 @@ session_exit_message(Session *s, int sta if (c->ostate != CHAN_OUTPUT_CLOSED) chan_write_failed(c); } diff --git a/openssh-6.4p1-xauthlocalhostname.patch b/openssh-6.5p1-xauthlocalhostname.patch similarity index 86% rename from openssh-6.4p1-xauthlocalhostname.patch rename to openssh-6.5p1-xauthlocalhostname.patch index 3ca28e5..1b9ea8c 100644 --- a/openssh-6.4p1-xauthlocalhostname.patch +++ b/openssh-6.5p1-xauthlocalhostname.patch @@ -1,10 +1,10 @@ # handle hostname changes when forwarding X # bnc#98627 -diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c ---- a/openssh-6.4p1/session.c -+++ b/openssh-6.4p1/session.c -@@ -1118,17 +1118,17 @@ copy_environment(char **source, char *** +diff --git a/openssh-6.5p1/session.c b/openssh-6.5p1/session.c +--- a/openssh-6.5p1/session.c ++++ b/openssh-6.5p1/session.c +@@ -1141,17 +1141,17 @@ copy_environment(char **source, char *** debug3("Copy environment: %s=%s", var_name, var_val); child_set_env(env, envsize, var_name, var_val); @@ -23,7 +23,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c #if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) char *path = NULL; #endif -@@ -1305,25 +1305,27 @@ do_setup_env(Session *s, const char *she +@@ -1328,25 +1328,27 @@ do_setup_env(Session *s, const char *she read_environment_file(&env, &envsize, buf); } if (debug_flag) { @@ -52,7 +52,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c do_xauth = s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; -@@ -1367,22 +1369,30 @@ do_rc_files(Session *s, const char *shel +@@ -1390,22 +1392,30 @@ do_rc_files(Session *s, const char *shel "%.500s add %.100s %.100s %.100s\n", options.xauth_location, s->auth_display, s->auth_proto, s->auth_data); @@ -83,7 +83,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c } static void -@@ -1631,16 +1641,17 @@ child_close_fds(void) +@@ -1659,16 +1669,17 @@ child_close_fds(void) * ids, and executing the command or shell. */ #define ARGV_MAX 10 @@ -101,7 +101,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c /* remove hostkey from the child's memory */ destroy_sensitive_data(); -@@ -1697,17 +1708,17 @@ do_child(Session *s, const char *command +@@ -1725,17 +1736,17 @@ do_child(Session *s, const char *command * legal, and means /bin/sh. */ shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; @@ -120,7 +120,7 @@ diff --git a/openssh-6.4p1/session.c b/openssh-6.4p1/session.c /* we have to stash the hostname before we close our socket. */ if (options.use_login) hostname = get_remote_name_or_ip(utmp_len, -@@ -1766,17 +1777,17 @@ do_child(Session *s, const char *command +@@ -1794,17 +1805,17 @@ do_child(Session *s, const char *command strerror(errno)); if (r) exit(1); diff --git a/openssh-6.5p1.tar.gz b/openssh-6.5p1.tar.gz new file mode 100644 index 0000000..915ff6b --- /dev/null +++ b/openssh-6.5p1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1195ed55db945252d5a1730d4a2a2a5c1c9a6aa01ef2e5af750a962623d9027 +size 1293187 diff --git a/openssh-askpass-gnome.changes b/openssh-askpass-gnome.changes index 96ca191..d8ff328 100644 --- a/openssh-askpass-gnome.changes +++ b/openssh-askpass-gnome.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 12 01:24:16 UTC 2014 - pcerny@suse.com + +- Update of the underlying OpenSSH to 6.5p1 + ------------------------------------------------------------------- Fri Jan 24 15:13:09 UTC 2014 - pcerny@suse.com diff --git a/openssh-askpass-gnome.spec b/openssh-askpass-gnome.spec index ff959eb..6738eef 100644 --- a/openssh-askpass-gnome.spec +++ b/openssh-askpass-gnome.spec @@ -26,7 +26,7 @@ BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: tcpd-devel BuildRequires: update-desktop-files -Version: 6.4p1 +Version: 6.5p1 Release: 0 Requires: openssh = %{version} Summary: A GNOME-Based Passphrase Dialog for OpenSSH diff --git a/openssh.changes b/openssh.changes index 350dc56..5c78c3a 100644 --- a/openssh.changes +++ b/openssh.changes @@ -1,3 +1,98 @@ +------------------------------------------------------------------- +Wed Feb 12 01:24:16 UTC 2014 - pcerny@suse.com + +- Update to 6.5p1 + Features since 6.4p1: + * ssh(1), sshd(8): support for key exchange using ECDH in + Daniel Bernstein's Curve25519; default when both the client + and server support it. + * ssh(1), sshd(8): support for Ed25519 as a public key type fo + rboth server and client. Ed25519 is an EC signature offering + better security than ECDSA and DSA and good performance. + * Add a new private key format that uses a bcrypt KDF to better + protect keys at rest. Used unconditionally for Ed25519 keys, + on demand for other key types via the -o ssh-keygen(1) + option. Intended to become default in the near future. + Details documented in PROTOCOL.key. + * ssh(1), sshd(8): new transport cipher + "chacha20-poly1305@openssh.com" combining Daniel Bernstein's + ChaCha20 stream cipher and Poly1305 MAC to build an + authenticated encryption mode. Details documented + PROTOCOL.chacha20poly1305. + * ssh(1), sshd(8): refuse RSA keys from old proprietary clients + and servers that use the obsolete RSA+MD5 signature scheme. + It will still be possible to connect with these + clients/servers but only DSA keys will be accepted, and + OpenSSH will refuse connection entirely in a future release. + * ssh(1), sshd(8): refuse old proprietary clients and servers + that use a weaker key exchange hash calculation. + * ssh(1): increase the size of the Diffie-Hellman groups + requested for each symmetric key size. New values from NIST + Special Publication 800-57 with the upper limit specified by + RFC4419. + * ssh(1), ssh-agent(1): support pkcs#11 tokens that only + provide X.509 certs instead of raw public keys (requested as + bz#1908). + * ssh(1): new ssh_config(5) "Match" keyword that allows + conditional configuration to be applied by matching on + hostname, user and result of arbitrary commands. + * ssh(1): support for client-side hostname canonicalisation + using a set of DNS suffixes and rules in ssh_config(5). This + allows unqualified names to be canonicalised to + fully-qualified domain names to eliminate ambiguity when + looking up keys in known_hosts or checking host certificate + names. + * sftp-server(8): ability to whitelist and/or blacklist sftp + protocol requests by name. + * sftp-server(8): sftp "fsync@openssh.com" to support calling + fsync(2) on an open file handle. + * sshd(8): ssh_config(5) PermitTTY to disallow TTY allocation, + mirroring the longstanding no-pty authorized_keys option. + * ssh(1): ssh_config ProxyUseFDPass option that supports the + use of ProxyCommands that establish a connection and then + pass a connected file descriptor back to ssh(1). This allows + the ProxyCommand to exit rather than staying around to + transfer data. + Bugfixes since 6.4p1: + * ssh(1), sshd(8): fix potential stack exhaustion caused by + nested certificates. + * ssh(1): bz#1211: make BindAddress work with + UsePrivilegedPort. + * sftp(1): bz#2137: fix the progress meter for resumed + transfer. + * ssh-add(1): bz#2187: do not request smartcard PIN when + removing keys from ssh-agent. + * sshd(8): bz#2139: fix re-exec fallback when original sshd + binary cannot be executed. + * ssh-keygen(1): make relative-specified certificate expiry + times relative to current time and not the validity start + time. + * sshd(8): bz#2161: fix AuthorizedKeysCommand inside a Match + block. + * sftp(1): bz#2129: symlinking a file would incorrectly + canonicalise the target path. + * ssh-agent(1): bz#2175: fix a use-after-free in the PKCS#11 + agent helper executable. + * sshd(8): improve logging of sessions to include the user + name, remote host and port, the session type (shell, command, + etc.) and allocated TTY (if any). + * sshd(8): bz#1297: tell the client (via a debug message) when + their preferred listen address has been overridden by the + server's GatewayPorts setting. + * sshd(8): bz#2162: include report port in bad protocol banner + message. + * sftp(1): bz#2163: fix memory leak in error path in + do_readdir(). + * sftp(1): bz#2171: don't leak file descriptor on error. + * sshd(8): include the local address and port in "Connection + from ..." message (only shown at loglevel>=verbose). +- systemd systems + * create sysconfig file on systemd systems as well, yet do not + require it at run-time (bnc#862600) + * symlink rcsshd to /usr/bin/service +- rename "-forcepermissions" patch to "-sftp_force_permissions" +- disable key converter - ssh-keygen is able to do the same + ------------------------------------------------------------------- Tue Feb 11 07:42:09 UTC 2014 - meissner@suse.com diff --git a/openssh.spec b/openssh.spec index af59b68..1fdb4e0 100644 --- a/openssh.spec +++ b/openssh.spec @@ -41,17 +41,22 @@ %endif %if 0%{?suse_version} > 1140 -%define has_systemd 1 %define has_krb_mini 1 %else -%define has_systemd 0 %define has_krb_mini 0 %endif -%if 0%{?suse_version} >= 1230 -%define init_script_allowed 0 +%if 0%{?suse_version} > 1220 +%define uses_systemd 1 %else -%define init_script_allowed 1 +%define uses_systemd 0 +%endif + +%define sandbox_seccomp 0 +%ifarch %ix86 x86_64 +%if 0%{?suse_version} > 1220 +%define sandbox_seccomp 1 +%endif %endif %define _fwdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d @@ -77,17 +82,16 @@ BuildRequires: libselinux-devel BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pam-devel -%if %{has_systemd} +%if %{uses_systemd} BuildRequires: pkgconfig(systemd) %{?systemd_requires} %endif BuildRequires: tcpd-devel -Requires: /bin/netstat PreReq: pwdutils %{insserv_prereq} %{fillup_prereq} coreutils Conflicts: nonfreessh Recommends: xauth Recommends: %{name}-helpers -Version: 6.4p1 +Version: 6.5p1 Release: 0 Summary: Secure Shell Client and Server (Remote Login Program) License: BSD-3-Clause and MIT @@ -104,40 +108,41 @@ Source7: sshd.fw Source8: sysconfig.ssh Source9: sshd-gen-keys-start Source10: sshd.service -Patch1: openssh-6.4p1-key-converter.patch -Patch2: openssh-6.4p1-X11-forwarding.patch -Patch3: openssh-6.4p1-lastlog.patch -Patch4: openssh-6.4p1-pam-fix2.patch -Patch5: openssh-6.4p1-saveargv-fix.patch -Patch6: openssh-6.4p1-pam-fix3.patch -Patch7: openssh-6.4p1-gssapimitm.patch -Patch8: openssh-6.4p1-eal3.patch -Patch9: openssh-6.4p1-blocksigalrm.patch -Patch10: openssh-6.4p1-send_locale.patch -Patch11: openssh-6.4p1-xauthlocalhostname.patch -Patch12: openssh-6.4p1-xauth.patch -Patch13: openssh-6.4p1-default-protocol.patch -Patch14: openssh-6.4p1-pts.patch -Patch15: openssh-6.4p1-pam-check-locks.patch -Patch16: openssh-6.4p1-fingerprint_hash.patch -Patch17: openssh-6.4p1-audit1-remove_duplicit_audit.patch -Patch18: openssh-6.4p1-audit2-better_audit_of_user_actions.patch -Patch19: openssh-6.4p1-audit3-key_auth_usage.patch -Patch20: openssh-6.4p1-audit4-kex_results.patch -Patch21: openssh-6.4p1-audit5-session_key_destruction.patch -Patch22: openssh-6.4p1-audit6-server_key_destruction.patch -Patch23: openssh-6.4p1-audit7-libaudit_compat.patch -Patch24: openssh-6.4p1-audit8-libaudit_dns_timeouts.patch -Patch25: openssh-6.4p1-seed-prng.patch -Patch26: openssh-6.4p1-ldap.patch -Patch27: openssh-6.4p1-fips.patch -Patch28: openssh-6.4p1-gssapi_key_exchange.patch -Patch29: openssh-6.4p1-login_options.patch -Patch30: openssh-6.4p1-disable-openssl-abi-check.patch -Patch31: openssh-6.4p1-no_fork-no_pid_file.patch -Patch32: openssh-6.4p1-host_ident.patch -Patch33: openssh-6.4p1-sftp_homechroot.patch -Patch34: openssh-6.4p1-forcepermissions.patch +Patch1: openssh-6.5p1-key-converter.patch +Patch2: openssh-6.5p1-X11-forwarding.patch +Patch3: openssh-6.5p1-lastlog.patch +Patch4: openssh-6.5p1-pam-fix2.patch +Patch5: openssh-6.5p1-saveargv-fix.patch +Patch6: openssh-6.5p1-pam-fix3.patch +Patch7: openssh-6.5p1-gssapimitm.patch +Patch8: openssh-6.5p1-eal3.patch +Patch9: openssh-6.5p1-blocksigalrm.patch +Patch10: openssh-6.5p1-send_locale.patch +Patch11: openssh-6.5p1-xauthlocalhostname.patch +Patch12: openssh-6.5p1-xauth.patch +Patch13: openssh-6.5p1-default-protocol.patch +Patch14: openssh-6.5p1-pts.patch +Patch15: openssh-6.5p1-pam-check-locks.patch +Patch16: openssh-6.5p1-fingerprint_hash.patch +Patch17: openssh-6.5p1-audit1-remove_duplicit_audit.patch +Patch18: openssh-6.5p1-audit2-better_audit_of_user_actions.patch +Patch19: openssh-6.5p1-audit3-key_auth_usage.patch +Patch20: openssh-6.5p1-audit4-kex_results.patch +Patch21: openssh-6.5p1-audit5-session_key_destruction.patch +Patch22: openssh-6.5p1-audit6-server_key_destruction.patch +Patch23: openssh-6.5p1-audit7-libaudit_compat.patch +Patch24: openssh-6.5p1-audit8-libaudit_dns_timeouts.patch +Patch25: openssh-6.5p1-seed-prng.patch +Patch26: openssh-6.5p1-ldap.patch +Patch27: openssh-6.5p1-fips.patch +Patch28: openssh-6.5p1-gssapi_key_exchange.patch +Patch29: openssh-6.5p1-login_options.patch +Patch30: openssh-6.5p1-disable-openssl-abi-check.patch +Patch31: openssh-6.5p1-no_fork-no_pid_file.patch +Patch32: openssh-6.5p1-host_ident.patch +Patch33: openssh-6.5p1-sftp_homechroot.patch +Patch34: openssh-6.5p1-sftp_force_permissions.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -162,7 +167,7 @@ Helper applications for OpenSSH which retrieve keys from various sources. %prep %setup -q -%patch1 -p2 +#patch1 -p2 %patch2 -p2 %patch3 -p2 %patch4 -p2 @@ -195,7 +200,7 @@ Helper applications for OpenSSH which retrieve keys from various sources. %patch31 -p2 %patch32 -p2 %patch33 -p2 -%patch34 -p1 +%patch34 -p2 cp %{SOURCE3} %{SOURCE4} . %build @@ -212,14 +217,14 @@ PIEFLAGS="-fPIE" PIEFLAGS="-fpie" %endif CFLAGS="%{optflags} $PIEFLAGS -fstack-protector" -%if 0%{?suse_version} < 1230 -CFLAGS="-lrt $CFLAGS" -%endif +#%if 0%{?suse_version} < 1230 +#CFLAGS="-lrt $CFLAGS" +#%endif CXXFLAGS="%{optflags} $PIEFLAGS -fstack-protector" LDFLAGS="-pie -Wl,--as-needed" -%if 0%{?suse_version} < 1230 -LDFLAGS="-lrt $LDFLAGS" -%endif +#%if 0%{?suse_version} < 1230 +#LDFLAGS="-lrt $LDFLAGS" +#%endif #CPPFLAGS="%{optflags} -DUSE_INTERNAL_B64" export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS ./configure \ @@ -232,14 +237,18 @@ export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS %if %{has_libselinux} --with-selinux \ %endif -%if %{has_systemd} +%if %{uses_systemd} --with-pid-dir=/run \ %endif --with-ssl-engine \ --with-pam \ --with-kerberos5=%{_prefix} \ --with-privsep-path=/var/lib/empty \ +%if %{sandbox_seccomp} + --with-sandbox=seccomp_filter \ +%else --with-sandbox=rlimit \ +%endif %ifnarch s390 s390x --with-opensc \ %endif @@ -253,24 +262,28 @@ export LDFLAGS CFLAGS CXXFLAGS CPPFLAGS --target=%{_target_cpu}-suse-linux \ ### configure end -make -j 1 +make %{?_smp_mflags} -make -j 1 -C converter +#make %{?_smp_mflags} -C converter %install make install DESTDIR=%{buildroot} -make install DESTDIR=%{buildroot} -C converter +#make install DESTDIR=%{buildroot} -C converter + install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d install -d -m 755 %{buildroot}/var/lib/sshd install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sshd install -d -m 755 %{buildroot}%{_sysconfdir}/slp.reg.d/ install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/slp.reg.d/ install -d -m 755 %{buildroot}%{_initddir} -%if %{init_script_allowed} -install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/sshd -ln -vs ../..%{_initddir}/sshd %{buildroot}%{_sbindir}/rcsshd +%if %{uses_systemd} +install -m 0755 %{SOURCE1} . +install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcsshd %else -install -m 755 %{SOURCE1} . +install -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/sshd +install -m 0644 %{SOURCE10} . +ln -s ../..%{_initddir}/sshd %{buildroot}%{_sbindir}/rcsshd %endif install -d -m 755 %{buildroot}/var/adm/fillup-templates install -m 644 %{SOURCE8} %{buildroot}/var/adm/fillup-templates @@ -289,44 +302,38 @@ install -m 644 %{SOURCE7} %{buildroot}%{_fwdefdir}/sshd # askpass wrapper sed -e "s,@LIBEXECDIR@,%{_libexecdir},g" < %{SOURCE6} > %{buildroot}%{_libexecdir}/ssh/ssh-askpass rm -f %{buildroot}%{_datadir}/Ssh.bin - -%if %{has_systemd} +# sshd keys generator wrapper install -D -m 0755 %{SOURCE9} %{buildroot}%{_sbindir}/sshd-gen-keys-start -install -D -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}/sshd.service -ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcsshd -%endif %pre getent group sshd >/dev/null || %{_sbindir}/groupadd -r sshd getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd -s /bin/false -c "SSH daemon" sshd -%if %{has_systemd} +%if %{uses_systemd} %service_add_pre sshd.service %endif %post -%if %{init_script_allowed} -%{fillup_and_insserv -n ssh sshd} -%endif -%if %{has_systemd} +%if %{uses_systemd} +%{fillup_only -n ssh sshd} %service_add_post sshd.service +%else +%{fillup_and_insserv -n ssh sshd} %endif %preun -%if %{init_script_allowed} -%stop_on_removal sshd -%endif -%if %{has_systemd} +%if %{uses_systemd} %service_del_preun sshd.service +%else +%stop_on_removal sshd %endif %postun -%if %{init_script_allowed} +%if %{uses_systemd} +%service_del_postun sshd.service +%else %restart_on_update sshd %{insserv_cleanup} %endif -%if %{has_systemd} -%service_del_postun sshd.service -%endif %files %defattr(-,root,root) @@ -337,10 +344,12 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %verify(not mode) %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config %verify(not mode) %attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd -%if %{init_script_allowed} -%attr(0755,root,root) %config %{_initddir}/sshd -%else +%if %{uses_systemd} %doc sshd.init +%attr(0644,root,root) %config %{_unitdir}/sshd.service +%else +%attr(0755,root,root) %config %{_initddir}/sshd +%doc sshd.service %endif %attr(0755,root,root) %{_bindir}/* %attr(0755,root,root) %{_sbindir}/* @@ -353,10 +362,6 @@ getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d /var/lib/sshd %dir %{_sysconfdir}/slp.reg.d %config %{_sysconfdir}/slp.reg.d/ssh.reg /var/adm/fillup-templates/sysconfig.ssh -%if %{has_systemd} -%{_sbindir}/sshd-gen-keys-start -%{_unitdir}/sshd.service -%endif %if %{has_fw_dir} %if %{needs_all_dirs} %dir %{_fwdir} diff --git a/sshd.init b/sshd.init index 71057ab..e42bb7a 100644 --- a/sshd.init +++ b/sshd.init @@ -56,7 +56,7 @@ rc_reset case "$1" in start) - ssh-keygen -A + /usr/sbin/sshd-gen-keys-start echo -n "Starting SSH daemon" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. diff --git a/sshd.service b/sshd.service index 87f4764..2c02aa5 100644 --- a/sshd.service +++ b/sshd.service @@ -3,7 +3,7 @@ Description=OpenSSH Daemon After=network.target [Service] -EnvironmentFile=/etc/sysconfig/ssh +EnvironmentFile=-/etc/sysconfig/ssh ExecStartPre=/usr/sbin/sshd-gen-keys-start ExecStart=/usr/sbin/sshd -D $SSHD_OPTS ExecReload=/bin/kill -HUP $MAINPID