From 9fae7ec89d9c28b5f35911a78ef3775b79ca2e47 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 13 Jul 2022 09:06:33 -0500 Subject: [PATCH] RSA: loading keys could error out if xml extension wasn't installed --- phpseclib/Crypt/RSA.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 03022492..b0211994 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -1470,6 +1470,10 @@ class Crypt_RSA // http://en.wikipedia.org/wiki/XML_Signature case CRYPT_RSA_PRIVATE_FORMAT_XML: case CRYPT_RSA_PUBLIC_FORMAT_XML: + if (!extension_loaded('xml')) { + return false; + } + $this->components = array(); $xml = xml_parser_create('UTF-8');