Skip to content

libssh2: fix to ignore known_hosts if SHA256 host public key is set #16805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Mar 23, 2025

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 to d1e7d91 #7646
Follow-up to 272282a #4747

Syncing behavior with MD5 host public keys.

Follow-up to d1e7d91 curl#7646
Follow-up to 272282a curl#4747
vszakats added a commit to vszakats/curl that referenced this pull request Mar 23, 2025
Syncing behavior with MD5 host public keys.

libcurl implemented to force a host key type when the host 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 to d1e7d91 curl#7646
Follow-up to 272282a curl#4747

Closes curl#16805
@vszakats vszakats changed the title libssh2: fix to ignore known_hosts when SHA256 host public key is set libssh2: fix to ignore known_hosts if SHA256 host public key is set Mar 24, 2025
vszakats added a commit to vszakats/curl that referenced this pull request Mar 24, 2025
Syncing behavior with MD5 host public keys.

libcurl implemented to force a host key type when the host 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 to d1e7d91 curl#7646
Follow-up to 272282a curl#4747

Closes curl#16805
@vszakats vszakats closed this in cd7eb9e Mar 24, 2025
@vszakats vszakats deleted the libssh2-sha256hostpub-vs-knownhosts branch March 24, 2025 08:48
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
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 to d1e7d91 curl#7646
Follow-up to 272282a curl#4747

Closes curl#16805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants