From 46e866f0aa5e6c5612ff468987a00788343c0706 Mon Sep 17 00:00:00 2001 From: Wytze van der Raay Date: Thu, 28 Aug 2014 15:10:17 +0000 Subject: [PATCH] Fix for https://bugs.cacert.org/view.php?id=1297 "includes/lib/check_weak_key.php is broken after upgrade to Debian Wheezy with openssl 1.0" --- includes/lib/check_weak_key.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/lib/check_weak_key.php b/includes/lib/check_weak_key.php index 59c6cd6..dd4f3a5 100644 --- a/includes/lib/check_weak_key.php +++ b/includes/lib/check_weak_key.php @@ -128,7 +128,7 @@ function checkWeakKeyText($text) if ($algorithm === "rsaEncryption") { - if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text, $keysize)) + if (!preg_match('/^\s*Public-Key: \((\d+) bit\)$/m', $text, $keysize)) { return failWithId("checkWeakKeyText(): Couldn't parse the RSA ". "key size.\nData:\n$text"); @@ -308,7 +308,7 @@ function checkDebianVulnerability($text, $keysize = 0) if ($algorithm !== "rsaEncryption") return false; /* Extract public key size */ - if (!preg_match('/^\s*RSA Public Key: \((\d+) bit\)$/m', $text, + if (!preg_match('/^\s*Public-Key: \((\d+) bit\)$/m', $text, $keysize)) { trigger_error("checkDebianVulnerability(): Couldn't parse the ". @@ -338,7 +338,7 @@ function checkDebianVulnerability($text, $keysize = 0) /* Extract RSA modulus */ - if (!preg_match('/^\s*Modulus \(\d+ bit\):\n'. + if (!preg_match('/^\s*Modulus:\n'. '((?:\s*[0-9a-f][0-9a-f]:(?:\n)?)+[0-9a-f][0-9a-f])$/m', $text, $modulus)) {