summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sshd.c b/sshd.c
index f2ee10d2c..004ddd4a5 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.439 2015/01/26 03:04:46 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.440 2015/01/26 06:10:03 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
@@ -836,7 +836,7 @@ list_hostkey_types(void)
836} 836}
837 837
838static Key * 838static Key *
839get_hostkey_by_type(int type, int need_private, struct ssh *ssh) 839get_hostkey_by_type(int type, int nid, int need_private, struct ssh *ssh)
840{ 840{
841 int i; 841 int i;
842 Key *key; 842 Key *key;
@@ -857,7 +857,8 @@ get_hostkey_by_type(int type, int need_private, struct ssh *ssh)
857 key = sensitive_data.host_pubkeys[i]; 857 key = sensitive_data.host_pubkeys[i];
858 break; 858 break;
859 } 859 }
860 if (key != NULL && key->type == type) 860 if (key != NULL && key->type == type &&
861 (key->type != KEY_ECDSA || key->ecdsa_nid == nid))
861 return need_private ? 862 return need_private ?
862 sensitive_data.host_keys[i] : key; 863 sensitive_data.host_keys[i] : key;
863 } 864 }
@@ -865,15 +866,15 @@ get_hostkey_by_type(int type, int need_private, struct ssh *ssh)
865} 866}
866 867
867Key * 868Key *
868get_hostkey_public_by_type(int type, struct ssh *ssh) 869get_hostkey_public_by_type(int type, int nid, struct ssh *ssh)
869{ 870{
870 return get_hostkey_by_type(type, 0, ssh); 871 return get_hostkey_by_type(type, nid, 0, ssh);
871} 872}
872 873
873Key * 874Key *
874get_hostkey_private_by_type(int type, struct ssh *ssh) 875get_hostkey_private_by_type(int type, int nid, struct ssh *ssh)
875{ 876{
876 return get_hostkey_by_type(type, 1, ssh); 877 return get_hostkey_by_type(type, nid, 1, ssh);
877} 878}
878 879
879Key * 880Key *