fix: update to phpseclib3

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-10-01 18:32:04 -03:00
commit f658fe07fa
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -12,8 +12,9 @@ use Exception;
use OC\Core\Command\Base;
use OCA\Libresign\Service\Install\InstallService;
use OCA\Libresign\Service\Install\SignSetupService;
use OCA\Libresign\Vendor\phpseclib\Crypt\RSA;
use OCA\Libresign\Vendor\phpseclib\File\X509;
use OCA\Libresign\Vendor\phpseclib3\Crypt\RSA;
use OCA\Libresign\Vendor\phpseclib3\Exception\NoKeyLoadedException;
use OCA\Libresign\Vendor\phpseclib3\File\X509;
use OCP\IConfig;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@ -57,8 +58,9 @@ class SignSetup extends Base {
return 1;
}
$rsa = new RSA();
if ($rsa->loadKey($privateKey) === false) {
try {
$rsa = RSA::loadPrivateKey($privateKey);
} catch (NoKeyLoadedException) {
$output->writeln('Invalid private key');
return 1;
}