Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dcommander committed Jan 21, 2025
2 parents a82e4c9 + 095c380 commit 3c65230
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ if keyboard grabbing is enabled.
TurboVNC Viewers to incorrectly interpret Shift + vertical scroll wheel events
as horizontal scroll wheel events.

8. Fixed an issue whereby the TurboVNC Viewer's built-in SSH client threw a
NullPointerException if a cipher algorithm supported by the SSH server but not
by the SSH client was specified using the `Ciphers` OpenSSH config file
keyword.


3.1.3
=====
Expand Down
8 changes: 8 additions & 0 deletions java/com/jcraft/jsch/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,8 @@ private void updateKeys(KeyExchange kex) throws Exception{
String method;

method=guess[KeyExchange.PROPOSAL_ENC_ALGS_STOC];
if(getConfig(method)==null)
throw new JSchException("Unsupported cipher "+method);
c=Class.forName(getConfig(method));
s2ccipher=(Cipher)(c.getDeclaredConstructor().newInstance());
while(s2ccipher.getBlockSize()>Es2c.length){
Expand All @@ -1182,6 +1184,8 @@ private void updateKeys(KeyExchange kex) throws Exception{
s2ccipher_size=s2ccipher.getIVSize();

method=guess[KeyExchange.PROPOSAL_MAC_ALGS_STOC];
if(getConfig(method)==null)
throw new JSchException("Unsupported cipher "+method);
c=Class.forName(getConfig(method));
s2cmac=(MAC)(c.getDeclaredConstructor().newInstance());
MACs2c = expandKey(buf, K, H, MACs2c, hash, s2cmac.getBlockSize());
Expand All @@ -1191,6 +1195,8 @@ private void updateKeys(KeyExchange kex) throws Exception{
s2cmac_result2=new byte[s2cmac.getBlockSize()];

method=guess[KeyExchange.PROPOSAL_ENC_ALGS_CTOS];
if(getConfig(method)==null)
throw new JSchException("Unsupported cipher "+method);
c=Class.forName(getConfig(method));
c2scipher=(Cipher)(c.getDeclaredConstructor().newInstance());
while(c2scipher.getBlockSize()>Ec2s.length){
Expand All @@ -1209,6 +1215,8 @@ private void updateKeys(KeyExchange kex) throws Exception{
c2scipher_size=c2scipher.getIVSize();

method=guess[KeyExchange.PROPOSAL_MAC_ALGS_CTOS];
if(getConfig(method)==null)
throw new JSchException("Unsupported cipher "+method);
c=Class.forName(getConfig(method));
c2smac=(MAC)(c.getDeclaredConstructor().newInstance());
MACc2s = expandKey(buf, K, H, MACc2s, hash, c2smac.getBlockSize());
Expand Down

0 comments on commit 3c65230

Please sign in to comment.