Skip to content

Commit a2956fd

Browse files
fix: update to phpseclib3
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 438e3b6 commit a2956fd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/Command/Developer/SignSetup.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
use OC\Core\Command\Base;
1313
use OCA\Libresign\Service\Install\InstallService;
1414
use OCA\Libresign\Service\Install\SignSetupService;
15-
use OCA\Libresign\Vendor\phpseclib\Crypt\RSA;
16-
use OCA\Libresign\Vendor\phpseclib\File\X509;
15+
use OCA\Libresign\Vendor\phpseclib3\Crypt\RSA;
16+
use OCA\Libresign\Vendor\phpseclib3\Exception\NoKeyLoadedException;
17+
use OCA\Libresign\Vendor\phpseclib3\File\X509;
1718
use OCP\IConfig;
1819
use Symfony\Component\Console\Input\InputInterface;
1920
use Symfony\Component\Console\Input\InputOption;
@@ -57,8 +58,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5758
return 1;
5859
}
5960

60-
$rsa = new RSA();
61-
if ($rsa->loadKey($privateKey) === false) {
61+
try {
62+
$rsa = RSA::loadPrivateKey($privateKey);
63+
} catch (NoKeyLoadedException) {
6264
$output->writeln('Invalid private key');
6365
return 1;
6466
}

0 commit comments

Comments
 (0)