mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-15 17:57:12 +00:00
Compare numeric part of OpenSSL version
This commit is contained in:
parent
3c99773184
commit
b0129e9125
@ -515,9 +515,16 @@ class Crypt_RSA
|
|||||||
|
|
||||||
$versions = array();
|
$versions = array();
|
||||||
if (!empty($matches[1])) {
|
if (!empty($matches[1])) {
|
||||||
for ($i = 0; $i < count($matches[1]); $i++) {
|
for ($i = 0; $i < count($matches[1]); $i++) {
|
||||||
$versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
|
$fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
|
||||||
}
|
|
||||||
|
// Remove letter part in OpenSSL version
|
||||||
|
if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
|
||||||
|
$versions[$matches[1][$i]] = $fullVersion;
|
||||||
|
} else {
|
||||||
|
$versions[$matches[1][$i]] = $m[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
|
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
|
||||||
|
@ -278,7 +278,14 @@ class Math_BigInteger
|
|||||||
$versions = array();
|
$versions = array();
|
||||||
if (!empty($matches[1])) {
|
if (!empty($matches[1])) {
|
||||||
for ($i = 0; $i < count($matches[1]); $i++) {
|
for ($i = 0; $i < count($matches[1]); $i++) {
|
||||||
$versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
|
$fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
|
||||||
|
|
||||||
|
// Remove letter part in OpenSSL version
|
||||||
|
if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
|
||||||
|
$versions[$matches[1][$i]] = $fullVersion;
|
||||||
|
} else {
|
||||||
|
$versions[$matches[1][$i]] = $m[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user