@@ -51,25 +51,25 @@ |
||
51 | 51 | |
52 | 52 | // ported from |
53 | 53 | // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1092 |
54 | - if ($configuration->hasValue($prefix . 'keys')) { |
|
55 | - $extracted['keys'] = $configuration->getArray($prefix . 'keys'); |
|
54 | + if ($configuration->hasValue($prefix.'keys')) { |
|
55 | + $extracted['keys'] = $configuration->getArray($prefix.'keys'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // ported from |
59 | 59 | // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1108 |
60 | - if ($configuration->hasValue($prefix . 'certData')) { |
|
61 | - $extracted['certificateData'] = $configuration->getString($prefix . 'certData'); |
|
60 | + if ($configuration->hasValue($prefix.'certData')) { |
|
61 | + $extracted['certificateData'] = $configuration->getString($prefix.'certData'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // ported from |
65 | 65 | // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1119 |
66 | - if ($configuration->hasValue($prefix . 'certificate')) { |
|
67 | - $extracted['certificateData'] = $configuration->getString($prefix . 'certificate'); |
|
66 | + if ($configuration->hasValue($prefix.'certificate')) { |
|
67 | + $extracted['certificateData'] = $configuration->getString($prefix.'certificate'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // ported from |
71 | 71 | // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/modules/saml/lib/Message.php#L161 |
72 | - if ($configuration->hasValue($prefix . 'certFingerprint')) { |
|
72 | + if ($configuration->hasValue($prefix.'certFingerprint')) { |
|
73 | 73 | $extracted['certificateFingerprint'] = $configuration->getArrayizeString('certFingerprint'); |
74 | 74 | } |
75 | 75 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function getPrivateKey($name, $required = FALSE) |
47 | 47 | { |
48 | 48 | $privateKeys = $this->get('privateKeys'); |
49 | - $key = array_filter($privateKeys, function (SAML2_Configuration_PrivateKey $key) use ($name) { |
|
49 | + $key = array_filter($privateKeys, function(SAML2_Configuration_PrivateKey $key) use ($name) { |
|
50 | 50 | return $key->getName() === $name; |
51 | 51 | }); |
52 | 52 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function getPrivateKey($name, $required = FALSE) |
47 | 47 | { |
48 | 48 | $privateKeys = $this->get('privateKeys'); |
49 | - $key = array_filter($privateKeys, function (SAML2_Configuration_PrivateKey $key) use ($name) { |
|
49 | + $key = array_filter($privateKeys, function(SAML2_Configuration_PrivateKey $key) use ($name) { |
|
50 | 50 | return $key->getName() === $name; |
51 | 51 | }); |
52 | 52 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | SAML2_Configuration_CertificateProvider $configuration |
46 | 46 | ) { |
47 | 47 | $logger = $this->logger; |
48 | - $pemCandidates = $this->configuredKeys->filter(function (SAML2_Certificate_Key $key) use ($logger) { |
|
48 | + $pemCandidates = $this->configuredKeys->filter(function(SAML2_Certificate_Key $key) use ($logger) { |
|
49 | 49 | if (!$key instanceof SAML2_Certificate_X509) { |
50 | 50 | $logger->debug(sprintf('Skipping unknown key type: "%s"', $key['type'])); |
51 | 51 | return FALSE; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | throw new SAML2_Signature_MissingConfigurationException(sprintf( |
70 | 70 | 'No certificates or fingerprints have been configured%s', |
71 | - $configuration->has('entityid') ? ' for "' . $configuration->get('entityid') . '"' : '' |
|
71 | + $configuration->has('entityid') ? ' for "'.$configuration->get('entityid').'"' : '' |
|
72 | 72 | )); |
73 | 73 | } |
74 | 74 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | SAML2_SignedElement $signedElement, |
58 | 58 | SAML2_Configuration_CertificateProvider $configuration |
59 | 59 | ) { |
60 | - $this->certificates = array_map(function ($certificate) { |
|
60 | + $this->certificates = array_map(function($certificate) { |
|
61 | 61 | return SAML2_Certificate_X509::createFromCertificateData($certificate); |
62 | 62 | }, $this->certificates); |
63 | 63 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | if ($xml->getAttribute('Version') !== '2.0') { |
145 | 145 | /* Currently a very strict check. */ |
146 | - throw new Exception('Unsupported version: ' . $xml->getAttribute('Version')); |
|
146 | + throw new Exception('Unsupported version: '.$xml->getAttribute('Version')); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | $this->issueInstant = SAML2_Utils::xsDateTimeToTimestamp($xml->getAttribute('IssueInstant')); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | { |
397 | 397 | $this->document = SAML2_DOMDocumentFactory::create(); |
398 | 398 | |
399 | - $root = $this->document->createElementNS(SAML2_Const::NS_SAMLP, 'samlp:' . $this->tagName); |
|
399 | + $root = $this->document->createElementNS(SAML2_Const::NS_SAMLP, 'samlp:'.$this->tagName); |
|
400 | 400 | $this->document->appendChild($root); |
401 | 401 | |
402 | 402 | /* Ugly hack to add another namespace declaration to the root element. */ |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | public static function fromXML(DOMElement $xml) |
523 | 523 | { |
524 | 524 | if ($xml->namespaceURI !== SAML2_Const::NS_SAMLP) { |
525 | - throw new Exception('Unknown namespace of SAML message: ' . var_export($xml->namespaceURI, TRUE)); |
|
525 | + throw new Exception('Unknown namespace of SAML message: '.var_export($xml->namespaceURI, TRUE)); |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | switch ($xml->localName) { |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | case 'ArtifactResolve': |
542 | 542 | return new SAML2_ArtifactResolve($xml); |
543 | 543 | default: |
544 | - throw new Exception('Unknown SAML message: ' . var_export($xml->localName, TRUE)); |
|
544 | + throw new Exception('Unknown SAML message: '.var_export($xml->localName, TRUE)); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | } |
@@ -208,6 +208,10 @@ |
||
208 | 208 | * @param $soapmessage Soap response needs to be type DOMDocument |
209 | 209 | * @return $soapfaultstring string|NULL |
210 | 210 | */ |
211 | + |
|
212 | + /** |
|
213 | + * @param DOMDocument $soapMessage |
|
214 | + */ |
|
211 | 215 | private function getSOAPFault($soapMessage) |
212 | 216 | { |
213 | 217 | $soapFault = SAML2_Utils::xpQuery($soapMessage->firstChild, '/soap-env:Envelope/soap-env:Body/soap-env:Fault'); |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $privateKey = SimpleSAML_Utilities::loadPrivateKey($srcMetadata); |
47 | 47 | $publicKey = SimpleSAML_Utilities::loadPublicKey($srcMetadata); |
48 | 48 | if ($privateKey !== NULL && $publicKey !== NULL && isset($publicKey['PEM'])) { |
49 | - $keyCertData = $privateKey['PEM'] . $publicKey['PEM']; |
|
50 | - $file = SimpleSAML_Utilities::getTempDir() . '/' . sha1($keyCertData) . '.pem'; |
|
49 | + $keyCertData = $privateKey['PEM'].$publicKey['PEM']; |
|
50 | + $file = SimpleSAML_Utilities::getTempDir().'/'.sha1($keyCertData).'.pem'; |
|
51 | 51 | if (!file_exists($file)) { |
52 | 52 | SimpleSAML_Utilities::writeFile($file, $keyCertData); |
53 | 53 | } |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | if ($key['type'] !== 'X509Certificate') { |
67 | 67 | continue; |
68 | 68 | } |
69 | - $certData .= "-----BEGIN CERTIFICATE-----\n" . |
|
70 | - chunk_split($key['X509Certificate'], 64) . |
|
69 | + $certData .= "-----BEGIN CERTIFICATE-----\n". |
|
70 | + chunk_split($key['X509Certificate'], 64). |
|
71 | 71 | "-----END CERTIFICATE-----\n"; |
72 | 72 | } |
73 | - $peerCertFile = SimpleSAML_Utilities::getTempDir() . '/' . sha1($certData) . '.pem'; |
|
73 | + $peerCertFile = SimpleSAML_Utilities::getTempDir().'/'.sha1($certData).'.pem'; |
|
74 | 74 | if (!file_exists($peerCertFile)) { |
75 | 75 | SimpleSAML_Utilities::writeFile($peerCertFile, $certData); |
76 | 76 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | // Add soap-envelopes |
97 | 97 | $request = $msg->toSignedXML(); |
98 | - $request = self::START_SOAP_ENVELOPE . $request->ownerDocument->saveXML($request) . self::END_SOAP_ENVELOPE; |
|
98 | + $request = self::START_SOAP_ENVELOPE.$request->ownerDocument->saveXML($request).self::END_SOAP_ENVELOPE; |
|
99 | 99 | |
100 | 100 | SAML2_Utils::getContainer()->debugMessage($request, 'out'); |
101 | 101 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | // There is a fault element but we haven't found out what the fault string is |
222 | 222 | $soapFaultString = "Unknown fault string found"; |
223 | 223 | // find out the fault string |
224 | - $faultStringElement = SAML2_Utils::xpQuery($soapFaultElement, './soap-env:faultstring') ; |
|
224 | + $faultStringElement = SAML2_Utils::xpQuery($soapFaultElement, './soap-env:faultstring'); |
|
225 | 225 | if (!empty($faultStringElement)) { |
226 | 226 | return $faultStringElement[0]->textContent; |
227 | 227 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | case SAML2_Const::BINDING_HOK_SSO: |
38 | 38 | return new SAML2_HTTPPost(); |
39 | 39 | default: |
40 | - throw new Exception('Unsupported binding: ' . var_export($urn, TRUE)); |
|
40 | + throw new Exception('Unsupported binding: '.var_export($urn, TRUE)); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | |
84 | 84 | $logger = SAML2_Utils::getContainer()->getLogger(); |
85 | 85 | $logger->warning('Unable to find the SAML 2 binding used for this request.'); |
86 | - $logger->warning('Request method: ' . var_export($_SERVER['REQUEST_METHOD'], TRUE)); |
|
86 | + $logger->warning('Request method: '.var_export($_SERVER['REQUEST_METHOD'], TRUE)); |
|
87 | 87 | if (!empty($_GET)) { |
88 | - $logger->warning("GET parameters: '" . implode("', '", array_map('addslashes', array_keys($_GET))) . "'"); |
|
88 | + $logger->warning("GET parameters: '".implode("', '", array_map('addslashes', array_keys($_GET)))."'"); |
|
89 | 89 | } |
90 | 90 | if (!empty($_POST)) { |
91 | - $logger->warning("POST parameters: '" . implode("', '", array_map('addslashes', array_keys($_POST))) . "'"); |
|
91 | + $logger->warning("POST parameters: '".implode("', '", array_map('addslashes', array_keys($_POST)))."'"); |
|
92 | 92 | } |
93 | 93 | if (isset($_SERVER['CONTENT_TYPE'])) { |
94 | - $logger->warning('Content-Type: ' . var_export($_SERVER['CONTENT_TYPE'], TRUE)); |
|
94 | + $logger->warning('Content-Type: '.var_export($_SERVER['CONTENT_TYPE'], TRUE)); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | throw new Exception('Unable to find the current binding.'); |