are of the expected "safe prime" structure and have had
appropriate primality tests performed;
feedback and ok dtucker@
+ - grunk@cvs.openbsd.org 2008/06/26 11:46:31
+ [readconf.c readconf.h ssh.1 ssh_config.5 sshconnect.c]
+ Move SSH Fingerprint Visualization away from sharing the config option
+ CheckHostIP to an own config option named VisualHostKey.
+ While there, fix the behaviour that ssh would draw a random art picture
+ on every newly seen host even when the option was not enabled.
+ prodded by deraadt@, discussions,
+ help and ok markus@ djm@ dtucker@
20080628
- (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec]
-/* $OpenBSD: readconf.c,v 1.166 2008/06/11 21:01:35 grunk Exp $ */
+/* $OpenBSD: readconf.c,v 1.167 2008/06/26 11:46:31 grunk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
+ oVisualHostKey,
oDeprecated, oUnsupported
} OpCodes;
{ "tunneldevice", oTunnelDevice },
{ "localcommand", oLocalCommand },
{ "permitlocalcommand", oPermitLocalCommand },
+ { "visualhostkey", oVisualHostKey },
{ NULL, oBadOption }
};
case oCheckHostIP:
intptr = &options->check_host_ip;
- arg = strdelim(&s);
- if (!arg || *arg == '\0')
- fatal("%.200s line %d: Missing CheckHostIP argument.",
- filename, linenum);
- value = 0; /* To avoid compiler warning... */
- if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
- value = SSHCTL_CHECKHOSTIP_YES;
- else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0)
- value = SSHCTL_CHECKHOSTIP_NO;
- else if (strcmp(arg, "fingerprint") == 0)
- value = SSHCTL_CHECKHOSTIP_FPR;
- else
- fatal("%.200s line %d: Bad CheckHostIP argument.",
- filename, linenum);
- if (*activep && *intptr == -1)
- *intptr = value;
- break;
+ goto parse_flag;
case oVerifyHostKeyDNS:
intptr = &options->verify_host_key_dns;
intptr = &options->permit_local_command;
goto parse_flag;
+ case oVisualHostKey:
+ intptr = &options->visual_host_key;
+ goto parse_flag;
+
case oDeprecated:
debug("%s line %d: Deprecated option \"%s\"",
filename, linenum, keyword);
options->tun_remote = -1;
options->local_command = NULL;
options->permit_local_command = -1;
+ options->visual_host_key = -1;
}
/*
options->tun_remote = SSH_TUNID_ANY;
if (options->permit_local_command == -1)
options->permit_local_command = 0;
+ if (options->visual_host_key == -1)
+ options->visual_host_key = 0;
/* options->local_command should not be set by default */
/* options->proxy_command should not be set by default */
/* options->user will be set in the main program if appropriate */
-/* $OpenBSD: readconf.h,v 1.73 2008/06/11 21:01:35 grunk Exp $ */
+/* $OpenBSD: readconf.h,v 1.74 2008/06/26 11:46:31 grunk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
char *local_command;
int permit_local_command;
+ int visual_host_key;
} Options;
-#define SSHCTL_CHECKHOSTIP_NO 0
-#define SSHCTL_CHECKHOSTIP_YES 1
-#define SSHCTL_CHECKHOSTIP_FPR 2
-
#define SSHCTL_MASTER_NO 0
#define SSHCTL_MASTER_YES 1
#define SSHCTL_MASTER_AUTO 2
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: ssh.1,v 1.274 2008/06/13 20:13:26 grunk Exp $
-.Dd $Mdocdate: June 13 2008
+.\" $OpenBSD: ssh.1,v 1.275 2008/06/26 11:46:31 grunk Exp $
+.Dd $Mdocdate$
.Dt SSH 1
.Os
.Sh NAME
using
.Em random art .
By setting the
-.Cm CheckHostIP
+.Cm VisualHostKey
option to
-.Dq fingerprint ,
+.Dq yes ,
a small ASCII graphic gets displayed on every login to a server, no matter
if the session itself is interactive or not.
By learning the pattern a known server produces, a user can easily
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: ssh_config.5,v 1.110 2008/06/12 19:10:09 jmc Exp $
+.\" $OpenBSD: ssh_config.5,v 1.111 2008/06/26 11:46:31 grunk Exp $
.Dd $Mdocdate$
.Dt SSH_CONFIG 5
.Os
file.
This allows ssh to detect if a host key changed due to DNS spoofing.
If the option is set to
-.Dq fingerprint ,
-a fingerprint and an ASCII art representation of the key are printed,
-in addition to the host IP address check.
-If the option is set to
.Dq no ,
the check will not be executed.
The default is
.Sx VERIFYING HOST KEYS
in
.Xr ssh 1 .
+.It Cm VisualHostKey
+If this flag is set to
+.Dq yes ,
+an ASCII art representation of the remote host key fingerprint is
+printed additionally to the hex fingerprint string.
+If this flag is set to
+.Dq no ,
+only the hex fingerprint string will be printed.
+The default is
+.Dq no .
.It Cm XAuthLocation
Specifies the full pathname of the
.Xr xauth 1
-/* $OpenBSD: sshconnect.c,v 1.208 2008/06/12 23:24:58 ian Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.209 2008/06/26 11:46:31 grunk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
char msg[1024];
int len, host_line, ip_line;
const char *host_file = NULL, *ip_file = NULL;
- int display_randomart;
/*
* Force accepting of the host key for loopback/localhost. The
ip = xstrdup("<no hostip for proxy command>");
}
- /*
- * check_host_ip may be set to zero in the next step, so if it
- * conveys a request to display the random art, save it away.
- */
- display_randomart = (options.check_host_ip == SSHCTL_CHECKHOSTIP_FPR);
-
/*
* Turn off check_host_ip if the connection is to localhost, via proxy
* command or if we don't have a hostname to compare with
logit("Warning: Permanently added the %s host "
"key for IP address '%.128s' to the list "
"of known hosts.", type, ip);
- } else if (display_randomart) {
+ } 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,
SSH_FP_RANDOMART);
snprintf(msg, sizeof(msg),
"The authenticity of host '%.200s (%s)' can't be "
"established%s\n"
- "%s key fingerprint is %s.\n%s\n%s"
+ "%s key fingerprint is %s.%s%s\n%s"
"Are you sure you want to continue connecting "
"(yes/no)? ",
- host, ip, msg1, type, fp, ra, msg2);
+ host, ip, msg1, type, fp,
+ options.visual_host_key ? "\n" : "",
+ options.visual_host_key ? ra : "",
+ msg2);
xfree(ra);
xfree(fp);
if (!confirm(msg))