Skip to content

Commit bd6e045

Browse files
committed
refactor: Throwing forAuthenticationFailed instead of forDecryptionFailed
1 parent 2e871d2 commit bd6e045

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

system/Encryption/Exceptions/EncryptionException.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,4 @@ public static function forEncryptionFailed()
8282
{
8383
return new static(lang('Encryption.encryptionFailed'));
8484
}
85-
86-
/**
87-
* Thrown during data decryption when a problem or error occurred.
88-
*
89-
* @return static
90-
*/
91-
public static function forDecryptionFailed()
92-
{
93-
return new static(lang('Encryption.decryptionFailed'));
94-
}
9585
}

system/Encryption/Handlers/OpenSSLHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function decrypt($data, #[SensitiveParameter] $params = null)
156156
$decryptedData = \openssl_decrypt($data, $this->cipher, $encryptKey, OPENSSL_RAW_DATA, $iv);
157157

158158
if ($decryptedData === false) {
159-
throw EncryptionException::forDecryptionFailed();
159+
throw EncryptionException::forAuthenticationFailed();
160160
}
161161

162162
return $decryptedData;

system/Language/en/Encryption.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
'starterKeyNeeded' => 'Encrypter needs a starter key.',
2020
'authenticationFailed' => 'Decrypting: authentication failed.',
2121
'encryptionFailed' => 'Encryption failed.',
22-
'decryptionFailed' => 'Decryption failed.',
2322
];

0 commit comments

Comments
 (0)