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 12 additions and 7 deletions
Showing only changes of commit 3a72363937 - Show all commits

View file

@ -21,7 +21,8 @@
*/
public static function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface
{
if(!$request->getSession()->flagExists(SessionFlags::VER_COMMUNITY_GUIDELINES))
$session = $request->getSession();
if(!$session->flagExists(SessionFlags::VER_COMMUNITY_GUIDELINES))
{
return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Community guidelines has already been accepted');
}
@ -29,7 +30,7 @@
try
{
// Check & update the session flow
SessionManager::updateFlow($request->getSession(), [SessionFlags::VER_COMMUNITY_GUIDELINES]);
SessionManager::updateFlow($session, [SessionFlags::VER_COMMUNITY_GUIDELINES]);
}
catch (DatabaseOperationException $e)
{

View file

@ -13,19 +13,23 @@
class AcceptPrivacyPolicy extends Method
{
/**
* Executes the process of accepting the privacy policy.
*
* @inheritDoc
*/
public static function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface
{
$session = $request->getSession();
if(!$session->flagExists(SessionFlags::VER_PRIVACY_POLICY))
{
return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Privacy policy has already been accepted');
}
try
{
// Remove the verification flag
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::VER_PRIVACY_POLICY]);
// Check & update the session flow
SessionManager::updateFlow($request->getSession());
SessionManager::updateFlow($session, [SessionFlags::VER_PRIVACY_POLICY]);
}
catch (DatabaseOperationException $e)
{