diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-10 15:56:37 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-10 15:56:37 -0700 |
commit | 20ae69ab7babe8d526de7d4c584aa5cd2f836e1f (patch) | |
tree | 538d1c25bad65ebd8ca07144aa1c0d0d625c407f /Zotlabs/Web/HTTPSig.php | |
parent | 5877e28d729489a9ba75397bcbe86c8a811c87e8 (diff) | |
parent | 67024c023aed13070296c6e44644e489ff5f2417 (diff) | |
download | volse-hubzilla-20ae69ab7babe8d526de7d4c584aa5cd2f836e1f.tar.gz volse-hubzilla-20ae69ab7babe8d526de7d4c584aa5cd2f836e1f.tar.bz2 volse-hubzilla-20ae69ab7babe8d526de7d4c584aa5cd2f836e1f.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Web/HTTPSig.php')
-rw-r--r-- | Zotlabs/Web/HTTPSig.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index 2b139a2a1..fee8aaa41 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -91,6 +91,9 @@ class HTTPSig { if($sig_block['algorithm'] === 'rsa-sha256') { $algorithm = 'sha256'; } + if($sig_block['algorithm'] === 'rsa-sha512') { + $algorithm = 'sha512'; + } if(! $key) { $result['signer'] = $sig_block['keyId']; @@ -113,6 +116,8 @@ class HTTPSig { $digest = explode('=', $headers['digest']); if($digest[0] === 'SHA-256') $hashalg = 'sha256'; + if($digest[0] === 'SHA-512') + $hashalg = 'sha512'; // The explode operation will have stripped the '=' padding, so compare against unpadded base64 if(rtrim(base64_encode(hash($hashalg,$body,true)),'=') === $digest[1]) { @@ -164,6 +169,9 @@ class HTTPSig { if($alg === 'sha256') { $algorithm = 'rsa-sha256'; } + if($alg === 'sha512') { + $algorithm = 'rsa-sha512'; + } $x = self::sign($request,$head,$prvkey,$alg); |