-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ResourceKnownHostsServerKeyVerifier does not consider the specified keytypes #8674
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
Comments
Yeah... We blindly modeled this one after
Now in the latest version I see they have it fixed:
Will fix ours shortly respectively. Thank you for the pointer! NOTE: we cannot upgrade to the latest MINA since it looks like they have a bug in path resolution for remote directory creation. |
Fixes spring-projects#8674 The `ResourceKnownHostsServerKeyVerifier` does not take into account that several different keys can be present in the known hosts resource for the same host/port * Fix `ResourceKnownHostsServerKeyVerifier` to find a list of knows host for the requested session. Then iterate of this result to match the key type first and then compare keys and their `revoked` marker **Cherry-pick to `6.1.x` & `6.0.x`**
Please, find the fix in the linked PR. |
Hey @artembilan , thanks for your super fast resolution of the issue. 🥇 :) |
Fixes #8674 The `ResourceKnownHostsServerKeyVerifier` does not take into account that several different keys can be present in the known hosts resource for the same host/port * Fix `ResourceKnownHostsServerKeyVerifier` to find a list of knows host for the requested session. Then iterate of this result to match the key type first and then compare keys and their `revoked` marker **Cherry-pick to `6.1.x` & `6.0.x`**
Fixes #8674 The `ResourceKnownHostsServerKeyVerifier` does not take into account that several different keys can be present in the known hosts resource for the same host/port * Fix `ResourceKnownHostsServerKeyVerifier` to find a list of knows host for the requested session. Then iterate of this result to match the key type first and then compare keys and their `revoked` marker **Cherry-pick to `6.1.x` & `6.0.x`**
Fixes #8674 The `ResourceKnownHostsServerKeyVerifier` does not take into account that several different keys can be present in the known hosts resource for the same host/port * Fix `ResourceKnownHostsServerKeyVerifier` to find a list of knows host for the requested session. Then iterate of this result to match the key type first and then compare keys and their `revoked` marker **Cherry-pick to `6.1.x` & `6.0.x`**
In what version(s) of Spring Integration are you seeing this issue?
6.0.5.
6.1.1 should still be affected as the code was not changed
Describe the bug
The ResourceKnownHostsServerKeyVerifier in Spring Integration Sftp seems to always select the first matching key from the provided known_host file and seems not to take into account the specified keytype.
To Reproduce
To reproduce the issue, add multiple keytypes for the same host and port. Then experiment with the order.
Expected behavior
The keytype should be considered, and the findKnownHostEntry method should select the matching host, port and keytype.
**Related Code **
You can refer to the code at https://github.com/spring-projects/spring-integration/blob/v6.1.1/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/ResourceKnownHostsServerKeyVerifier.java#L122
The text was updated successfully, but these errors were encountered: