forgejo/services/mailer
Gusted 9508aa7713
Improve usage of HMAC output for mailer tokens
- If the incoming mail feature is enabled, tokens are being sent with
outgoing mails. These tokens contains information about what type of
action is allow with such token (such as replying to a certain issue
ID), to verify these tokens the code uses the HMAC-SHA256 construction.
- The output of the HMAC is truncated to 80 bits, because this is
recommended by RFC2104, but RFC2104 actually doesn't recommend this. It
recommends, if truncation should need to take place, it should use
max(80, hash_len/2) of the leftmost bits. For HMAC-SHA256 this works out
to 128 bits instead of the currently used 80 bits.
- Update to token version 2 and disallow any usage of token version 1,
token version 2 are generated with 128 bits of HMAC output.
- Add test to verify the deprecation of token version 1 and a general
MAC check test.
2024-11-15 10:59:36 +01:00
..
incoming Update module github.com/jhillyerd/enmime to v2 2024-10-23 06:04:11 +00:00
token Improve usage of HMAC output for mailer tokens 2024-11-15 10:59:36 +01:00
mail.go fix: extend forgejo_auth_token table 2024-11-15 10:59:36 +01:00
mail_admin_new_user.go
mail_admin_new_user_test.go
mail_auth_test.go
mail_comment.go
mail_issue.go mail issue: Display issue type in email header 2024-10-19 21:25:54 +02:00
mail_release.go
mail_repo.go
mail_team_invite.go
mail_test.go mail issue: Display issue type in email header 2024-10-19 21:25:54 +02:00
mailer.go
mailer_test.go
main_test.go
notify.go