-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dkim-verify): Show the length of the source body in DKIM results
- Loading branch information
Showing
10 changed files
with
3,308 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"upgrade": true, | ||
"reject": ["marked", "marked-man"] | ||
"reject": ["marked", "marked-man", "chai"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; | ||
d=football.example.com; [email protected]; | ||
q=dns/txt; s=brisbane; t=1528637909; h=from : to : | ||
subject : date : message-id : from : subject : date; | ||
bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; | ||
b=/gCrinpcQOoIfuHNQIbq4pgh9kyIK3AQUdt9OdqQehSwhEIug4D11Bus | ||
Fa3bT3FY5OsU7ZbnKELq+eXdp1Q1Dw== | ||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; | ||
d=football.example.com; [email protected]; | ||
q=dns/txt; s=test; t=1528637909; h=from : to : subject : | ||
date : message-id : from : subject : date; | ||
bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; | ||
b=F45dVWDfMbQDGHJFlXUNB2HKfbCeLRyhDXgFpEL8GwpsRe0IeIixNTe3 | ||
DhCVlUrSjV4BwcVcOF6+FF3Zo9Rpo1tFOeS9mPYQTnGdaSGsgeefOsk2Jz | ||
dA+L10TeYt9BgDfQNZtKdN1WO//KgIqXP7OdEFE4LjFYNcUxZQ4FADY+8= | ||
From: Joe SixPack <[email protected]> | ||
To: Suzie Q <[email protected]> | ||
Subject: Is dinner ready? | ||
Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) | ||
Message-ID: <[email protected]> | ||
|
||
Hi. | ||
|
||
We lost the game. Are you hungry yet? | ||
|
||
Joe. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const crypto = require('crypto'); | ||
const subtle = crypto.subtle; | ||
|
||
const data = Buffer.from( | ||
fs | ||
.readFileSync(__dirname + '/canon-header.bin', 'binary') | ||
.replace(/[ \t]/g, ' ') | ||
.replace(/\r?\n/g, '\r\n') | ||
.replace(/\s*$/, ''), | ||
'binary' | ||
); | ||
|
||
const secretKeyBuf = Buffer.from(fs.readFileSync(__dirname + '/ed.key', 'ascii'), 'base64'); | ||
const pubKeyBuf = Buffer.from('11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=', 'base64'); | ||
const signature = Buffer.from('/gCrinpcQOoIfuHNQIbq4pgh9kyIK3AQUdt9OdqQehSwhEIug4D11BusFa3bT3FY5OsU7ZbnKELq+eXdp1Q1Dw==', 'base64'); | ||
|
||
//let verifier = crypto.createVerify('ed25519'); | ||
//verifier.update(data); | ||
|
||
console.log(data.toString()); | ||
console.log(data.toString('base64')); | ||
|
||
let main = async () => { | ||
const pubkey = await subtle.importKey('raw', pubKeyBuf, 'Ed25519', false, ['verify']); | ||
|
||
console.log(pubkey); | ||
|
||
let res = await subtle.verify('Ed25519', pubkey, signature, data); | ||
console.log(res); | ||
}; | ||
|
||
main().catch(err => console.error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.