]> git.mxchange.org Git - friendica.git/commitdiff
Add support for "hs2019" algorithm value in Util\HTTPSignature
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 4 Jul 2020 17:12:59 +0000 (13:12 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 4 Jul 2020 17:12:59 +0000 (13:12 -0400)
src/Util/HTTPSignature.php

index e4d2e93ff0ac9bf09587768722602a45689682d2..8df4ecc4147f2de533db78fbb695fa987cf8d12c 100644 (file)
@@ -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';
                }