Prepare for Lemmy!

Handle hs2019 in algorithm
merge-requests/5/head
Terence Eden 2024-03-05 17:14:34 +00:00
rodzic df7836d9fa
commit 91319bda5d
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -1464,6 +1464,13 @@ HTML;
$signature = base64_decode( $signatureParts["signature"] );
$algorithm = $signatureParts["algorithm"];
// There might be many different signing algorithms
// TODO: Find a way to transform these automatically
// See https://github.com/superseriousbusiness/gotosocial/issues/1186#issuecomment-1976166659 and https://github.com/snarfed/bridgy-fed/issues/430 for hs2019
if ( "hs2019" == $algorithm ) {
$algorithm = "sha256";
}
// Finally! Calculate whether the signature is valid
// Returns 1 if verified, 0 if not, false or -1 if an error occurred
$verified = openssl_verify(