diff options
Diffstat (limited to 'registry/registry.go')
-rw-r--r-- | registry/registry.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/registry/registry.go b/registry/registry.go index 1901f0c..cc99d63 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -3,9 +3,7 @@ package registry import ( "bytes" "context" - "crypto/sha256" "crypto/x509" - "encoding/base64" "encoding/gob" "encoding/json" "encoding/pem" @@ -263,11 +261,11 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol request.Header.Set("Content-Type", "application/activity+json") request.Header.Set("Host", url.Host) - h := sha256.New() - h.Write(jsonData) - digestHeader := base64.StdEncoding.Strict().EncodeToString(h.Sum(nil)) - request.Header.Add("Digest", "SHA-256="+digestHeader) - request.Header.Add("Content-Type", "application/activity+json") + // h := sha256.New() + // h.Write(jsonData) + // digestHeader := base64.StdEncoding.Strict().EncodeToString(h.Sum(nil)) + // request.Header.Add("Digest", "SHA-256="+digestHeader) + // request.Header.Add("Content-Type", "application/activity+json") signedString := fmt.Sprintf("(request-target): post %s\ndate: %s\ndigest: %s\nhost: %s", url.Path, date, digestHeader, url.Host) @@ -311,8 +309,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol prefs := []httpsig.Algorithm{} digestAlgorithm := httpsig.DigestSha256 // The "Date" and "Digest" headers must already be set on r, as well as r.URL. - headersToSign := []string{httpsig.RequestTarget, "host", "date", "digest", "content-type"} - signer, _, err := httpsig.NewSigner(prefs, digestAlgorithm, headersToSign, httpsig.Signature, 100) + headersToSign := []string{httpsig.RequestTarget, "host", "date", "digest"} + signer, _, err := httpsig.NewSigner(prefs, digestAlgorithm, headersToSign, httpsig.Signature, 0) if err != nil { return err } |