Skip to content

MIME Tools v3.5: add codec enhancements, UTF-16LE Base64, RFC 2047 decoding, and SAML improvements - #39

Open
ExSlam wants to merge 24 commits into
npp-plugins:masterfrom
ExSlam:master
Open

MIME Tools v3.5: add codec enhancements, UTF-16LE Base64, RFC 2047 decoding, and SAML improvements#39
ExSlam wants to merge 24 commits into
npp-plugins:masterfrom
ExSlam:master

Conversation

@ExSlam

@ExSlam ExSlam commented Aug 18, 2026

Copy link
Copy Markdown

Summary

This PR brings the accumulated MIME Tools improvements from the fork back into the upstream repository and updates the plugin to v3.5.

The changes add new Base64, Base64URL, MIME header, and SAML functionality while also improving codec performance, buffer handling, build consistency, and CI coverage.

Main changes

Base64

  • Add Base64 Encode with padding by line.

  • Add Base64URL Encode and Base64URL Decode.

  • Add UTF-16LE Base64 Encode and Decode.

  • Clarify the existing per-line decoder as Base64 Decode by line (padded/unpadded).

  • Optimize Base64 and Base64URL encoding/decoding.

  • Make padded-by-line Base64 encoding single-pass.

MIME / RFC 2047

Quoted-Printable

  • Optimize Quoted-Printable decoding to avoid unnecessary repeated work and improve performance on larger selections.

SAML

  • Fix the longstanding SAML Decode corruption issue where valid HTTP-Redirect SAML messages could decode into corrupted XML containing embedded NUL characters.

  • The root cause was truncation of DEFLATE length/distance base-table values in the bundled inflater.

  • Fix SAML Decode URL-error handling and a temporary Base64 buffer leak.

  • Addresses UTF8 Encoding issues for SAML Decode #5.

  • Add SAML Encode for the SAML 2.0 HTTP-Redirect binding:

    • raw DEFLATE
    • Base64
    • URL encoding
  • Add a small dependency-free raw DEFLATE compressor for the encoding path.

  • SAML Encode and Decode can now be used as inverse operations for HTTP-Redirect payloads.

Safety and implementation cleanup

  • Replace several manually sized buffers with safer dynamically sized containers.
  • Add overflow and bounds checks around codec operations and Scintilla selections.
  • Reduce unnecessary selection and intermediate-buffer copies.
  • Remove unused declarations.
  • Clean up and translate comments.

Build and CI

  • Make Visual Studio compile settings consistent across Win32, x64, and ARM64.

  • Enable additional compiler security checks and release optimizations.

  • Restore CI builds on pushes and pull requests.

  • Build both Debug and Release configurations for:

    • Win32
    • x64
    • ARM64

Version

Updates MIME Tools to v3.5.

Closes #5
Closes #14
Closes #37

ExSlam and others added 24 commits March 17, 2024 23:00
Store the position of newline characters for each line and add a padding before the newline if necessary.
Add the Add base64EncodeWithPaddingByLine function to b64.h and b64.cpp.
Add convertToBase64FromAscii_pad_byline() function to mimeTools.h and mimeTools.cpp.
- Optimize Base64 and Base64URL encoding and decoding
- Remove unnecessary Base64URL buffer copies and translation passes
- Make padded-by-line Base64 encoding single-pass
- Make Quoted-Printable decoding linear-time
- Reduce Scintilla selection copying
- Restore push/PR Debug and Release builds for x64, Win32, and ARM64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to decode "encoded-word"'s Feature request: Support for UTF-16 encoded Base64 UTF8 Encoding issues for SAML Decode

3 participants