@@ -87,7 +87,7 @@ |
||
87 | 87 | * |
88 | 88 | * @param $data - The encrypted-and-signed message as base64 ASCII |
89 | 89 | * |
90 | - * @return bool|string - The decrypted cleartext or false if signature failed |
|
90 | + * @return string|false - The decrypted cleartext or false if signature failed |
|
91 | 91 | */ |
92 | 92 | public function decrypt($data) |
93 | 93 | { |
@@ -75,7 +75,7 @@ |
||
75 | 75 | * |
76 | 76 | * @param string $data - The encrypted-and-signed message as base64 ASCII |
77 | 77 | * |
78 | - * @return bool|string - The decrypted cleartext or false if signature failed |
|
78 | + * @return string|false - The decrypted cleartext or false if signature failed |
|
79 | 79 | */ |
80 | 80 | public function decrypt($data) |
81 | 81 | { |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $ivlen = openssl_cipher_iv_length($cipher); |
85 | 85 | $iv = substr($c, 0, $ivlen); |
86 | 86 | $hmac = substr($c, $ivlen, $sha2len = 32); |
87 | - $ciphertext_raw = substr($c, $ivlen+$sha2len); |
|
87 | + $ciphertext_raw = substr($c, $ivlen + $sha2len); |
|
88 | 88 | $cleartext = openssl_decrypt($ciphertext_raw, $cipher, $this->saltedKey, $options = OPENSSL_RAW_DATA, $iv); |
89 | 89 | $calcmac = hash_hmac('sha256', $ciphertext_raw, $this->saltedKey, $as_binary = true); |
90 | 90 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // Verify expiration |
113 | 113 | if ($cookieData) { |
114 | - $expiry = (int)substr($cookieData, 0, 10); |
|
114 | + $expiry = (int) substr($cookieData, 0, 10); |
|
115 | 115 | $data = substr($cookieData, 10); |
116 | 116 | |
117 | 117 | if ($expiry > $this->getNow()) { |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | |
149 | 149 | // Restore the known good cookie value |
150 | 150 | $this->currentCookieData = $this->crypto->encrypt( |
151 | - sprintf('%010u', $expiry) . $session_data |
|
151 | + sprintf('%010u', $expiry).$session_data |
|
152 | 152 | ); |
153 | 153 | |
154 | 154 | // Respect auto-expire on browser close for the session cookie (in case the cookie lifetime is zero) |
155 | - $cookieLifetime = min((int)$params['lifetime'], $lifetime); |
|
155 | + $cookieLifetime = min((int) $params['lifetime'], $lifetime); |
|
156 | 156 | |
157 | 157 | Cookie::set( |
158 | 158 | $this->cookie, |
@@ -45,8 +45,8 @@ |
||
45 | 45 | protected function getLifetime() |
46 | 46 | { |
47 | 47 | $params = session_get_cookie_params(); |
48 | - $cookieLifetime = (int)$params['lifetime']; |
|
49 | - $gcLifetime = (int)ini_get('session.gc_maxlifetime'); |
|
48 | + $cookieLifetime = (int) $params['lifetime']; |
|
49 | + $gcLifetime = (int) ini_get('session.gc_maxlifetime'); |
|
50 | 50 | |
51 | 51 | return $cookieLifetime ? min($cookieLifetime, $gcLifetime) : $gcLifetime; |
52 | 52 | } |
@@ -25,6 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param SessionHandlerInterface[] |
28 | + * @param BaseStore[] $handlers |
|
28 | 29 | * |
29 | 30 | * @return $this |
30 | 31 | */ |
@@ -38,6 +39,7 @@ discard block |
||
38 | 39 | |
39 | 40 | /** |
40 | 41 | * @param string |
42 | + * @param string $key |
|
41 | 43 | * |
42 | 44 | * @return $this |
43 | 45 | */ |