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

Closed
netkas wants to merge 421 commits from master into dev
Showing only changes of commit 65c2254b0c - Show all commits

View file

@ -88,7 +88,6 @@ class CaptchaManager
// Return false if the captcha does not exist // Return false if the captcha does not exist
if(!self::captchaExists($peer_uuid)) if(!self::captchaExists($peer_uuid))
{ {
Logger::getLogger()->warning(sprintf("The requested captcha does not exist for the peer %s", $peer_uuid));
return false; return false;
} }
@ -97,25 +96,21 @@ class CaptchaManager
// Return false if the captcha has already been solved // Return false if the captcha has already been solved
if($captcha->getStatus() === CaptchaStatus::SOLVED) if($captcha->getStatus() === CaptchaStatus::SOLVED)
{ {
Logger::getLogger()->warning(sprintf("The requested captcha has already been solved for the peer %s", $peer_uuid));
return false; return false;
} }
// Return false if the captcha is older than 5 minutes // Return false if the captcha is older than 5 minutes
if ($captcha->isExpired()) if ($captcha->isExpired())
{ {
Logger::getLogger()->warning(sprintf("The requested captcha is older than 5 minutes for the peer %s", $peer_uuid));
return false; return false;
} }
// Verify the answer // Verify the answer
if($captcha->getAnswer() !== $answer) if($captcha->getAnswer() !== $answer)
{ {
Logger::getLogger()->warning(sprintf("The answer to the requested captcha is incorrect for the peer %s", $peer_uuid));
return false; return false;
} }
Logger::getLogger()->debug(sprintf("The answer to the requested captcha is correct for the peer %s", $peer_uuid));
$statement = Database::getConnection()->prepare("UPDATE captcha_images SET status='SOLVED', answered=NOW() WHERE peer_uuid=?"); $statement = Database::getConnection()->prepare("UPDATE captcha_images SET status='SOLVED', answered=NOW() WHERE peer_uuid=?");
$statement->bindParam(1, $peer_uuid); $statement->bindParam(1, $peer_uuid);