Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

TODO: Add known hosts checking #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions ext/qsshsocket/qsshsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,46 @@ void QSshSocket::run()
else
error(SessionCreationError);

// TODO: Add known hosts checking
//{
// enum ssh_known_hosts_e state;
// ssh_key srv_pubkey;
// int rc;

// rc = ssh_get_server_publickey(session, &srv_pubkey);
// if (rc != SSH_OK) {
// // ??
// }

// rc = ssh_get_publickey_hash(srv_pubkey,
// SSH_PUBLICKEY_HASH_SHA256,
// &hash,
// &hlen);
// ssh_key_free(srv_pubkey);
// if (rc != SSH_OK) {
// // ???
// }

// state = ssh_session_is_known_server(session)
// switch(state) {
// case SSH_KNOWN_HOSTS_CHANGED:
// /* FAIL */
// case SSH_KNOWN_HOSTS_OTHER:
// /* FAIL */
// case SSH_KNOWN_HOSTS_NOT_FOUND:
// /* FALL_THROUGH */
// case SSH_SERVER_NOT_KNOWN:
// /* Ask user to accept key */
// if (accept) {
// rc = ssh_session_update_known_hosts(m_session);
// }
// break;
// case SSH_KNOWN_HOSTS_ERROR:
// /* FAIL */
// case SSH_KNOWN_HOSTS_OK:
// break; /* OK */
// }
//}
}

}
Expand Down