summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2015-04-20 17:05:28 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2015-04-20 17:05:28 +0200
commita38bf33da41b36cdb8350e2b35ea75e2317056d5 (patch)
treebd32e16cf8344016add7e5c04074544d51ec012a
parent2548d57bbeed95989d3d0a3997995224e516a817 (diff)
downloadsimplesamlphp-a38bf33da41b36cdb8350e2b35ea75e2317056d5.zip
simplesamlphp-a38bf33da41b36cdb8350e2b35ea75e2317056d5.tar.gz
simplesamlphp-a38bf33da41b36cdb8350e2b35ea75e2317056d5.tar.bz2
Move SimpleSAML_Utils_Crypto to SimpleSAML\Utils\Crypto.
-rwxr-xr-xbin/pwgen.php2
-rw-r--r--lib/SimpleSAML/Bindings/Shib13/HTTPPost.php4
-rw-r--r--lib/SimpleSAML/Utilities.php18
-rw-r--r--lib/SimpleSAML/Utils/Crypto.php55
-rw-r--r--modules/adfs/www/idp/metadata.php6
-rw-r--r--modules/authcrypt/lib/Auth/Source/Hash.php2
-rw-r--r--modules/authcrypt/lib/Auth/Source/Htpasswd.php2
-rw-r--r--modules/core/lib/Auth/Source/AdminPassword.php2
-rw-r--r--modules/core/www/postredirect.php2
-rw-r--r--modules/saml/lib/Message.php12
-rw-r--r--modules/saml/www/idp/certs.php6
-rw-r--r--modules/saml/www/sp/metadata.php4
-rw-r--r--www/saml2/idp/metadata.php6
-rw-r--r--www/shib13/idp/metadata.php4
14 files changed, 63 insertions, 62 deletions
diff --git a/bin/pwgen.php b/bin/pwgen.php
index 83b4dfe..24fef6c 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 b105225..d992aba 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 3d33065..170156c 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 d54dfdd..8eab717 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 345dbb5..e4e58a4 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 9bc0615..7c68417 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 0ffa5ac..bf9fd83 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 adab5d6..12cf0dc 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 7614d98..3daa0cd 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 6e36d36..1e85687 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 48be5f0..83f2f19 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 851ec9c..f41e8ac 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 e8015ea..67d56ca 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 e65642d..fc0a358 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,