mirror of
https://github.com/curl/curl.git
synced 2026-08-12 21:10:54 +03:00
libssh2: fix to ignore known_hosts if SHA256 host public key is set
Syncing behavior with MD5 host public keys. libcurl implemented to force a host key type for hosts is present in `known_hosts`, and disabled this logic when an MD5 host public key is explicitly set. libcurl later received support for SHA256 host public keys. This update missed to extend the `known_hosts` logic with the new key type. This caused test 3022 to fail if a pre-existing `known_hosts` listed the test server IP (127.0.0.1) with a non-RSA host key algo. Follow-up tod1e7d9197b#7646 Follow-up to272282a054#4747 Closes #16805
This commit is contained in:
parent
581a7b07a6
commit
cd7eb9e0f2
1 changed files with 3 additions and 1 deletions
|
|
@ -796,7 +796,9 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data)
|
|||
int port = 0;
|
||||
bool found = FALSE;
|
||||
|
||||
if(sshc->kh && !data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]) {
|
||||
if(sshc->kh &&
|
||||
!data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5] &&
|
||||
!data->set.str[STRING_SSH_HOST_PUBLIC_KEY_SHA256]) {
|
||||
/* lets try to find our host in the known hosts file */
|
||||
while(!libssh2_knownhost_get(sshc->kh, &store, store)) {
|
||||
/* For non-standard ports, the name will be enclosed in */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue