Skip to content

Commit

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

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Jul 8, 2024
1 parent 2b5db85 commit 71dad2c
Show file tree
Hide file tree
Showing 37 changed files with 1,373 additions and 1,982 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- name: Build libxml2
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh libxml2 ${{ matrix.target }}
- name: Build xmlsec1
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xmlasec ${{ matrix.target }}
- name: Move to cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -85,7 +88,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 zlib-devel doxygen boost-test swig python3-devel java-17-openjdk-devel xsd minizip-devel
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
- name: Install CMake
if: matrix.container == 39
run: |
Expand Down Expand Up @@ -119,7 +122,7 @@ jobs:
DEBEMAIL: github-actions@github.com
steps:
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper cmake xsdcxx libxml-security-c-dev libxml2-dev zlib1g-dev doxygen swig openjdk-11-jdk-headless libpython3-dev python3-setuptools libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper pkg-config cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev doxygen swig openjdk-11-jdk-headless libpython3-dev python3-setuptools libboost-test-dev lintian
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -210,13 +213,13 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev zlib1g-dev doxygen
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev doxygen
- name: Build docs
run: |
cmake -B build -S .
cmake --build build --target docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doc
Expand All @@ -234,7 +237,7 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev zlib1g-dev curl ca-certificates
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev curl ca-certificates
- name: Download Coverity Build Tool
run: |
curl --silent --data "token=$TOKEN&project=$PROJECTNAME" -o cov-analysis-linux64.tar.gz https://scan.coverity.com/download/cxx/linux64
Expand Down Expand Up @@ -268,7 +271,7 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev zlib1g-dev curl ca-certificates
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev curl ca-certificates
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ endif()
if(POLICY CMP0122)
cmake_policy(SET CMP0122 NEW)
endif()
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
project(libdigidocpp VERSION 3.18.0)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})

include(VersionInfo)
include(GNUInstallDirs)
Expand Down Expand Up @@ -52,10 +56,21 @@ find_package(LibXml2 REQUIRED)
find_package(XmlSecurityC REQUIRED)
find_package(XSD 4.0 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(MiniZip 1 QUIET) # version range (0...<2.0.0) requires CMake>=3.19
if(UNIX AND NOT APPLE)
find_package(MiniZip 1 QUIET)
add_library(xmlsec INTERFACE)
if(UNIX)
find_package(PkgConfig)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET)
pkg_check_modules(XMLSEC1_OPENSSL xmlsec1-openssl REQUIRED IMPORTED_TARGET)
target_link_libraries(xmlsec INTERFACE PkgConfig::XMLSEC1_OPENSSL)
if(NOT APPLE)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET)
endif()
else()
find_package(unofficial-xmlsec REQUIRED)
target_link_libraries(xmlsec INTERFACE
unofficial::xmlsec::xmlsec1
unofficial::xmlsec::xmlsec1-openssl
)
endif()
find_package(SWIG)
find_package(JNI)
Expand Down
2 changes: 2 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Priority: optional
Maintainer: RIA <info@ria.ee>
Build-Depends:
debhelper-compat (= 12),
pkg-config,
cmake,
libxml-security-c-dev,
xsdcxx (>= 4.0) | xsd (>= 4.0),
libxml2-dev,
libxmlsec1-dev,
doxygen,
swig,
java8-sdk-headless,
Expand Down
43 changes: 0 additions & 43 deletions etc/schema/ts_119612v020101_additionaltypes_xsd.xsd

This file was deleted.

43 changes: 0 additions & 43 deletions etc/schema/ts_119612v020101_additionaltypes_xsd.xsd.orig

This file was deleted.

92 changes: 0 additions & 92 deletions etc/schema/ts_119612v020101_sie_xsd.xsd

This file was deleted.

Loading

0 comments on commit 71dad2c

Please sign in to comment.