Comparing version 4.6.8 to 4.6.9
# Changelog | ||
## [4.6.9](https://github.com/postalsys/mailauth/compare/v4.6.8...v4.6.9) (2024-08-22) | ||
### Bug Fixes | ||
* **deps:** Removed uuid dependency in favor of crypto.randomUUID() ([0b5d8f5](https://github.com/postalsys/mailauth/commit/0b5d8f5328d0b82f75daea7fdbd74e1e76e8b642)) | ||
* **dkim-relaxed:** Faster DKIM hash calculation for relaxed body if the body contains extremely long lines ([fd8c89e](https://github.com/postalsys/mailauth/commit/fd8c89edd87a114464f99ebf79a1e903a8287876)) | ||
## [4.6.8](https://github.com/postalsys/mailauth/compare/v4.6.7...v4.6.8) (2024-06-04) | ||
@@ -4,0 +12,0 @@ |
@@ -125,4 +125,16 @@ /* eslint no-control-regex: 0 */ | ||
/** | ||
* Performs the following modifications for a single line: | ||
* - Replace all <LF> chars with <CR><LF> | ||
* - Replace all spaces and tabs with a single space. | ||
* - Remove trailing whitespace | ||
* @param {Buffer} line | ||
* @returns {Buffer} fixed line | ||
*/ | ||
fixLineBuffer(line) { | ||
let resultLine = []; | ||
// Allocate maximum expected buffer length | ||
// If the line is only filled with <LF> bytes then we need 2 times the size of the line | ||
let lineBuf = Buffer.alloc(line.length * 2); | ||
// Start processing the line from the end to beginning | ||
let writePos = lineBuf.length - 1; | ||
@@ -134,6 +146,6 @@ let nonWspFound = false; | ||
if (line[i] === CHAR_LF) { | ||
resultLine.unshift(line[i]); | ||
lineBuf[writePos--] = line[i]; | ||
if (i === 0 || line[i - 1] !== CHAR_CR) { | ||
// add missing carriage return | ||
resultLine.unshift(CHAR_CR); | ||
lineBuf[writePos--] = CHAR_CR; | ||
} | ||
@@ -144,3 +156,3 @@ continue; | ||
if (line[i] === CHAR_CR) { | ||
resultLine.unshift(line[i]); | ||
lineBuf[writePos--] = line[i]; | ||
continue; | ||
@@ -157,3 +169,3 @@ } | ||
if (prevWsp) { | ||
resultLine.unshift(CHAR_SPACE); | ||
lineBuf[writePos--] = CHAR_SPACE; | ||
prevWsp = false; | ||
@@ -163,10 +175,10 @@ } | ||
nonWspFound = true; | ||
resultLine.unshift(line[i]); | ||
lineBuf[writePos--] = line[i]; | ||
} | ||
if (prevWsp && nonWspFound) { | ||
resultLine.unshift(CHAR_SPACE); | ||
lineBuf[writePos--] = CHAR_SPACE; | ||
} | ||
return Buffer.from(resultLine); | ||
return lineBuf.subarray(writePos + 1); | ||
} | ||
@@ -173,0 +185,0 @@ |
@@ -11,3 +11,2 @@ 'use strict'; | ||
const crypto = require('node:crypto'); | ||
const { v4: uuidv4 } = require('uuid'); | ||
const libmime = require('libmime'); | ||
@@ -337,3 +336,3 @@ | ||
? crypto.createHash('sha256').update(Buffer.from(signatureHeader.parsed?.b?.value, 'base64')).digest('hex') | ||
: uuidv4(), | ||
: crypto.randomUUID(), | ||
signingDomain: signatureHeader.signingDomain, | ||
@@ -340,0 +339,0 @@ selector: signatureHeader.selector, |
{ | ||
"name": "mailauth", | ||
"version": "4.6.8", | ||
"version": "4.6.9", | ||
"description": "Email authentication library for Node.js", | ||
@@ -45,15 +45,14 @@ "main": "lib/mailauth.js", | ||
"mbox-reader": "1.2.0", | ||
"mocha": "10.4.0" | ||
"mocha": "10.7.3" | ||
}, | ||
"dependencies": { | ||
"@postalsys/vmc": "1.0.8", | ||
"fast-xml-parser": "4.4.0", | ||
"fast-xml-parser": "4.4.1", | ||
"ipaddr.js": "2.2.0", | ||
"joi": "17.13.1", | ||
"joi": "17.13.3", | ||
"libmime": "5.3.5", | ||
"nodemailer": "6.9.13", | ||
"nodemailer": "6.9.14", | ||
"punycode.js": "2.3.1", | ||
"tldts": "6.1.24", | ||
"tldts": "6.1.40", | ||
"undici": "5.28.4", | ||
"uuid": "9.0.1", | ||
"yargs": "17.7.2" | ||
@@ -60,0 +59,0 @@ }, |
Sorry, the diff of this file is not supported yet
285021
10
5533
+ Addedfast-xml-parser@4.4.1(transitive)
+ Addedjoi@17.13.3(transitive)
+ Addednodemailer@6.9.14(transitive)
+ Addedtldts@6.1.40(transitive)
+ Addedtldts-core@6.1.76(transitive)
- Removeduuid@9.0.1
- Removedfast-xml-parser@4.4.0(transitive)
- Removedjoi@17.13.1(transitive)
- Removednodemailer@6.9.13(transitive)
- Removedtldts@6.1.24(transitive)
- Removedtldts-core@6.1.77(transitive)
- Removeduuid@9.0.1(transitive)
Updatedfast-xml-parser@4.4.1
Updatedjoi@17.13.3
Updatednodemailer@6.9.14
Updatedtldts@6.1.40