aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel0 <77419041+FChannel0@users.noreply.github.com>2021-07-03 16:17:46 -0700
committerGitHub <noreply@github.com>2021-07-03 16:17:46 -0700
commitab6edbbe8044d5a3c7d9456bd15e3a74af35111a (patch)
treeb45a5860c9a8e89071324ab980316054e1030695 /main.go
parenta3f45e6a5cb85a43364756bd28a14936d1d95ae7 (diff)
parentd9cce000fdc8d804e73ff2fa4bfd2f1a151d90d9 (diff)
Merge pull request #35 from the-sageman/pem-failsafe
In case the PEM key is missing, do not fail too hard.
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go
index f98add9..7a30721 100644
--- a/main.go
+++ b/main.go
@@ -1899,7 +1899,8 @@ func MakeActivityRequestOutbox(db *sql.DB, activity Activity) {
path = re.ReplaceAllString(path, "")
sig := fmt.Sprintf("(request-target): %s %s\nhost: %s\ndate: %s", "post", path, instance, date)
- encSig := ActivitySign(db, *activity.Actor, sig)
+ encSig, err := ActivitySign(db, *activity.Actor, sig)
+ CheckError(err, "unable to sign activity response")
signature := fmt.Sprintf("keyId=\"%s\",headers=\"(request-target) host date\",signature=\"%s\"", activity.Actor.PublicKey.Id, encSig)
req.Header.Set("Content-Type", activitystreams)
@@ -1937,7 +1938,8 @@ func MakeActivityRequest(db *sql.DB, activity Activity) {
path = re.ReplaceAllString(path, "")
sig := fmt.Sprintf("(request-target): %s %s\nhost: %s\ndate: %s", "post", path, instance, date)
- encSig := ActivitySign(db, *activity.Actor, sig)
+ encSig, err := ActivitySign(db, *activity.Actor, sig)
+ CheckError(err, "unable to sign activity response")
signature := fmt.Sprintf("keyId=\"%s\",headers=\"(request-target) host date\",signature=\"%s\"", activity.Actor.PublicKey.Id, encSig)
req.Header.Set("Content-Type", activitystreams)