Made message signing in Cryptography use SHA512 as the message content for... #1
2 changed files with 5 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
use Socialbox\Enums\Flags\SessionFlags;
|
||||
use Socialbox\Enums\StandardError;
|
||||
use Socialbox\Exceptions\DatabaseOperationException;
|
||||
use Socialbox\Exceptions\Standard\MissingRpcArgumentException;
|
||||
use Socialbox\Exceptions\Standard\StandardRpcException;
|
||||
use Socialbox\Interfaces\SerializableInterface;
|
||||
use Socialbox\Managers\CaptchaManager;
|
||||
|
@ -23,7 +24,7 @@
|
|||
{
|
||||
if(!$rpcRequest->containsParameter('answer'))
|
||||
{
|
||||
return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, 'The answer parameter is required');
|
||||
throw new MissingRpcArgumentException('answer');
|
||||
}
|
||||
|
||||
$session = $request->getSession();
|
||||
|
@ -32,7 +33,7 @@
|
|||
{
|
||||
if(CaptchaManager::getCaptcha($session->getPeerUuid())?->isExpired())
|
||||
{
|
||||
return $rpcRequest->produceError(StandardError::CAPTCHA_EXPIRED, 'The captcha has expired');
|
||||
return $rpcRequest->produceError(StandardError::EXPIRED, 'The captcha has expired');
|
||||
}
|
||||
}
|
||||
catch(DatabaseOperationException $e)
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
case NOT_FOUND = -105;
|
||||
case RESOLUTION_FAILED = -106;
|
||||
case CONFLICT = -107;
|
||||
case CRYPTOGRAPHIC_ERROR = -108;
|
||||
case EXPIRED = -108;
|
||||
case CRYPTOGRAPHIC_ERROR = -109;
|
||||
|
||||
// RPC Errors
|
||||
case RPC_METHOD_NOT_FOUND = -1000;
|
||||
|
|
Loading…
Add table
Reference in a new issue