upstream commit

Avoid confusing error message when attempting to use
ssh-keyscan built without SSH protocol v.1 to scan for v.1 keys; bz#2583

Upstream-ID: 5d214abd3a21337d67c6dcc5aa6f313298d0d165
This commit is contained in:
djm@openbsd.org 2017-01-06 03:41:58 +00:00 committed by Damien Miller
parent 0999533014
commit f89b928534
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keyscan.c,v 1.106 2016/05/02 10:26:04 djm Exp $ */ /* $OpenBSD: ssh-keyscan.c,v 1.107 2017/01/06 03:41:58 djm Exp $ */
/* /*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
* *
@ -752,10 +752,13 @@ main(int argc, char **argv)
tname = strtok(optarg, ","); tname = strtok(optarg, ",");
while (tname) { while (tname) {
int type = sshkey_type_from_name(tname); int type = sshkey_type_from_name(tname);
switch (type) { switch (type) {
#ifdef WITH_SSH1
case KEY_RSA1: case KEY_RSA1:
get_keytypes |= KT_RSA1; get_keytypes |= KT_RSA1;
break; break;
#endif
case KEY_DSA: case KEY_DSA:
get_keytypes |= KT_DSA; get_keytypes |= KT_DSA;
break; break;
@ -769,7 +772,8 @@ main(int argc, char **argv)
get_keytypes |= KT_ED25519; get_keytypes |= KT_ED25519;
break; break;
case KEY_UNSPEC: case KEY_UNSPEC:
fatal("unknown key type %s", tname); default:
fatal("Unknown key type \"%s\"", tname);
} }
tname = strtok(NULL, ","); tname = strtok(NULL, ",");
} }