diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-22 15:22:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-22 15:22:58 +0200 |
commit | 90167f09d3c797422a3701be8c576c92de520d8c (patch) | |
tree | 369ac420a468080d7e5754579d9787b7fa3b7faf /src/wrapper.c | |
parent | 9c376dd913b40bbcf9e0fc528f53e02c104b6c58 (diff) | |
download | libssh-90167f09d3c797422a3701be8c576c92de520d8c.tar.gz libssh-90167f09d3c797422a3701be8c576c92de520d8c.tar.xz libssh-90167f09d3c797422a3701be8c576c92de520d8c.zip |
server: Migrate hostkey check to new pki.
Diffstat (limited to 'src/wrapper.c')
-rw-r--r-- | src/wrapper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wrapper.c b/src/wrapper.c index bbe26e66..f1eebbc2 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -46,6 +46,7 @@ #include "libssh/session.h" #include "libssh/crypto.h" #include "libssh/wrapper.h" +#include "libssh/pki.h" /* it allocates a new cipher structure based on its offset into the global table */ static struct crypto_struct *cipher_new(int offset) { @@ -348,11 +349,9 @@ int crypt_set_algorithms_server(ssh_session session){ server=session->server_kex.methods[SSH_HOSTKEYS]; client=session->client_kex.methods[SSH_HOSTKEYS]; match=ssh_find_matching(server,client); - if(match && !strcmp(match,"ssh-dss")) - session->hostkeys=SSH_KEYTYPE_DSS; - else if(match && !strcmp(match,"ssh-rsa")) - session->hostkeys=SSH_KEYTYPE_RSA; - else { + if (match) { + session->srv.hostkey = ssh_key_type_from_name(match); + } else { ssh_set_error(session, SSH_FATAL, "Cannot know what %s is into %s", match ? match : NULL, server); SAFE_FREE(match); |