summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-05-15 14:24:09 +1000
committerDamien Miller <djm@mindrot.org>2014-05-15 14:24:09 +1000
commit1f0311c7c7d10c94ff7f823de9c5b2ed79368b14 (patch)
treeae708c2a25f84a04bcb04f2dbf3e8039e0f692bc /hostfile.c
parentc5893785564498cea73cb60d2cf199490483e080 (diff)
- markus@cvs.openbsd.org 2014/04/29 18:01:49
[auth.c authfd.c authfile.c bufaux.c cipher.c cipher.h hostfile.c] [kex.c key.c mac.c monitor.c monitor_wrap.c myproposal.h packet.c] [roaming_client.c ssh-agent.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] [ssh-pkcs11.h ssh.c sshconnect.c sshconnect2.c sshd.c] make compiling against OpenSSL optional (make OPENSSL=no); reduces algorithms to curve25519, aes-ctr, chacha, ed25519; allows us to explore further options; with and ok djm
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;