mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +05:30
Added code coverage ignore docblocks
This commit is contained in:
parent
de13e14cdd
commit
335630f150
@ -36,7 +36,9 @@ class KeyCrypt
|
|||||||
$chunk = substr($unencryptedData, 0, $chunkSize);
|
$chunk = substr($unencryptedData, 0, $chunkSize);
|
||||||
$unencryptedData = substr($unencryptedData, $chunkSize);
|
$unencryptedData = substr($unencryptedData, $chunkSize);
|
||||||
if (openssl_private_encrypt($chunk, $encrypted, $privateKey) === false) {
|
if (openssl_private_encrypt($chunk, $encrypted, $privateKey) === false) {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
throw new \LogicException('Failed to encrypt data');
|
throw new \LogicException('Failed to encrypt data');
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
$output .= $encrypted;
|
$output .= $encrypted;
|
||||||
}
|
}
|
||||||
@ -72,7 +74,9 @@ class KeyCrypt
|
|||||||
$chunk = substr($encryptedData, 0, $chunkSize);
|
$chunk = substr($encryptedData, 0, $chunkSize);
|
||||||
$encryptedData = substr($encryptedData, $chunkSize);
|
$encryptedData = substr($encryptedData, $chunkSize);
|
||||||
if (openssl_public_decrypt($chunk, $decrypted, $publicKey) === false) {
|
if (openssl_public_decrypt($chunk, $decrypted, $publicKey) === false) {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
throw new \LogicException('Failed to decrypt data');
|
throw new \LogicException('Failed to decrypt data');
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
$output .= $decrypted;
|
$output .= $decrypted;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ class SecureKey
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$string = random_bytes($len);
|
$string = random_bytes($len);
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
} catch (\TypeError $e) {
|
} catch (\TypeError $e) {
|
||||||
// Well, it's an integer, so this IS unexpected.
|
// Well, it's an integer, so this IS unexpected.
|
||||||
throw OAuthServerException::serverError("An unexpected error has occurred");
|
throw OAuthServerException::serverError("An unexpected error has occurred");
|
||||||
@ -41,6 +42,7 @@ class SecureKey
|
|||||||
// If you get this message, the CSPRNG failed hard.
|
// If you get this message, the CSPRNG failed hard.
|
||||||
throw OAuthServerException::serverError("Could not generate a random string. Is our OS secure?");
|
throw OAuthServerException::serverError("Could not generate a random string. Is our OS secure?");
|
||||||
}
|
}
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
return bin2hex($string);
|
return bin2hex($string);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user