Made message signing in Cryptography use SHA512 as the message content for... #1

Closed
netkas wants to merge 421 commits from master into dev
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 24530f5494 - Show all commits

View file

@ -6,6 +6,7 @@
use Socialbox\Enums\Flags\SessionFlags; use Socialbox\Enums\Flags\SessionFlags;
use Socialbox\Enums\StandardError; use Socialbox\Enums\StandardError;
use Socialbox\Exceptions\DatabaseOperationException; use Socialbox\Exceptions\DatabaseOperationException;
use Socialbox\Exceptions\Standard\MissingRpcArgumentException;
use Socialbox\Exceptions\Standard\StandardRpcException; use Socialbox\Exceptions\Standard\StandardRpcException;
use Socialbox\Interfaces\SerializableInterface; use Socialbox\Interfaces\SerializableInterface;
use Socialbox\Managers\CaptchaManager; use Socialbox\Managers\CaptchaManager;
@ -23,7 +24,7 @@
{ {
if(!$rpcRequest->containsParameter('answer')) if(!$rpcRequest->containsParameter('answer'))
{ {
return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, 'The answer parameter is required'); throw new MissingRpcArgumentException('answer');
} }
$session = $request->getSession(); $session = $request->getSession();
@ -32,7 +33,7 @@
{ {
if(CaptchaManager::getCaptcha($session->getPeerUuid())?->isExpired()) 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) catch(DatabaseOperationException $e)

View file

@ -16,7 +16,8 @@
case NOT_FOUND = -105; case NOT_FOUND = -105;
case RESOLUTION_FAILED = -106; case RESOLUTION_FAILED = -106;
case CONFLICT = -107; case CONFLICT = -107;
case CRYPTOGRAPHIC_ERROR = -108; case EXPIRED = -108;
case CRYPTOGRAPHIC_ERROR = -109;
// RPC Errors // RPC Errors
case RPC_METHOD_NOT_FOUND = -1000; case RPC_METHOD_NOT_FOUND = -1000;