diff options
author | sageman_ <sageman@anomine.net> | 2021-07-03 20:43:41 +0200 |
---|---|---|
committer | sageman_ <sageman@anomine.net> | 2021-07-03 20:43:41 +0200 |
commit | d9cce000fdc8d804e73ff2fa4bfd2f1a151d90d9 (patch) | |
tree | f03c80f35d43c0a5eb305a58de4fb9dc06a99533 /main.go | |
parent | 97ce6d91545ec10f35d692ccbf60536d83f5debf (diff) |
In case the PEM key is missing, do not fail too hard.
Tell the administrator in a friendly matter that they are an idiot and they should seek assistance in generating a new keypair and telling everyone about it.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1852,7 +1852,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) @@ -1890,7 +1891,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) |