summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hostfile.c b/hostfile.c
index 8bc9540b7..ee2daf45f 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.57 2014/06/24 01:13:21 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
@@ -47,6 +47,7 @@
47#include <stdio.h> 47#include <stdio.h>
48#include <stdlib.h> 48#include <stdlib.h>
49#include <string.h> 49#include <string.h>
50#include <stdarg.h>
50 51
51#include "xmalloc.h" 52#include "xmalloc.h"
52#include "match.h" 53#include "match.h"
@@ -182,6 +183,7 @@ static int
182hostfile_check_key(int bits, const Key *key, const char *host, 183hostfile_check_key(int bits, const Key *key, const char *host,
183 const char *filename, u_long linenum) 184 const char *filename, u_long linenum)
184{ 185{
186#ifdef WITH_SSH1
185 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL) 187 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL)
186 return 1; 188 return 1;
187 if (bits != BN_num_bits(key->rsa->n)) { 189 if (bits != BN_num_bits(key->rsa->n)) {
@@ -191,6 +193,7 @@ hostfile_check_key(int bits, const Key *key, const char *host,
191 logit("Warning: replace %d with %d in %s, line %lu.", 193 logit("Warning: replace %d with %d in %s, line %lu.",
192 bits, BN_num_bits(key->rsa->n), filename, linenum); 194 bits, BN_num_bits(key->rsa->n), filename, linenum);
193 } 195 }
196#endif
194 return 1; 197 return 1;
195} 198}
196 199
@@ -296,11 +299,15 @@ load_hostkeys(struct hostkeys *hostkeys, const char *host, const char *path)
296 key = key_new(KEY_UNSPEC); 299 key = key_new(KEY_UNSPEC);
297 if (!hostfile_read_key(&cp, &kbits, key)) { 300 if (!hostfile_read_key(&cp, &kbits, key)) {
298 key_free(key); 301 key_free(key);
302#ifdef WITH_SSH1
299 key = key_new(KEY_RSA1); 303 key = key_new(KEY_RSA1);
300 if (!hostfile_read_key(&cp, &kbits, key)) { 304 if (!hostfile_read_key(&cp, &kbits, key)) {
301 key_free(key); 305 key_free(key);
302 continue; 306 continue;
303 } 307 }
308#else
309 continue;
310#endif
304 } 311 }
305 if (!hostfile_check_key(kbits, key, host, path, linenum)) 312 if (!hostfile_check_key(kbits, key, host, path, linenum))
306 continue; 313 continue;