@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if (!$xml->hasAttribute('Binding')) { |
| 55 | - throw new \Exception('Missing Binding on ' . $xml->tagName); |
|
| 55 | + throw new \Exception('Missing Binding on '.$xml->tagName); |
|
| 56 | 56 | } |
| 57 | 57 | $this->Binding = $xml->getAttribute('Binding'); |
| 58 | 58 | |
| 59 | 59 | if (!$xml->hasAttribute('Location')) { |
| 60 | - throw new \Exception('Missing Location on ' . $xml->tagName); |
|
| 60 | + throw new \Exception('Missing Location on '.$xml->tagName); |
|
| 61 | 61 | } |
| 62 | 62 | $this->Location = $xml->getAttribute('Location'); |
| 63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | if ($a->namespaceURI === null) { |
| 70 | 70 | continue; /* Not namespace-qualified -- skip. */ |
| 71 | 71 | } |
| 72 | - $fullName = '{' . $a->namespaceURI . '}' . $a->localName; |
|
| 72 | + $fullName = '{'.$a->namespaceURI.'}'.$a->localName; |
|
| 73 | 73 | $this->attributes[$fullName] = array( |
| 74 | 74 | 'qualifiedName' => $a->nodeName, |
| 75 | 75 | 'namespaceURI' => $a->namespaceURI, |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | assert(is_string($namespaceURI)); |
| 91 | 91 | assert(is_string($localName)); |
| 92 | 92 | |
| 93 | - $fullName = '{' . $namespaceURI . '}' . $localName; |
|
| 93 | + $fullName = '{'.$namespaceURI.'}'.$localName; |
|
| 94 | 94 | |
| 95 | 95 | return isset($this->attributes[$fullName]); |
| 96 | 96 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | assert(is_string($namespaceURI)); |
| 108 | 108 | assert(is_string($localName)); |
| 109 | 109 | |
| 110 | - $fullName = '{' . $namespaceURI . '}' . $localName; |
|
| 110 | + $fullName = '{'.$namespaceURI.'}'.$localName; |
|
| 111 | 111 | if (!isset($this->attributes[$fullName])) { |
| 112 | 112 | return ''; |
| 113 | 113 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | $localName = $name[1]; |
| 136 | 136 | |
| 137 | - $fullName = '{' . $namespaceURI . '}' . $localName; |
|
| 137 | + $fullName = '{'.$namespaceURI.'}'.$localName; |
|
| 138 | 138 | $this->attributes[$fullName] = array( |
| 139 | 139 | 'qualifiedName' => $qualifiedName, |
| 140 | 140 | 'namespaceURI' => $namespaceURI, |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | assert(is_string($namespaceURI)); |
| 154 | 154 | assert(is_string($localName)); |
| 155 | 155 | |
| 156 | - $fullName = '{' . $namespaceURI . '}' . $localName; |
|
| 156 | + $fullName = '{'.$namespaceURI.'}'.$localName; |
|
| 157 | 157 | unset($this->attributes[$fullName]); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | assert(is_string($name)); |
| 117 | 117 | |
| 118 | - $e = Utils::xpQuery($parent, './saml_metadata:' . $name); |
|
| 118 | + $e = Utils::xpQuery($parent, './saml_metadata:'.$name); |
|
| 119 | 119 | |
| 120 | 120 | $ret = array(); |
| 121 | 121 | foreach ($e as $i) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return null; |
| 143 | 143 | } |
| 144 | 144 | if (count($e) > 1) { |
| 145 | - throw new \Exception('More than one ' . $name . ' in ' . $parent->tagName); |
|
| 145 | + throw new \Exception('More than one '.$name.' in '.$parent->tagName); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | return $e[0]; |
@@ -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 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $symKeyInfoAlgo = $symmetricKeyInfo->getAlgorithm(); |
| 424 | 424 | |
| 425 | 425 | if (in_array($symKeyInfoAlgo, $blacklist, true)) { |
| 426 | - throw new \Exception('Algorithm disabled: ' . var_export($symKeyInfoAlgo, true)); |
|
| 426 | + throw new \Exception('Algorithm disabled: '.var_export($symKeyInfoAlgo, true)); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | if ($symKeyInfoAlgo === XMLSecurityKey::RSA_OAEP_MGF1P && $inputKeyAlgo === XMLSecurityKey::RSA_1_5) { |
@@ -439,9 +439,9 @@ discard block |
||
| 439 | 439 | /* Make sure that the input key format is the same as the one used to encrypt the key. */ |
| 440 | 440 | if ($inputKeyAlgo !== $symKeyInfoAlgo) { |
| 441 | 441 | throw new \Exception( |
| 442 | - 'Algorithm mismatch between input key and key used to encrypt ' . |
|
| 443 | - ' the symmetric key for the message. Key was: ' . |
|
| 444 | - var_export($inputKeyAlgo, true) . '; message was: ' . |
|
| 442 | + 'Algorithm mismatch between input key and key used to encrypt '. |
|
| 443 | + ' the symmetric key for the message. Key was: '. |
|
| 444 | + var_export($inputKeyAlgo, true).'; message was: '. |
|
| 445 | 445 | var_export($symKeyInfoAlgo, true) |
| 446 | 446 | ); |
| 447 | 447 | } |
@@ -455,20 +455,20 @@ discard block |
||
| 455 | 455 | /* To protect against "key oracle" attacks, we need to be able to create a |
| 456 | 456 | * symmetric key, and for that we need to know the key size. |
| 457 | 457 | */ |
| 458 | - throw new \Exception('Unknown key size for encryption algorithm: ' . var_export($symmetricKey->type, true)); |
|
| 458 | + throw new \Exception('Unknown key size for encryption algorithm: '.var_export($symmetricKey->type, true)); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | try { |
| 462 | 462 | $key = $encKey->decryptKey($symmetricKeyInfo); |
| 463 | 463 | if (strlen($key) != $keySize) { |
| 464 | 464 | throw new \Exception( |
| 465 | - 'Unexpected key size (' . strlen($key) * 8 . 'bits) for encryption algorithm: ' . |
|
| 465 | + 'Unexpected key size ('.strlen($key)*8.'bits) for encryption algorithm: '. |
|
| 466 | 466 | var_export($symmetricKey->type, true) |
| 467 | 467 | ); |
| 468 | 468 | } |
| 469 | 469 | } catch (\Exception $e) { |
| 470 | 470 | /* We failed to decrypt this key. Log it, and substitute a "random" key. */ |
| 471 | - Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: ' . $e->getMessage()); |
|
| 471 | + Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: '.$e->getMessage()); |
|
| 472 | 472 | /* Create a replacement key, so that it looks like we fail in the same way as if the key was correctly padded. */ |
| 473 | 473 | |
| 474 | 474 | /* We base the symmetric key on the encrypted key and private key, so that we always behave the |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $encryptedKey = $encKey->getCipherValue(); |
| 478 | 478 | $pkey = openssl_pkey_get_details($symmetricKeyInfo->key); |
| 479 | 479 | $pkey = sha1(serialize($pkey), true); |
| 480 | - $key = sha1($encryptedKey . $pkey, true); |
|
| 480 | + $key = sha1($encryptedKey.$pkey, true); |
|
| 481 | 481 | |
| 482 | 482 | /* Make sure that the key has the correct length. */ |
| 483 | 483 | if (strlen($key) > $keySize) { |
@@ -492,8 +492,8 @@ discard block |
||
| 492 | 492 | /* Make sure that the input key has the correct format. */ |
| 493 | 493 | if ($inputKeyAlgo !== $symKeyAlgo) { |
| 494 | 494 | throw new \Exception( |
| 495 | - 'Algorithm mismatch between input key and key in message. ' . |
|
| 496 | - 'Key was: ' . var_export($inputKeyAlgo, true) . '; message was: ' . |
|
| 495 | + 'Algorithm mismatch between input key and key in message. '. |
|
| 496 | + 'Key was: '.var_export($inputKeyAlgo, true).'; message was: '. |
|
| 497 | 497 | var_export($symKeyAlgo, true) |
| 498 | 498 | ); |
| 499 | 499 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | $algorithm = $symmetricKey->getAlgorithm(); |
| 504 | 504 | if (in_array($algorithm, $blacklist, true)) { |
| 505 | - throw new \Exception('Algorithm disabled: ' . var_export($algorithm, true)); |
|
| 505 | + throw new \Exception('Algorithm disabled: '.var_export($algorithm, true)); |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | /** @var string $decrypted */ |
@@ -514,8 +514,8 @@ discard block |
||
| 514 | 514 | * namespaces needed to parse the XML. |
| 515 | 515 | */ |
| 516 | 516 | $xml = '<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" '. |
| 517 | - 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . |
|
| 518 | - $decrypted . |
|
| 517 | + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'. |
|
| 518 | + $decrypted. |
|
| 519 | 519 | '</root>'; |
| 520 | 520 | |
| 521 | 521 | try { |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | * Something went wrong during decryption, but for security |
| 555 | 555 | * reasons we cannot tell the user what failed. |
| 556 | 556 | */ |
| 557 | - Utils::getContainer()->getLogger()->error('Decryption failed: ' . $e->getMessage()); |
|
| 557 | + Utils::getContainer()->getLogger()->error('Decryption failed: '.$e->getMessage()); |
|
| 558 | 558 | throw new \Exception('Failed to decrypt XML element.', 0, $e); |
| 559 | 559 | } |
| 560 | 560 | } |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | $regex = '/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d{1,9})?Z$/D'; |
| 717 | 717 | if (preg_match($regex, $time, $matches) == 0) { |
| 718 | 718 | throw new \Exception( |
| 719 | - 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: ' . $time |
|
| 719 | + 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: '.$time |
|
| 720 | 720 | ); |
| 721 | 721 | } |
| 722 | 722 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function emergency($message, array $context = []) |
| 18 | 18 | { |
| 19 | - \SimpleSAML\Logger::emergency($message . ($context ? " " . var_export($context, true) : "")); |
|
| 19 | + \SimpleSAML\Logger::emergency($message.($context ? " ".var_export($context, true) : "")); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function alert($message, array $context = []) |
| 33 | 33 | { |
| 34 | - \SimpleSAML\Logger::alert($message . ($context ? " " . var_export($context, true) : "")); |
|
| 34 | + \SimpleSAML\Logger::alert($message.($context ? " ".var_export($context, true) : "")); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function critical($message, array $context = []) |
| 47 | 47 | { |
| 48 | - \SimpleSAML\Logger::critical($message . ($context ? " " . var_export($context, true) : "")); |
|
| 48 | + \SimpleSAML\Logger::critical($message.($context ? " ".var_export($context, true) : "")); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function error($message, array $context = []) |
| 60 | 60 | { |
| 61 | - \SimpleSAML\Logger::error($message . ($context ? " " . var_export($context, true) : "")); |
|
| 61 | + \SimpleSAML\Logger::error($message.($context ? " ".var_export($context, true) : "")); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function warning($message, array $context = []) |
| 75 | 75 | { |
| 76 | - \SimpleSAML\Logger::warning($message . ($context ? " " . var_export($context, true) : "")); |
|
| 76 | + \SimpleSAML\Logger::warning($message.($context ? " ".var_export($context, true) : "")); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function notice($message, array $context = []) |
| 87 | 87 | { |
| 88 | - \SimpleSAML\Logger::notice($message . ($context ? " " . var_export($context, true) : "")); |
|
| 88 | + \SimpleSAML\Logger::notice($message.($context ? " ".var_export($context, true) : "")); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function info($message, array $context = []) |
| 101 | 101 | { |
| 102 | - \SimpleSAML\Logger::info($message . ($context ? " " . var_export($context, true) : "")); |
|
| 102 | + \SimpleSAML\Logger::info($message.($context ? " ".var_export($context, true) : "")); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function debug($message, array $context = []) |
| 113 | 113 | { |
| 114 | - \SimpleSAML\Logger::debug($message . ($context ? " " . var_export($context, true) : "")); |
|
| 114 | + \SimpleSAML\Logger::debug($message.($context ? " ".var_export($context, true) : "")); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |