mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 10:25:37 +00:00
ssh-client: Use ssh_get_server_publickey() if possible
This commit is contained in:
parent
e25ab3cc8b
commit
4e7caeb536
1 changed files with 5 additions and 0 deletions
|
|
@ -282,8 +282,13 @@ static void on_ssh_client_event(struct tmate_ssh_client *client)
|
|||
}
|
||||
|
||||
case SSH_AUTH_SERVER:
|
||||
#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0, 9, 0)
|
||||
if (ssh_get_server_publickey(session, &pubkey) < 0)
|
||||
tmate_fatal("ssh_get_server_publickey");
|
||||
#else
|
||||
if (ssh_get_publickey(session, &pubkey) < 0)
|
||||
tmate_fatal("ssh_get_publickey");
|
||||
#endif
|
||||
|
||||
if (ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_SHA256,
|
||||
&hash, &hash_len) < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue