From 80bbd953ae9e2a9bf901b5804254d31617104d46 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Fri, 6 Jan 2023 11:35:49 -0500 Subject: use struct encoding --- registry/registry.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'registry/registry.go') diff --git a/registry/registry.go b/registry/registry.go index a6cd41d..d22ac9a 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -268,7 +268,7 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol h := sha256.New() h.Write(jsonData) - digestHeader := base64.StdEncoding.EncodeToString(h.Sum(nil)) + digestHeader := base64.StdEncoding.Strict().EncodeToString(h.Sum(nil)) request.Header.Add("Digest", "SHA-256="+digestHeader) request.Header.Add("Content-Type", "application/activity+json") @@ -311,8 +311,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol } r.mu.Unlock() - b64sig := base64.StdEncoding.EncodeToString(signature) - var header = `keyId="` + actorKeyUrl.String() + `",algorithm="hs2019",headers="(request-target) date digest host",signature="` + b64sig + `"` + b64sig := base64.StdEncoding.Strict().EncodeToString(signature) + var header = `keyId="` + actorKeyUrl.String() + `",algorithm="hs2019 ",headers="(request-target) date digest host",signature="` + b64sig + `"` request.Header.Add("Signature", header) //http sig signing code - broken? -- cgit v1.2.3