Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from phpseclib:master #195

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
7f31a1e
SSH2: make it so phpseclib initiates key re-exchange after 1GB
terrafrost Nov 22, 2024
0b9fd56
Merge branch '1.0' into 2.0
terrafrost Nov 22, 2024
ccf4b48
SSH2: PHP didn't support constant expressions until PHP 5.6
terrafrost Nov 22, 2024
b966aa2
Merge branch '1.0' into 2.0
terrafrost Nov 22, 2024
b38e849
SSH2: don't count len of packets sent / rcvd during key exchange
terrafrost Nov 22, 2024
53645af
Merge branch '1.0' into 2.0
terrafrost Nov 22, 2024
dcd4b2a
Merge branch '2.0' into 3.0
terrafrost Nov 22, 2024
feb12c8
Merge branch '3.0'
terrafrost Nov 22, 2024
7aa66fd
CS adjustments
terrafrost Nov 22, 2024
6f4af7e
SSH2: extra_packets is no longer used
terrafrost Nov 22, 2024
9957287
Merge branch '1.0' into 2.0
terrafrost Nov 22, 2024
614d8ae
Merge branch '2.0' into 3.0
terrafrost Nov 22, 2024
e81fd68
SSH2: rm changes i made for debugging
terrafrost Nov 22, 2024
f388cb1
Merge branch '3.0'
terrafrost Nov 22, 2024
f5113e1
SSH2: rm extra_packets in a few more places
terrafrost Nov 22, 2024
7070529
Merge branch '3.0'
terrafrost Nov 22, 2024
7c56d2c
CS adjustments
terrafrost Nov 22, 2024
b66b5dc
SSH2: replace user_error with Exceptions
terrafrost Nov 23, 2024
5160738
Merge branch '3.0'
terrafrost Nov 23, 2024
b39334b
SSH2: replace \RuntimeException with UnsupportedAlgorithmException
terrafrost Nov 23, 2024
ccac840
Merge branch '3.0'
terrafrost Nov 23, 2024
88fd8e0
run unit tests on PHP 8.3 and 8.4
terrafrost Nov 23, 2024
910927a
Merge branch '1.0' into 2.0
terrafrost Nov 23, 2024
a27023a
Merge branch '2.0' into 3.0
terrafrost Nov 23, 2024
866ae12
Merge branch '3.0'
terrafrost Nov 23, 2024
2b79c06
fix deprecated
dmnlk Nov 26, 2024
57435e2
SSH2: add bytesUntilKeyReexchange() method
terrafrost Nov 28, 2024
6865afb
Merge branch '1.0' into 2.0
terrafrost Nov 28, 2024
8eb3c09
Merge branch '2.0' into 3.0
terrafrost Nov 28, 2024
c38fde1
CS adjustments
terrafrost Nov 28, 2024
49825b8
Merge branch '3.0'
terrafrost Nov 28, 2024
3e27d83
more CS adjustments
terrafrost Nov 28, 2024
181f13a
fix unit tests on PHP 8.3/8.4
terrafrost Nov 28, 2024
3106784
Merge branch '1.0' into 2.0
terrafrost Nov 28, 2024
10a9c2e
Merge branch '2.0' into 3.0
terrafrost Nov 28, 2024
a60ebaf
Merge branch '3.0'
terrafrost Nov 28, 2024
e432117
fix PHP 8.4 deprecations
terrafrost Nov 29, 2024
e6864d4
Merge branch '3.0'
terrafrost Nov 29, 2024
6dcb3bb
X509: fix another PHP 8.4 deprecation
terrafrost Nov 29, 2024
b5d32a8
Merge branch '3.0'
terrafrost Nov 29, 2024
7d1779e
X509: even more PHP 8.4 deprecations
terrafrost Nov 29, 2024
18d71ce
Merge branch '3.0'
terrafrost Nov 29, 2024
e6b4017
Merge pull request #2052 from dmnlk/feature/php84-compatible
terrafrost Nov 29, 2024
58709cf
RSA: PHP 8.4 deprecated xml_set_object()
terrafrost Nov 29, 2024
05085f4
BigInteger: fix for PHP 8.4.0 - 8.4.1 regression
terrafrost Nov 29, 2024
ca7ae97
Merge branch '1.0' into 2.0
terrafrost Nov 29, 2024
7127d93
Merge branch '2.0' into 3.0
terrafrost Nov 29, 2024
faced4d
Merge branch '3.0'
terrafrost Nov 29, 2024
46c3756
SSH2: fix PHP 8.4 deprecatin w.r.t. declare(strict_types=1)
terrafrost Nov 29, 2024
8de7a89
BigInteger: improve detection of newly introduced GMP bug
terrafrost Nov 29, 2024
702bd33
Merge branch '1.0' into 2.0
terrafrost Nov 29, 2024
ad709d8
Merge branch '2.0' into 3.0
terrafrost Nov 29, 2024
eefcfdd
Merge branch '3.0'
terrafrost Nov 29, 2024
5cadfba
Merge branch 'master' of https://github.com/phpseclib/phpseclib
terrafrost Nov 29, 2024
2914a15
Tests/X509: add testRSACertWithECSDASig unit test
terrafrost Dec 4, 2024
7b43ea0
X509: algorithmidentifier parameters could get incorrectly set
terrafrost Nov 29, 2024
83978e6
Tests/CSR: update testNewCSR() test
terrafrost Dec 4, 2024
fc5b4b3
CS adjustments
terrafrost Dec 4, 2024
1f7937f
Merge branch '3.0'
terrafrost Dec 4, 2024
573f4aa
SFTP: fix possible SFTPv3 error when rcving date only attributes
terrafrost Dec 4, 2024
487bfa2
Merge branch '3.0'
terrafrost Dec 4, 2024
0efd317
EC/BaseCurves/Montgomery: fix needless conversion in multiplyPoint
terrafrost Dec 4, 2024
ff82c80
Merge branch '3.0'
terrafrost Dec 4, 2024
80c7ee9
unset($block);
jmarchan-ByTel Dec 2, 2024
58e9e43
Merge branch '3.0'
terrafrost Dec 4, 2024
2fe0eab
SSH2: ignore [email protected] in key re-exchanges
terrafrost Dec 7, 2024
0a14273
Merge branch '1.0' into 2.0
terrafrost Dec 7, 2024
b59d7be
Merge branch '2.0' into 3.0
terrafrost Dec 7, 2024
c6c89a6
Merge branch '3.0'
terrafrost Dec 7, 2024
eaa7be7
CHANGELOG: add 2.0.48 release
terrafrost Dec 14, 2024
709ec10
Merge branch '2.0' into 3.0
terrafrost Dec 14, 2024
17b0998
Merge branch '3.0'
terrafrost Dec 14, 2024
5d4bf23
Add send_eof function
Jan 2, 2025
3161d5b
chore: replace extract function
felipe-dossantos-iteris Jan 2, 2025
0c07f44
chore: properly set url path
felipe-dossantos-iteris Jan 2, 2025
40bc1da
fix typo
Jan 3, 2025
3111903
Ensure that users of PHP 8.2.26-nmm1 users don't utilize the GMP func…
Dec 20, 2024
cbf4b2b
Merge branch '1.0' into 2.0
terrafrost Jan 3, 2025
ec5b843
Merge branch '2.0' into 3.0
terrafrost Jan 3, 2025
c876c25
Merge branch '3.0'
terrafrost Jan 3, 2025
5c98486
chore: improve Url variables assignment
felipe-dossantos-iteris Jan 6, 2025
dd214f8
chore: remove variable type comments
felipe-dossantos-iteris Jan 6, 2025
4176a28
Merge branch 'phpseclib:master' into var-overwrite-reviewed
felipef0xx Jan 6, 2025
87e8e42
changes as requested by terrafrost
Jan 7, 2025
8983118
SSH2: send_eof() -> sendEOF()
terrafrost Jan 16, 2025
037892f
SSH2: channel status tweaks
terrafrost Jan 12, 2025
373586f
Merge branch 'bjne' into 3.0
terrafrost Jan 16, 2025
087fe31
SSH2: make sendEOF() better handle different channel situations
terrafrost Jan 16, 2025
41003ab
Merge branch '3.0'
terrafrost Jan 16, 2025
0b9fd98
SFTP: fix typing error
terrafrost Jan 16, 2025
da54eb6
SFTP: convert filenames to strings
terrafrost Jan 16, 2025
6ac64e2
Merge branch '1.0' into 2.0
terrafrost Jan 16, 2025
66e4d6f
Merge branch '2.0' into 3.0
terrafrost Jan 16, 2025
0cf9203
Merge branch '3.0'
terrafrost Jan 16, 2025
8d087a2
CHANGELOG: 3.0.43 release had some poorly worded entries
terrafrost Jan 17, 2025
6e40ba6
Merge branch '3.0'
terrafrost Jan 17, 2025
faa15a9
CHANGELOG: 2.0.48 release had some poorly worded entries
terrafrost Jan 17, 2025
658ee70
Merge branch '2.0' into 3.0
terrafrost Jan 17, 2025
55e593e
Merge branch '3.0'
terrafrost Jan 17, 2025
a117eb9
Merge pull request #2063 from felipef0xx/var-overwrite-reviewed
terrafrost Jan 20, 2025
a02712f
Support ASN.1 tag encoding with values greater than 30.
mmauv Jan 13, 2025
604ef70
Tests/ASN1: Void return types weren't supported until PHP 7.1
terrafrost Jan 24, 2025
42a0603
CS adjustments
terrafrost Jan 24, 2025
be60d5f
Merge branch '3.0'
terrafrost Jan 25, 2025
3bb2976
ASN1: explain the use of BigInteger's for handling OID's
terrafrost Jan 25, 2025
6a9996a
Merge branch '3.0'
terrafrost Jan 25, 2025
5b04772
Merge branch 'master' of https://github.com/phpseclib/phpseclib
terrafrost Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.1', '8.2', '8.3', '8.4']
quality_tools:
name: Quality Tools
timeout-minutes: 5
Expand Down Expand Up @@ -92,4 +92,4 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.1', '8.2', '8.3', '8.4']
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.0.43 - 2024-12-14

