summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--readconf.c29
-rw-r--r--readconf.h7
-rw-r--r--ssh.18
-rw-r--r--ssh_config.518
-rw-r--r--sshconnect.c18
6 files changed, 45 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index 70c06d785..5df3f91d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,14 @@
20 are of the expected "safe prime" structure and have had 20 are of the expected "safe prime" structure and have had
21 appropriate primality tests performed; 21 appropriate primality tests performed;
22 feedback and ok dtucker@ 22 feedback and ok dtucker@
23 - grunk@cvs.openbsd.org 2008/06/26 11:46:31
24 [readconf.c readconf.h ssh.1 ssh_config.5 sshconnect.c]
25 Move SSH Fingerprint Visualization away from sharing the config option
26 CheckHostIP to an own config option named VisualHostKey.
27 While there, fix the behaviour that ssh would draw a random art picture
28 on every newly seen host even when the option was not enabled.
29 prodded by deraadt@, discussions,
30 help and ok markus@ djm@ dtucker@
23 31
2420080628 3220080628
25 - (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec] 33 - (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec]
@@ -4440,4 +4448,4 @@
4440 OpenServer 6 and add osr5bigcrypt support so when someone migrates 4448 OpenServer 6 and add osr5bigcrypt support so when someone migrates
4441 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 4449 passwords between UnixWare and OpenServer they will still work. OK dtucker@
4442 4450
4443$Id: ChangeLog,v 1.5028 2008/06/29 12:47:04 djm Exp $ 4451$Id: ChangeLog,v 1.5029 2008/06/29 14:04:03 djm Exp $
diff --git a/readconf.c b/readconf.c
index 1d61145c4..73f6eb361 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.166 2008/06/11 21:01:35 grunk Exp $ */ 1/* $OpenBSD: readconf.c,v 1.167 2008/06/26 11:46:31 grunk 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
@@ -130,6 +130,7 @@ typedef enum {
130 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, 130 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
131 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, 131 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
132 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 132 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
133 oVisualHostKey,
133 oDeprecated, oUnsupported 134 oDeprecated, oUnsupported
134} OpCodes; 135} OpCodes;
135 136
@@ -226,6 +227,7 @@ static struct {
226 { "tunneldevice", oTunnelDevice }, 227 { "tunneldevice", oTunnelDevice },
227 { "localcommand", oLocalCommand }, 228 { "localcommand", oLocalCommand },
228 { "permitlocalcommand", oPermitLocalCommand }, 229 { "permitlocalcommand", oPermitLocalCommand },
230 { "visualhostkey", oVisualHostKey },
229 { NULL, oBadOption } 231 { NULL, oBadOption }
230}; 232};
231 233
@@ -452,23 +454,7 @@ parse_flag:
452 454
453 case oCheckHostIP: 455 case oCheckHostIP:
454 intptr = &options->check_host_ip; 456 intptr = &options->check_host_ip;
455 arg = strdelim(&s); 457 goto parse_flag;
456 if (!arg || *arg == '\0')
457 fatal("%.200s line %d: Missing CheckHostIP argument.",
458 filename, linenum);
459 value = 0; /* To avoid compiler warning... */
460 if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
461 value = SSHCTL_CHECKHOSTIP_YES;
462 else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0)
463 value = SSHCTL_CHECKHOSTIP_NO;
464 else if (strcmp(arg, "fingerprint") == 0)
465 value = SSHCTL_CHECKHOSTIP_FPR;
466 else
467 fatal("%.200s line %d: Bad CheckHostIP argument.",
468 filename, linenum);
469 if (*activep && *intptr == -1)
470 *intptr = value;
471 break;
472 458
473 case oVerifyHostKeyDNS: 459 case oVerifyHostKeyDNS:
474 intptr = &options->verify_host_key_dns; 460 intptr = &options->verify_host_key_dns;
@@ -931,6 +917,10 @@ parse_int:
931 intptr = &options->permit_local_command; 917 intptr = &options->permit_local_command;
932 goto parse_flag; 918 goto parse_flag;
933 919
920 case oVisualHostKey:
921 intptr = &options->visual_host_key;
922 goto parse_flag;
923
934 case oDeprecated: 924 case oDeprecated:
935 debug("%s line %d: Deprecated option \"%s\"", 925 debug("%s line %d: Deprecated option \"%s\"",
936 filename, linenum, keyword); 926 filename, linenum, keyword);
@@ -1081,6 +1071,7 @@ initialize_options(Options * options)
1081 options->tun_remote = -1; 1071 options->tun_remote = -1;
1082 options->local_command = NULL; 1072 options->local_command = NULL;
1083 options->permit_local_command = -1; 1073 options->permit_local_command = -1;
1074 options->visual_host_key = -1;
1084} 1075}
1085 1076
1086/* 1077/*
@@ -1215,6 +1206,8 @@ fill_default_options(Options * options)
1215 options->tun_remote = SSH_TUNID_ANY; 1206 options->tun_remote = SSH_TUNID_ANY;
1216 if (options->permit_local_command == -1) 1207 if (options->permit_local_command == -1)
1217 options->permit_local_command = 0; 1208 options->permit_local_command = 0;
1209 if (options->visual_host_key == -1)
1210 options->visual_host_key = 0;
1218 /* options->local_command should not be set by default */ 1211 /* options->local_command should not be set by default */
1219 /* options->proxy_command should not be set by default */ 1212 /* options->proxy_command should not be set by default */
1220 /* options->user will be set in the main program if appropriate */ 1213 /* options->user will be set in the main program if appropriate */
diff --git a/readconf.h b/readconf.h
index 5c16a0ba6..47c7aef4e 100644
--- a/readconf.h
+++ b/readconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.h,v 1.73 2008/06/11 21:01:35 grunk Exp $ */ 1/* $OpenBSD: readconf.h,v 1.74 2008/06/26 11:46:31 grunk Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -120,13 +120,10 @@ typedef struct {
120 120
121 char *local_command; 121 char *local_command;
122 int permit_local_command; 122 int permit_local_command;
123 int visual_host_key;
123 124
124} Options; 125} Options;
125 126
126#define SSHCTL_CHECKHOSTIP_NO 0
127#define SSHCTL_CHECKHOSTIP_YES 1
128#define SSHCTL_CHECKHOSTIP_FPR 2
129
130#define SSHCTL_MASTER_NO 0 127#define SSHCTL_MASTER_NO 0
131#define SSHCTL_MASTER_YES 1 128#define SSHCTL_MASTER_YES 1
132#define SSHCTL_MASTER_AUTO 2 129#define SSHCTL_MASTER_AUTO 2
diff --git a/ssh.1 b/ssh.1
index e975dae01..6165e2f73 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,8 +34,8 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.274 2008/06/13 20:13:26 grunk Exp $ 37.\" $OpenBSD: ssh.1,v 1.275 2008/06/26 11:46:31 grunk Exp $
38.Dd $Mdocdate: June 13 2008 38.Dd $Mdocdate: June 26 2008 $
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -1035,9 +1035,9 @@ there is also support to compare host keys visually,
1035using 1035using
1036.Em random art . 1036.Em random art .
1037By setting the 1037By setting the
1038.Cm CheckHostIP 1038.Cm VisualHostKey
1039option to 1039option to
1040.Dq fingerprint , 1040.Dq yes ,
1041a small ASCII graphic gets displayed on every login to a server, no matter 1041a small ASCII graphic gets displayed on every login to a server, no matter
1042if the session itself is interactive or not. 1042if the session itself is interactive or not.
1043By learning the pattern a known server produces, a user can easily 1043By learning the pattern a known server produces, a user can easily
diff --git a/ssh_config.5 b/ssh_config.5
index 53b3b6f1f..85e7ba06d 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -34,8 +34,8 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh_config.5,v 1.110 2008/06/12 19:10:09 jmc Exp $ 37.\" $OpenBSD: ssh_config.5,v 1.111 2008/06/26 11:46:31 grunk Exp $
38.Dd $Mdocdate: June 12 2008 $ 38.Dd $Mdocdate: June 26 2008 $
39.Dt SSH_CONFIG 5 39.Dt SSH_CONFIG 5
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -161,10 +161,6 @@ will additionally check the host IP address in the
161file. 161file.
162This allows ssh to detect if a host key changed due to DNS spoofing. 162This allows ssh to detect if a host key changed due to DNS spoofing.
163If the option is set to 163If the option is set to
164.Dq fingerprint ,
165a fingerprint and an ASCII art representation of the key are printed,
166in addition to the host IP address check.
167If the option is set to
168.Dq no , 164.Dq no ,
169the check will not be executed. 165the check will not be executed.
170The default is 166The default is
@@ -1064,6 +1060,16 @@ See also
1064.Sx VERIFYING HOST KEYS 1060.Sx VERIFYING HOST KEYS
1065in 1061in
1066.Xr ssh 1 . 1062.Xr ssh 1 .
1063.It Cm VisualHostKey
1064If this flag is set to
1065.Dq yes ,
1066an ASCII art representation of the remote host key fingerprint is
1067printed additionally to the hex fingerprint string.
1068If this flag is set to
1069.Dq no ,
1070only the hex fingerprint string will be printed.
1071The default is
1072.Dq no .
1067.It Cm XAuthLocation 1073.It Cm XAuthLocation
1068Specifies the full pathname of the 1074Specifies the full pathname of the
1069.Xr xauth 1 1075.Xr xauth 1
diff --git a/sshconnect.c b/sshconnect.c
index 267670771..9c1550a96 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.208 2008/06/12 23:24:58 ian Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.209 2008/06/26 11:46:31 grunk 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
@@ -598,7 +598,6 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
598 char msg[1024]; 598 char msg[1024];
599 int len, host_line, ip_line; 599 int len, host_line, ip_line;
600 const char *host_file = NULL, *ip_file = NULL; 600 const char *host_file = NULL, *ip_file = NULL;
601 int display_randomart;
602 601
603 /* 602 /*
604 * Force accepting of the host key for loopback/localhost. The 603 * Force accepting of the host key for loopback/localhost. The
@@ -646,12 +645,6 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
646 } 645 }
647 646
648 /* 647 /*
649 * check_host_ip may be set to zero in the next step, so if it
650 * conveys a request to display the random art, save it away.
651 */
652 display_randomart = (options.check_host_ip == SSHCTL_CHECKHOSTIP_FPR);
653
654 /*
655 * Turn off check_host_ip if the connection is to localhost, via proxy 648 * Turn off check_host_ip if the connection is to localhost, via proxy
656 * command or if we don't have a hostname to compare with 649 * command or if we don't have a hostname to compare with
657 */ 650 */
@@ -735,7 +728,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
735 logit("Warning: Permanently added the %s host " 728 logit("Warning: Permanently added the %s host "
736 "key for IP address '%.128s' to the list " 729 "key for IP address '%.128s' to the list "
737 "of known hosts.", type, ip); 730 "of known hosts.", type, ip);
738 } else if (display_randomart) { 731 } else if (options.visual_host_key) {
739 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); 732 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
740 ra = key_fingerprint(host_key, SSH_FP_MD5, 733 ra = key_fingerprint(host_key, SSH_FP_MD5,
741 SSH_FP_RANDOMART); 734 SSH_FP_RANDOMART);
@@ -793,10 +786,13 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
793 snprintf(msg, sizeof(msg), 786 snprintf(msg, sizeof(msg),
794 "The authenticity of host '%.200s (%s)' can't be " 787 "The authenticity of host '%.200s (%s)' can't be "
795 "established%s\n" 788 "established%s\n"
796 "%s key fingerprint is %s.\n%s\n%s" 789 "%s key fingerprint is %s.%s%s\n%s"
797 "Are you sure you want to continue connecting " 790 "Are you sure you want to continue connecting "
798 "(yes/no)? ", 791 "(yes/no)? ",
799 host, ip, msg1, type, fp, ra, msg2); 792 host, ip, msg1, type, fp,
793 options.visual_host_key ? "\n" : "",
794 options.visual_host_key ? ra : "",
795 msg2);
800 xfree(ra); 796 xfree(ra);
801 xfree(fp); 797 xfree(fp);
802 if (!confirm(msg)) 798 if (!confirm(msg))