Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add OpenSSL 3.x, V8 12.1+, GCC 15 compatibility and system library support #1641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
toabctl wants to merge 20 commits into ONLYOFFICE:master
base: master
Choose a base branch
Loading
from toabctl:openssl3-compat
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8f05f21
Add OpenSSL 3.x compatibility to common_openssl
toabctl Mar 11, 2026
336e87b
Add OpenSSL 3.x compatibility to Certificate_openssl
toabctl Mar 11, 2026
8cd2325
Add OpenSSL 3.x compatibility to osign certificate
toabctl Mar 11, 2026
fc31de6
Add OpenSSL 3.x compatibility to doctrenderer hash
toabctl Mar 11, 2026
603127d
Handle unsupported hash algorithms in HashEmbed
toabctl Mar 11, 2026
a4b236d
Allow using system OpenSSL via CONFIG+=use_system_openssl
toabctl Mar 11, 2026
ea3c718
Remove redundant vendored zlib.h include from ioapibuf.h
toabctl Mar 12, 2026
8c11d67
Allow using system zlib via CONFIG+=use_system_zlib
toabctl Mar 12, 2026
5a8f8ab
Allow using system Crypto++ via CONFIG+=use_system_cryptopp
toabctl Mar 12, 2026
15549d4
Allow using system Boost via CONFIG+=use_system_boost
toabctl Mar 12, 2026
7f24264
Allow using system ICU via CONFIG+=use_system_icu
toabctl Mar 12, 2026
06d0719
Allow using system HarfBuzz via CONFIG+=use_system_harfbuzz
toabctl Mar 12, 2026
cd81b64
Allow using system libheif via CONFIG+=use_system_heif
toabctl Mar 12, 2026
1e72d7e
Allow using system V8 via CONFIG+=use_system_v8
toabctl Mar 12, 2026
c92f694
Use portable include path for libheif header
toabctl Mar 12, 2026
78a4250
Fix incompatible pointer types in vendored jasper JPEG-2000
toabctl Mar 12, 2026
704e7b6
Fix GCC 15 and V8 12.1+ compatibility issues
toabctl Mar 12, 2026
f22a1fb
Allow using system V8 via CONFIG+=use_system_v8
toabctl Mar 13, 2026
30f03ae
Export zlib_addon symbols for shared library visibility
toabctl Mar 13, 2026
c75ccef
Allow using system googletest via CONFIG+=use_system_googletest
toabctl Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 44 additions & 36 deletions Common/3dParty/boost/boost.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,53 +1,61 @@
INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
!use_system_boost {
INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib

core_android {
INCLUDEPATH += $$PWD/build/android/include
CORE_BOOST_LIBS = $$PWD/build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX

DEFINES += "_HAS_AUTO_PTR_ETC=0"
}

bundle_xcframeworks {
xcframework_platform_ios_simulator {
CORE_BOOST_LIBS = $$PWD/build/ios_xcframework/ios_simulator/lib/$$CORE_BUILDS_PLATFORM_PREFIX
} else {
CORE_BOOST_LIBS = $$PWD/build/ios_xcframework/ios/lib/$$CORE_BUILDS_PLATFORM_PREFIX
}
}
}

core_ios:CONFIG += disable_enum_constexpr_conversion
core_android:CONFIG += disable_enum_constexpr_conversion
core_mac:CONFIG += disable_enum_constexpr_conversion
core_linux_clang:CONFIG += disable_enum_constexpr_conversion

core_android {
INCLUDEPATH += $$PWD/build/android/include
CORE_BOOST_LIBS = $$PWD/build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX

DEFINES += "_HAS_AUTO_PTR_ETC=0"
}

disable_enum_constexpr_conversion {
QMAKE_CFLAGS += -Wno-enum-constexpr-conversion
QMAKE_CXXFLAGS += -Wno-enum-constexpr-conversion
}

bundle_xcframeworks {
xcframework_platform_ios_simulator {
CORE_BOOST_LIBS = $$PWD/build/ios_xcframework/ios_simulator/lib/$$CORE_BUILDS_PLATFORM_PREFIX
} else {
CORE_BOOST_LIBS = $$PWD/build/ios_xcframework/ios/lib/$$CORE_BUILDS_PLATFORM_PREFIX
}
}

core_win_arm64 {
DEFINES += MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS=0
}

