mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:22:37 +02:00
[ticket/15851] Use raw values for verifying signature
PHPBB-15851
This commit is contained in:
@@ -101,7 +101,7 @@ class get_updates
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$raw_signature = file_get_contents($signature_path);
|
$signature = file_get_contents($signature_path);
|
||||||
|
|
||||||
$hash = hash_file('sha384', $file_path, true);
|
$hash = hash_file('sha384', $file_path, true);
|
||||||
if ($hash === false)
|
if ($hash === false)
|
||||||
@@ -109,15 +109,21 @@ class get_updates
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$signature = base64_decode($raw_signature);
|
$raw_signature = base64_decode($signature);
|
||||||
if ($signature === false)
|
if ($raw_signature === false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$raw_public_key = base64_decode($this->public_key);
|
||||||
|
if ($raw_public_key === false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return sodium_crypto_sign_verify_detached($signature, $hash, $this->public_key);
|
return sodium_crypto_sign_verify_detached($raw_signature, $hash, $raw_public_key);
|
||||||
}
|
}
|
||||||
catch (SodiumException)
|
catch (SodiumException)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user