6 Commits

Author SHA1 Message Date
Alberto Bertogli
1a014be277 internal/dkim: Apply gofmt -s
A run of `gofmt -s` found two instances where a struct definition could
be simplified. This patch applies those suggestions.
2025-10-24 12:43:51 +01:00
Alberto Bertogli
f7e0e9fe65 Minor cleanups for staticcheck issues
staticcheck found a couple of minor code cleanup improvements, like
unused variables or an out-of-order defer, mostly in tests.

This patch fixes those problems by making the necessary adjustments.

They're all fairly small, and should not change the logic in any
significant way.
2025-10-24 12:15:36 +01:00
Andreas Deininger
227379ecde cleanup: Remove unused/unnecessary code 2024-12-01 22:03:47 +00:00
Alberto Bertogli
a1b6821ce1 dkim: Make timestamp parsing more robust against overflow
The timestamp string in the t= and x= headers is an "unsigned decimal
integer", but time.Unix takes an int64. Today we parse it as uint64 and
then cast it, but this can cause issues with overflow and type
conversion.

This patch fixes that by parsing the timestamps as signed integers, and
then checking they're positive.
2024-05-10 16:47:22 +01:00
Alberto Bertogli
1a1befc75a dkim: Update .gitignore pattern for private test cases
The current .gitignore pattern doesn't work when the private test cases
are a symlink, which can be convenient.

This patch fixes it by changing the pattern to match symlinks as well as
directories.
2024-04-21 11:08:08 +01:00
Alberto Bertogli
76a72367ae dkim: Implement internal dkim signing and verification
This patch implements internal DKIM signing and verification.
2024-03-12 20:43:21 +00:00