mirror of https://github.com/rspamd/rspamd.git
Browse Source
This PR addresses critical issues in DKIM relaxed body canonicalization and modernizes the codebase by replacing GLib types with standard C types. - **RFC Compliance**: Fixed incorrect canonicalization of lines containing only whitespace. Previously, such lines were not properly handled according to RFC 6376, which could lead to DKIM signature verification failures. - **Memory Safety**: Fixed incorrect pointer dereference in `rspamd_dkim_skip_empty_lines` that could cause undefined behavior. - **Zero-copy Optimization**: Reimplemented `rspamd_dkim_relaxed_body_step` to avoid unnecessary memory copies. The new implementation: - Processes input data directly without intermediate buffers - Reduces the number of `EVP_DigestUpdate` calls by processing larger chunks - Improves CPU cache efficiency - Results in significantly better performance for large email bodies - Replaced all GLib types with standard C equivalents: - `gsize` → `size_t` - `gssize` → `ssize_t` - `gboolean` → `bool` - `TRUE/FALSE` → `true/false` - And other GLib-specific types - Added necessary standard headers (`stdbool.h`, `stdint.h`, `limits.h`) - Added comprehensive debug logging for: - Chunk processing with size information - Empty line detection and skipping - Space collapsing operations Issue: #5590pull/5593/head
2 changed files with 405 additions and 351 deletions
720
src/libserver/dkim.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Loading…
Reference in new issue