aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-31 21:38:03 -0700
committerzotlabs <mike@macgirvin.com>2017-08-31 21:38:03 -0700
commitae8cdc3b42a01bfa6a8a7baf80bad2544c3821a7 (patch)
tree859652d073439cf21cdd01f70bb7dfb35c73ef85 /Zotlabs/Web
parentb413beeb365ea09ac79f57e68dbb6ac49b5ea056 (diff)
downloadvolse-hubzilla-ae8cdc3b42a01bfa6a8a7baf80bad2544c3821a7.tar.gz
volse-hubzilla-ae8cdc3b42a01bfa6a8a7baf80bad2544c3821a7.tar.bz2
volse-hubzilla-ae8cdc3b42a01bfa6a8a7baf80bad2544c3821a7.zip
some changes after testing server-to-server magic auth
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/HTTPSig.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index 537cd52a1..1f485a881 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -145,7 +145,7 @@ class HTTPSig {
- static function create_sig($request,$head,$prvkey,$keyid = 'Key',$send_headers = false,$alg = 'sha256') {
+ static function create_sig($request,$head,$prvkey,$keyid = 'Key',$send_headers = false,$auth = false,$alg = 'sha256') {
$return_headers = [];
@@ -155,8 +155,14 @@ class HTTPSig {
$x = self::sign($request,$head,$prvkey,$alg);
- $sighead = 'Signature: keyId="' . $keyid . '",algorithm="' . $algorithm
+ if($auth) {
+ $sighead = 'Authorization: Signature keyId="' . $keyid . '",algorithm="' . $algorithm
. '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"';
+ }
+ else {
+ $sighead = 'Signature: keyId="' . $keyid . '",algorithm="' . $algorithm
+ . '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"';
+ }
if($head) {
foreach($head as $k => $v) {