Skip to content

Commit 79d7001

Browse files
authored
Use libxml2/xmsec1 for XAdES signature parsing and validation (#607)
IB-7948 Signed-off-by: Raul Metsma <[email protected]>
1 parent 006d38f commit 79d7001

File tree

87 files changed

+879
-5482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+879
-5482
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permissions:
55
env:
66
BUILD_NUMBER: ${{ github.run_number }}
77
CMAKE_BUILD_PARALLEL_LEVEL: 4
8-
UBUNTU_DEPS: cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev
8+
UBUNTU_DEPS: cmake libxml2-dev libxmlsec1-dev zlib1g-dev
99
jobs:
1010
macos:
1111
name: Build on macOS for ${{ matrix.target }}
@@ -21,8 +21,7 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
brew update
24-
brew install --formula swig doxygen boost xsd || brew link --overwrite xsd
25-
brew unlink xerces-c
24+
brew install --formula swig doxygen boost
2625
brew unlink [email protected] || true
2726
brew unlink [email protected] || true
2827
brew unlink xz
@@ -32,24 +31,15 @@ jobs:
3231
with:
3332
path: cache
3433
key: ${{ matrix.target }}-${{ hashFiles('prepare_osx_build_environment.sh') }}
35-
- name: Build xerces-c
36-
if: steps.cache.outputs.cache-hit != 'true'
37-
run: ./prepare_osx_build_environment.sh xerces ${{ matrix.target }}
38-
- name: Build xalan-c
39-
if: steps.cache.outputs.cache-hit != 'true'
40-
run: ./prepare_osx_build_environment.sh xalan ${{ matrix.target }}
4134
- name: Build openssl
4235
if: steps.cache.outputs.cache-hit != 'true'
4336
run: ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
44-
- name: Build xml-security-c
45-
if: steps.cache.outputs.cache-hit != 'true'
46-
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
4737
- name: Build libxml2
4838
if: steps.cache.outputs.cache-hit != 'true'
4939
run: ./prepare_osx_build_environment.sh libxml2 ${{ matrix.target }}
50-
- name: Build xmlsec1
40+
- name: Build xmlsec
5141
if: steps.cache.outputs.cache-hit != 'true'
52-
run: ./prepare_osx_build_environment.sh xmlasec ${{ matrix.target }}
42+
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
5343
- name: Move to cache
5444
if: steps.cache.outputs.cache-hit != 'true'
5545
run: |
@@ -89,7 +79,7 @@ jobs:
8979
- name: Install Deps
9080
run: |
9181
dnf install -y --setopt=install_weak_deps=False \
92-
git gcc-c++ cmake rpm-build xml-security-c-devel libxml2-devel xmlsec1-openssl-devel libtool-ltdl-devel zlib-devel doxygen boost-test swig python3-devel java-17-openjdk-devel xsd minizip-devel
82+
git gcc-c++ cmake rpm-build libxml2-devel xmlsec1-openssl-devel libtool-ltdl-devel zlib-devel doxygen boost-test swig python3-devel java-17-openjdk-devel minizip-devel
9383
- name: Install CMake
9484
if: matrix.container == 39
9585
run: |
@@ -182,8 +172,6 @@ jobs:
182172
with:
183173
python-version: 3.11
184174
architecture: ${{ matrix.platform }}
185-
- name: Build xsd
186-
run: .\prepare_win_build_environment.ps1 -xsd
187175
- name: Install WiX
188176
run: |
189177
dotnet tool install -g wix --version 5.0.0

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ find_package(PKCS11)
5252
#find_package(PoDoFo)
5353
find_package(Threads)
5454
find_package(LibXml2 REQUIRED)
55-
find_package(XmlSecurityC REQUIRED)
56-
find_package(XSD 4.0 REQUIRED)
5755
find_package(ZLIB REQUIRED)
5856
find_package(MiniZip 1 QUIET)
5957
add_library(xmlsec INTERFACE)

build-library.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ cmake --fresh -B ${TARGET} -S . \
9393
-DCMAKE_OSX_ARCHITECTURES="${ARCHS// /;}" \
9494
-DCMAKE_FIND_ROOT_PATH="${TARGET_PATH};/usr/local;/opt/homebrew" \
9595
-DOPENSSL_ROOT_DIR=${TARGET_PATH} \
96-
-DXercesC_ROOT=${TARGET_PATH} \
9796
${CMAKEARGS}
9897
cmake --build ${TARGET}
9998

build.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ param(
1515
[string]$swig = $null,
1616
[string]$doxygen = $null,
1717
[switch]$boost = $false,
18-
[string]$xsd = "$libdigidocpp\xsd",
1918
[string]$sign = $null
2019
)
2120

@@ -43,7 +42,6 @@ foreach($type in @("Debug", "RelWithDebInfo")) {
4342
"-DCMAKE_INSTALL_LIBDIR=bin" `
4443
"-DCMAKE_TOOLCHAIN_FILE=$vcpkg_dir/scripts/buildsystems/vcpkg.cmake" `
4544
"-DVCPKG_INSTALLED_DIR=$vcpkg_installed\vcpkg_installed_$platform" `
46-
"-DXSD_ROOT=$xsd" `
4745
"-DSIGNCERT=$sign" `
4846
$cmakeext "&&" $cmake --build $buildpath --target $target "&&" $cmake --install $buildpath
4947
}

debian/control

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Build-Depends:
66
debhelper-compat (= 12),
77
pkg-config,
88
cmake,
9-
libxml-security-c-dev,
10-
xsdcxx (>= 4.0) | xsd (>= 4.0),
119
libxml2-dev,
1210
libxmlsec1-dev,
1311
doxygen,

etc/schema/OpenDocument-manifest-schema-v1.0-os.rng

Lines changed: 0 additions & 111 deletions
This file was deleted.

etc/schema/OpenDocument_dsig.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
-->
3434
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsig="urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0">
3535
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
36+
<xs:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="XAdES01903v132-201601.xsd"/>
3637
<xs:element name="document-signatures">
3738
<xs:complexType>
3839
<xs:sequence>

0 commit comments

Comments
 (0)