Skip to content

Commit e2a7383

Browse files
authored
Merge pull request #2040 from nextcloud/dependabot/composer/stable31/phpseclib/phpseclib-2.0.48
build(deps): Bump phpseclib/phpseclib from 2.0.47 to 2.0.48
2 parents 193aea7 + 3dbf72c commit e2a7383

File tree

10 files changed

+271
-91
lines changed

10 files changed

+271
-91
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"pear/pear-core-minimal": "^1.10",
4141
"php-http/guzzle7-adapter": "^1.0.0",
4242
"php-opencloud/openstack": "^3.1",
43-
"phpseclib/phpseclib": "^2.0.45",
43+
"phpseclib/phpseclib": "^2.0.48",
4444
"pimple/pimple": "^3.5.0",
4545
"psr/clock": "^1.0",
4646
"psr/container": "^2.0.2",

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,17 +2886,17 @@
28862886
},
28872887
{
28882888
"name": "phpseclib/phpseclib",
2889-
"version": "2.0.47",
2890-
"version_normalized": "2.0.47.0",
2889+
"version": "2.0.48",
2890+
"version_normalized": "2.0.48.0",
28912891
"source": {
28922892
"type": "git",
28932893
"url": "https://github.com/phpseclib/phpseclib.git",
2894-
"reference": "b7d7d90ee7df7f33a664b4aea32d50a305d35adb"
2894+
"reference": "eaa7be704b8b93a6913b69eb7f645a59d7731b61"
28952895
},
28962896
"dist": {
28972897
"type": "zip",
2898-
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/b7d7d90ee7df7f33a664b4aea32d50a305d35adb",
2899-
"reference": "b7d7d90ee7df7f33a664b4aea32d50a305d35adb",
2898+
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/eaa7be704b8b93a6913b69eb7f645a59d7731b61",
2899+
"reference": "eaa7be704b8b93a6913b69eb7f645a59d7731b61",
29002900
"shasum": ""
29012901
},
29022902
"require": {
@@ -2914,7 +2914,7 @@
29142914
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
29152915
"ext-xml": "Install the XML extension to load XML formatted public keys."
29162916
},
2917-
"time": "2024-02-26T04:55:38+00:00",
2917+
"time": "2024-12-14T21:03:54+00:00",
29182918
"type": "library",
29192919
"installation-source": "dist",
29202920
"autoload": {
@@ -2979,7 +2979,7 @@
29792979
],
29802980
"support": {
29812981
"issues": "https://github.com/phpseclib/phpseclib/issues",
2982-
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.47"
2982+
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.48"
29832983
},
29842984
"funding": [
29852985
{

composer/installed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@
401401
'dev_requirement' => false,
402402
),
403403
'phpseclib/phpseclib' => array(
404-
'pretty_version' => '2.0.47',
405-
'version' => '2.0.47.0',
406-
'reference' => 'b7d7d90ee7df7f33a664b4aea32d50a305d35adb',
404+
'pretty_version' => '2.0.48',
405+
'version' => '2.0.48.0',
406+
'reference' => 'eaa7be704b8b93a6913b69eb7f645a59d7731b61',
407407
'type' => 'library',
408408
'install_path' => __DIR__ . '/../phpseclib/phpseclib',
409409
'aliases' => array(),

phpseclib/phpseclib/phpseclib/Crypt/Base.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ function getBlockLength()
611611
*
612612
* @access public
613613
* @param string $key
614-
* @internal Could, but not must, extend by the child Crypt_* class
615614
*/
616615
function setKey($key)
617616
{

phpseclib/phpseclib/phpseclib/Crypt/RSA.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,9 +1396,14 @@ function. As is, the definitive authority on this encoding scheme isn't the IET
13961396
$this->components = array();
13971397

13981398
$xml = xml_parser_create('UTF-8');
1399-
xml_set_object($xml, $this);
1400-
xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
1401-
xml_set_character_data_handler($xml, '_data_handler');
1399+
if (version_compare(PHP_VERSION, '8.4.0', '>=')) {
1400+
xml_set_element_handler($xml, array($this, '_start_element_handler'), array($this, '_stop_element_handler'));
1401+
xml_set_character_data_handler($xml, array($this, '_data_handler'));
1402+
} else {
1403+
xml_set_object($xml, $this);
1404+
xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
1405+
xml_set_character_data_handler($xml, '_data_handler');
1406+
}
14021407
// add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
14031408
if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
14041409
xml_parser_free($xml);

phpseclib/phpseclib/phpseclib/File/X509.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,7 +3847,8 @@ function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption')
38473847
array(
38483848
'version' => 'v1',
38493849
'subject' => $this->dn,
3850-
'subjectPKInfo' => $publicKey
3850+
'subjectPKInfo' => $publicKey,
3851+
'attributes' => array()
38513852
),
38523853
'signatureAlgorithm' => array('algorithm' => $signatureAlgorithm),
38533854
'signature' => false // this is going to be overwritten later
@@ -4003,11 +4004,11 @@ function signCRL($issuer, $crl, $signatureAlgorithm = 'sha1WithRSAEncryption')
40034004
$version = isset($tbsCertList['version']) ? $tbsCertList['version'] : 0;
40044005
if (!$version) {
40054006
if (!empty($tbsCertList['crlExtensions'])) {
4006-
$version = 1; // v2.
4007+
$version = 'v2'; // v2.
40074008
} elseif (!empty($tbsCertList['revokedCertificates'])) {
40084009
foreach ($tbsCertList['revokedCertificates'] as $cert) {
40094010
if (!empty($cert['crlEntryExtensions'])) {
4010-
$version = 1; // v2.
4011+
$version = 'v2'; // v2.
40114012
}
40124013
}
40134014
}

phpseclib/phpseclib/phpseclib/Math/BigInteger.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,17 @@ class BigInteger
251251
function __construct($x = 0, $base = 10)
252252
{
253253
if (!defined('MATH_BIGINTEGER_MODE')) {
254+
255+
// https://github.com/php/php-src/commit/e0a0e216a909dc4ee4ea7c113a5f41d49525f02e broke GMP
256+
// https://github.com/php/php-src/commit/424ba0f2ff9677d16b4e339e90885bd4bc49fcf1 fixed it
257+
// see https://github.com/php/php-src/issues/16870 for more info
258+
if (version_compare(PHP_VERSION, '8.2.26', '<')) {
259+
$gmpOK = true;
260+
} else {
261+
$gmpOK = !in_array(PHP_VERSION_ID, array(80226, 80314, 80400, 80401));
262+
}
254263
switch (true) {
255-
case extension_loaded('gmp'):
264+
case extension_loaded('gmp') && $gmpOK:
256265
define('MATH_BIGINTEGER_MODE', self::MODE_GMP);
257266
break;
258267
case extension_loaded('bcmath'):

phpseclib/phpseclib/phpseclib/Net/SFTP.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,8 @@ function _init_sftp_connection()
758758
return false;
759759
}
760760
$this->canonicalize_paths = false;
761-
$this->_reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
761+
$this->_reset_sftp();
762+
return $this->_init_sftp_connection();
762763
}
763764

764765
$this->_update_stat_cache($this->pwd, array());
@@ -3629,20 +3630,30 @@ function _send_sftp_packet($type, $data, $request_id = 1)
36293630
}
36303631

36313632
/**
3632-
* Resets a connection for re-use
3633+
* Resets the SFTP channel for re-use
36333634
*
3634-
* @param int $reason
36353635
* @access private
36363636
*/
3637-
function _reset_connection($reason)
3637+
function _reset_sftp()
36383638
{
3639-
parent::_reset_connection($reason);
36403639
$this->use_request_id = false;
36413640
$this->pwd = false;
36423641
$this->requestBuffer = array();
36433642
$this->partial_init = false;
36443643
}
36453644

3645+
/**
3646+
* Resets a connection for re-use
3647+
*
3648+
* @param int $reason
3649+
* @access private
3650+
*/
3651+
function _reset_connection($reason)
3652+
{
3653+
parent::_reset_connection($reason);
3654+
$this->_reset_sftp();
3655+
}
3656+
36463657
/**
36473658
* Receives SFTP Packets
36483659
*

0 commit comments

Comments
 (0)