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
diff --git a/hostfile.c b/hostfile.c index b8f9cd143..1804cff99 100644 --- a/hostfile.c +++ b/hostfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hostfile.c,v 1.69 2017/04/30 23:10:43 djm Exp $ */ | 1 | /* $OpenBSD: hostfile.c,v 1.70 2017/04/30 23:18:44 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 |
@@ -346,16 +346,11 @@ check_hostkeys_by_key_or_type(struct hostkeys *hostkeys, | |||
346 | HostStatus end_return = HOST_NEW; | 346 | HostStatus end_return = HOST_NEW; |
347 | int want_cert = sshkey_is_cert(k); | 347 | int want_cert = sshkey_is_cert(k); |
348 | HostkeyMarker want_marker = want_cert ? MRK_CA : MRK_NONE; | 348 | HostkeyMarker want_marker = want_cert ? MRK_CA : MRK_NONE; |
349 | int proto = (k ? k->type : keytype) == KEY_RSA1 ? 1 : 2; | ||
350 | 349 | ||
351 | if (found != NULL) | 350 | if (found != NULL) |
352 | *found = NULL; | 351 | *found = NULL; |
353 | 352 | ||
354 | for (i = 0; i < hostkeys->num_entries; i++) { | 353 | for (i = 0; i < hostkeys->num_entries; i++) { |
355 | if (proto == 1 && hostkeys->entries[i].key->type != KEY_RSA1) | ||
356 | continue; | ||
357 | if (proto == 2 && hostkeys->entries[i].key->type == KEY_RSA1) | ||
358 | continue; | ||
359 | if (hostkeys->entries[i].marker != want_marker) | 354 | if (hostkeys->entries[i].marker != want_marker) |
360 | continue; | 355 | continue; |
361 | if (k == NULL) { | 356 | if (k == NULL) { |
@@ -490,13 +485,6 @@ host_delete(struct hostkey_foreach_line *l, void *_ctx) | |||
490 | return 0; | 485 | return 0; |
491 | } | 486 | } |
492 | 487 | ||
493 | /* XXX might need a knob for this later */ | ||
494 | /* Don't remove RSA1 keys */ | ||
495 | if (l->key->type == KEY_RSA1) { | ||
496 | fprintf(ctx->out, "%s\n", l->line); | ||
497 | return 0; | ||
498 | } | ||
499 | |||
500 | /* | 488 | /* |
501 | * If this line contains one of the keys that we will be | 489 | * If this line contains one of the keys that we will be |
502 | * adding later, then don't change it and mark the key for | 490 | * 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, | |||
804 | lineinfo.keytype = sshkey_type_from_name(ktype); | 792 | lineinfo.keytype = sshkey_type_from_name(ktype); |
805 | 793 | ||
806 | /* | 794 | /* |
807 | * Assume RSA1 if the first component is a short | 795 | * Assume legacy RSA1 if the first component is a short |
808 | * decimal number. | 796 | * decimal number. |
809 | */ | 797 | */ |
810 | if (lineinfo.keytype == KEY_UNSPEC && l < 8 && | 798 | if (lineinfo.keytype == KEY_UNSPEC && l < 8 && |
811 | strspn(ktype, "0123456789") == l) | 799 | strspn(ktype, "0123456789") == l) |
812 | lineinfo.keytype = KEY_RSA1; | 800 | goto bad; |
813 | 801 | ||
814 | /* | 802 | /* |
815 | * Check that something other than whitespace follows | 803 | * Check that something other than whitespace follows |