From 88295aad8f18b8e79c09bdc6477748c1b194c981 Mon Sep 17 00:00:00 2001 From: amy bones Date: Wed, 18 Jan 2023 20:16:41 -0800 Subject: [PATCH] fix: relay signature handling A change sometime ago moved to setting some signature fields in the incoming object to undefined as opposed to deleting them. The trouble is that downstream code checks against existence, not undefinedness and rejects the message. Resolves: #9665 --- .../backend/src/remote/activitypub/misc/ld-signature.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/remote/activitypub/misc/ld-signature.ts b/packages/backend/src/remote/activitypub/misc/ld-signature.ts index 0a4ec3a53..1657597ab 100644 --- a/packages/backend/src/remote/activitypub/misc/ld-signature.ts +++ b/packages/backend/src/remote/activitypub/misc/ld-signature.ts @@ -70,13 +70,13 @@ export class LdSignature { ...options, "@context": "https://w3id.org/identity/v1", }; - transformedOptions["type"] = undefined; - transformedOptions["id"] = undefined; - transformedOptions["signatureValue"] = undefined; + delete transformedOptions["type"]; + delete transformedOptions["id"]; + delete transformedOptions["signatureValue"]; const canonizedOptions = await this.normalize(transformedOptions); const optionsHash = this.sha256(canonizedOptions); const transformedData = { ...data }; - transformedData["signature"] = undefined; + delete transformedData["signature"]; const cannonidedData = await this.normalize(transformedData); if (this.debug) console.debug(`cannonidedData: ${cannonidedData}`); const documentHash = this.sha256(cannonidedData);