diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-04-30 23:18:44 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-05-01 10:05:01 +1000 |
commit | 873d3e7d9a4707d0934fb4c4299354418f91b541 (patch) | |
tree | 4fd961131c84ad1626f11ffdcdc4316a26febacb /hostfile.c | |
parent | 788ac799a6efa40517f2ac0d895a610394298ffc (diff) |
upstream commit
remove KEY_RSA1
ok markus@
Upstream-ID: 7408517b077c892a86b581e19f82a163069bf133
Diffstat (limited to 'hostfile.c')
-rw-r--r-- | hostfile.c | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: hostfile.c,v 1.69 2017/04/30 23:10:43 djm Exp $ */ +/* $OpenBSD: hostfile.c,v 1.70 2017/04/30 23:18:44 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -346,16 +346,11 @@ check_hostkeys_by_key_or_type(struct hostkeys *hostkeys, HostStatus end_return = HOST_NEW; int want_cert = sshkey_is_cert(k); HostkeyMarker want_marker = want_cert ? MRK_CA : MRK_NONE; - int proto = (k ? k->type : keytype) == KEY_RSA1 ? 1 : 2; if (found != NULL) *found = NULL; for (i = 0; i < hostkeys->num_entries; i++) { - if (proto == 1 && hostkeys->entries[i].key->type != KEY_RSA1) - continue; - if (proto == 2 && hostkeys->entries[i].key->type == KEY_RSA1) - continue; if (hostkeys->entries[i].marker != want_marker) continue; if (k == NULL) { @@ -490,13 +485,6 @@ host_delete(struct hostkey_foreach_line *l, void *_ctx) return 0; } - /* XXX might need a knob for this later */ - /* Don't remove RSA1 keys */ - if (l->key->type == KEY_RSA1) { - fprintf(ctx->out, "%s\n", l->line); - return 0; - } - /* * If this line contains one of the keys that we will be * adding later, then don't change it and mark the key for @@ -804,12 +792,12 @@ hostkeys_foreach(const char *path, hostkeys_foreach_fn *callback, void *ctx, lineinfo.keytype = sshkey_type_from_name(ktype); /* - * Assume RSA1 if the first component is a short + * Assume legacy RSA1 if the first component is a short * decimal number. */ if (lineinfo.keytype == KEY_UNSPEC && l < 8 && strspn(ktype, "0123456789") == l) - lineinfo.keytype = KEY_RSA1; + goto bad; /* * Check that something other than whitespace follows |