From 89ed509ea3c2df0e39f5418ffec9611d4bbca6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no> Date: Fri, 1 Sep 2017 16:42:43 +0200 Subject: [PATCH] Fix build --- lib/SimpleSAML/Utils/Config/Metadata.php | 2 +- lib/SimpleSAML/Utils/Crypto.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php index 595474308..7a86b213d 100644 --- a/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/lib/SimpleSAML/Utils/Config/Metadata.php @@ -277,6 +277,6 @@ class Metadata \SimpleSAML\Logger::maskErrors(E_ALL); $hidden = in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]); \SimpleSAML\Logger::popErrorMask(); - return $hidden; + return $hidden === true; } } diff --git a/lib/SimpleSAML/Utils/Crypto.php b/lib/SimpleSAML/Utils/Crypto.php index 31f63aad9..766998eb3 100644 --- a/lib/SimpleSAML/Utils/Crypto.php +++ b/lib/SimpleSAML/Utils/Crypto.php @@ -24,9 +24,14 @@ class Crypto */ private static function _aesDecrypt($ciphertext, $secret) { + if (!is_string($ciphertext)) { + throw new \InvalidArgumentException( + 'Input parameter "$ciphertext" must be a string with more than 48 characters.' + ); + } /** @var int $len */ $len = mb_strlen($ciphertext, '8bit'); - if (!is_string($ciphertext) || $len < 48) { + if ($len < 48) { throw new \InvalidArgumentException( 'Input parameter "$ciphertext" must be a string with more than 48 characters.' ); -- GitLab