@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | if (!$xml->hasAttribute('index')) { |
43 | - throw new \Exception('Missing index on ' . $xml->tagName); |
|
43 | + throw new \Exception('Missing index on '.$xml->tagName); |
|
44 | 44 | } |
45 | 45 | $this->index = (int) $xml->getAttribute('index'); |
46 | 46 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | if (!$xml->hasAttribute('protocolSupportEnumeration')) { |
121 | - throw new \Exception('Missing protocolSupportEnumeration attribute on ' . $xml->localName); |
|
121 | + throw new \Exception('Missing protocolSupportEnumeration attribute on '.$xml->localName); |
|
122 | 122 | } |
123 | 123 | $this->protocolSupportEnumeration = preg_split('/[\s]+/', $xml->getAttribute('protocolSupportEnumeration')); |
124 | 124 |
@@ -49,21 +49,21 @@ discard block |
||
49 | 49 | $msg .= urlencode($msgStr); |
50 | 50 | |
51 | 51 | if ($relayState !== null) { |
52 | - $msg .= '&RelayState=' . urlencode($relayState); |
|
52 | + $msg .= '&RelayState='.urlencode($relayState); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | if ($key !== null) { |
56 | 56 | /* Add the signature. */ |
57 | - $msg .= '&SigAlg=' . urlencode($key->type); |
|
57 | + $msg .= '&SigAlg='.urlencode($key->type); |
|
58 | 58 | |
59 | 59 | $signature = $key->signData($msg); |
60 | - $msg .= '&Signature=' . urlencode(base64_encode($signature)); |
|
60 | + $msg .= '&Signature='.urlencode(base64_encode($signature)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (strpos($destination, '?') === false) { |
64 | - $destination .= '?' . $msg; |
|
64 | + $destination .= '?'.$msg; |
|
65 | 65 | } else { |
66 | - $destination .= '&' . $msg; |
|
66 | + $destination .= '&'.$msg; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $destination; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function send(Message $message) |
80 | 80 | { |
81 | 81 | $destination = $this->getRedirectURL($message); |
82 | - Utils::getContainer()->getLogger()->debug('Redirect to ' . strlen($destination) . ' byte URL: ' . $destination); |
|
82 | + Utils::getContainer()->getLogger()->debug('Redirect to '.strlen($destination).' byte URL: '.$destination); |
|
83 | 83 | Utils::getContainer()->redirect($destination); |
84 | 84 | } |
85 | 85 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | if (isset($data['SAMLEncoding']) && $data['SAMLEncoding'] !== self::DEFLATE) { |
109 | - throw new \Exception('Unknown SAMLEncoding: ' . var_export($data['SAMLEncoding'], true)); |
|
109 | + throw new \Exception('Unknown SAMLEncoding: '.var_export($data['SAMLEncoding'], true)); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $message = base64_decode($message); |
@@ -182,18 +182,18 @@ discard block |
||
182 | 182 | switch ($name) { |
183 | 183 | case 'SAMLRequest': |
184 | 184 | case 'SAMLResponse': |
185 | - $sigQuery = $name . '=' . $value; |
|
185 | + $sigQuery = $name.'='.$value; |
|
186 | 186 | break; |
187 | 187 | case 'RelayState': |
188 | - $relayState = '&RelayState=' . $value; |
|
188 | + $relayState = '&RelayState='.$value; |
|
189 | 189 | break; |
190 | 190 | case 'SigAlg': |
191 | - $sigAlg = '&SigAlg=' . $value; |
|
191 | + $sigAlg = '&SigAlg='.$value; |
|
192 | 192 | break; |
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
196 | - $data['SignedQuery'] = $sigQuery . $relayState . $sigAlg; |
|
196 | + $data['SignedQuery'] = $sigQuery.$relayState.$sigAlg; |
|
197 | 197 | |
198 | 198 | return $data; |
199 | 199 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function emergency($message, array $context = array()) |
17 | 17 | { |
18 | - \SimpleSAML\Logger::emergency($message . var_export($context, true)); |
|
18 | + \SimpleSAML\Logger::emergency($message.var_export($context, true)); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function alert($message, array $context = array()) |
32 | 32 | { |
33 | - \SimpleSAML\Logger::alert($message . var_export($context, true)); |
|
33 | + \SimpleSAML\Logger::alert($message.var_export($context, true)); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function critical($message, array $context = array()) |
46 | 46 | { |
47 | - \SimpleSAML\Logger::critical($message . var_export($context, true)); |
|
47 | + \SimpleSAML\Logger::critical($message.var_export($context, true)); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function error($message, array $context = array()) |
59 | 59 | { |
60 | - \SimpleSAML\Logger::error($message . var_export($context, true)); |
|
60 | + \SimpleSAML\Logger::error($message.var_export($context, true)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function warning($message, array $context = array()) |
74 | 74 | { |
75 | - \SimpleSAML\Logger::warning($message . var_export($context, true)); |
|
75 | + \SimpleSAML\Logger::warning($message.var_export($context, true)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function notice($message, array $context = array()) |
86 | 86 | { |
87 | - \SimpleSAML\Logger::notice($message . var_export($context, true)); |
|
87 | + \SimpleSAML\Logger::notice($message.var_export($context, true)); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function info($message, array $context = array()) |
100 | 100 | { |
101 | - \SimpleSAML\Logger::info($message . var_export($context, true)); |
|
101 | + \SimpleSAML\Logger::info($message.var_export($context, true)); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function debug($message, array $context = array()) |
112 | 112 | { |
113 | - \SimpleSAML\Logger::debug($message . var_export($context, true)); |
|
113 | + \SimpleSAML\Logger::debug($message.var_export($context, true)); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | foreach ($namespaces as $prefix => $uri) { |
249 | - $newElement->setAttributeNS($uri, $prefix . ':__ns_workaround__', 'tmp'); |
|
249 | + $newElement->setAttributeNS($uri, $prefix.':__ns_workaround__', 'tmp'); |
|
250 | 250 | $newElement->removeAttributeNS($uri, '__ns_workaround__'); |
251 | 251 | } |
252 | 252 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | case 'true': |
280 | 280 | return true; |
281 | 281 | default: |
282 | - throw new \Exception('Invalid value of boolean attribute ' . var_export($attributeName, true) . ': ' . var_export($value, true)); |
|
282 | + throw new \Exception('Invalid value of boolean attribute '.var_export($attributeName, true).': '.var_export($value, true)); |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $symKeyInfoAlgo = $symmetricKeyInfo->getAlgorith(); |
416 | 416 | |
417 | 417 | if (in_array($symKeyInfoAlgo, $blacklist, true)) { |
418 | - throw new \Exception('Algorithm disabled: ' . var_export($symKeyInfoAlgo, true)); |
|
418 | + throw new \Exception('Algorithm disabled: '.var_export($symKeyInfoAlgo, true)); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if ($symKeyInfoAlgo === XMLSecurityKey::RSA_OAEP_MGF1P && $inputKeyAlgo === XMLSecurityKey::RSA_1_5) { |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | /* Make sure that the input key format is the same as the one used to encrypt the key. */ |
432 | 432 | if ($inputKeyAlgo !== $symKeyInfoAlgo) { |
433 | 433 | throw new \Exception( |
434 | - 'Algorithm mismatch between input key and key used to encrypt ' . |
|
435 | - ' the symmetric key for the message. Key was: ' . |
|
436 | - var_export($inputKeyAlgo, true) . '; message was: ' . |
|
434 | + 'Algorithm mismatch between input key and key used to encrypt '. |
|
435 | + ' the symmetric key for the message. Key was: '. |
|
436 | + var_export($inputKeyAlgo, true).'; message was: '. |
|
437 | 437 | var_export($symKeyInfoAlgo, true) |
438 | 438 | ); |
439 | 439 | } |
@@ -447,20 +447,20 @@ discard block |
||
447 | 447 | /* To protect against "key oracle" attacks, we need to be able to create a |
448 | 448 | * symmetric key, and for that we need to know the key size. |
449 | 449 | */ |
450 | - throw new \Exception('Unknown key size for encryption algorithm: ' . var_export($symmetricKey->type, true)); |
|
450 | + throw new \Exception('Unknown key size for encryption algorithm: '.var_export($symmetricKey->type, true)); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | try { |
454 | 454 | $key = $encKey->decryptKey($symmetricKeyInfo); |
455 | 455 | if (strlen($key) != $keySize) { |
456 | 456 | throw new \Exception( |
457 | - 'Unexpected key size (' . strlen($key) * 8 . 'bits) for encryption algorithm: ' . |
|
457 | + 'Unexpected key size ('.strlen($key)*8.'bits) for encryption algorithm: '. |
|
458 | 458 | var_export($symmetricKey->type, true) |
459 | 459 | ); |
460 | 460 | } |
461 | 461 | } catch (\Exception $e) { |
462 | 462 | /* We failed to decrypt this key. Log it, and substitute a "random" key. */ |
463 | - Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: ' . $e->getMessage()); |
|
463 | + Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: '.$e->getMessage()); |
|
464 | 464 | /* Create a replacement key, so that it looks like we fail in the same way as if the key was correctly padded. */ |
465 | 465 | |
466 | 466 | /* We base the symmetric key on the encrypted key and private key, so that we always behave the |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $encryptedKey = $encKey->getCipherValue(); |
470 | 470 | $pkey = openssl_pkey_get_details($symmetricKeyInfo->key); |
471 | 471 | $pkey = sha1(serialize($pkey), true); |
472 | - $key = sha1($encryptedKey . $pkey, true); |
|
472 | + $key = sha1($encryptedKey.$pkey, true); |
|
473 | 473 | |
474 | 474 | /* Make sure that the key has the correct length. */ |
475 | 475 | if (strlen($key) > $keySize) { |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | /* Make sure that the input key has the correct format. */ |
485 | 485 | if ($inputKeyAlgo !== $symKeyAlgo) { |
486 | 486 | throw new \Exception( |
487 | - 'Algorithm mismatch between input key and key in message. ' . |
|
488 | - 'Key was: ' . var_export($inputKeyAlgo, true) . '; message was: ' . |
|
487 | + 'Algorithm mismatch between input key and key in message. '. |
|
488 | + 'Key was: '.var_export($inputKeyAlgo, true).'; message was: '. |
|
489 | 489 | var_export($symKeyAlgo, true) |
490 | 490 | ); |
491 | 491 | } |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | $algorithm = $symmetricKey->getAlgorith(); |
496 | 496 | if (in_array($algorithm, $blacklist, true)) { |
497 | - throw new \Exception('Algorithm disabled: ' . var_export($algorithm, true)); |
|
497 | + throw new \Exception('Algorithm disabled: '.var_export($algorithm, true)); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | /** @var string $decrypted */ |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | * namespaces needed to parse the XML. |
507 | 507 | */ |
508 | 508 | $xml = '<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" '. |
509 | - 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . |
|
510 | - $decrypted . |
|
509 | + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'. |
|
510 | + $decrypted. |
|
511 | 511 | '</root>'; |
512 | 512 | |
513 | 513 | try { |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | * Something went wrong during decryption, but for security |
547 | 547 | * reasons we cannot tell the user what failed. |
548 | 548 | */ |
549 | - Utils::getContainer()->getLogger()->error('Decryption failed: ' . $e->getMessage()); |
|
549 | + Utils::getContainer()->getLogger()->error('Decryption failed: '.$e->getMessage()); |
|
550 | 550 | throw new \Exception('Failed to decrypt XML element.', 0, $e); |
551 | 551 | } |
552 | 552 | } |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | $regex = '/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?Z$/D'; |
709 | 709 | if (preg_match($regex, $time, $matches) == 0) { |
710 | 710 | throw new \Exception( |
711 | - 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: ' . $time |
|
711 | + 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: '.$time |
|
712 | 712 | ); |
713 | 713 | } |
714 | 714 |
@@ -54,8 +54,8 @@ |
||
54 | 54 | return; |
55 | 55 | } |
56 | 56 | |
57 | - $this->IPHint = Utils::extractStrings($xml, Common::NS, 'IPHint'); |
|
58 | - $this->DomainHint = Utils::extractStrings($xml, Common::NS, 'DomainHint'); |
|
57 | + $this->IPHint = Utils::extractStrings($xml, Common::NS, 'IPHint'); |
|
58 | + $this->DomainHint = Utils::extractStrings($xml, Common::NS, 'DomainHint'); |
|
59 | 59 | $this->GeolocationHint = Utils::extractStrings($xml, Common::NS, 'GeolocationHint'); |
60 | 60 | |
61 | 61 | foreach (Utils::xpQuery($xml, "./*[namespace-uri()!='".Common::NS."']") as $node) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $generatedId = pack('H*', ((string) SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(20)))); |
42 | - $artifact = base64_encode("\x00\x04\x00\x00" . sha1($message->getIssuer(), true) . $generatedId) ; |
|
42 | + $artifact = base64_encode("\x00\x04\x00\x00".sha1($message->getIssuer(), true).$generatedId); |
|
43 | 43 | $artifactData = $message->toUnsignedXML(); |
44 | 44 | $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData); |
45 | 45 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | if (array_key_exists('SAMLart', $_REQUEST)) { |
83 | 83 | $artifact = base64_decode($_REQUEST['SAMLart']); |
84 | - $endpointIndex = bin2hex(substr($artifact, 2, 2)); |
|
84 | + $endpointIndex = bin2hex(substr($artifact, 2, 2)); |
|
85 | 85 | $sourceId = bin2hex(substr($artifact, 4, 20)); |
86 | 86 | } else { |
87 | 87 | throw new \Exception('Missing SAMLart parameter.'); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $idpMetadata = $metadataHandler->getMetaDataConfigForSha1($sourceId, 'saml20-idp-remote'); |
93 | 93 | |
94 | 94 | if ($idpMetadata === null) { |
95 | - throw new \Exception('No metadata found for remote provider with SHA1 ID: ' . var_export($sourceId, true)); |
|
95 | + throw new \Exception('No metadata found for remote provider with SHA1 ID: '.var_export($sourceId, true)); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | $endpoint = null; |
99 | 99 | foreach ($idpMetadata->getEndpoints('ArtifactResolutionService') as $ep) { |
100 | - if ($ep['index'] === hexdec($endpointIndex)) { |
|
100 | + if ($ep['index'] === hexdec($endpointIndex)) { |
|
101 | 101 | $endpoint = $ep; |
102 | 102 | break; |
103 | 103 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | throw new \Exception('No ArtifactResolutionService with the correct index.'); |
108 | 108 | } |
109 | 109 | |
110 | - Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := " . $endpoint['Location']); |
|
110 | + Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := ".$endpoint['Location']); |
|
111 | 111 | |
112 | 112 | //Construct the ArtifactResolve Request |
113 | 113 | $ar = new ArtifactResolve(); |
@@ -264,7 +264,7 @@ |
||
264 | 264 | if ($this->encryptedNameId === null) { |
265 | 265 | $this->nameId->toXML($root); |
266 | 266 | } else { |
267 | - $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); |
|
267 | + $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedID'); |
|
268 | 268 | $root->appendChild($eid); |
269 | 269 | $eid->appendChild($root->ownerDocument->importNode($this->encryptedNameId, true)); |
270 | 270 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | if (strpos($keyword, "+") !== false) { |
73 | 73 | throw new \Exception('Keywords may not contain a "+" character.'); |
74 | 74 | } |
75 | - $value .= str_replace(' ', '+', $keyword) . ' '; |
|
75 | + $value .= str_replace(' ', '+', $keyword).' '; |
|
76 | 76 | } |
77 | 77 | $value = rtrim($value); |
78 | 78 | $e->appendChild($doc->createTextNode($value)); |