mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[PR #294] [CLOSED] Fix openssl compatibility #294
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ultimatepp/ultimatepp/pull/294
Author: @killerdevildog
Created: 7/27/2025
Status: ❌ Closed
Base:
master← Head:fix-openssl-compatibility📝 Commits (3)
b22baebFix OpenSSL compatibility: Support both OpenSSL 1.1.1+ and 3.0+3876fb7Add OpenSSL compatibility test suite1936624Enhance OpenSSL compatibility test with system information📊 Changes
6 files changed (+479 additions, -9 deletions)
View changed files
➕
Makefile.test(+38 -0)➕
test_aes_compatibility.cpp(+95 -0)➕
test_openssl_compatibility(+0 -0)➕
test_openssl_compatibility.cpp(+313 -0)📝
uppsrc/Core/SSL/AES.cpp(+28 -5)📝
uppsrc/Core/SSL/SSL.h(+5 -4)📄 Description
Fix OpenSSL Compatability for AES-256-GCM Encryption
Problem
The current Ultimate++ AES setup just won't compile on older Linux distros like Rocky Linux 8 or CentOS 8, since they're stuck on OpenSSL 1.1.1 instead of the newer 3.0+. The code was relying on those fancy OpenSSL 3.0-only APIs that aren't around in the old versions, leading to straight-up build failures.
Solution
I threw in some backwards-compatible support for OpenSSL by using conditional compilation tied to OPENSSL_VERSION_NUMBER. This way, everything runs smooth on both old and new versions without messing with the public API at all.
Changes Made
Backward Compatability
The public API stays exactly the same: All those AES256Encrypt/AES256Decrypt functions behave just like before.
Cross-version encryption works fine: Stuff encrypted on OpenSSL 3.0 decrypts on 1.1.1, and the other way around.
No hit to performance either: It picks the best APIs for whatever OpenSSL version you're on.
Testing
I tested this out on:
Files Modified
This fix sorts out the OpenSSL compatability headache from commit
500ccc1, keeping full backwards compatability and making sure AES encryption plays nice across all supported OpenSSL versions.The output of the tests on each system are as follows
=== System Information ===
OS: Linux
Kernel: 6.14.0-24-generic #24~24.04.3-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 7 16:39:17 UTC 2
Architecture: x86_64
Hostname: shadowbane-base
Distribution: Ubuntu (Debian-based)
OpenSSL compile-time version: OpenSSL 3.0.13 30 Jan 2024
OpenSSL version number: 0x300000d0
OpenSSL library location: /usr/lib/x86_64-linux-gnu/libssl.so
Testing OpenSSL AES-256-GCM compatibility...
OpenSSL version: OpenSSL 3.0.13 30 Jan 2024
OpenSSL version number: 0x300000d0
Test 1: Cipher access...
Using OpenSSL 3.0+ API (EVP_CIPHER_fetch)
✓ EVP_CIPHER_fetch succeeded
Test 2: PBKDF2 key derivation...
✓ PKCS5_PBKDF2_HMAC succeeded
Key: 5b10a2be73de8f2cfa9eff3eab7fa7e3...
Test 3: Complete AES-256-GCM encryption/decryption...
Original: Hello, OpenSSL compatibility test! This is a longer message to test chunked encryption.
Using EVP_EncryptInit_ex2...
✓ Encryption initialization succeeded
✓ Encryption completed, ciphertext length: 87
Tag: 6d3a3eefd60a19bd5ec90ecf632c3083
Starting decryption...
✓ Decryption completed, length: 87
Decrypted: Hello, OpenSSL compatibility test! This is a longer message to test chunked encryption.
✓ Round-trip verification successful!
All OpenSSL AES-256-GCM compatibility tests passed!
The Ultimate++ AES compatibility fix should work correctly on this system.
=== System Information ===
OS: Linux
Kernel: 4.18.0-553.el8_10.x86_64 #1 SMP Fri May 24 13:05:10 UTC 2024
Architecture: x86_64
Hostname: localhost.localdomain
Distribution: Rocky Linux (RPM-based)
OpenSSL compile-time version: OpenSSL 1.1.1k FIPS 25 Mar 2021
OpenSSL version number: 0x101010bf
OpenSSL library location: /usr/lib64/libssl.so
Testing OpenSSL AES-256-GCM compatibility...
OpenSSL version: OpenSSL 1.1.1k FIPS 25 Mar 2021
OpenSSL version number: 0x101010bf
Test 1: Cipher access...
Using OpenSSL 1.1.1 API (EVP_aes_256_gcm)
✓ EVP_aes_256_gcm succeeded
Test 2: PBKDF2 key derivation...
✓ PKCS5_PBKDF2_HMAC succeeded
Key: 5b10a2be73de8f2cfa9eff3eab7fa7e3...
Test 3: Complete AES-256-GCM encryption/decryption...
Original: Hello, OpenSSL compatibility test! This is a longer message to test chunked encryption.
Using EVP_EncryptInit_ex...
✓ Encryption initialization succeeded
✓ Encryption completed, ciphertext length: 87
Tag: 6d3a3eefd60a19bd5ec90ecf632c3083
Starting decryption...
✓ Decryption completed, length: 87
Decrypted: Hello, OpenSSL compatibility test! This is a longer message to test chunked encryption.
✓ Round-trip verification successful!
All OpenSSL AES-256-GCM compatibility tests passed!
The Ultimate++ AES compatibility fix should work correctly on this system.
the test files can be deleted, befoer merge just there for you to test.
Fixes #292
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.