mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 21:12:15 +09:00
Pass through crypto exceptions
This commit is contained in:
parent
865e34c0d0
commit
8c797aaba1
1 changed files with 2 additions and 9 deletions
|
|
@ -60,14 +60,7 @@ class Security
|
||||||
// Use defuse/php-encryption if possible.
|
// Use defuse/php-encryption if possible.
|
||||||
if (!$force_compat && function_exists('openssl_encrypt'))
|
if (!$force_compat && function_exists('openssl_encrypt'))
|
||||||
{
|
{
|
||||||
try
|
return base64_encode(\Crypto::Encrypt($plaintext, $key));
|
||||||
{
|
|
||||||
return base64_encode(\Crypto::Encrypt($plaintext, $key));
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, use the CryptoCompat class.
|
// Otherwise, use the CryptoCompat class.
|
||||||
|
|
@ -102,7 +95,7 @@ class Security
|
||||||
{
|
{
|
||||||
return \Crypto::Decrypt($ciphertext, $key);
|
return \Crypto::Decrypt($ciphertext, $key);
|
||||||
}
|
}
|
||||||
catch (\Exception $e)
|
catch (\InvalidCiphertextException $e)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue