From 17ee5ec3111bd5bd9fd3e54f91c575e415e644d6 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 14 Apr 2021 15:34:05 +0200 Subject: [PATCH 1/3] fix: add extra control to check if issuer format is obmitted; --- src/Spid/Saml/In/Response.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spid/Saml/In/Response.php b/src/Spid/Saml/In/Response.php index b3738fe..1292a6f 100644 --- a/src/Spid/Saml/In/Response.php +++ b/src/Spid/Saml/In/Response.php @@ -57,8 +57,8 @@ public function validate($xml, $hasAssertion): bool } elseif ($xml->getElementsByTagName('Issuer')->item(0)->nodeValue != $_SESSION['idpEntityId']) { throw new \Exception("Invalid Issuer attribute, expected " . $_SESSION['idpEntityId'] . " but received " . $xml->getElementsByTagName('Issuer')->item(0)->nodeValue); - } elseif ($xml->getElementsByTagName('Issuer')->item(0)->getAttribute('Format') != - 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity') { + } elseif (!epmty($xml->getElementsByTagName('Issuer')->item(0)->getAttribute('Format')) && + $xml->getElementsByTagName('Issuer')->item(0)->getAttribute('Format') != 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity') { throw new \Exception("Invalid Issuer attribute, expected 'urn:oasis:names:tc:SAML:2.0:nameid-format:" . "entity'" . " but received " . $xml->getElementsByTagName('Issuer')->item(0)->getAttribute('Format')); } From c7d3d4d2786c114ede72ea20fdd5aaa1ca183760 Mon Sep 17 00:00:00 2001 From: andreadegiovine Date: Thu, 15 Apr 2021 12:02:24 +0200 Subject: [PATCH 2/3] fix: change pack name; --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d545129..2223d4f 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "italia/spid-php-lib", + "name": "thewave/spid-php-lib", "description": "PHP package for SPID authentication", "type": "library", "license": "BSD-3-Clause", @@ -28,4 +28,4 @@ "archive": { "exclude": ["/example", "/tests"] } -} +} \ No newline at end of file From a34a9aef6d54ad13af5df549e14a90e3d8f063b0 Mon Sep 17 00:00:00 2001 From: andreadegiovine Date: Thu, 15 Apr 2021 12:14:50 +0200 Subject: [PATCH 3/3] fix: restore pack name; --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2223d4f..243e148 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "thewave/spid-php-lib", + "name": "italia/spid-php-lib", "description": "PHP package for SPID authentication", "type": "library", "license": "BSD-3-Clause",