summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-01-13 23:04:47 +0000
committerDamien Miller <djm@mindrot.org>2016-01-14 10:06:01 +1100
commited4ce82dbfa8a3a3c8ea6fa0db113c71e234416c (patch)
tree008ac3334471370857e32b48893cb6f07d28e987 /ssh.c
parent9a728cc918fad67c8a9a71201088b1e150340ba4 (diff)
upstream commit
eliminate fallback from untrusted X11 forwarding to trusted forwarding when the X server disables the SECURITY extension; Reported by Thomas Hoger; ok deraadt@ Upstream-ID: f76195bd2064615a63ef9674a0e4096b0713f938
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/ssh.c b/ssh.c
index 81704ab31..096c5b5d7 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.432 2015/12/11 03:20:09 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.433 2016/01/13 23:04:47 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1626,6 +1626,7 @@ ssh_session(void)
1626 struct winsize ws; 1626 struct winsize ws;
1627 char *cp; 1627 char *cp;
1628 const char *display; 1628 const char *display;
1629 char *proto = NULL, *data = NULL;
1629 1630
1630 /* Enable compression if requested. */ 1631 /* Enable compression if requested. */
1631 if (options.compression) { 1632 if (options.compression) {
@@ -1696,13 +1697,9 @@ ssh_session(void)
1696 display = getenv("DISPLAY"); 1697 display = getenv("DISPLAY");
1697 if (display == NULL && options.forward_x11) 1698 if (display == NULL && options.forward_x11)
1698 debug("X11 forwarding requested but DISPLAY not set"); 1699 debug("X11 forwarding requested but DISPLAY not set");
1699 if (options.forward_x11 && display != NULL) { 1700 if (options.forward_x11 && client_x11_get_proto(display,
1700 char *proto, *data; 1701 options.xauth_location, options.forward_x11_trusted,
1701 /* Get reasonable local authentication information. */ 1702 options.forward_x11_timeout, &proto, &data) == 0) {
1702 client_x11_get_proto(display, options.xauth_location,
1703 options.forward_x11_trusted,
1704 options.forward_x11_timeout,
1705 &proto, &data);
1706 /* Request forwarding with authentication spoofing. */ 1703 /* Request forwarding with authentication spoofing. */
1707 debug("Requesting X11 forwarding with authentication " 1704 debug("Requesting X11 forwarding with authentication "
1708 "spoofing."); 1705 "spoofing.");
@@ -1792,6 +1789,7 @@ ssh_session2_setup(int id, int success, void *arg)
1792 extern char **environ; 1789 extern char **environ;
1793 const char *display; 1790 const char *display;
1794 int interactive = tty_flag; 1791 int interactive = tty_flag;
1792 char *proto = NULL, *data = NULL;
1795 1793
1796 if (!success) 1794 if (!success)
1797 return; /* No need for error message, channels code sens one */ 1795 return; /* No need for error message, channels code sens one */
@@ -1799,12 +1797,9 @@ ssh_session2_setup(int id, int success, void *arg)
1799 display = getenv("DISPLAY"); 1797 display = getenv("DISPLAY");
1800 if (display == NULL && options.forward_x11) 1798 if (display == NULL && options.forward_x11)
1801 debug("X11 forwarding requested but DISPLAY not set"); 1799 debug("X11 forwarding requested but DISPLAY not set");
1802 if (options.forward_x11 && display != NULL) { 1800 if (options.forward_x11 && client_x11_get_proto(display,
1803 char *proto, *data; 1801 options.xauth_location, options.forward_x11_trusted,
1804 /* Get reasonable local authentication information. */ 1802 options.forward_x11_timeout, &proto, &data) == 0) {
1805 client_x11_get_proto(display, options.xauth_location,
1806 options.forward_x11_trusted,
1807 options.forward_x11_timeout, &proto, &data);
1808 /* Request forwarding with authentication spoofing. */ 1803 /* Request forwarding with authentication spoofing. */
1809 debug("Requesting X11 forwarding with authentication " 1804 debug("Requesting X11 forwarding with authentication "
1810 "spoofing."); 1805 "spoofing.");