Skip to content

Commit

Permalink
Merge pull request #24 from mc1arke/jenkins-44120-fix-npe
Browse files Browse the repository at this point in the history
[JENKINS-44120] Prevent NPE when using DH group 1 or 14 with SHA1 KEX
  • Loading branch information
mc1arke committed May 17, 2017
2 parents ef5cb14 + 1d36524 commit 8ddd97a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/trilead/ssh2/transport/KexManager.java
Expand Up @@ -444,7 +444,7 @@ public synchronized void handleMessage(byte[] msg, int msglen) throws IOExceptio
if (kxs.np.kex_algo.equals("diffie-hellman-group1-sha1")
|| kxs.np.kex_algo.equals("diffie-hellman-group14-sha1"))
{
kxs.dhx = new DhExchange(kxs.dhx.getHashAlgorithm());
kxs.dhx = new DhExchange("SHA1");

if (kxs.np.kex_algo.equals("diffie-hellman-group1-sha1"))
kxs.dhx.init(1, rnd);
Expand Down

0 comments on commit 8ddd97a

Please sign in to comment.