From f8a00d63f4f858401f611bad51c1a9f839013ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Sun, 9 Mar 2014 03:47:32 +0100 Subject: bug 1255: Mixed up variable names for pub/Y, don't calculate the bit size of all variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Tänzer --- includes/lib/check_weak_key.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/lib/check_weak_key.php b/includes/lib/check_weak_key.php index 6628bed..090d66b 100644 --- a/includes/lib/check_weak_key.php +++ b/includes/lib/check_weak_key.php @@ -222,11 +222,7 @@ function checkWeakKeyText($text) $num_Q = @gmp_init($key_Q, 16); $num_G = @gmp_init($key_G, 16); - $bit_pub = ltrim(gmp_strval($num_pub, 2), "0"); $bit_P = ltrim(gmp_strval($num_P, 2), "0"); - $bit_Q = ltrim(gmp_strval($num_Q, 2), "0"); - $bit_G = ltrim(gmp_strval($num_G, 2), "0"); - $keysize = strlen($bit_P); if ($keysize < 2048) { @@ -261,9 +257,9 @@ function checkWeakKeyText($text) } //Check the numbers are all less than the public modulus P - if(0 <= gmp_cmp($num_Q, $num_P) || 0 <= gmp_cmp($num_G, $num_P) || 0 <= gmp_cmp($num_Y, $num_P)) { + if(0 <= gmp_cmp($num_Q, $num_P) || 0 <= gmp_cmp($num_G, $num_P) || 0 <= gmp_cmp($num_pub, $num_P)) { return failWithId("checkWeakKeyText(): The supplied DSA ". - "key does seem to be normalized to have Q < P, G < P and Y < P.\nData:\n$text"); + "key does seem to be normalized to have Q < P, G < P and pub < P.\nData:\n$text"); } break; -- cgit v1.2.1