mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15851] Use raw values for verifying signature
PHPBB-15851
This commit is contained in:
parent
dacabf0537
commit
3506883c75
1 changed files with 10 additions and 4 deletions
|
@ -101,7 +101,7 @@ class get_updates
|
|||
return false;
|
||||
}
|
||||
|
||||
$raw_signature = file_get_contents($signature_path);
|
||||
$signature = file_get_contents($signature_path);
|
||||
|
||||
$hash = hash_file('sha384', $file_path, true);
|
||||
if ($hash === false)
|
||||
|
@ -109,15 +109,21 @@ class get_updates
|
|||
return false;
|
||||
}
|
||||
|
||||
$signature = base64_decode($raw_signature);
|
||||
if ($signature === false)
|
||||
$raw_signature = base64_decode($signature);
|
||||
if ($raw_signature === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$raw_public_key = base64_decode($this->public_key);
|
||||
if ($raw_public_key === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue