@@ -212,6 +212,10 @@ discard block |
||
212 | 212 | return array($cipherKey, $macKey, $iv); |
213 | 213 | } |
214 | 214 | |
215 | + /** |
|
216 | + * @param string $a |
|
217 | + * @param string $b |
|
218 | + */ |
|
215 | 219 | protected function hash_equals($a, $b) { |
216 | 220 | $key = openssl_random_pseudo_bytes(128); |
217 | 221 | return hash_hmac('sha512', $a, $key) === hash_hmac('sha512', $b, $key); |
@@ -249,7 +253,7 @@ discard block |
||
249 | 253 | /** |
250 | 254 | * Pad the data with a random char chosen by the pad amount. |
251 | 255 | * |
252 | - * @param $data |
|
256 | + * @param string $data |
|
253 | 257 | * @return string |
254 | 258 | */ |
255 | 259 | protected function pad($data) { |
@@ -265,8 +269,8 @@ discard block |
||
265 | 269 | /** |
266 | 270 | * Unpad the the data |
267 | 271 | * |
268 | - * @param $data |
|
269 | - * @return bool|string |
|
272 | + * @param string $data |
|
273 | + * @return false|string |
|
270 | 274 | */ |
271 | 275 | protected function unpad($data) { |
272 | 276 | $length = $this->getKeySize(); |
@@ -283,7 +287,7 @@ discard block |
||
283 | 287 | * Encrypt a credential |
284 | 288 | * |
285 | 289 | * @param Credential|array $credential the credential to decrypt |
286 | - * @return Credential|array |
|
290 | + * @return string |
|
287 | 291 | */ |
288 | 292 | public function decryptCredential($credential) { |
289 | 293 | return $this->handleCredential($credential, 'decrypt'); |
@@ -304,6 +308,7 @@ discard block |
||
304 | 308 | * Handles the encryption / decryption of a credential |
305 | 309 | * |
306 | 310 | * @param Credential|array $credential the credential to encrypt |
311 | + * @param string $op |
|
307 | 312 | * @return Credential|array |
308 | 313 | * @throws \Exception |
309 | 314 | */ |
@@ -347,7 +352,7 @@ discard block |
||
347 | 352 | /** |
348 | 353 | * Decrypt a file |
349 | 354 | * |
350 | - * @param File|array $file |
|
355 | + * @param File $file |
|
351 | 356 | * @return File|array |
352 | 357 | */ |
353 | 358 | |
@@ -358,7 +363,7 @@ discard block |
||
358 | 363 | /** |
359 | 364 | * Handles the encryption / decryption of a File |
360 | 365 | * |
361 | - * @param File|array $credential the credential to encrypt |
|
366 | + * @param string $op |
|
362 | 367 | * @return File|array |
363 | 368 | * @throws \Exception |
364 | 369 | */ |