aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <>2021-06-06 18:34:24 -0700
committerFChannel <>2021-06-06 18:34:24 -0700
commitf3a73b3a9f8b7895eeb54f007bde72126eae56d2 (patch)
tree53911524a5423a47faa1cce714a0a34b40adfae8 /main.go
parent96f71a374a9b7f7982a1ca750a33b87034aad46c (diff)
basic header signature conversion
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.go b/main.go
index 9e34264..dd6e25a 100644
--- a/main.go
+++ b/main.go
@@ -1769,10 +1769,11 @@ func MakeActivityRequestOutbox(db *sql.DB, activity Activity) {
sig := fmt.Sprintf("(request-target): %s %s\\nhost: %s\\ndate: %s", "post", path, instance, date)
encSig := ActivitySign(db, *activity.Actor, sig)
+ signature := fmt.Sprintf("keyId=\"%s\",headers=\"(request-target) host date\",signature=\"%s\"", activity.Actor.PublicKey.Id, encSig)
req.Header.Set("Content-Type", activitystreams)
req.Header.Set("Date", date)
- req.Header.Set("Signature", encSig)
+ req.Header.Set("Signature", signature)
req.Host = instance
_, err = http.DefaultClient.Do(req)
@@ -1803,10 +1804,11 @@ func MakeActivityRequest(db *sql.DB, activity Activity) {
sig := fmt.Sprintf("(request-target): %s %s\\nhost: %s\\ndate: %s", "post", path, instance, date)
encSig := ActivitySign(db, *activity.Actor, sig)
-
+ signature := fmt.Sprintf("keyId=\"%s\",headers=\"(request-target) host date\",signature=\"%s\"", activity.Actor.PublicKey.Id, encSig)
+
req.Header.Set("Content-Type", activitystreams)
req.Header.Set("Date", date)
- req.Header.Set("Signature", encSig)
+ req.Header.Set("Signature", signature)
req.Host = instance
CheckError(err, "error with sending activity req to")