-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
email/dkim: set ExpiredAtto MaxInt64 if value is greater than 12 digits
According to RFC 6376, To avoid denial-of-service attacks, implementations MAY consider any value longer than 12 digits to be infinite. Since ExpiredAt type is uint64, we cannot set it to infinite, so set it to maximum value int64 (not maximum of uint64).
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 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
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 |
---|---|---|
|
@@ -189,6 +189,11 @@ func TestSignatureParse(t *testing.T) { | |
"4bmp/YzhwvcubU4=;" + | ||
" c=simple/simple;" + | ||
" [email protected]; q=dns/txt\r\n", | ||
}, { | ||
desc: `With expired-at more than 12 digits`, | ||
in: "v=1; a=rsa-sha256; d=example.com; s=mykey; h=from; bh=bh; b=b; t=1117574938; x=9223372036854775808\r\n", | ||
expRelaxed: "v=1; a=rsa-sha256; d=example.com; s=mykey; h=from; bh=bh; b=b; t=1117574938; x=9223372036854775807; \r\n", | ||
expSimple: "v=1; a=rsa-sha256; d=example.com; s=mykey; h=from; bh=bh; b=b; t=1117574938; x=9223372036854775808\r\n", | ||
}} | ||
|
||
for _, c := range cases { | ||
|