-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some SSH servers will not honor the negotiated rsa-sha2-256 algorithms if the client does not indicate support for SSH_MSG_EXT_INFO messages. Since we only need to accept these messages, but are free to ignore their contents, adding support amounts to sending "ext-info-c" with our kex algorithm proposal.
- Loading branch information
Showing
4 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/com/hierynomus/sshj/transport/kex/ExtInfoClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.hierynomus.sshj.transport.kex; | ||
|
||
import net.schmizz.sshj.transport.kex.KeyExchange; | ||
|
||
/** | ||
* Stub kex algorithm factory that indicates support for SSH2_MSG_EXT_INFO. | ||
* Some servers will not send `rsa-sha2-*` signatures if the client doesn't indicate support. | ||
* | ||
* Note: Since the server sends `ext-info-s` to indicate support, this fake kex algorithm is never negotiated. | ||
*/ | ||
public class ExtInfoClientFactory implements net.schmizz.sshj.common.Factory.Named<KeyExchange> { | ||
@Override | ||
public String getName() { | ||
return "ext-info-c"; | ||
} | ||
|
||
@Override | ||
public KeyExchange create() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters