From: Hypolite Petovan Date: Sat, 4 Jul 2020 17:12:59 +0000 (-0400) Subject: Add support for "hs2019" algorithm value in Util\HTTPSignature X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=78b424c7fdf95585bb738d1a0ee931cefb5ccbf6;p=friendica.git Add support for "hs2019" algorithm value in Util\HTTPSignature --- diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index e4d2e93ff0..8df4ecc414 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -534,6 +534,14 @@ class HTTPSignature $algorithm = null; + // Wildcard value where signing algorithm should be derived from keyId + // @see https://tools.ietf.org/html/draft-ietf-httpbis-message-signatures-00#section-4.1 + // Defaulting to SHA256 as it seems to be the prevalent implementation + // @see https://arewehs2019yet.vpzom.click + if ($sig_block['algorithm'] === 'hs2019') { + $algorithm = 'sha256'; + } + if ($sig_block['algorithm'] === 'rsa-sha256') { $algorithm = 'sha256'; }