Skip to content

Commit

Permalink
Fix client version to be compliant with RFC 4253 section 4.2 by not i…
Browse files Browse the repository at this point in the history
…ncluding minus sign characters mwiede#115.
  • Loading branch information
norrisjeremy committed Feb 2, 2022
1 parent f64c6a1 commit 1d207e2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* JplLogger, using [Java 9's JEP 264](https://openjdk.java.net/jeps/264)
* Log4j2Logger, using [Apache Log4j 2](https://logging.apache.org/log4j/2.x/)
* Slf4jLogger, using [SLF4J](https://www.slf4j.org/)
* Fix client version to be compliant with [RFC 4253 section 4.2](https://datatracker.ietf.org/doc/html/rfc4253#section-4.2) by not including minus sign characters [#115](https://github.com/mwiede/jsch/issues/115)
* [0.1.72](https://github.com/mwiede/jsch/releases/tag/jsch-0.1.72)
* Switch chacha20-poly1305@<!-- -->openssh.com algorithm to a pure [Bouncy Castle](https://www.bouncycastle.org/java.html) based implementation
* implement openssh config behavior to handle append, prepend and removal of algorithms [#104](https://github.com/mwiede/jsch/pull/104)
Expand Down
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>versionWithoutMinus</name>
<value>${project.version}</value>
<regex>-</regex>
<replacement>_</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java-templates/com/jcraft/jsch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

final class Version {

private static final String VERSION = "${project.version}";
private static final String VERSION = "${versionWithoutMinus}";

static String getVersion() {
return VERSION;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jcraft/jsch/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class Session implements Runnable{
private static final int PACKET_MAX_SIZE = 256 * 1024;

private byte[] V_S; // server version
private byte[] V_C=Util.str2byte("SSH-2.0-JSCH-"+Version.getVersion()); // client version
private byte[] V_C=Util.str2byte("SSH-2.0-JSCH_"+Version.getVersion()); // client version

private byte[] I_C; // the payload of the client's SSH_MSG_KEXINIT
private byte[] I_S; // the payload of the server's SSH_MSG_KEXINIT
Expand Down

0 comments on commit 1d207e2

Please sign in to comment.