@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return $this->getAppValues($app); |
300 | 300 | } else { |
301 | 301 | $appIds = $this->getApps(); |
302 | - $values = array_map(function ($appId) use ($key) { |
|
302 | + $values = array_map(function($appId) use ($key) { |
|
303 | 303 | return isset($this->cache[$appId][$key]) ? $this->cache[$appId][$key] : null; |
304 | 304 | }, $appIds); |
305 | 305 | $result = array_combine($appIds, $values); |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | $rows = $result->fetchAll(); |
349 | 349 | foreach ($rows as $row) { |
350 | 350 | if (!isset($this->cache[$row['appid']])) { |
351 | - $this->cache[(string)$row['appid']] = []; |
|
351 | + $this->cache[(string) $row['appid']] = []; |
|
352 | 352 | } |
353 | 353 | |
354 | - $this->cache[(string)$row['appid']][(string)$row['configkey']] = (string)$row['configvalue']; |
|
354 | + $this->cache[(string) $row['appid']][(string) $row['configkey']] = (string) $row['configvalue']; |
|
355 | 355 | } |
356 | 356 | $result->closeCursor(); |
357 | 357 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ['app' => 'encryption']); |
125 | 125 | |
126 | 126 | if (openssl_error_string()) { |
127 | - $log->error('Encryption library openssl_pkey_new() fails: ' . openssl_error_string(), |
|
127 | + $log->error('Encryption library openssl_pkey_new() fails: '.openssl_error_string(), |
|
128 | 128 | ['app' => 'encryption']); |
129 | 129 | } |
130 | 130 | } elseif (openssl_pkey_export($res, |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | 'privateKey' => $privateKey |
140 | 140 | ]; |
141 | 141 | } |
142 | - $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.' . $this->user, |
|
142 | + $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.'.$this->user, |
|
143 | 143 | ['app' => 'encryption']); |
144 | 144 | if (openssl_error_string()) { |
145 | - $log->error('Encryption Library:' . openssl_error_string(), |
|
145 | + $log->error('Encryption Library:'.openssl_error_string(), |
|
146 | 146 | ['app' => 'encryption']); |
147 | 147 | } |
148 | 148 | |
@@ -213,15 +213,15 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function generateHeader($keyFormat = 'hash') { |
215 | 215 | if (in_array($keyFormat, $this->supportedKeyFormats, true) === false) { |
216 | - throw new \InvalidArgumentException('key format "' . $keyFormat . '" is not supported'); |
|
216 | + throw new \InvalidArgumentException('key format "'.$keyFormat.'" is not supported'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | $cipher = $this->getCipher(); |
220 | 220 | |
221 | 221 | $header = self::HEADER_START |
222 | - . ':cipher:' . $cipher |
|
223 | - . ':keyFormat:' . $keyFormat |
|
224 | - . ':' . self::HEADER_END; |
|
222 | + . ':cipher:'.$cipher |
|
223 | + . ':keyFormat:'.$keyFormat |
|
224 | + . ':'.self::HEADER_END; |
|
225 | 225 | |
226 | 226 | return $header; |
227 | 227 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | if (!$encryptedContent) { |
245 | 245 | $error = 'Encryption (symmetric) of content failed'; |
246 | - $this->logger->error($error . openssl_error_string(), |
|
246 | + $this->logger->error($error.openssl_error_string(), |
|
247 | 247 | ['app' => 'encryption']); |
248 | 248 | throw new EncryptionFailedException($error); |
249 | 249 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @return string |
320 | 320 | */ |
321 | 321 | private function concatIV($encryptedContent, $iv) { |
322 | - return $encryptedContent . '00iv00' . $iv; |
|
322 | + return $encryptedContent.'00iv00'.$iv; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | * @return string |
329 | 329 | */ |
330 | 330 | private function concatSig($encryptedContent, $signature) { |
331 | - return $encryptedContent . '00sig00' . $signature; |
|
331 | + return $encryptedContent.'00sig00'.$signature; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * @return string |
341 | 341 | */ |
342 | 342 | private function addPadding($data) { |
343 | - return $data . 'xxx'; |
|
343 | + return $data.'xxx'; |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | protected function generatePasswordHash($password, $cipher, $uid = '') { |
355 | 355 | $instanceId = $this->config->getSystemValue('instanceid'); |
356 | 356 | $instanceSecret = $this->config->getSystemValue('secret'); |
357 | - $salt = hash('sha256', $uid . $instanceId . $instanceSecret, true); |
|
357 | + $salt = hash('sha256', $uid.$instanceId.$instanceSecret, true); |
|
358 | 358 | $keySize = $this->getKeySize($cipher); |
359 | 359 | |
360 | 360 | $hash = hash_pbkdf2( |
@@ -474,10 +474,10 @@ discard block |
||
474 | 474 | if ($catFile['signature'] !== false) { |
475 | 475 | try { |
476 | 476 | // First try the new format |
477 | - $this->checkSignature($catFile['encrypted'], $passPhrase . '_' . $version . '_' . $position, $catFile['signature']); |
|
477 | + $this->checkSignature($catFile['encrypted'], $passPhrase.'_'.$version.'_'.$position, $catFile['signature']); |
|
478 | 478 | } catch (GenericEncryptionException $e) { |
479 | 479 | // For compatibility with old files check the version without _ |
480 | - $this->checkSignature($catFile['encrypted'], $passPhrase . $version . $position, $catFile['signature']); |
|
480 | + $this->checkSignature($catFile['encrypted'], $passPhrase.$version.$position, $catFile['signature']); |
|
481 | 481 | } |
482 | 482 | } |
483 | 483 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @return string |
517 | 517 | */ |
518 | 518 | private function createSignature($data, $passPhrase) { |
519 | - $passPhrase = hash('sha512', $passPhrase . 'a', true); |
|
519 | + $passPhrase = hash('sha512', $passPhrase.'a', true); |
|
520 | 520 | return hash_hmac('sha256', $data, $passPhrase); |
521 | 521 | } |
522 | 522 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | if ($plainContent) { |
615 | 615 | return $plainContent; |
616 | 616 | } else { |
617 | - throw new DecryptionFailedException('Encryption library: Decryption (symmetric) of content failed: ' . openssl_error_string()); |
|
617 | + throw new DecryptionFailedException('Encryption library: Decryption (symmetric) of content failed: '.openssl_error_string()); |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | if (openssl_open($encKeyFile, $plainContent, $shareKey, $privateKey, 'RC4')) { |
681 | 681 | return $plainContent; |
682 | 682 | } else { |
683 | - throw new MultiKeyDecryptException('multikeydecrypt with share key failed:' . openssl_error_string()); |
|
683 | + throw new MultiKeyDecryptException('multikeydecrypt with share key failed:'.openssl_error_string()); |
|
684 | 684 | } |
685 | 685 | } |
686 | 686 | |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | 'data' => $sealed |
717 | 717 | ]; |
718 | 718 | } else { |
719 | - throw new MultiKeyEncryptException('multikeyencryption failed ' . openssl_error_string()); |
|
719 | + throw new MultiKeyEncryptException('multikeyencryption failed '.openssl_error_string()); |
|
720 | 720 | } |
721 | 721 | } |
722 | 722 | } |