summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hostfile.c b/hostfile.c
index 8bc9540b7..91741cab8 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.c,v 1.55 2014/01/31 16:39:19 tedu Exp $ */ 1/* $OpenBSD: hostfile.c,v 1.56 2014/04/29 18:01:49 markus 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
@@ -182,6 +182,7 @@ static int
182hostfile_check_key(int bits, const Key *key, const char *host, 182hostfile_check_key(int bits, const Key *key, const char *host,
183 const char *filename, u_long linenum) 183 const char *filename, u_long linenum)
184{ 184{
185#ifdef WITH_SSH1
185 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL) 186 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL)
186 return 1; 187 return 1;
187 if (bits != BN_num_bits(key->rsa->n)) { 188 if (bits != BN_num_bits(key->rsa->n)) {
@@ -191,6 +192,7 @@ hostfile_check_key(int bits, const Key *key, const char *host,
191 logit("Warning: replace %d with %d in %s, line %lu.", 192 logit("Warning: replace %d with %d in %s, line %lu.",
192 bits, BN_num_bits(key->rsa->n), filename, linenum); 193 bits, BN_num_bits(key->rsa->n), filename, linenum);
193 } 194 }
195#endif
194 return 1; 196 return 1;
195} 197}
196 198
@@ -296,11 +298,15 @@ load_hostkeys(struct hostkeys *hostkeys, const char *host, const char *path)
296 key = key_new(KEY_UNSPEC); 298 key = key_new(KEY_UNSPEC);
297 if (!hostfile_read_key(&cp, &kbits, key)) { 299 if (!hostfile_read_key(&cp, &kbits, key)) {
298 key_free(key); 300 key_free(key);
301#ifdef WITH_SSH1
299 key = key_new(KEY_RSA1); 302 key = key_new(KEY_RSA1);
300 if (!hostfile_read_key(&cp, &kbits, key)) { 303 if (!hostfile_read_key(&cp, &kbits, key)) {
301 key_free(key); 304 key_free(key);
302 continue; 305 continue;
303 } 306 }
307#else
308 continue;
309#endif
304 } 310 }
305 if (!hostfile_check_key(kbits, key, host, path, linenum)) 311 if (!hostfile_check_key(kbits, key, host, path, linenum))
306 continue; 312 continue;