fix: do not include CRLF before MIME boundary in the part body

This change adds a test and updates mailparse from 0.15.0 to 0.16.0.
mailparse 0.16.0 includes a fix for the bug
that resulted in CRLF being included at the end of the body.
Workaround for the bug in the `pk_validate` function is also removed.
This commit is contained in:
link2xt
2025-02-07 04:11:42 +00:00
committed by l
parent 068726453e
commit a0ff0d71bc
5 changed files with 78 additions and 13 deletions

View File

@@ -379,13 +379,6 @@ pub fn pk_validate(
let standalone_signature = StandaloneSignature::from_armor_single(Cursor::new(signature))?.0;
// Remove trailing CRLF before the delimiter.
// According to RFC 3156 it is considered to be part of the MIME delimiter for the purpose of
// OpenPGP signature calculation.
let content = content
.get(..content.len().saturating_sub(2))
.context("index is out of range")?;
for pkey in public_keys_for_validation {
if standalone_signature.verify(pkey, content).is_ok() {
let fp = pkey.dc_fingerprint();