- fix PHP 8.4 deprecations
- BigInteger: workaround for regression in GMP that PHP introduced
- BigInteger: speed up Barrett reductions
- X509: make the attributes section of new CSRs be blank (#1522)
- X509: add getRequestedCertificateExtensions()
- X509: algorithmidentifier parameters could get incorrectly set (#2051)
- SSH2: ignore [email protected] in key re-exchanges (#2050)
- SSH2: make it so phpseclib initiates key re-exchange after 1GB (#2050)
- SSH2: if string is passed to setPreferredAlgorithms treat as array
- SSH2: update setPreferredAlgorithms() to accept csv's

## 3.0.42 - 2024-09-15

- X509: CRL version number wasn't correctly being saved (#2037)
Expand Down Expand Up @@ -287,6 +300,19 @@
- Salsa20 / ChaCha20
- namespace changed from `phpseclib\` to `\phpseclib3` to facilitate phpseclib 2 shim (phpseclib2_compat)

## 2.0.48 - 2024-12-14

- BigInteger: workaround for regression in GMP that PHP introduced
- X509: make the attributes section of new CSRs be blank (#1522)
- X509: CRL version number wasn't correctly being saved (#2037)
- SSH2: ignore [email protected] in key re-exchanges (#2050)
- SSH2: make it so phpseclib initiates key re-exchange after 1GB (#2050)
- SSH2: if string is passed to setPreferredAlgorithms treat as array
- SSH2: identification strings > 255 bytes didn't get parsed correctly
- SSH2: fix possible infinite loop on packet timeout
- SSH2: handle SSH2_MSG_EXT_INFO out of login (#2001, #2002)
- SSH2/Agent: reset supported_private_key_algorithms for every key (#1995)

## 2.0.47 - 2024-02-25

- BigInteger: add getLength() and getLengthInBytes() methods
Expand Down
2 changes: 1 addition & 1 deletion phpseclib/Common/Functions/Strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static function unpackSSH2(string $format, string &$data): array
// 64-bit floats can be used to get larger numbers then 32-bit signed ints would allow
// for. sure, you're not gonna get the full precision of 64-bit numbers but just because
// you need > 32-bit precision doesn't mean you need the full 64-bit precision
extract(unpack('Nupper/Nlower', self::shift($data, 8)));
['upper' => $upper, 'lower' => $lower] = unpack('Nupper/Nlower', self::shift($data, 8));
$temp = $upper ? 4294967296 * $upper : 0;
$temp += $lower < 0 ? ($lower & 0x7FFFFFFFF) + 0x80000000 : $lower;
// $temp = hexdec(bin2hex(self::shift($data, 8)));
Expand Down
10 changes: 5 additions & 5 deletions phpseclib/Crypt/Blowfish.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Blowfish extends BlockCipher
/**
* Block Length of the cipher
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @see Common\SymmetricKey::block_size
* @var int
*/
protected $block_size = 8;
Expand Down Expand Up @@ -309,7 +309,7 @@ class Blowfish extends BlockCipher
* derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
* of that, we'll just precompute it once.}
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength()
* @see Common\SymmetricKey::setKeyLength()
* @var int
*/
protected $key_length = 16;
Expand Down Expand Up @@ -349,7 +349,7 @@ public function setKeyLength(int $length): void
*
* This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
* @see Common\SymmetricKey::isValidEngine()
*/
protected function isValidEngineHelper(int $engine): bool
{
Expand All @@ -373,7 +373,7 @@ protected function isValidEngineHelper(int $engine): bool
/**
* Setup the key (expansion)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey()
* @see Common\SymmetricKey::_setupKey()
*/
protected function setupKey(): void
{
Expand Down Expand Up @@ -711,7 +711,7 @@ protected function decryptBlock(string $in): string
/**
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt()
* @see Common\SymmetricKey::_setupInlineCrypt()
*/
protected function setupInlineCrypt(): void
{
Expand Down
42 changes: 29 additions & 13 deletions phpseclib/Crypt/Common/Formats/Keys/PKCS8.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ public static function setPRF(string $algo): void

/**
* Returns a SymmetricKey object based on a PBES1 $algo
*
* @return SymmetricKey
*/
private static function getPBES1EncryptionObject(string $algo)
private static function getPBES1EncryptionObject(string $algo): SymmetricKey
{
$algo = preg_match('#^pbeWith(?:MD2|MD5|SHA1|SHA)And(.*?)-CBC$#', $algo, $matches) ?
$matches[1] :
Expand Down Expand Up @@ -345,7 +343,10 @@ protected static function load($key, ?string $password = null): array
if (!$temp) {
throw new RuntimeException('Unable to decode BER');
}
extract(ASN1::asn1map($temp[0], Maps\PBEParameter::MAP));
[
'salt' => $salt,
'iterationCount' => $iterationCount
] = ASN1::asn1map($temp[0], Maps\PBEParameter::MAP);
$iterationCount = (int) $iterationCount->toString();
$cipher->setPassword($password, $kdf, $hash, $salt, $iterationCount);
$key = $cipher->decrypt($decrypted['encryptedData']);
Expand All @@ -363,7 +364,10 @@ protected static function load($key, ?string $password = null): array
throw new RuntimeException('Unable to decode BER');
}
$temp = ASN1::asn1map($temp[0], Maps\PBES2params::MAP);
extract($temp);
[
'keyDerivationFunc' => $keyDerivationFunc,
'encryptionScheme' => $encryptionScheme
] = $temp;

$cipher = self::getPBES2EncryptionObject($encryptionScheme['algorithm']);
$meta['meta']['cipher'] = $encryptionScheme['algorithm'];
Expand All @@ -373,7 +377,10 @@ protected static function load($key, ?string $password = null): array
throw new RuntimeException('Unable to decode BER');
}
$temp = ASN1::asn1map($temp[0], Maps\PBES2params::MAP);
extract($temp);
[
'keyDerivationFunc' => $keyDerivationFunc,
'encryptionScheme' => $encryptionScheme
] = $temp;

if (!$cipher instanceof RC2) {
$cipher->setIV($encryptionScheme['parameters']['octetString']);
Expand All @@ -382,7 +389,10 @@ protected static function load($key, ?string $password = null): array
if (!$temp) {
throw new RuntimeException('Unable to decode BER');
}
extract(ASN1::asn1map($temp[0], Maps\RC2CBCParameter::MAP));
[
'rc2ParametersVersion' => $rc2ParametersVersion,
'iv' => $iv
] = ASN1::asn1map($temp[0], Maps\RC2CBCParameter::MAP);
$effectiveKeyLength = (int) $rc2ParametersVersion->toString();
switch ($effectiveKeyLength) {
case 160:
Expand All @@ -407,9 +417,15 @@ protected static function load($key, ?string $password = null): array
if (!$temp) {
throw new RuntimeException('Unable to decode BER');
}
$prf = ['algorithm' => 'id-hmacWithSHA1'];
$params = ASN1::asn1map($temp[0], Maps\PBKDF2params::MAP);
extract($params);
if (empty($params['prf'])) {
$params['prf'] = ['algorithm' => 'id-hmacWithSHA1'];
}
[
'salt' => $salt,
'iterationCount' => $iterationCount,
'prf' => $prf
] = $params;
$meta['meta']['prf'] = $prf['algorithm'];
$hash = str_replace('-', '/', substr($prf['algorithm'], 11));
$params = [
Expand Down Expand Up @@ -511,7 +527,7 @@ protected static function load($key, ?string $password = null): array
*
* @param bool $enabled
*/
public static function setBinaryOutput($enabled)
public static function setBinaryOutput($enabled): void
{
self::$binary = $enabled;
}
Expand Down Expand Up @@ -616,7 +632,7 @@ protected static function wrapPrivateKey(string $key, $attr, $params, $password,

$key = ASN1::encodeDER($key, Maps\EncryptedPrivateKeyInfo::MAP);

if (isset($options['binary']) ? $options['binary'] : self::$binary) {
if ($options['binary'] ?? self::$binary) {
return $key;
}

Expand All @@ -625,7 +641,7 @@ protected static function wrapPrivateKey(string $key, $attr, $params, $password,
"-----END ENCRYPTED PRIVATE KEY-----";
}

if (isset($options['binary']) ? $options['binary'] : self::$binary) {
if ($options['binary'] ?? self::$binary) {
return $key;
}

Expand Down Expand Up @@ -654,7 +670,7 @@ protected static function wrapPublicKey(string $key, $params, ?string $oid = nul

$key = ASN1::encodeDER($key, Maps\PublicKeyInfo::MAP);

if (isset($options['binary']) ? $options['binary'] : self::$binary) {
if ($options['binary'] ?? self::$binary) {
return $key;
}

Expand Down
14 changes: 11 additions & 3 deletions phpseclib/Crypt/Common/Formats/Keys/PuTTY.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static function load($key, $password)

$source = Strings::packSSH2('ssss', $type, $encryption, $components['comment'], $public);

extract(unpack('Nlength', Strings::shift($public, 4)));
['length' => $length] = unpack('Nlength', Strings::shift($public, 4));
$newtype = Strings::shift($public, $length);
if ($newtype != $type) {
throw new RuntimeException('The binary type does not match the human readable type field');
Expand Down Expand Up @@ -214,7 +214,11 @@ public static function load($key, $password)
$parallelism = trim(preg_replace('#Argon2-Parallelism: (\d+)#', '$1', $key[$offset++]));
$salt = Strings::hex2bin(trim(preg_replace('#Argon2-Salt: ([0-9a-f]+)#', '$1', $key[$offset++])));

extract(self::generateV3Key($password, $flavour, (int)$memory, (int)$passes, $salt));
[
'symkey' => $symkey,
'symiv' => $symiv,
'hashkey' => $hashkey
] = self::generateV3Key($password, $flavour, (int)$memory, (int)$passes, $salt);

break;
case 2:
Expand Down Expand Up @@ -306,7 +310,11 @@ protected static function wrapPrivateKey(string $public, string $private, string
$key .= "Argon2-Passes: 13\r\n";
$key .= "Argon2-Parallelism: 1\r\n";
$key .= "Argon2-Salt: " . Strings::bin2hex($salt) . "\r\n";
extract(self::generateV3Key($password, 'Argon2id', 8192, 13, $salt));
[
'symkey' => $symkey,
'symiv' => $symiv,
'hashkey' => $hashkey
] = self::generateV3Key($password, 'Argon2id', 8192, 13, $salt);

$hash = new Hash('sha256');
$hash->setKey($hashkey);
Expand Down
2 changes: 1 addition & 1 deletion phpseclib/Crypt/Common/StreamCipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class StreamCipher extends SymmetricKey
*
* Stream ciphers do not have a block size
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @see SymmetricKey::block_size
* @var int
*/
protected $block_size = 0;
Expand Down
22 changes: 11 additions & 11 deletions phpseclib/Crypt/DES.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ class DES extends BlockCipher
/**
* Block Length of the cipher
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @see Common\SymmetricKey::block_size
* @var int
*/
protected $block_size = 8;

/**
* Key Length (in bytes)
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength()
* @see Common\SymmetricKey::setKeyLength()
* @var int
*/
protected $key_length = 8;

/**
* The OpenSSL names of the cipher / modes
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::openssl_mode_names
* @see Common\SymmetricKey::openssl_mode_names
* @var array
*/
protected $openssl_mode_names = [
Expand Down Expand Up @@ -572,7 +572,7 @@ public function __construct(string $mode)
*
* This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
* @see Common\SymmetricKey::isValidEngine()
*/
protected function isValidEngineHelper(int $engine): bool
{
Expand All @@ -599,7 +599,7 @@ protected function isValidEngineHelper(int $engine): bool
*
* DES also requires that every eighth bit be a parity bit, however, we'll ignore that.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setKey()
* @see Common\SymmetricKey::setKey()
*/
public function setKey(string $key): void
{
Expand All @@ -615,8 +615,8 @@ public function setKey(string $key): void
* Encrypts a block
*
* @see self::encrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
* @see Common\SymmetricKey::encryptBlock()
* @see Common\SymmetricKey::encrypt()
*/
protected function encryptBlock(string $in): string
{
Expand All @@ -627,8 +627,8 @@ protected function encryptBlock(string $in): string
* Decrypts a block
*
* @see self::decrypt()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock()
* @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
* @see Common\SymmetricKey::decryptBlock()
* @see Common\SymmetricKey::decrypt()
*/
protected function decryptBlock(string $in): string
{
Expand Down Expand Up @@ -724,7 +724,7 @@ private function processBlock(string $block, int $mode)
/**
* Creates the key schedule
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey()
* @see Common\SymmetricKey::setupKey()
*/
protected function setupKey(): void
{
Expand Down Expand Up @@ -1258,7 +1258,7 @@ protected function setupKey(): void
/**
* Setup the performance-optimized function for de/encrypt()
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()
* @see Common\SymmetricKey::setupInlineCrypt()
*/
protected function setupInlineCrypt(): void
{
Expand Down
7 changes: 6 additions & 1 deletion phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public static function load($key, $password)
if (!isset($components['private'])) {
return $components;
}
extract($components);
[
'type' => $type,
'comment' => $comment,
'public' => $public,
'private' => $private
] = $components;
unset($components['public'], $components['private']);

[$p, $q, $g, $y] = Strings::unpackSSH2('iiii', $public);
Expand Down
2 changes: 1 addition & 1 deletion phpseclib/Crypt/DSA/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function sign($message): string
return $signature;
}

extract(ASN1Signature::load($signature));
['r' => $r, 's' => $s] = ASN1Signature::load($signature);

return $format::save($r, $s);
}
Expand Down
2 changes: 1 addition & 1 deletion phpseclib/Crypt/DSA/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function verify($message, $signature): bool
if ($params === false || count($params) != 2) {
return false;
}
extract($params);
['r' => $r, 's' => $s] = $params;

if (self::$engines['OpenSSL'] && in_array($this->hash->getHash(), openssl_get_md_methods())) {
$sig = $format != 'ASN1' ? ASN1Signature::save($r, $s) : $signature;
Expand Down
2 changes: 1 addition & 1 deletion phpseclib/Crypt/EC/BaseCurves/Montgomery.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private function doubleAndAddPoint(array $p, array $q, PrimeInteger $x1): array
public function multiplyPoint(array $p, BigInteger $d): array
{
$p1 = [$this->one, $this->zero];
$alreadyInternal = isset($x[1]);
$alreadyInternal = isset($p[1]);
$p2 = $this->convertToInternal($p);
$x = $p[0];

Expand Down
Loading