diff --git a/bin/pwgen.php b/bin/pwgen.php index 83b4dfeafea66023b251f82812ac3ff1a408237a..24fef6ca56eae472937064db1eb5dd0d053a2d1a 100755 --- a/bin/pwgen.php +++ b/bin/pwgen.php @@ -44,4 +44,4 @@ if(!in_array(strtolower($algo), hash_algos())) { echo "Do you want to use a salt? (yes/no) [yes] "; $s = (trim(fgets(STDIN)) == 'no') ? '' : 'S'; -echo "\n " . SimpleSAML_Utils_Crypto::pwHash($password, strtoupper( $s . $algo ) ). "\n\n"; +echo "\n " . SimpleSAML\Utils\Crypto::pwHash($password, strtoupper( $s . $algo ) ). "\n\n"; diff --git a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php index b105225600bb4777228139cc5705de5cf9f9f77a..d992aba6d6506e485e0489edb7408ea93c2b0d30 100644 --- a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php +++ b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php @@ -29,8 +29,8 @@ class SimpleSAML_Bindings_Shib13_HTTPPost { SimpleSAML_Utilities::validateXMLDocument($response, 'saml11'); - $privatekey = SimpleSAML_Utils_Crypto::loadPrivateKey($idpmd, TRUE); - $publickey = SimpleSAML_Utils_Crypto::loadPublicKey($idpmd, TRUE); + $privatekey = SimpleSAML\Utils\Crypto::loadPrivateKey($idpmd, TRUE); + $publickey = SimpleSAML\Utils\Crypto::loadPublicKey($idpmd, TRUE); $responsedom = new DOMDocument(); $responsedom->loadXML(str_replace ("\r", "", $response)); diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 3d3306532575815790a6e224f95593520a88bd05..170156c2d55c7f2c3b4eaba5cfc188a531f2e550 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -1020,18 +1020,18 @@ class SimpleSAML_Utilities { /** - * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML_Utils_Crypto::loadPublicKey() instead. + * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPublicKey() instead. */ public static function loadPublicKey(SimpleSAML_Configuration $metadata, $required = FALSE, $prefix = '') { - return SimpleSAML_Utils_Crypto::loadPublicKey($metadata, $required, $prefix); + return SimpleSAML\Utils\Crypto::loadPublicKey($metadata, $required, $prefix); } /** - * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML_Utils_Crypto::loadPrivateKey() instead. + * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPrivateKey() instead. */ public static function loadPrivateKey(SimpleSAML_Configuration $metadata, $required = FALSE, $prefix = '') { - return SimpleSAML_Utils_Crypto::loadPrivateKey($metadata, $required, $prefix); + return SimpleSAML\Utils\Crypto::loadPrivateKey($metadata, $required, $prefix); } @@ -1163,7 +1163,7 @@ class SimpleSAML_Utilities { $session = SimpleSAML_Session::getSessionFromRequest(); $session->setData('core_postdatalink', $postId, $postData); - $redirInfo = base64_encode(SimpleSAML_Utils_Crypto::aesEncrypt($session->getSessionId() . ':' . $postId)); + $redirInfo = base64_encode(SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId() . ':' . $postId)); $url = SimpleSAML_Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $redirInfo)); $url = preg_replace("#^https:#", "http:", $url); @@ -1571,18 +1571,18 @@ class SimpleSAML_Utilities { /** - * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML_Utils_Crypto::aesEncrypt() instead. + * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::aesEncrypt() instead. */ public static function aesEncrypt($clear) { - return SimpleSAML_Utils_Crypto::aesEncrypt($clear); + return SimpleSAML\Utils\Crypto::aesEncrypt($clear); } /** - * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML_Utils_Crypto::aesDecrypt() instead. + * @deprecated This function will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::aesDecrypt() instead. */ public static function aesDecrypt($encData) { - return SimpleSAML_Utils_Crypto::aesDecrypt($encData); + return SimpleSAML\Utils\Crypto::aesDecrypt($encData); } diff --git a/lib/SimpleSAML/Utils/Crypto.php b/lib/SimpleSAML/Utils/Crypto.php index d54dfddd9547cc6b339d7b81114973f76e2aa314..8eab717e93b889a295b4260eeb4bd7a55b181f05 100644 --- a/lib/SimpleSAML/Utils/Crypto.php +++ b/lib/SimpleSAML/Utils/Crypto.php @@ -1,4 +1,5 @@ <?php +namespace SimpleSAML\Utils; /** @@ -6,26 +7,26 @@ * * @package SimpleSAMLphp */ -class SimpleSAML_Utils_Crypto +class Crypto { /** * Decrypt data using AES and the system-wide secret salt as key. * - * @param string $data The encrypted data to decrypt. + * @param string $ciphertext The encrypted data to decrypt. * * @return string The decrypted data. - * @throws SimpleSAML_Error_Exception If the mcrypt module is not loaded or $ciphertext is not a string. + * @throws \SimpleSAML_Error_Exception If the mcrypt module is not loaded or $ciphertext is not a string. * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ public static function aesDecrypt($ciphertext) { if (!is_string($ciphertext)) { - throw new SimpleSAML_Error_Exception('Input parameter "$ciphertext" must be a string.'); + throw new \SimpleSAML_Error_Exception('Input parameter "$ciphertext" must be a string.'); } if (!function_exists("mcrypt_encrypt")) { - throw new SimpleSAML_Error_Exception("The mcrypt PHP module is not loaded."); + throw new \SimpleSAML_Error_Exception("The mcrypt PHP module is not loaded."); } $enc = MCRYPT_RIJNDAEL_256; @@ -34,7 +35,7 @@ class SimpleSAML_Utils_Crypto $ivSize = mcrypt_get_iv_size($enc, $mode); $keySize = mcrypt_get_key_size($enc, $mode); - $key = hash('sha256', SimpleSAML\Utils\Config::getSecretSalt(), true); + $key = hash('sha256', Config::getSecretSalt(), true); $key = substr($key, 0, $keySize); $iv = substr($ciphertext, 0, $ivSize); @@ -55,17 +56,17 @@ class SimpleSAML_Utils_Crypto * @param string $data The data to encrypt. * * @return string The encrypted data and IV. - * @throws SimpleSAML_Error_Exception If the mcrypt module is not loaded or $data is not a string. + * @throws \SimpleSAML_Error_Exception If the mcrypt module is not loaded or $data is not a string. * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ public static function aesEncrypt($data) { if (!is_string($data)) { - throw new SimpleSAML_Error_Exception('Input parameter "$data" must be a string.'); + throw new \SimpleSAML_Error_Exception('Input parameter "$data" must be a string.'); } if (!function_exists("mcrypt_encrypt")) { - throw new SimpleSAML_Error_Exception('The mcrypt PHP module is not loaded.'); + throw new \SimpleSAML_Error_Exception('The mcrypt PHP module is not loaded.'); } $enc = MCRYPT_RIJNDAEL_256; @@ -75,7 +76,7 @@ class SimpleSAML_Utils_Crypto $ivSize = mcrypt_get_iv_size($enc, $mode); $keySize = mcrypt_get_key_size($enc, $mode); - $key = hash('sha256', SimpleSAML\Utils\Config::getSecretSalt(), true); + $key = hash('sha256', Config::getSecretSalt(), true); $key = substr($key, 0, $keySize); $len = strlen($data); @@ -101,38 +102,38 @@ class SimpleSAML_Utils_Crypto * - 'PEM': Data for the private key, in PEM-format. * - 'password': Password for the private key. * - * @param SimpleSAML_Configuration $metadata The metadata array the private key should be loaded from. + * @param \SimpleSAML_Configuration $metadata The metadata array the private key should be loaded from. * @param bool $required Whether the private key is required. If this is true, a * missing key will cause an exception. Defaults to false. * @param string $prefix The prefix which should be used when reading from the metadata * array. Defaults to ''. * * @return array|NULL Extracted private key, or NULL if no private key is present. - * @throws SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load it. + * @throws \SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load it. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> */ - public static function loadPrivateKey(SimpleSAML_Configuration $metadata, $required = false, $prefix = '') + public static function loadPrivateKey(\SimpleSAML_Configuration $metadata, $required = false, $prefix = '') { if (!is_bool($required) || !is_string($prefix)) { - throw new SimpleSAML_Error_Exception('Invalid input parameters.'); + throw new \SimpleSAML_Error_Exception('Invalid input parameters.'); } $file = $metadata->getString($prefix.'privatekey', null); if ($file === null) { // no private key found if ($required) { - throw new SimpleSAML_Error_Exception('No private key found in metadata.'); + throw new \SimpleSAML_Error_Exception('No private key found in metadata.'); } else { return null; } } - $file = SimpleSAML_Utilities::resolveCert($file); + $file = \SimpleSAML_Utilities::resolveCert($file); $data = @file_get_contents($file); if ($data === false) { - throw new SimpleSAML_Error_Exception('Unable to load private key from file "'.$file.'"'); + throw new \SimpleSAML_Error_Exception('Unable to load private key from file "'.$file.'"'); } $ret = array( @@ -162,7 +163,7 @@ class SimpleSAML_Utils_Crypto * - 'certData': The certificate data, base64 encoded, on a single line. (Only present if this is a certificate.) * - 'certFingerprint': Array of valid certificate fingerprints. (Only present if this is a certificate.) * - * @param SimpleSAML_Configuration $metadata The metadata. + * @param \SimpleSAML_Configuration $metadata The metadata. * @param bool $required Whether the private key is required. If this is TRUE, a missing key * will cause an exception. Default is FALSE. * @param string $prefix The prefix which should be used when reading from the metadata array. @@ -170,12 +171,12 @@ class SimpleSAML_Utils_Crypto * * @return array|NULL Public key or certificate data, or NULL if no public key or certificate was found. * - * @throws SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load it. + * @throws \SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load it. * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * @author Lasse Birnbaum Jensen */ - public static function loadPublicKey(SimpleSAML_Configuration $metadata, $required = false, $prefix = '') + public static function loadPublicKey(\SimpleSAML_Configuration $metadata, $required = false, $prefix = '') { assert('is_bool($required)'); assert('is_string($prefix)'); @@ -219,7 +220,7 @@ class SimpleSAML_Utils_Crypto // no public key/certificate available if ($required) { - throw new SimpleSAML_Error_Exception('No public key / certificate found in metadata.'); + throw new \SimpleSAML_Error_Exception('No public key / certificate found in metadata.'); } else { return null; } @@ -234,7 +235,7 @@ class SimpleSAML_Utils_Crypto * @param string $salt An optional salt to use. * * @return string The hashed password. - * @throws SimpleSAML_Error_Exception If the algorithm specified is not supported, or the input parameters are not + * @throws \SimpleSAML_Error_Exception If the algorithm specified is not supported, or the input parameters are not * strings. * @see hash_algos() * @author Dyonisius Visser, TERENA <visser@terena.org> @@ -243,7 +244,7 @@ class SimpleSAML_Utils_Crypto public static function pwHash($password, $algorithm, $salt = null) { if (!is_string($algorithm) || !is_string($password)) { - throw new SimpleSAML_Error_Exception('Invalid input parameters.'); + throw new \SimpleSAML_Error_Exception('Invalid input parameters.'); } // hash w/o salt @@ -267,7 +268,7 @@ class SimpleSAML_Utils_Crypto return $alg_str.base64_encode($hash.$salt); } - throw new SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($algorithm).'\' is not supported'); + throw new \SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($algorithm).'\' is not supported'); } @@ -278,14 +279,14 @@ class SimpleSAML_Utils_Crypto * @param string $password The password to check in clear. * * @return boolean True if the hash corresponds with the given password, false otherwise. - * @throws SimpleSAML_Error_Exception If the algorithm specified is not supported, or the input parameters are not + * @throws \SimpleSAML_Error_Exception If the algorithm specified is not supported, or the input parameters are not * strings. * @author Dyonisius Visser, TERENA <visser@terena.org> */ public static function pwValid($hash, $password) { if (!is_string($hash) || !is_string($password)) { - throw new SimpleSAML_Error_Exception('Invalid input parameters.'); + throw new \SimpleSAML_Error_Exception('Invalid input parameters.'); } // match algorithm string (e.g. '{SSHA256}', '{MD5}') @@ -312,6 +313,6 @@ class SimpleSAML_Utils_Crypto return $hash === $password; } - throw new SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($alg).'\' is not supported'); + throw new \SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($alg).'\' is not supported'); } } diff --git a/modules/adfs/www/idp/metadata.php b/modules/adfs/www/idp/metadata.php index 345dbb5bf8d146d16c2b9b592b09db29793ed4a7..e4e58a4f377b7bebb5f210630b883e8917fe0b83 100644 --- a/modules/adfs/www/idp/metadata.php +++ b/modules/adfs/www/idp/metadata.php @@ -20,7 +20,7 @@ try { $availableCerts = array(); $keys = array(); - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); if ($certInfo !== NULL) { $availableCerts['new_idp.crt'] = $certInfo; $keys[] = array( @@ -34,7 +34,7 @@ try { $hasNewCert = FALSE; } - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE); $availableCerts['idp.crt'] = $certInfo; $keys[] = array( 'type' => 'X509Certificate', @@ -44,7 +44,7 @@ try { ); if ($idpmeta->hasValue('https.certificate')) { - $httpsCert = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); + $httpsCert = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); assert('isset($httpsCert["certData"])'); $availableCerts['https.crt'] = $httpsCert; $keys[] = array( diff --git a/modules/authcrypt/lib/Auth/Source/Hash.php b/modules/authcrypt/lib/Auth/Source/Hash.php index 9bc061580e8e493457b5d0e9dd614454aaf6bdaf..7c684176bf4a76a570dd549a64737f156a639960 100644 --- a/modules/authcrypt/lib/Auth/Source/Hash.php +++ b/modules/authcrypt/lib/Auth/Source/Hash.php @@ -82,7 +82,7 @@ class sspmod_authcrypt_Auth_Source_Hash extends sspmod_core_Auth_UserPassBase { foreach($this->users as $userpass=>$attrs) { $matches = explode(':', $userpass, 2); if ($matches[0] === $username) { - if(SimpleSAML_Utils_Crypto::pwValid($matches[1], $password)) { + if(SimpleSAML\Utils\Crypto::pwValid($matches[1], $password)) { return $this->users[$userpass]; } else { SimpleSAML_Logger::debug('Incorrect password "' . $password . '" for user '. $username); diff --git a/modules/authcrypt/lib/Auth/Source/Htpasswd.php b/modules/authcrypt/lib/Auth/Source/Htpasswd.php index 0ffa5ac28de8c09bbbc6db0a48c3766ea5d01e6d..bf9fd83800f3c2fa103a8ded55adeb2293bcb323 100644 --- a/modules/authcrypt/lib/Auth/Source/Htpasswd.php +++ b/modules/authcrypt/lib/Auth/Source/Htpasswd.php @@ -86,7 +86,7 @@ class sspmod_authcrypt_Auth_Source_Htpasswd extends sspmod_core_Auth_UserPassBas } // SHA1 or plain-text - if(SimpleSAML_Utils_Crypto::pwValid($crypted, $password)) { + if(SimpleSAML\Utils\Crypto::pwValid($crypted, $password)) { SimpleSAML_Logger::debug('User '. $username . ' authenticated successfully'); return $attributes; } diff --git a/modules/core/lib/Auth/Source/AdminPassword.php b/modules/core/lib/Auth/Source/AdminPassword.php index adab5d60dbc39ef4e0850d0949d9f73272a9916e..12cf0dcaa7218eb3ccc104c1d75020b11096a99d 100644 --- a/modules/core/lib/Auth/Source/AdminPassword.php +++ b/modules/core/lib/Auth/Source/AdminPassword.php @@ -54,7 +54,7 @@ class sspmod_core_Auth_Source_AdminPassword extends sspmod_core_Auth_UserPassBas throw new SimpleSAML_Error_Error('WRONGUSERPASS'); } - if (!SimpleSAML_Utils_Crypto::pwValid($adminPassword, $password)) { + if (!SimpleSAML\Utils\Crypto::pwValid($adminPassword, $password)) { throw new SimpleSAML_Error_Error('WRONGUSERPASS'); } diff --git a/modules/core/www/postredirect.php b/modules/core/www/postredirect.php index 7614d98122d11ea96ddc4c4db51d37d9700873bb..3daa0cd681b99f328b70a646fed7db25a861cbfd 100644 --- a/modules/core/www/postredirect.php +++ b/modules/core/www/postredirect.php @@ -16,7 +16,7 @@ if (array_key_exists('RedirId', $_REQUEST)) { throw new SimpleSAML_Error_BadRequest('Invalid RedirInfo data.'); } - list($sessionId, $postId) = explode(':', SimpleSAML_Utils_Crypto::aesDecrypt($encData)); + list($sessionId, $postId) = explode(':', SimpleSAML\Utils\Crypto::aesDecrypt($encData)); if (empty($sessionId) || empty($postId)) { throw new SimpleSAML_Error_BadRequest('Invalid session info data.'); diff --git a/modules/saml/lib/Message.php b/modules/saml/lib/Message.php index 6e36d3623af915fef05737745f4fa507f9b998bf..1e85687ad35e9c48f7d1c47943a559f79d22e098 100644 --- a/modules/saml/lib/Message.php +++ b/modules/saml/lib/Message.php @@ -21,11 +21,11 @@ class sspmod_saml_Message { $dstPrivateKey = $dstMetadata->getString('signature.privatekey', NULL); if ($dstPrivateKey !== NULL) { - $keyArray = SimpleSAML_Utils_Crypto::loadPrivateKey($dstMetadata, TRUE, 'signature.'); - $certArray = SimpleSAML_Utils_Crypto::loadPublicKey($dstMetadata, FALSE, 'signature.'); + $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, TRUE, 'signature.'); + $certArray = SimpleSAML\Utils\Crypto::loadPublicKey($dstMetadata, FALSE, 'signature.'); } else { - $keyArray = SimpleSAML_Utils_Crypto::loadPrivateKey($srcMetadata, TRUE); - $certArray = SimpleSAML_Utils_Crypto::loadPublicKey($srcMetadata, FALSE); + $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($srcMetadata, TRUE); + $certArray = SimpleSAML\Utils\Crypto::loadPublicKey($srcMetadata, FALSE); } $algo = $dstMetadata->getString('signature.algorithm', NULL); @@ -281,7 +281,7 @@ class sspmod_saml_Message { $keys = array(); /* Load the new private key if it exists. */ - $keyArray = SimpleSAML_Utils_Crypto::loadPrivateKey($dstMetadata, FALSE, 'new_'); + $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, FALSE, 'new_'); if ($keyArray !== NULL) { assert('isset($keyArray["PEM"])'); @@ -294,7 +294,7 @@ class sspmod_saml_Message { } /* Find the existing private key. */ - $keyArray = SimpleSAML_Utils_Crypto::loadPrivateKey($dstMetadata, TRUE); + $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, TRUE); assert('isset($keyArray["PEM"])'); $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, array('type'=>'private')); diff --git a/modules/saml/www/idp/certs.php b/modules/saml/www/idp/certs.php index 48be5f09ebd7cafff0c79223536250337003f409..83f2f198450633b995bcbd4b47d8f9d34f2aecd2 100644 --- a/modules/saml/www/idp/certs.php +++ b/modules/saml/www/idp/certs.php @@ -17,13 +17,13 @@ $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted'); switch($_SERVER['PATH_INFO']) { case '/new_idp.crt': - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); break; case '/idp.crt': - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE); break; case '/https.crt': - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); break; default: throw new SimpleSAML_Error_NotFound('Unknown certificate.'); diff --git a/modules/saml/www/sp/metadata.php b/modules/saml/www/sp/metadata.php index 851ec9ccd43738fb447754ee57c9e1ac70ab2b46..f41e8ac84f10e9d0826cd359fe97490605b5721c 100644 --- a/modules/saml/www/sp/metadata.php +++ b/modules/saml/www/sp/metadata.php @@ -91,7 +91,7 @@ foreach ($assertionsconsumerservices as $services) { $metaArray20['AssertionConsumerService'] = $eps; $keys = array(); -$certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($spconfig, FALSE, 'new_'); +$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($spconfig, FALSE, 'new_'); if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) { $hasNewCert = TRUE; @@ -107,7 +107,7 @@ if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) { $hasNewCert = FALSE; } -$certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($spconfig); +$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($spconfig); if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) { $certData = $certInfo['certData']; diff --git a/www/saml2/idp/metadata.php b/www/saml2/idp/metadata.php index e8015ea440946866cac4dca8bd78dc9e8b2a00c8..67d56ca45b73ab05c012821fbdee34977bae305a 100644 --- a/www/saml2/idp/metadata.php +++ b/www/saml2/idp/metadata.php @@ -22,7 +22,7 @@ try { $availableCerts = array(); $keys = array(); - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); if ($certInfo !== NULL) { $availableCerts['new_idp.crt'] = $certInfo; $keys[] = array( @@ -36,7 +36,7 @@ try { $hasNewCert = FALSE; } - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE); $availableCerts['idp.crt'] = $certInfo; $keys[] = array( 'type' => 'X509Certificate', @@ -46,7 +46,7 @@ try { ); if ($idpmeta->hasValue('https.certificate')) { - $httpsCert = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); + $httpsCert = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); assert('isset($httpsCert["certData"])'); $availableCerts['https.crt'] = $httpsCert; $keys[] = array( diff --git a/www/shib13/idp/metadata.php b/www/shib13/idp/metadata.php index e65642dfc087719c006f15e93d4c7655bf1e574f..fc0a3583431b4b4376f8523539f22ba03cdf5143 100644 --- a/www/shib13/idp/metadata.php +++ b/www/shib13/idp/metadata.php @@ -21,7 +21,7 @@ try { $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'shib13-idp-hosted'); $keys = array(); - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); if ($certInfo !== NULL) { $keys[] = array( 'type' => 'X509Certificate', @@ -31,7 +31,7 @@ try { ); } - $certInfo = SimpleSAML_Utils_Crypto::loadPublicKey($idpmeta, TRUE); + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE); $keys[] = array( 'type' => 'X509Certificate', 'signing' => TRUE,