Skip to content

Commit

Permalink
Bug fix decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
kamshory committed Nov 20, 2024
1 parent 4889b2d commit e27c8d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SecretObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function decryptString($ciphertext, $hexKey = null)
$iv = substr($ivHashCiphertext, 0, 16);
$hash = substr($ivHashCiphertext, 16, 32);
$ciphertext = substr($ivHashCiphertext, 48);
if (!hash_equals(hash_hmac('sha256', $ciphertext . $iv, $key, true), $hash))
if (!$hash || !hash_equals(hash_hmac('sha256', $ciphertext . $iv, $key, true), $hash))
{
return null;
}
Expand Down

0 comments on commit e27c8d9

Please sign in to comment.