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 4 additions and 30 deletions
Showing only changes of commit 1108711eb7 - Show all commits

View file

@ -50,27 +50,15 @@
// Remove the SET_PASSWORD flag // Remove the SET_PASSWORD flag
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::SET_PASSWORD]); SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::SET_PASSWORD]);
// Check & update the session flow
SessionManager::updateFlow($request->getSession());
} }
catch(Exception $e) catch(Exception $e)
{ {
throw new StandardException('Failed to set password due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e); throw new StandardException('Failed to set password due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
} }
// Check if all registration flags are removed
if(SessionFlags::isComplete($request->getSession()->getFlags()))
{
// Set the session as authenticated
try
{
SessionManager::setAuthenticated($request->getSessionUuid(), true);
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::REGISTRATION_REQUIRED, SessionFlags::AUTHENTICATION_REQUIRED]);
}
catch (DatabaseOperationException $e)
{
throw new StandardException('Failed to update session due to an internal exception', StandardError::INTERNAL_SERVER_ERROR, $e);
}
}
return $rpcRequest->produceResponse(true); return $rpcRequest->produceResponse(true);
} }
} }

View file

@ -47,6 +47,7 @@
if($result) if($result)
{ {
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::VER_IMAGE_CAPTCHA]); SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::VER_IMAGE_CAPTCHA]);
SessionManager::updateFlow($session);
} }
} }
catch (DatabaseOperationException $e) catch (DatabaseOperationException $e)
@ -54,21 +55,6 @@
throw new StandardException("There was an unexpected error while trying to answer the captcha", StandardError::INTERNAL_SERVER_ERROR, $e); throw new StandardException("There was an unexpected error while trying to answer the captcha", StandardError::INTERNAL_SERVER_ERROR, $e);
} }
// Check if all registration flags are removed
if(SessionFlags::isComplete($request->getSession()->getFlags()))
{
// Set the session as authenticated
try
{
SessionManager::setAuthenticated($request->getSessionUuid(), true);
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::REGISTRATION_REQUIRED, SessionFlags::AUTHENTICATION_REQUIRED]);
}
catch (DatabaseOperationException $e)
{
return $rpcRequest->produceError(StandardError::INTERNAL_SERVER_ERROR, $e);
}
}
return $rpcRequest->produceResponse($result); return $rpcRequest->produceResponse($result);
} }
} }