diff --git a/package.json b/package.json index f69a3ac32..853e9cef3 100644 --- a/package.json +++ b/package.json @@ -8,5 +8,10 @@ "packages/*", "scripts" ], - "packageManager": "yarn@3.2.3" + "packageManager": "yarn@3.2.3", + "dependencies": { + "@zk-email/circuits": "workspace:^", + "@zk-email/contracts": "workspace:^", + "@zk-email/helpers": "workspace:^" + } } diff --git a/packages/helpers/src/dkim/body/index.ts b/packages/helpers/src/dkim/body/index.ts index 5291ab029..09ed8579d 100644 --- a/packages/helpers/src/dkim/body/index.ts +++ b/packages/helpers/src/dkim/body/index.ts @@ -3,6 +3,10 @@ import { RelaxedHash } from './relaxed'; export const dkimBody = (canonicalization: any, ...options: [string, number]) => { canonicalization = (canonicalization ?? 'simple/simple').toString().split('/').pop()?.toLowerCase().trim(); + + let spacesPattern = canonicalization; + spacesPattern = spacesPattern.replace(/\t/g, ' '); + switch (canonicalization) { case 'simple': return new SimpleHash(...options); diff --git a/packages/helpers/src/dkim/message-parser.ts b/packages/helpers/src/dkim/message-parser.ts index e6ab57da3..be4001574 100644 --- a/packages/helpers/src/dkim/message-parser.ts +++ b/packages/helpers/src/dkim/message-parser.ts @@ -119,6 +119,7 @@ export class MessageParser extends Writable { if (typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); + chunk = chunk.replace(/\t/g, ' ') } for (let partialChunk of this.ensureLinebreaks(chunk)) { diff --git a/yarn.lock b/yarn.lock index 2e043d8a2..3417d04b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2748,7 +2748,7 @@ __metadata: languageName: node linkType: hard -"@zk-email/circuits@workspace:packages/circuits": +"@zk-email/circuits@workspace:^, @zk-email/circuits@workspace:packages/circuits": version: 0.0.0-use.local resolution: "@zk-email/circuits@workspace:packages/circuits" dependencies: @@ -2767,7 +2767,7 @@ __metadata: languageName: unknown linkType: soft -"@zk-email/contracts@workspace:packages/contracts": +"@zk-email/contracts@workspace:^, @zk-email/contracts@workspace:packages/contracts": version: 0.0.0-use.local resolution: "@zk-email/contracts@workspace:packages/contracts" dependencies: @@ -2776,7 +2776,7 @@ __metadata: languageName: unknown linkType: soft -"@zk-email/helpers@workspace:packages/helpers": +"@zk-email/helpers@workspace:^, @zk-email/helpers@workspace:packages/helpers": version: 0.0.0-use.local resolution: "@zk-email/helpers@workspace:packages/helpers" dependencies: @@ -6353,6 +6353,10 @@ __metadata: "root-workspace-0b6124@workspace:.": version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." + dependencies: + "@zk-email/circuits": "workspace:^" + "@zk-email/contracts": "workspace:^" + "@zk-email/helpers": "workspace:^" languageName: unknown linkType: soft