diff options
author | FChannel0 <77419041+FChannel0@users.noreply.github.com> | 2021-07-03 16:17:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 16:17:46 -0700 |
commit | ab6edbbe8044d5a3c7d9456bd15e3a74af35111a (patch) | |
tree | b45a5860c9a8e89071324ab980316054e1030695 /main.go | |
parent | a3f45e6a5cb85a43364756bd28a14936d1d95ae7 (diff) | |
parent | d9cce000fdc8d804e73ff2fa4bfd2f1a151d90d9 (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.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |