Skip to content

Commit 96dc74b

Browse files
metsma4nd3r
authored andcommitted
Update version number and libs
* OpenSSL 3.5.4 * LibXML2 2.15.1 * xmlsec1 1.3.9 IB-8679, IB-8681, #686 Signed-off-by: Raul Metsma <[email protected]> Co-authored-by: Ander Punnar <[email protected]>
1 parent 0a3844b commit 96dc74b

22 files changed

+388
-657
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
uses: actions/cache@v4
9494
with:
9595
path: ${{ github.workspace }}/vcpkg_cache
96-
key: vcpkg-${{ matrix.target }}-${{ hashFiles('.github/workflows/*', 'vcpkg.json', 'vcpkg-ports/**', 'CMakeLists.txt', '**/CMakeLists.txt', 'CMakePresets.json') }}
96+
key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
9797
- name: Prepare vcpkg
9898
uses: lukka/run-vcpkg@v11
9999
with:
@@ -139,20 +139,30 @@ jobs:
139139
name: fedora_${{ matrix.container }}
140140
path: build/libdigidocpp*.rpm
141141
ubuntu:
142-
name: Build on Ubuntu ${{ matrix.container }} ${{ matrix.arch }}
142+
name: Build on ${{ matrix.dist }} ${{ matrix.ver }} ${{ matrix.arch }}
143143
runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }}
144-
container: ubuntu:${{ matrix.container }}
144+
container: ${{ matrix.dist }}:${{ matrix.ver }}
145145
strategy:
146146
matrix:
147-
container: ['22.04', '24.04', '25.04', '25.10']
148-
arch: ['amd64', 'arm64']
147+
dist: [ubuntu]
148+
ver: ['22.04', '24.04', '25.04', '25.10']
149+
arch: [amd64, arm64]
150+
java: [17]
151+
include: [
152+
{ dist: debian, ver: 'bookworm', arch: amd64, java: 17 },
153+
{ dist: debian, ver: 'trixie', arch: amd64, java: 21 },
154+
]
149155
env:
150156
DEBIAN_FRONTEND: noninteractive
151157
DEBFULLNAME: github-actions
152158
153159
steps:
154160
- name: Install dependencies
155-
run: apt update -qq && apt install --no-install-recommends -y lsb-release build-essential devscripts debhelper lintian pkg-config ${UBUNTU_DEPS} doxygen swig openjdk-17-jdk-headless libpython3-dev python3-setuptools libboost-test-dev
161+
run: |
162+
echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs
163+
echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
164+
echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
165+
apt update -qq && apt install --no-install-recommends -y lsb-release build-essential devscripts debhelper lintian pkg-config ${UBUNTU_DEPS} doxygen swig openjdk-${{ matrix.java }}-jdk-headless libpython3-dev python3-setuptools libboost-test-dev
156166
- name: Checkout
157167
uses: actions/checkout@v5
158168
- name: Setup changelog
@@ -162,14 +172,14 @@ jobs:
162172
dch --distribution $(lsb_release -cs) -v ${VERSIONEX} "Release ${VERSIONEX}."
163173
- name: Build packages
164174
run: |
165-
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-${{ matrix.arch }} dpkg-buildpackage -us -uc
175+
JAVA_HOME=/usr/lib/jvm/java-${{ matrix.java }}-openjdk-${{ matrix.arch }} dpkg-buildpackage -us -uc
166176
mv ../libdigidocpp*.* .
167177
- name: Lintian
168178
run: lintian *.deb;
169179
- name: Archive artifacts
170180
uses: actions/upload-artifact@v4
171181
with:
172-
name: ubuntu_${{ matrix.container }}_${{ matrix.arch }}
182+
name: ${{ matrix.dist }}_${{ matrix.ver }}_${{ matrix.arch }}
173183
path: libdigidocpp*.*
174184
windows:
175185
name: Build on Windows
@@ -195,7 +205,7 @@ jobs:
195205
uses: actions/cache@v4
196206
with:
197207
path: ${{ github.workspace }}/vcpkg_cache
198-
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('.github/workflows/*', 'vcpkg.json', 'vcpkg-ports/**', 'CMakeLists.txt', '**/CMakeLists.txt', 'CMakePresets.json') }}
208+
key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
199209
- name: Prepare vcpkg
200210
uses: lukka/run-vcpkg@v11
201211
with:
@@ -298,7 +308,7 @@ jobs:
298308
- name: Install dependencies
299309
run: sudo apt update -qq && sudo apt install --no-install-recommends -y ${UBUNTU_DEPS}
300310
- name: Initialize CodeQL
301-
uses: github/codeql-action/init@v3
311+
uses: github/codeql-action/init@v4
302312
with:
303313
languages: cpp
304314
queries: +security-and-quality
@@ -311,12 +321,12 @@ jobs:
311321
-DBUILD_TOOLS=NO
312322
cmake --build build
313323
- name: Perform CodeQL Analysis
314-
uses: github/codeql-action/analyze@v3
324+
uses: github/codeql-action/analyze@v4
315325
with:
316326
upload: False
317327
output: sarif-results
318328
- name: Filter results
319-
uses: advanced-security/filter-sarif@develop
329+
uses: advanced-security/filter-sarif@v1
320330
with:
321331
patterns: |
322332
-src/json.hpp
@@ -326,6 +336,6 @@ jobs:
326336
input: sarif-results/cpp.sarif
327337
output: sarif-results/cpp.sarif
328338
- name: Upload results
329-
uses: github/codeql-action/upload-sarif@v3
339+
uses: github/codeql-action/upload-sarif@v4
330340
with:
331341
sarif_file: sarif-results/cpp.sarif

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ endif()
55
if(POLICY CMP0177)
66
cmake_policy(SET CMP0177 NEW)
77
endif()
8-
project(libdigidocpp VERSION 4.3.0)
8+
project(libdigidocpp VERSION 4.4.0
9+
DESCRIPTION "C++ library for digital signatures and validation of digitally signed documents"
10+
HOMEPAGE_URL https://github.com/open-eid/libdigidocpp
11+
)
912
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
1013
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
1114

@@ -35,7 +38,7 @@ set( BUILD_TOOLS YES CACHE BOOL "Build digidoc-tool" )
3538
set( BUILD_SHARED_LIBS YES CACHE BOOL "Build library as SHARED or STATIC" )
3639
set( SIGNCERT "" CACHE STRING "Common name of certificate to used sign binaries, empty skip signing" )
3740
set( CROSSSIGNCERT "" CACHE STRING "Common name of certificate to used cross sign binaries, empty skip signing" )
38-
set(CMAKE_CXX_STANDARD 20)
41+
set(CMAKE_CXX_STANDARD 23)
3942
set(CMAKE_CXX_STANDARD_REQUIRED YES)
4043
set(CMAKE_C_VISIBILITY_PRESET hidden)
4144
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

examples/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ apply plugin: 'com.android.application'
33
def libsPath = '/Library/libdigidocpp'
44

55
android {
6-
compileSdk 35
6+
compileSdk = 36
77
defaultConfig {
88
applicationId "ee.ria.libdigidocpp"
9-
minSdk 30
10-
targetSdk 35
9+
minSdk = 33
10+
targetSdk = 36
1111
versionCode 1
1212
versionName "1.0"
1313
if (System.getenv("BUILD_NUMBER")) {
@@ -26,7 +26,7 @@ android {
2626
targetCompatibility JavaVersion.VERSION_17
2727
sourceCompatibility JavaVersion.VERSION_17
2828
}
29-
sourceSets.main.java.srcDirs += [libsPath + '.androidarm/include']
29+
sourceSets.main.java.srcDirs += [libsPath + '.androidarm64/include']
3030
namespace 'ee.ria.libdigidocpp'
3131
}
3232

examples/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:8.12.2'
8+
classpath 'com.android.tools.build:gradle:8.13.0'
99
}
1010
}
1111

prepare_osx_build_environment.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22
set -e
33

4-
OPENSSL_DIR=openssl-3.5.2
5-
XMLSEC_DIR=xmlsec1-1.3.7
4+
OPENSSL_DIR=openssl-3.5.4
5+
XMLSEC_DIR=xmlsec1-1.3.9
66
ARGS="$@"
77

88
case "$@" in
@@ -58,8 +58,6 @@ function xmlsec {
5858
tar xf ${XMLSEC_DIR}.tar.gz
5959
cd ${XMLSEC_DIR}
6060
patch -Np1 -i ../vcpkg-ports/xmlsec/xmlsec1-1.3.5.legacy.patch
61-
patch -Np1 -i ../vcpkg-ports/xmlsec/xmlsec1-1.3.7.rsapss.patch
62-
patch -Np1 -i ../vcpkg-ports/xmlsec/xmlsec1-1.3.7.ecdsa-sig.patch
6361
case "${ARGS}" in
6462
*iphone*) CONFIGURE="--host=aarch64-apple-darwin --enable-static --disable-shared --without-libxslt" ;;
6563
*) CONFIGURE="--disable-static --enable-shared" ;;

src/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ add_library(digidocpp_util STATIC
6868

6969
target_link_libraries(digidocpp_util PUBLIC digidocpp_ver PRIVATE $<$<OR:$<PLATFORM_ID:Darwin>,$<PLATFORM_ID:iOS>>:-framework\ CoreFoundation>)
7070

71-
add_library(digidocpp_priv STATIC
71+
add_library(digidocpp_tsl STATIC
7272
crypto/Connect.cpp
7373
crypto/Digest.cpp
7474
crypto/TSL.cpp
@@ -77,14 +77,14 @@ add_library(digidocpp_priv STATIC
7777
XMLDocument.h
7878
)
7979

80-
set_target_properties(digidocpp_util digidocpp_priv PROPERTIES
80+
set_target_properties(digidocpp_util digidocpp_tsl PROPERTIES
8181
COMPILE_DEFINITIONS digidocpp_EXPORTS
8282
POSITION_INDEPENDENT_CODE YES
8383
)
8484

85-
target_include_directories(digidocpp_priv PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
85+
target_include_directories(digidocpp_tsl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
8686

87-
target_link_libraries(digidocpp_priv
87+
target_link_libraries(digidocpp_tsl
8888
digidocpp_util
8989
ZLIB::ZLIB
9090
LibXml2::LibXml2
@@ -153,11 +153,11 @@ target_include_directories(digidocpp PUBLIC
153153
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
154154
$<INSTALL_INTERFACE:include>
155155
)
156-
target_link_libraries(digidocpp PRIVATE ${CMAKE_DL_LIBS} minizip digidocpp_priv)
156+
target_link_libraries(digidocpp PRIVATE ${CMAKE_DL_LIBS} minizip digidocpp_tsl)
157157

158158
if( BUILD_TOOLS )
159159
add_executable(digidoc-tool digidoc-tool.cpp)
160-
target_link_libraries(digidoc-tool digidocpp digidocpp_priv Threads::Threads)
160+
target_link_libraries(digidoc-tool digidocpp digidocpp_tsl Threads::Threads)
161161
target_link_options(digidoc-tool PRIVATE
162162
$<$<PLATFORM_ID:Windows>: /MANIFEST:NO /MANIFEST:EMBED /MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/digidoc-tool.manifest>
163163
)
@@ -382,7 +382,7 @@ if( FRAMEWORK )
382382
)
383383
else()
384384
if(NOT ${BUILD_SHARED_LIBS})
385-
install( TARGETS minizip digidocpp_priv digidocpp_util DESTINATION ${CMAKE_INSTALL_LIBDIR} )
385+
install( TARGETS minizip digidocpp_tsl digidocpp_util DESTINATION ${CMAKE_INSTALL_LIBDIR} )
386386
endif()
387387
if( BUILD_TOOLS )
388388
install( TARGETS digidoc-tool DESTINATION ${CMAKE_INSTALL_BINDIR} )

src/XMLDocument.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ struct XMLDocument: public unique_free_d<xmlFreeDoc>, public XMLNode
303303
d = {};
304304
}
305305

306-
XMLDocument(std::string_view path, const XMLName &n = {}) noexcept
307-
: XMLDocument(path.empty() ? nullptr : xmlParseFile(path.data()), n)
306+
XMLDocument(const std::string &path, const XMLName &n = {}) noexcept
307+
: XMLDocument(path.empty() ? nullptr : xmlParseFile(path.c_str()), n)
308308
{}
309309

310310
static XMLDocument openStream(std::istream &is, const XMLName &name = {}, bool hugeFile = false)
@@ -314,27 +314,26 @@ struct XMLDocument: public unique_free_d<xmlFreeDoc>, public XMLNode
314314
is->read(buffer, len);
315315
return is->good() || is->eof() ? int(is->gcount()) : -1;
316316
}, nullptr, &is, XML_CHAR_ENCODING_NONE));
317-
#if VERSION_CHECK(XMLSEC_VERSION_MAJOR, XMLSEC_VERSION_MINOR, XMLSEC_VERSION_SUBMINOR) >= VERSION_CHECK(1, 3, 0)
318-
ctxt->options |= xmlSecParserGetDefaultOptions() & ~XML_PARSE_HUGE;
319-
#else
320317
ctxt->options |= XML_PARSE_NOENT|XML_PARSE_DTDLOAD|XML_PARSE_DTDATTR|XML_PARSE_NONET|XML_PARSE_NODICT;
321-
#endif
318+
#if LIBXML_VERSION >= 21300
319+
ctxt->options |= XML_PARSE_NO_XXE;
320+
#else
322321
ctxt->loadsubset |= XML_DETECT_IDS|XML_COMPLETE_ATTRS;
322+
#endif
323323
if(hugeFile)
324324
{
325325
ctxt->options |= XML_PARSE_HUGE;
326326
#if LIBXML_VERSION < 21300
327327
if(ctxt->sax)
328-
ctxt->sax->entityDecl = 0;
328+
ctxt->sax->entityDecl = nullptr;
329329
#endif
330330
}
331331
auto result = xmlParseDocument(ctxt.get());
332332
if(result != 0 || !ctxt->wellFormed)
333333
{
334334
if(const xmlError *lastError = xmlCtxtGetLastError(ctxt.get()))
335335
THROW("%s", lastError->message);
336-
else
337-
THROW("Failed to parse XML document from stream");
336+
THROW("Failed to parse XML document from stream");
338337
}
339338
return {ctxt->myDoc, name};
340339
}

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ add_definitions(
77
)
88
add_executable(unittests libdigidocpp_boost.cpp)
99
add_executable(TSLTests TSLTests.cpp)
10-
target_link_libraries(unittests digidocpp digidocpp_priv Boost::unit_test_framework)
10+
target_link_libraries(unittests digidocpp digidocpp_tsl Boost::unit_test_framework)
1111
target_link_libraries(TSLTests digidocpp digidocpp_util Boost::unit_test_framework)
1212
if(WIN32)
1313
string(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index b952d7bf..6d43569b 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -8,7 +8,7 @@ if(${VERSION} MATCHES [[([0-9]+)\.([0-9]+)\.([0-9]+)]])
6+
set(LIBXML_MICRO_VERSION ${CMAKE_MATCH_3})
7+
endif()
8+
9+
-project(libxml2 VERSION ${VERSION} LANGUAGES C)
10+
+project(libxml2 VERSION ${VERSION} LANGUAGES C CXX)
11+
12+
set(CMAKE_C_STANDARD 11)
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 3850f6b..8beb11e 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -669,7 +669,6 @@ if(1)
6+
set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
7+
endif()
8+
configure_file(xml2-config.in xml2-config @ONLY)
9+
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
10+
11+
set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
12+
set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")

0 commit comments

Comments
 (0)