summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2015-04-16 15:34:43 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2015-04-16 15:34:43 +0200
commit4f7e78f6b4d7e8cc7dea613f3beb45004776dfa3 (patch)
tree8429579ec683bcde2eab1bb990aaf5fec6dc11bf /lib/SimpleSAML
parent1b2e51643d9d63bc99f1781939d8763dfe3d31c1 (diff)
downloadsimplesamlphp-4f7e78f6b4d7e8cc7dea613f3beb45004776dfa3.zip
simplesamlphp-4f7e78f6b4d7e8cc7dea613f3beb45004776dfa3.tar.gz
simplesamlphp-4f7e78f6b4d7e8cc7dea613f3beb45004776dfa3.tar.bz2
Schedule SimpleSAML_Utilities::stringToHex() for removal. Deprecate and stop using it.
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r--lib/SimpleSAML/Error/Error.php2
-rw-r--r--lib/SimpleSAML/Session.php2
-rw-r--r--lib/SimpleSAML/SessionHandlerCookie.php2
-rw-r--r--lib/SimpleSAML/SessionHandlerPHP.php2
-rw-r--r--lib/SimpleSAML/Utilities.php7
-rw-r--r--lib/SimpleSAML/XHTML/EMail.php2
6 files changed, 7 insertions, 10 deletions
diff --git a/lib/SimpleSAML/Error/Error.php b/lib/SimpleSAML/Error/Error.php
index 402eeea..a422e62 100644
--- a/lib/SimpleSAML/Error/Error.php
+++ b/lib/SimpleSAML/Error/Error.php
@@ -202,7 +202,7 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception {
$emsg = array_shift($data);
$etrace = implode("\n", $data);
- $reportId = SimpleSAML_Utilities::stringToHex(openssl_random_pseudo_bytes(4));
+ $reportId = bin2hex(openssl_random_pseudo_bytes(4));
SimpleSAML_Logger::error('Error report with id ' . $reportId . ' generated.');
$config = SimpleSAML_Configuration::getInstance();
diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index dbe899f..df43435 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -137,7 +137,7 @@ class SimpleSAML_Session
$sh = SimpleSAML_SessionHandler::getSessionHandler();
$this->sessionId = $sh->newSessionId();
- $this->trackid = SimpleSAML_Utilities::stringToHex(openssl_random_pseudo_bytes(5));
+ $this->trackid = bin2hex(openssl_random_pseudo_bytes(5));
$this->dirty = true;
diff --git a/lib/SimpleSAML/SessionHandlerCookie.php b/lib/SimpleSAML/SessionHandlerCookie.php
index 86486fd..9e47a8a 100644
--- a/lib/SimpleSAML/SessionHandlerCookie.php
+++ b/lib/SimpleSAML/SessionHandlerCookie.php
@@ -93,7 +93,7 @@ extends SimpleSAML_SessionHandler {
* A random session id.
*/
private static function createSessionID() {
- return SimpleSAML_Utilities::stringToHex(openssl_random_pseudo_bytes(16));
+ return bin2hex(openssl_random_pseudo_bytes(16));
}
diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php
index 2fe63c3..36fe075 100644
--- a/lib/SimpleSAML/SessionHandlerPHP.php
+++ b/lib/SimpleSAML/SessionHandlerPHP.php
@@ -77,7 +77,7 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler {
}
/* Generate new (secure) session id. */
- $sessionId = SimpleSAML_Utilities::stringToHex(openssl_random_pseudo_bytes(16));
+ $sessionId = bin2hex(openssl_random_pseudo_bytes(16));
SimpleSAML_Session::createSession($sessionId);
if (session_id() !== '') {
diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index e22fea3..b71a6e2 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -382,7 +382,7 @@ class SimpleSAML_Utilities {
public static function generateID() {
- return '_' . self::stringToHex(openssl_random_pseudo_bytes(21));
+ return '_' . bin2hex(openssl_random_pseudo_bytes(21));
}
@@ -967,10 +967,7 @@ class SimpleSAML_Utilities {
/**
- * This function converts a binary string to hexadecimal characters.
- *
- * @param $bytes Input string.
- * @return String with lowercase hexadecimal characters.
+ * @deprecated This function will be removed in SSP 2.0. Please use bin2hex() instead.
*/
public static function stringToHex($bytes) {
$ret = '';
diff --git a/lib/SimpleSAML/XHTML/EMail.php b/lib/SimpleSAML/XHTML/EMail.php
index 761f5de..5b69962 100644
--- a/lib/SimpleSAML/XHTML/EMail.php
+++ b/lib/SimpleSAML/XHTML/EMail.php
@@ -65,7 +65,7 @@ pre {
if ($this->subject == NULL) throw new Exception('EMail field [subject] is required and not set.');
if ($this->body == NULL) throw new Exception('EMail field [body] is required and not set.');
- $random_hash = SimpleSAML_Utilities::stringToHex(openssl_random_pseudo_bytes(16));
+ $random_hash = bin2hex(openssl_random_pseudo_bytes(16));
if (isset($this->from))
$this->headers[]= 'From: ' . $this->from;