Skip to content

Commit

Permalink
Use libxml2/xmsec1 for XAdES signature parsing and validation
Browse files Browse the repository at this point in the history
IB-7948

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Jul 18, 2024
1 parent 03fd47f commit b6eae06
Show file tree
Hide file tree
Showing 83 changed files with 592 additions and 4,802 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
env:
BUILD_NUMBER: ${{ github.run_number }}
CMAKE_BUILD_PARALLEL_LEVEL: 4
UBUNTU_DEPS: cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev
UBUNTU_DEPS: cmake libxml2-dev libxmlsec1-dev zlib1g-dev
jobs:
macos:
name: Build on macOS for ${{ matrix.target }}
Expand All @@ -21,8 +21,7 @@ jobs:
- name: Install dependencies
run: |
brew update
brew install --formula swig doxygen boost xsd || brew link --overwrite xsd
brew unlink xerces-c
brew install --formula swig doxygen boost
brew unlink [email protected] || true
brew unlink [email protected] || true
brew unlink xz
Expand All @@ -32,24 +31,15 @@ jobs:
with:
path: cache
key: ${{ matrix.target }}-${{ hashFiles('prepare_osx_build_environment.sh') }}
- name: Build xerces-c
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xerces ${{ matrix.target }}
- name: Build xalan-c
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xalan ${{ matrix.target }}
- name: Build openssl
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
- name: Build xml-security-c
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
- name: Build libxml2
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh libxml2 ${{ matrix.target }}
- name: Build xmlsec1
- name: Build xmlsec
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xmlasec ${{ matrix.target }}
run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
- name: Move to cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -89,7 +79,7 @@ jobs:
- name: Install Deps
run: |
dnf install -y --setopt=install_weak_deps=False \
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
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
- name: Install CMake
if: matrix.container == 39
run: |
Expand Down Expand Up @@ -182,8 +172,6 @@ jobs:
with:
python-version: 3.11
architecture: ${{ matrix.platform }}
- name: Build xsd
run: .\prepare_win_build_environment.ps1 -xsd
- name: Install WiX
run: |
dotnet tool install -g wix --version 5.0.0
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ find_package(PKCS11)
#find_package(PoDoFo)
find_package(Threads)
find_package(LibXml2 REQUIRED)
find_package(XmlSecurityC REQUIRED)
find_package(XSD 4.0 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(MiniZip 1 QUIET)
add_library(xmlsec INTERFACE)
Expand Down
2 changes: 0 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ param(
[string]$swig = $null,
[string]$doxygen = $null,
[switch]$boost = $false,
[string]$xsd = "$libdigidocpp\xsd",
[string]$sign = $null
)

Expand Down Expand Up @@ -43,7 +42,6 @@ foreach($type in @("Debug", "RelWithDebInfo")) {
"-DCMAKE_INSTALL_LIBDIR=bin" `
"-DCMAKE_TOOLCHAIN_FILE=$vcpkg_dir/scripts/buildsystems/vcpkg.cmake" `
"-DVCPKG_INSTALLED_DIR=$vcpkg_installed\vcpkg_installed_$platform" `
"-DXSD_ROOT=$xsd" `
"-DSIGNCERT=$sign" `
$cmakeext "&&" $cmake --build $buildpath --target $target "&&" $cmake --install $buildpath
}
Expand Down
2 changes: 1 addition & 1 deletion cmake
2 changes: 0 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Build-Depends:
debhelper-compat (= 12),
pkg-config,
cmake,
libxml-security-c-dev,
xsdcxx (>= 4.0) | xsd (>= 4.0),
libxml2-dev,
libxmlsec1-dev,
doxygen,
Expand Down
111 changes: 0 additions & 111 deletions etc/schema/OpenDocument-manifest-schema-v1.0-os.rng

This file was deleted.

1 change: 1 addition & 0 deletions etc/schema/OpenDocument_dsig.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
-->
<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">
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<xs:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="XAdES01903v132-201601.xsd"/>
<xs:element name="document-signatures">
<xs:complexType>
<xs:sequence>
Expand Down
2 changes: 2 additions & 0 deletions etc/schema/en_31916201v010101.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
attributeFormDefault="unqualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="xmldsig-core-schema.xsd"/>
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#"
schemaLocation="XAdES01903v132-201601.xsd"/>
<xsd:element name="ASiCManifest" type="ASiCManifestType">
<xsd:annotation>
<xsd:documentation>Schema for ASiCManifest – See ETSI EN 319 162</xsd:documentation>
Expand Down
8 changes: 0 additions & 8 deletions libdigidocpp.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
<File Name="legacy.dll" />
<File Name="zlib1.dll" />
<File Name="xerces-c_3_2.dll" />
<File Name="Xalan-C_1_12.dll" />
<File Name="XalanMessages_1_12.dll" />
<File Name="xsec_2_0.dll" />
<File Name="libxml2.dll" />
<File Name="libxmlsec1.dll" />
<File Name="libxmlsec1-openssl.dll" />
Expand Down Expand Up @@ -84,10 +80,6 @@

<ComponentGroup Id="DependenciesDev" Source="$(var.vcpkg)\debug\bin">
<File Name="zlibd1.dll" />
<File Name="xerces-c_3_2D.dll" />
<File Name="Xalan-C_1_12D.dll" />
<File Name="XalanMessages_1_12D.dll" />
<File Name="xsec_2_0D.dll" />
</ComponentGroup>

<ComponentGroup Id="LibrariesDev" Source="$(var.libdigidocpp)\bin">
Expand Down
Binary file removed patches/MsgCreator
Binary file not shown.
15 changes: 0 additions & 15 deletions patches/README.md

This file was deleted.

Loading

0 comments on commit b6eae06

Please sign in to comment.