core_windows {
VS_VERSION=140
VS_DEBUG=
VS_ARCH=x64
core_debug:VS_DEBUG=gd-
core_win_32:VS_ARCH=x32
core_win_arm64:VS_ARCH=a64
vs2019:VS_VERSION=142

DEFINES += BOOST_USE_WINDOWS_H BOOST_WINAPI_NO_REDECLARATIONS

BOOST_POSTFIX = -vc$${VS_VERSION}-mt-$${VS_DEBUG}$${VS_ARCH}-1_72

core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -llibboost_system$$BOOST_POSTFIX -llibboost_filesystem$$BOOST_POSTFIX
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -llibboost_regex$$BOOST_POSTFIX
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -llibboost_date_time$$BOOST_POSTFIX
use_system_boost {
core_boost_libs:LIBS += -lboost_system -lboost_filesystem
core_boost_regex:LIBS += -lboost_regex
core_boost_date_time:LIBS += -lboost_date_time
} else {
core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -lboost_system -lboost_filesystem
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -lboost_regex
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -lboost_date_time
core_windows {
VS_VERSION=140
VS_DEBUG=
VS_ARCH=x64
core_debug:VS_DEBUG=gd-
core_win_32:VS_ARCH=x32
core_win_arm64:VS_ARCH=a64
vs2019:VS_VERSION=142

DEFINES += BOOST_USE_WINDOWS_H BOOST_WINAPI_NO_REDECLARATIONS

BOOST_POSTFIX = -vc$${VS_VERSION}-mt-$${VS_DEBUG}$${VS_ARCH}-1_72

core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -llibboost_system$$BOOST_POSTFIX -llibboost_filesystem$$BOOST_POSTFIX
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -llibboost_regex$$BOOST_POSTFIX
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -llibboost_date_time$$BOOST_POSTFIX
} else {
core_boost_libs:LIBS += -L$$CORE_BOOST_LIBS -lboost_system -lboost_filesystem
core_boost_regex:LIBS += -L$$CORE_BOOST_LIBS -lboost_regex
core_boost_date_time:LIBS += -L$$CORE_BOOST_LIBS -lboost_date_time
}
}
7 changes: 7 additions & 0 deletions Common/3dParty/cryptopp/cryptopp.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use_system_cryptopp {
LIBS += -lcryptopp
} else {
DEFINES += CRYPTOPP_DISABLE_ASM
INCLUDEPATH += $$PWD/..
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib
}
31 changes: 23 additions & 8 deletions Common/3dParty/googletest/googletest.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
CORE_GTEST_PATH=$$PWD/googletest/googletest
use_system_googletest {
LIBS += -lgtest
!core_no_gtest_main:LIBS += -lgtest_main
core_gmock:LIBS += -lgmock
} else {
CORE_GTEST_PATH=$$PWD/googletest/googletest

CONFIG += c++14
CONFIG += c++14

CORE_GTEST_PATH_INCLUDE = $$CORE_GTEST_PATH/include
CORE_GTEST_PATH_INCLUDE = $$CORE_GTEST_PATH/include

INCLUDEPATH += $$CORE_GTEST_PATH
INCLUDEPATH += $$CORE_GTEST_PATH_INCLUDE
INCLUDEPATH += $$CORE_GTEST_PATH
INCLUDEPATH += $$CORE_GTEST_PATH_INCLUDE

SOURCES += \
$$CORE_GTEST_PATH/src/gtest-all.cc \
$$CORE_GTEST_PATH/src/gtest_main.cc
SOURCES += \
$$CORE_GTEST_PATH/src/gtest-all.cc
!core_no_gtest_main:SOURCES += $$CORE_GTEST_PATH/src/gtest_main.cc

core_gmock {
CORE_GMOCK_PATH=$$PWD/googletest/googlemock

INCLUDEPATH += $$CORE_GMOCK_PATH
INCLUDEPATH += $$CORE_GMOCK_PATH/include

SOURCES += $$CORE_GMOCK_PATH/src/gmock-all.cc
}
}
2 changes: 1 addition & 1 deletion Common/3dParty/harfbuzz/.gitignore
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
harfbuzz/
harfbuzz.pri
harfbuzz_sources.pri
module.version
6 changes: 6 additions & 0 deletions Common/3dParty/harfbuzz/harfbuzz.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use_system_harfbuzz {
INCLUDEPATH += /usr/include/harfbuzz
LIBS += -lharfbuzz
} else {
include($$PWD/harfbuzz_sources.pri)
}
6 changes: 3 additions & 3 deletions Common/3dParty/harfbuzz/make.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def clear_module():
else:
qmake_content_lines.append("")

if (base.is_file("./harfbuzz.pri")):
base.delete_file("./harfbuzz.pri")
if (base.is_file("./harfbuzz_sources.pri")):
base.delete_file("./harfbuzz_sources.pri")

with open("./harfbuzz.pri", "w") as file:
with open("./harfbuzz_sources.pri", "w") as file:
file.write("\n".join(qmake_content_lines))

#base.delete_file("./harfbuzz/src/hb-ft.cc")
Expand Down
6 changes: 6 additions & 0 deletions Common/3dParty/heif/heif.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use_system_heif {
LIBS += -lheif -lde265 -lx265
} else {

DEFINES += LIBHEIF_STATIC_BUILD

HEIF_BUILDS_PLATFORM_PREFIX = $$CORE_BUILDS_PLATFORM_PREFIX
Expand Down Expand Up @@ -40,3 +44,5 @@ core_mac | core_ios {
-L$$PWD/libde265/build/$$HEIF_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/libde265 -lde265 \
-L$$HEIF_BUILD_PATH/libheif -lheif
}

} # !use_system_heif
6 changes: 6 additions & 0 deletions Common/3dParty/icu/icu.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use_system_icu {
LIBS += -licuuc -licudata
} else {

ICU_MAJOR_VER = 74

core_windows {
Expand Down Expand Up @@ -62,3 +66,5 @@ core_android {
LIBS += $$PWD/android/build/$$CORE_BUILDS_PLATFORM_PREFIX_DST/libicuuc.a
LIBS += $$PWD/android/build/$$CORE_BUILDS_PLATFORM_PREFIX_DST/libicudata.a
}

} # !use_system_icu
28 changes: 15 additions & 13 deletions Common/3dParty/openssl/common/common_openssl.cpp
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/

#include "./common_openssl.h"
#include <openssl/opensslv.h>
#include <openssl/sha.h>
#include <openssl/rsa.h>
#include <openssl/bio.h>
Expand Down Expand Up @@ -138,18 +139,24 @@ namespace NSOpenSSL
publicKey = NULL;
privateKey = NULL;

RSA* rsa = RSA_new();
BIGNUM *exponent = BN_new();
EVP_PKEY* pkey = NULL;
EVP_PKEY_CTX* pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
if (!pctx)
return false;

BN_set_word(exponent, RSA_F4);
int result = RSA_generate_multi_prime_key(rsa, 2048, 2, exponent, NULL);
if (0 == result)
if (EVP_PKEY_keygen_init(pctx) <= 0 ||
EVP_PKEY_CTX_set_rsa_keygen_bits(pctx, 2048) <= 0 ||
EVP_PKEY_keygen(pctx, &pkey) <= 0)
{
EVP_PKEY_CTX_free(pctx);
return false;
}
EVP_PKEY_CTX_free(pctx);

if (true)
{
BIO* bio = BIO_new(BIO_s_mem());
if (PEM_write_bio_RSAPrivateKey(bio, rsa, NULL, NULL, 0, NULL, NULL))
if (PEM_write_bio_PrivateKey(bio, pkey, NULL, NULL, 0, NULL, NULL))
{
int key_length = BIO_pending(bio);
privateKey = openssl_alloc(key_length + 1);
Expand All @@ -168,7 +175,7 @@ namespace NSOpenSSL
if (true)
{
BIO* bio = BIO_new(BIO_s_mem());
if (PEM_write_bio_RSA_PUBKEY(bio, rsa))
if (PEM_write_bio_PUBKEY(bio, pkey))
{
int key_length = BIO_pending(bio);
publicKey = openssl_alloc(key_length + 1);
Expand All @@ -185,8 +192,7 @@ namespace NSOpenSSL
BIO_free_all(bio);
}

BN_free(exponent);
RSA_free(rsa);
EVP_PKEY_free(pkey);

return (NULL != publicKey && NULL != privateKey) ? true : false;
}
Expand Down Expand Up @@ -551,7 +557,6 @@ namespace NSOpenSSL
bool AES_Encrypt(int type, const unsigned char* key, const unsigned char* iv, const unsigned char* data, const unsigned int& size, unsigned char*& data_crypt, unsigned int& data_crypt_len)
{
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
EVP_EncryptInit_ex(ctx, _get_cipher_aes(type), NULL, key, iv);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL);
int out_len1 = (int)size + AES_BLOCK_SIZE;
Expand All @@ -561,13 +566,11 @@ namespace NSOpenSSL
EVP_EncryptFinal_ex(ctx, data_crypt + out_len1, &out_len2);
data_crypt_len = out_len1 + out_len2;
EVP_CIPHER_CTX_free(ctx);
EVP_cleanup();
return true;
}
bool AES_Decrypt(int type, const unsigned char* key, const unsigned char* iv, const unsigned char* data, const unsigned int& size, unsigned char*& data_decrypt, unsigned int& data_decrypt_len)
{
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
EVP_DecryptInit_ex(ctx, _get_cipher_aes(type), NULL, key, iv);
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, NULL);
int out_len1 = (int)size;
Expand All @@ -577,7 +580,6 @@ namespace NSOpenSSL
EVP_DecryptFinal_ex(ctx, data_decrypt + out_len1, &out_len2);
data_decrypt_len = out_len1 + out_len2;
EVP_CIPHER_CTX_free(ctx);
EVP_cleanup();
return true;
}

Expand Down
17 changes: 10 additions & 7 deletions Common/3dParty/openssl/openssl.pri
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ core_ios {

}

core_windows {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.lib
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.lib
use_system_openssl {
LIBS += -lssl -lcrypto
} else {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.a
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.a
core_windows {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.lib
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.lib
} else {
LIBS += $$OPENSSL_LIBS_DIRECTORY/libssl.a
LIBS += $$OPENSSL_LIBS_DIRECTORY/libcrypto.a
}
INCLUDEPATH += $$OPENSSL_LIBS_DIRECTORY/../include
}

INCLUDEPATH += $$OPENSSL_LIBS_DIRECTORY/../include
22 changes: 11 additions & 11 deletions Common/3dParty/pole/pole.cpp
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1283,19 +1283,19 @@ void DirTree::debug()
DirEntry* e = entry( i );
if( !e ) continue;
std::cout << i << ": ";
if( !e->valid ) std::cout << L"INVALID ";
if( !e->valid ) std::cout << "INVALID ";
std::wcout << e->name << L" ";
if( e->dir ) std::cout << L"(Dir) ";
else std::cout << L"(File) ";
std::cout << e->size << L" ";
std::cout << L"s:" << e->start << L" ";
std::cout << L"(";
if( e->child == End ) std::cout << L"-"; else std::cout << e->child;
if( e->dir ) std::cout << "(Dir) ";
else std::cout << "(File) ";
std::cout << e->size << " ";
std::cout << "s:" << e->start << " ";
std::cout << "(";
if( e->child == End ) std::cout << "-"; else std::cout << e->child;
std::cout << " ";
if( e->prev == End ) std::cout << L"-"; else std::cout << e->prev;
std::cout << L":";
if( e->next == End ) std::cout << L"-"; else std::cout << e->next;
std::cout << L")";
if( e->prev == End ) std::cout << "-"; else std::cout << e->prev;
std::cout << ":";
if( e->next == End ) std::cout << "-"; else std::cout << e->next;
std::cout << ")";
std::cout << std::endl;
}
}
Expand Down
16 changes: 16 additions & 0 deletions Common/3dParty/v8/v8.pri
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
use_system_v8 {
CONFIG += c++2a
CONFIG += use_v8_monolith
DEFINES += V8_VERSION_89_PLUS
DEFINES += V8_VERSION_121_PLUS
DEFINES += DISABLE_MEMORY_LIMITATION
# Node.js V8 does not enable pointer compression by default
# and snapshots require sdkjs compiled from source
# so neither V8_COMPRESS_POINTERS nor V8_SUPPORT_SNAPSHOTS are defined

INCLUDEPATH += /usr/include/v8
LIBS += -lv8 -lpthread
} else {

CORE_V8_PATH_OVERRIDE=$$PWD
!v8_version_60:CONFIG += v8_version_89

Expand Down Expand Up @@ -86,3 +100,5 @@ core_mac {
core_android {
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_monolith
}

} # !use_system_v8
1 change: 0 additions & 1 deletion Common/base.pri
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ core_windows {
QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}

DEFINES += CRYPTOPP_DISABLE_ASM
}

core_ios|core_mac {
Expand Down
4 changes: 2 additions & 2 deletions Common/cfcpp/test/test.pro
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
include(gtest_dependency.pri)

TARGET = test
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG += thread
CONFIG -= qt
CONFIG += core_no_gtest_main core_gmock

CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD
include(../../base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/googletest/googletest.pri)

ADD_DEPENDENCY(UnicodeConverter, kernel, CompoundFileLib)

Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /