From 1733c3366c2ff81bef8ba9139075607732cc0478 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 2 Jun 2013 16:55:19 +0200 Subject: [PATCH] [fix-weak-ssh-dh-keys] bitwise_leftShift() expects number of bits, not bytes. --- phpseclib/Net/SSH2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index bb75fc2d..aa87e06d 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1195,7 +1195,7 @@ class Net_SSH2 { -- http://tools.ietf.org/html/rfc4419#section-6.2 */ $q = new Math_BigInteger(1); - $q = $q->bitwise_leftShift(2 * $keyLength); + $q = $q->bitwise_leftShift(16 * $keyLength); // 2 * 8 * $keyLength $q = $q->subtract(new Math_BigInteger(1)); $g = new Math_BigInteger(2);